Hacker News new | past | comments | ask | show | jobs | submit login
Quantum Computing 101 (meetiqm.com)
128 points by doener on April 7, 2023 | hide | past | favorite | 47 comments



The videos by Microsoft Research[1] and PBS[2] are perhaps the most accessible and yet accurate explanations of quantum computing I have found so far.

[1] https://www.youtube.com/watch?v=F_Riqjdh2oM

[2] https://www.youtube.com/watch?v=IrbJYsep45E


Thought I'd share this 7 minute video I made that aims to explain QC as simply as possible (without losing all the fidelity, as most popular explainers do): https://www.youtube.com/watch?v=foPa3lvt0YE

It's not monetized or anything. Just hoping it's of some help to someone out there.


Good video, thanks for sharing!


This video clears a most important misconception everyone has regarding QC which is "How a QC does operation's parallelly and what does that even mean when you can only get 1 output irl?" I hope I myself have understood it correctly if that's right Also Minute Physics video for the Shor's Algorithm is good explaination https://www.youtube.com/watch?v=lvTqbM5Dq4Q&t=0s


Yes, that Minute Physics video is incredible!


I have 2 questions about QC that I have not understood or find any answers for. Maybe someone here knows the answer?

When there is examples of entanglement, it is always between two particles. But if I understand QC right, every qubit must be entangled with each other.

1a - Thus this mean that "particles" can be entangled, not only to one "particle", but to many at the same time? Or are they entangled in series or something?

It is often talk about that qubits need to be entangled in a QC, but never how this is done.

1b - So how is the entanglement between different qubits done in practice in a real QC?

As I understand QC you dont get a absolute answer, just a probability it is the right answer. And because of this you have to run the "simulation" many times to verify the answer. As I also understand is that when you read out the state of an qubit the quantum state collapse and so does it do for all the other qubits.

2a - Thus this mean that to read out the answer from all qubits, you always need to run, at minimum, as many simulations as there is qubits in the QC? That after the first run you read out the state of the first qubit, after the second run you read out the next qubit and so on until you have a state from all qubits for that simulation and then you combine them to a final anwser?

2b - How many times must you actually run a simulation in a QC to get an answer?


Not an expert, but I can answer some of your questions at least.

> Thus this mean that "particles" can be entangled, not only to one "particle", but to many at the same time? Or are they entangled in series or something?

There is in principle no limit to how many particles can be entangled together, but in practice it becomes harder and harder to prevent any particles from interacting with the external environment.

You have to be careful with terms here, because of the 'Monogamy of Entanglement', which essentially says that if A is fully entangled with B then B cannot be fully entangled with C.

https://en.wikipedia.org/wiki/Monogamy_of_entanglement

So how does this not contradict my earlier statement? When three particles are fully mutually entangled then any pair of them in isolation are not entangled at all.

To be more concrete, if you have three qbits which are in a superposition of 000 and 111, then no experiment you can do on the first two qbits can possibly distinguish this from two classically correlated bits unless you allow the third qbit to be involved in the experiment.

>As I understand QC you dont get a absolute answer, just a probability it is the right answer. And because of this you have to run the "simulation" many times to verify the answer. As I also understand is that when you read out the state of an qubit the quantum state collapse and so does it do for all the other qubits.

It's true that all the qbits collapse, but the state that they collapse is still interesting. You can get much more than 1 bit of useful information per simulation.

> How many times must you actually run a simulation in a QC to get an answer?

Depends on both the algorithm and the details of the hardware. Assuming an 'ideal' quantum computer (which will probably never exist), Grover's algorithm will give you the right answer after 2 runs on average.


As also a non-expert, I can add that the superposition and entanglement of qubits are performed using gates as in classical computing. There’s the Hadamard gate which takes two particles outputs a quantum superposition of the particles. Passing the result of this into a controlled-not gate, or CNOT, entangles the particles and induces them into a Bell state. From there, calculations are performed until some sort of measurement, wherein the entangled particles collapse into one possible definitive state.


So, for your first questions, you can definitely entangle as little or as many qubits as you want. In practice, it gets harder the more qubits you want to entangle. But a state like the GHZ state can entangle all qubits in your system.

How do you entangle? You can just let two particles interact, so they "mix" their information. Example: you send laser light (photon qubits) to an atom (another qubits). After a short period, there is a probability that the atom absorbed photons, but that probability is not 100%. You just entangled light with an atom. Only measurement can give you information on whether the photons were absorbed or not.

In practice, each platform has its own entangling mechanism. Usually, it entangles only 2 qubits. Many-qubit entanglement can be achieved by pairwise entangling AB, BC, CD, etc.

The first practical example of qubit entangling operation was the Cirac-Zoller gate, you can check it out.

Regarding your second question, you can actually measure just part of the system, and measure the rest later. It will give you a partial collapse. It's called "tracing out", the quantum analogue of marginalization in probability.


I get stuck on the "Applying Hadamard Twice" lesson, which assertss "Applying Hadamard twice [on a qubit] returns the qubit to its initial state again. From this we can conclude that the information stored in the qubit has not been lost."

