Introduction to Quantum Circuits
A quantum circuit is a sequence of operations applied to qubits.
Circuit diagrams are read from left to right. Each horizontal wire represents a qubit. Gates change the state, and measurements convert quantum information into classical outcomes.
A first circuit
Start with a qubit in (|0\rangle). Apply a Hadamard gate:
Measuring immediately gives 0 or 1 with equal probability.
But the circuit contains more than those probabilities. Apply another Hadamard gate:
The amplitudes interfere and return the qubit to its starting state.
Gates are reversible transformations
For an ideal closed quantum system, gates are represented by unitary matrices. Unitary evolution preserves total probability and is reversible.
Common one-qubit gates include:
- X: swaps (|0\rangle) and (|1\rangle);
- Z: changes the phase of (|1\rangle);
- H: creates or recombines equal superpositions;
- rotation gates: continuously change the state using an angle.
Controlled gates allow one qubit to affect another and can create entanglement.
Circuits as algorithms
A useful circuit normally has four stages:
- Prepare an input state.
- Encode the problem or data.
- Apply operations that create useful interference.
- Measure an observable or output distribution.
On present-day devices, researchers must also consider depth, noise, connectivity, calibration, and the number of repetitions needed to estimate a result.
Recording version
A quantum circuit is a controlled sequence of state transformations. The point is not merely to create superposition, but to recombine amplitudes so that the final measurement reveals something useful.
Use the two-Hadamard example first. It demonstrates interference with almost no machinery.