The Exercise
Three qubits enter the circuit of Figure 4.17: two ancillas, each prepared in , and a target in an arbitrary pure state . Each ancilla first passes a Hadamard gate. A Toffoli gate controlled by the two ancillas then acts on the target, followed by the phase gate on the target and a second Toffoli gate, and a Hadamard on each ancilla closes the circuit. Last, both ancillas are measured in the computational basis.
The exercise is to show that the two outcomes are both with probability , and that the target has then undergone the rotation about the axis by the angle with ; any other pair of outcomes leaves the Pauli applied to the target.
Qubits and Gates
A quantum system is described by its state space, a finite dimensional complex Hilbert space, and the composite system of two systems and has as its state space the tensor product of theirs. A pure state of is a unit vector in the state space of ; pure states of and of give the product state of . The qubit is the system with state space , and its basis states and are the standard basis vectors and . The circuit acts on three qubits, the first two the ancillas and the third the target, with input , written .
A unitary of is an operator on the state space of with , and it carries a pure state to the pure state . The identity is a unitary of every system.✦ For unitaries and of , the unitary , after , applies first and then .✦ For a unitary of and a unitary of , the product unitary of is the tensor product of the two operators; is acting on the first factor, the first wires of the composite, and is acting on the last factor, its last wires.
In the computational basis, the matrices of the Hadamard, of the three Pauli operators and of the phase gate are (1) The Hadamard , the Pauli and and the phase gate are the unitaries of the qubit whose operators have these matrices.
For a vector of , the Pauli vector gives the matrix , and the rotation about by a real angle is (2) where ; about a unit vector it is written . The rotation gate is the unitary of the qubit whose operator has the matrix .✦
For a unitary of a system , the controlled gate is the unitary of the composite of a control qubit with given by (3) For a unitary of a qubit, the doubly controlled gate of three qubits applies to the third exactly when the first two are both ; the Toffoli gate is .
The Circuit
The Hadamard layer of the circuit is the unitary of the three qubits (4)✦ The middle gate of the circuit is the unitary (5) and the circuit is , then , then again: (6) The rotation angle of the circuit is the real number (7)✦
For ancilla outcomes and and a target label , all in , the amplitude of the outcome on the target state is the complex number (8)✦ with the sum modulo two. It is the amplitude of in .
Measuring the Ancillas
A state of is a positive operator of unit trace on the state space of ; a pure state gives the state , the projector onto its vector. A measurement on with a finite set of outcomes is a family of measurement operators on the state space of , one for each outcome , with .✦ The positive operator valued measure (POVM) of a measurement on with operators is the family of effects ; the probability of the outcome on a state of is given by the Born rule, .
The projective measurement of in an orthonormal basis has the operators .✦ A measurement with operators on is made on the first wires of with the operators , and one on is made on the last wires with . The measurement of the control qubit, on a composite of a qubit with , is the projective measurement of the qubit in the computational basis, with operators .✦ Two measurements and of , with operators and , performed in turn with first, form the cascaded measurement of with outcomes and operators .✦
The measurement of both ancillas has, for each outcome , the measurement operator (9)
The Claim
Theorem 1. The angle satisfies (10)✦ For every pure state of the target, measuring both ancillas on the state of the output gives the outcome with probability (11)✦ There is a complex number with such that the amplitudes of the outcome are those of the rotation by , (12)✦ For ancilla outcomes and not both , there is a complex number with such that (13)✦
What Is Checked
The claim is stated over the circuit of (6), the measurement (9) of both ancillas with its Born probabilities, the amplitudes (8) and the angle (7), with the gates and acting on the target.
About these constructions the library proves that the controlled gate (3) is unitary for every unitary , and with it the Toffoli gate; that , , , and are unitary because their matrices are; and that products and tensor products of unitaries are unitary. It proves too that a unitary carries a pure state to a unit vector, that the product of two pure states has unit norm, that is a state, a positive operator of unit trace, and that every measurement built here, on the first or last wires or as a cascade, has operators with .