The article doesn't explain what a Hadamard Gate is actually physically doing to the qubit. Without that information, I do not draw the same conclusion that a qubit's storing and retaining any useful information. Instead, I'd assume that the Hadamard gate is (somehow?) sensing if a qubit is in a superposition or collapsed stated, and then it inverts that state (i.e. from a superposition to a collapsed state or from a collapsed state back into a superposition).

I'm not saying that's the correct assumption, I'm just pointing out some incomplete logic in the lessons that's prohibiting me from proceeding with this lesson plan until I can definitively rule out the possibility that the Hadamard gate itself is not introducing the information back into the qubit.


I supposed if you used an example of a 2 qubits (qbit A originally in a 50/50 superposition and qbit B in a 25/75 superposition), then showed that that the two H gates in series able to restore the original states every time - that would allow me to agree with your logical deduction that a qubit's information is not lost when H gates are applied. Since that's not included in this lesson, I'm going to need to exit and go hunt for that answer elewhere on the interwebs. I do like this lesson set-up though. That's been my only hang-up thus far.


I would pay $1000 to the first person who can write a useful book on quantum computing without a single Bra or Ket in it.

As it stands, quantum computing still has a huge gap between representing things in the form of equations (quantum circuits) and producing useful algorithms. I suspect that the fascination with describing things in terms of matrix math is partly responsible for this. Most useful classical algorithms are pretty much impossible to describe as classical circuits, so I don't understand the fascination with that form of notation in quantum computing.


Here you go: Quantum in Pictures: A New Way to Understand the Quantum World [1]. In recent years, quantum computing has been reduced to category theory, which in turn has been reduced to manipulating "spider diagrams". No traditional math needed. You can see some example transformations here [2].

You can transfer the money to Bob Coecke [3].

[1] https://www.amazon.com/Quantum-Pictures-New-Understand-World...

[2] https://twitter.com/CraigGidney/status/1643848850711662592

[3] https://www.quantinuum.com/qai/bobcoecke


Not quite what I had in mind, but I'll buy the book and check for both usefulness and Kets. This is still basically an explainer of the matrix algebra representation of algorithms, which is the part I actually don't like (not the notation per se).


“Oh I meant 1000 Liberian Dollars”


I actually meant it, but I suppose I've learned my lesson about offering people money on the internet. They don't read past the possible promise for money and throw as a bunch of shit at the wall to try to both (1) make the offerer do a bunch of work and (2) get it without actually meeting the criteria (knowningly...).

Case in point, the whole set of replies here are people who didn't read past the first sentence of that comment.


You don't need to need understand bra and kets. That's physicist notation. There's nothing stopping you from coding up everything in plain numpy matrix operations like in ML.

Here are the list of gates, go build your algorithm

https://en.m.wikipedia.org/wiki/Quantum_logic_gate

(Hint, the hardest part is hardware, not the math)


I don't think you understand me. The gates and the math are tied together very simply - the bras and kets are just a simple way to represent the matrix math. Quantum computing will probably advance a lot if it can free itself from the gates (which are tied directly to the equations), and move itself much further towards algorithms.

I don't want my quantum computer to constrain me to building up circuits with matrix math operations. Most algorithms you do today are very poorly represented as matrix math that way. As a toy example, write up a sorting algorithm as matrix math using classical gates for me, and come back. Then I will start treating logic gates as a serious way to write algorithms.


Many quantum algorithms aren't actually written as matrix math using gates - you can use something ZX as an alternate representation, and if your algorithm is composed of other algorithms you can abstract them and use recursions just fine (and that is in fact done fairly often). There are also other models of writing down quantum computation that don't use logic gates.

Pretty often you'll find that papers on the higher-order applicability of quantum computing, which tweak in simple ways or glue together existing basic algorithms, won't use the circuit model for their algorithms at all.

The reason the matrix math persists is twofold. Firstly, we don't have good quantum computers, and gate depth is severely limited, plus it can quickly became intractable to simulate inefficient circuits without using tricks, even if they are doing something simple.

So we are at a state in quantum computing where writing the basic algorithms requires absolutely extreme optimization, down to the level of logic gates, because it's not feasible to implement or even rigorously prove much any other way.

The other issue is that quantum computing offers you an infinite degree of freedom on the operations you can do. While in classical computing there are only two operations you can do on 1 bit, there is an infinite number of operations you can do on 1 qubit. These operations are easily described by a set of orthogonal normalized vectors (as a change of basis), so of course a matrix is the most natural way to describe them. The infinity of basic operations really is the problem here, unfortunately, so simpler ways of describing basic operations aren't really possible. Of course, that doesn't excuse the circuit based approach - that is however due to a limitation in technology.


This is a really interesting idea, that the use of the "crutch" of the gates and other similar representations is because of how expressive you can (theoretically) be.

