Live data from Hacker News

Getting Started with Quantum Computing in Python

dataespresso.com

11–20 of 45 posts

Re: Getting Started with Quantum Computing in Python

#11
post #6

Does anyone know of a pedagogically-minded quantum computer simulator?

The only one I'm aware of is in Common Lisp: https://www.dropbox.com/s/n5k9pikkcx5besa/QUANTUM_INTERPRETE....

It doesn't take much (LOC) to implement a simulator. You can understand how one works by reading the source: https://github.com/adamisntdead/QuSimPy

Re: Getting Started with Quantum Computing in Python

#12
post #10

I have a question. Please excuse my ignorance but I thought that once the world has a working quantum computer, the world as we know it will be destroyed. Since a quantum computer can solve any NP hard problem in a polynomial time, it would mean it could break any kind of crypto, any kind of security and can brute force anything. Why hasn't that happened yet since its 2018 and we already have quantum computers?

A quantum computer can't solve any NP hard problem in polynomial time as far as we know.

Re: Getting Started with Quantum Computing in Python

#13
post #10

I have a question. Please excuse my ignorance but I thought that once the world has a working quantum computer, the world as we know it will be destroyed. Since a quantum computer can solve any NP hard problem in a polynomial time, it would mean it could break any kind of crypto, any kind of security and can brute force anything. Why hasn't that happened yet since its 2018 and we already have quantum computers?

That's not how quantum computers work. They ("quantum networking") significantly increase security as you can tell whether a qubit has already been observed (eavesdropped) or not. Also, there are proven asymmetric cryptographic algorithms that work with quantum computers. Algorithms based on factorization (RSA) won't be safe any more but you still need a large amount of qubits (around 1000s - don't cite me on this please) to break them, which has not been achieved yet.

Definitely not the end of the world.

edit:// And they can not solve any NP-complete problem in polynomial time. That is a common misconception and not based on facts.

edit2:// Researchers working on quantum computers actually don't believe that they will make it mainstream (partially due to their complexity like cooling them down to near zero Kelvin) but instead be specialized systems available via the internet for rent - or something similar. More on the side of predicting complex systems like the weather than powering your smartphone. Then again, who thought the PC would make it mainstream.

Re: Getting Started with Quantum Computing in Python

#14
post #4

But confused. How does this work without Quantum hardware?

It is a quantum computer emulator. Regular binary computers can model quantum computers with a smallish number of q-bits (dozens) by the time we get to a quantum computer with hundreds of q-bits all the regular computers on the planet together will not be able to simulate it.

Re: Getting Started with Quantum Computing in Python

#16
post #6

Does anyone know of a pedagogically-minded quantum computer simulator?

Quirk: https://algassert.com/quirk

- Drag-and-drop what-you-see-is-what-you-get UI instead of script-based. Smooths out the learning curve.

- Supports putting state displays in the middle of the circuit, so you can directly view normally-inaccessible information instead of inferring it from experience or algebra.

- Fast. It updates all displays interactively, as you edit the circuit. Very easy to experiment, e.g. just drag a gate around seeing what it does in different places.

Re: Getting Started with Quantum Computing in Python

#17
post #2

Tangentially, noticed some good Python libs for Quantum computing have started appearing lately (one from google, Cirq for eg) could be a natural progression (from scientific computing). Good to see Python is making a presence there as well. Looks like it's going to stay relevant for a very long time.

Quantum computing won't require much extra power that python can't provide, the only heavy processing will be circuit generation which is (as far as we can see at the moment) fine to use python for. In the sort term though there's a big place for languages like C, C++ and Rust for things like simulations which need to be done

Yes, there are two reasons that python is an ideal tool for quantum computing libraries at the moment.

- In the NISQ era [1], circuits have limited depth and size. It doesn't matter so much which language (or even algorithm!) you use when N- Simulating a circuit is expensive, but all the heavy lifting can be delegated to highly optimized C code. The most expensive part of Cirq's simulation is (or soon will be) a call to `numpy.einsum` [2].

1: https://arxiv.org/abs/1801.00862

2: https://github.com/quantumlib/Cirq/blob/24638f234704686c4bb6...

Re: Getting Started with Quantum Computing in Python

#18
post #10

I have a question. Please excuse my ignorance but I thought that once the world has a working quantum computer, the world as we know it will be destroyed. Since a quantum computer can solve any NP hard problem in a polynomial time, it would mean it could break any kind of crypto, any kind of security and can brute force anything. Why hasn't that happened yet since its 2018 and we already have quantum computers?

> Since a quantum computer can solve any NP hard problem in a polynomial time

You are confusing https://en.wikipedia.org/wiki/BQP with NP.

Re: Getting Started with Quantum Computing in Python

#19
Quantum computing (under the quantum circuit model) basically consists of repeatedly applying unitary matrices to complex vectors (the qubits). They are like your Boolean logic gates but they must be unitary, which implies they must be reversible: https://en.wikipedia.org/wiki/Quantum_logic_gate.

You can think of unitary matrices as the complex analogue of rotation matrices (https://en.wikipedia.org/wiki/Unitary_matrix), so what quantum logic gates are doing is "rotating" these vectors around in a complex space.

Re: Getting Started with Quantum Computing in Python

#20

Quantum computing (under the quantum circuit model) basically consists of repeatedly applying unitary matrices to complex vectors (the qubits). They are like your Boolean logic gates but they must be unitary, which implies they must be reversible: https://en.wikipedia.org/wiki/Quantum_logic_gate . You can think of unitary matrices as the complex analogue of rotation matrices ( https://en.wikipedia.org/wiki/Unitary_ma…

In classical computing nobody thinks of programming as consisting of a series of logic gates, though :-).

Should we expect more abstractions from quantum computing models in the future? Quantum data structures, common quantum operations etc? Or are quantum algorithms too different from one another, or are "the quantum parts" of most quantum algorithms very compact? (Or do we try to keep them as compact as possible because of hardware constraints?)

Post reply on HN