Definition
Quantum Circuit
A quantum circuit is a finite sequence of quantum gates applied to a register of qubits.
Transformations
Let be the state space of an -qubit quantum register. A quantum circuit with gates
transforms an initial state by successive unitary operators:
At each time step,
Hence the whole circuit implements the composed unitary
so that
The rightmost gate acts first. A gate drawn earlier in the circuit appears further to the right in the algebraic product.
Gates on Part of a Register
A gate may be drawn on only one wire of a circuit, but mathematically it must act on the whole quantum register. This section explains how a local one-qubit gate is embedded into the larger state space.
For a two-qubit register,
The two copies of are not two fixed vectors. They are two state spaces, one for each qubit subsystem:
A basis state such as abbreviates
Here the first is a state of the first qubit, and the second is a state of the second qubit. The qubits are the subsystems; the kets are their states.
A one-qubit gate
acts on one qubit state space. To make it an operator on the whole two-qubit register, tensor it with the identity operator on the qubit that should remain unchanged.
To apply to the first qubit, use
To apply to the second qubit, use
On a product state, this means
So acts on the first qubit state and acts on the second qubit state. For general superpositions, the same rule extends by linearity.
Why the identity appears
A one-qubit gate is too small for the whole two-qubit register: it only has type .
The full register has type
Tensoring with fills the missing slot. The identity says: “leave this qubit state as it is, but keep it inside the full register.”
Flipping one qubit
With the Pauli-X gate,
Thus flips the state of the first qubit and leaves the state of the second qubit unchanged.
Similarly,
Thus leaves the state of the first qubit unchanged and flips the state of the second qubit.
For an -qubit register, a gate on one qubit is embedded by placing in the corresponding tensor slot and identities in all other slots.