The Exercise
Let and be positive integers and a classical function from bits to bits, sending each to . A unitary , built from classical reversible gates on a register of qubits and a register of qubits, computes : on it leaves the first register as it is and writes into the second. The problem asks for a circuit of gates that multiplies by the phase , with the second register in before and after.
Registers and Their States
A quantum system is given by its state space, a finite dimensional complex Hilbert space, and a pure state of a system is a unit vector in the state space of . The qudit with levels is the quantum system whose state space is with its standard inner product; its computational basis state , for , is the pure state given by the th standard basis vector. The qudit with levels is a register of qubits.
The composite system of two systems and has as its state space the tensor product of their state spaces.✦ For pure states of and of , the product state is the pure state of whose vector is the tensor product of the two vectors.✦ The two registers form one composite system, and is the product of the basis states and .
Unitaries
A unitary of a system , an evolution of as a closed system, is an operator on the state space of with ; it carries a pure state of to the pure state .✦ For unitaries and of , after is the unitary of , which applies first and then , and the adjoint is the unitary of whose operator is the adjoint of that of . For a unitary of and a unitary of , the product unitary is the unitary of whose operator is the tensor product of those of and .✦
A pure state of is an eigenstate of a unitary of with eigenvalue when (1)✦
The Circuit
For , the phase angle is (2)✦ For real angles , the diagonal phase gate is the unitary of the qudit with levels that is diagonal in the computational basis: (3)✦
For a unitary of a register of qubits together with a register of qubits, and the identity unitary of the first register, whose operator is the identity, the computable phase shift circuit is the unitary that applies , then with the angles of (2) on the second register, then : (4)✦
Counting Gates
Gates come in two kinds. The first are the classical reversible gates, NOT gates with at most two control qubits and the target outside them: the NOT, the controlled NOT and the Toffoli gate. A unitary of a register counts as gates of the first kind when it acts on the computational basis states as a circuit of classical reversible gates acts on bit strings. A gate of the second kind is a single qubit unitary on one qubit, or or controlled by a second qubit.
A unitary meets the gate budget , written , when it is a product of such pieces with at most gates of the first kind and at most of the second, up to identifications between systems, such as that of the two registers with one register of qubits.✦
The Claim
Theorem 1. Let and be natural numbers, a function from to , and a unitary of a register of qubits together with a register of qubits such that for every . Then for every the state is an eigenstate of : (5)✦
Theorem 2. Let and be positive integers and a unitary of a register of qubits together with a register of qubits that meets the gate budget . Then the circuit built from satisfies (6)✦
For a unitary that computes from classical reversible gates, the two theorems give the circuit the problem asks for, with the phase on as the eigenvalue of on and the gates split by kind.
What Is Checked
The claims are stated over the circuit of (4), which composes , the product unitary with the angles (2) and the adjoint ; over the product states of computational basis states; and over the eigenstate condition (1) and the gate budget.
About these constructions the library proves that after , the adjoint of a unitary, the product unitary and the diagonal phase gate are unitaries, the last since its diagonal entries have modulus one. It proves that a unitary applied to a pure state is again a unit vector, since a unitary preserves norms, and that so is the product of two pure states, since the norm of a product vector is the product of the norms.