2.1. The gate model in brief#
A short orientation before the longer treatments elsewhere on this site.
2.1.1. Qubits#
A qubit is a two-level quantum system. Its state is a superposition of the basis states \(|0\rangle\) and \(|1\rangle\),
where the complex amplitudes \(\alpha\) and \(\beta\) give the probabilities \(|\alpha|^2\) and \(|\beta|^2\) of measuring \(0\) or \(1\). Two qubits have four basis states, and \(n\) qubits have \(2^n\); this exponential growth of the state space is what quantum algorithms try to put to use.
2.1.2. Gates and circuits#
A quantum gate is a unitary operation on one or more qubits. Common single-qubit gates are the Pauli \(X\) gate, which flips \(|0\rangle\) and \(|1\rangle\); the \(Z\) gate, which flips the sign of \(|1\rangle\); and the Hadamard gate \(H\), which turns \(|0\rangle\) into the equal superposition \((|0\rangle + |1\rangle)/\sqrt{2}\). The two-qubit controlled-NOT (CNOT) gate flips its target qubit when its control qubit is \(|1\rangle\); applied after a Hadamard it produces an entangled Bell state,
A quantum circuit is a sequence of gates followed by measurements. A small set of gates, such as \(H\), the \(T\) phase gate and CNOT, is universal: any unitary operation can be approximated to any accuracy by a circuit built from them.
2.1.3. Measurement#
Measuring a qubit gives \(0\) or \(1\) at random, with the probabilities above, and leaves it in the state that was measured. A quantum algorithm is therefore arranged so that interference raises the amplitude of the useful answers before the final measurement.
2.1.4. Where to go next#
The quantum machine learning series builds these ideas up with code, starting from classical and quantum probability; notebook 2.1 covers the gate model in depth.