Quantum programs are drawn, not typed. The drawings look intimidating for about ninety seconds, and then they are easy.
- Outcomes that occur
- Outcomes with zero amplitude
The four rules
Each line across is one qubit. Its name is on the left. It starts as a 0 unless the picture says otherwise.
Time runs left to right. Things on the left happen first. That is it.
A box is a gate doing something to that one qubit.
A dot joined to a symbol by a vertical line is one qubit controlling another. The dot is the boss.
The little dial at the end is you looking. It is always last.
The number that actually matters
Width is how many qubits you need. Depth is how many steps run one after another.
Depth is the painful one. Qubits only stay reliable for a short while, and every step spends some of that time. So a wide, shallow circuit is far more likely to work today than a narrow, deep one.
That single fact explains most of what quantum researchers spend their time on.
Width
How many qubits — how tall the drawing is
Depth
How many steps in a row — how wide it is. This is the hard limit.
Shots
How many times you run the whole thing to see the pattern
The drawing is the program
This is not a diagram of the program. It is the program. Real hardware turns each box into a precisely timed pulse of microwave or laser light.
Most of the work in between is fitting your drawing onto the chip you actually have, because on a real chip not every qubit can talk to every other one.
Worth remembering
- Lines are qubits, left to right is time, boxes are gates, the dial is you looking.
- A dot joined to a symbol means one qubit is controlling another.
- The equations come out in the reverse order to the picture.
- Depth — steps in a row — is what today's machines struggle with, not width.