Quantum Circuits
A quantum circuit is an ordered series of quantum gates acting on a collection of qubits. By selecting appropriate gates we can create superposition, entangle qubits and ultimately perform a computation. The final measurement step converts the quantum state into classical information.
Mathematically a circuit corresponds to a unitary operator formed by multiplying the matrices of each gate. If acts first and acts second then the overall transformation is . For an ‑qubit register this unitary has dimension .
Quantum circuits can be visualised as diagrams where qubits are represented by horizontal lines and gates are applied at discrete time steps. This visual representation helps in understanding how quantum information flows through the circuit.
This documentation introduces the fundamental ideas behind quantum circuits. It explains the role of qubits, how basic gates transform them, and how measurements extract classical results. All of the examples can be recreated on the Quantum Simulator (opens in a new tab), which displays Bloch sphere visualisations as you implement gates onto qubits.
Designing a Circuit
A quantum circuit consists of three main steps:
- Choose the qubits. Decide how many qubits are required to represent the problem.
- Apply gates. Arrange single‑ and multi‑qubit gates to implement the desired transformation.
- Measure. Read out the qubits to obtain classical results.
When multiple qubits interact, the overall state grows exponentially with the number of qubits. This large state space is what gives quantum algorithms their power.
Measurements are described by projectors onto the computational basis. Measuring qubit collapses the state onto either or with probabilities given by the squared amplitudes.
Using the Quantum Simulator
The Quantum Simulator (opens in a new tab) offers an interface for constructing circuits. Gates from a library can be placed on any qubit line. As you build, the simulator shows real‑time measurement probabilities and Bloch sphere visualisations. Circuits can be exported to JSON for sharing or further analysis.
Example: Creating a Bell State
The following sequence prepares two qubits in an entangled Bell state. Try these steps in the simulator to see the states evolve:
- Start with both qubits in
|0⟩
. - Apply a Hadamard gate to the first qubit.
- Apply a controlled‑NOT with the first qubit as control and the second as target.
After these steps the system is in the state
This circuit is a building block for many algorithms and illustrates how simple gate sequences yield non‑classical correlations. Measuring either qubit produces a random bit, but the outcomes are perfectly correlated between the two qubits.