By the way, I have been a professional FPGA developer for a while, and every few years, vendors think "this will be the time that FPGAs get broad adoption." AI inference is (right now) a perfect problem for FPGA use (literally 100-1000x more efficient than GPUs), but almost nobody cares, despite how powerful the computers are. The reason nobody cares is that FPGA programming is about constructing classical circuits - thinking about algorithms that way is REALLY hard. For example, hash tables were invented in the 60's, but they came to FPGAs in the 2010's. Sure, you can kind of do recursion and other similar ideas, but it's generally really annoying to cram an algorithm into a representation that is FPGA-friendly.

I don't want quantum computing to wedge itself into the same trap, particularly when it doesn't look like it needs to on any fundamental level. Maybe I'm wrong that quantum computers will eventually overcome the limitations on depth, etc.


There was a company called reconfigure.io with a great solution where channel based concurrency was automatically compiled to parallel FPGA programs but they no long seem to be around


They are likely in the large graveyard of similar FPGA companies. I can name about 30 of them. All of these programming models hit a wall at a certain point because of the impedance mismatch with the underlying technology.


Actually, would you mind posting some of their names? It's been a while since I looked into this.


The point of quantum computing is that you get much of that matrix math for free.


Here you go: [0]

You probably owe him around $950 as there are a couple of kets in there, but mostly pretty clean I'd say

[0] https://www.scottaaronson.com/democritus/lec9.html


That would be $0 - and plenty of kets. People are missing the point here. I don't actually care much about the notation. I care that the algorithms are basically constructed out of matrix math. If you construct classical algorithms that way, you will find that aside from things like Fourier transforms (coincidence?), there's not much you can represent. The presence of a single ket basically undermines the idea that you don't need to do matrix math for quantum computing.


Many quantum algorithms have the basics described as circuits, but then put in things like loops and recursion in and around them. The problem is that it's really much more tedious to make proofs on these algorithms without gluing at least parts of them together and treating them as one, especially because you have vectors and complex numbers as your variables. We also don't have much hope to test anything that's not a quantum circuit because quantum random memory is very hard.


So lay question: why is entanglement a thing? When do entangled particles interact with the outside environment at all?


I’ve tried many quantum 101 read up’s and e-books, im gonna take yet another shot of finally understanding even the basics.


But why? I don't think it's worth it. Shor's algorithm is great, but 1. it's not clear we'll ever have quantum computers capable of implementing it for any meaninful number of bits 2. it can't be generalized to other encryption schemes and 3. we don't use RSA anymore. The other algorithms that can benefit from quantum computers don't provide an exponential speedup like Shor's algorithm, but rather speed up from quadratic to linear. That's not a good enough reason to start using a completely new paradigm.

By the way, I took a graduate course in quantum computation more than 20 years ago. People were equally gung-ho about quantum computation then. Not much has changed in the meantime. Quantum computation remains equally "just around the corner" now as it was then.


Shor's algorithm can break RSA, Diffie-Hellman, and elliptic curve DH. Some researchers believe it can be generalized to break lattice-based crypto.

QCs also useful for quantum simulations.


> The other algorithms that can benefit from quantum computers don't provide an exponential speedup like Shor's algorithm, but rather speed up from quadratic to linear. That's not a good enough reason to start using a completely new paradigm.

That entirely depends on how big N is.

There's also the point that we only know about quantum algorithms that have already been discovered despite the almost complete absence of working quantum computers.

I don't think too many classical algorithms were discovered before we had access to classical computing either. (I could be wrong).


Many classical algorithms were discovered before we had access to classical computers, but that's because we were doing classical computing by hand, and that made them useful and thus people looked out for them.

Quantum computers are different, because we have reason to think that they can scale exponentially faster than "follow these steps on pen and paper, but more faster", unlike classical computers.


>...we don't use RSA anymore.

This very website is using RSA for TLS authentication. There are lots of applications where the longer key generation time and longer keys of RSA are not an issue. RSA is pretty common. Which is a good thing. We don't want to put all our eggs in one basket.


Forget breaking cryptography, that's what the media cares about but there is no social value in it. (Although it's worth noting it breaks every public key cryptosystem used today, not just RSA)

The real applications are in simulating other quantum systems for drug discovery etc.


Shor's algorithm is actually very generalizable, it applies to any crypto based on the hidden Abelian subgroup problem, and it is believed by many that analogous algorithms exist for most promising asymetric crypto we are planning on using.


quantum computers provide exponential speedup on all asymmetric crypto currently in use (and the quantum resistant algorithms being finalized by nist are very likely broken).


The way I see it is that in the future, we will need a quantum computer to run Slack, instead of a quad-core classical cpu to run Slack. Any performance gains will be negated by bad programming.


I have been struggling for the last few months to get my head around quantum. Maybe this will help. I love how counterintuitive this is.


I find it to be both intuitive and counterintuitive.


At the same time and you can’t tell which one it is.


Its just a money laundering scheme. We’re never gonna see anything like quantum computers (no one can even explain them without buzzwords).


We already have quantum processors with hundreds of qubits, they're real physical machines not just theory.


Money Laundering? So something to do with proceeds of crime? You probably meant something else.


Agreed


THANK YOU. Finally something that doesnt just regurgitate the definition of a qbit


So far, this is looking really good!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: