The Exercise
Grover’s algorithm on two qubits looks for one marked item among four, , written in binary as the computational basis states , , and , the first qubit carrying the higher bit. The oracle for the marked item is the unitary that multiplies by and leaves the other three basis states unchanged; for it is the controlled gate.
In nuclear magnetic resonance (NMR) the two qubits are two coupled nuclear spins, acted on by rotations of each spin and by free evolution under their coupling, of strength . The exercise builds the oracles for , and from these: a rotation by about of each spin, evolution under the coupling for a time with , and, before and after, a rotation by about of each spin whose bit in is . Each sequence equals its oracle up to a global phase, and so acts on every state of the two spins as the oracle does. The library states both, for each of the three oracles.
Systems and Their Evolution
A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The composite system of two systems and is the system whose state space is the tensor product of their state spaces.✦ The qubit is the system whose state space is itself, and the two spins form the composite system of two qubits.
A pure state of is a unit vector in the state space of .✦ The computational basis states and of the qubit are the pure states given by the two standard basis vectors of .✦ A state of is a positive operator of unit trace on the state space of .✦
A unitary of is an operator on the state space of with , where is the identity operator.✦
Under a state of evolves as (1)✦
For two unitaries and of , after is the unitary of , first and then .✦
Given a unitary of and a unitary of , the product unitary is the unitary of whose operator is the tensor product of theirs.✦ The gate is the unitary of that applies to the first factor, and the gate is the unitary of that applies to the second factor.
An observable of is a self adjoint operator on the state space of .✦ The tensor product of an observable of and an observable of is the observable of whose operator is the tensor product of theirs.✦
The propagator of an observable of , taken as the Hamiltonian, from time to time and with Planck’s constant , is the unitary of (2)✦
Pauli Matrices and Rotations
The Pauli matrices are the complex matrices (3) For a real vector in three dimensions, the matrix is , and the rotation about by a real angle is the matrix (4) written when the axis is a unit vector . The rotations about the axis and the axis are and .
The gates , the quantum NOT, , the phase flip, and and are the unitaries of the qubit whose matrices in the computational basis are the ones above. The Pauli observable is the observable of the qubit with matrix , and the observable is the one for .
Gates on Two Qubits
For a unitary of a system , the controlled gate is the unitary of the composite of a control qubit with the target given by (5)✦ The controlled gate is on two qubits, the first the control; its matrix in the computational basis is .✦
For a real angle , the global phase gate on a system is the unitary .✦
Oracles and Pulse Sequences
The Grover oracles for , and are conjugated by on the qubits whose bit in is , (6)
The coupling Hamiltonian of the two spins with coupling constant is the observable of two qubits, the real number times the tensor product of the observable with itself.✦
For a coupling constant and a time , the controlled pulse sequence is the unitary of two qubits (7)✦ whose first factor is the propagator (2) of from time to time , in units with .
For a coupling constant and a time , the pulse sequences , and for the three oracles are the unitaries of two qubits that put rotations by about around : (8)
The Claim
Theorem 1. Let the coupling constant and the time be real numbers with . Then, with the phases acting as global phase gates, (9)✦ (10)✦ (11)✦ and for every state of two qubits (12)✦ (13)✦ (14)✦
What Is Checked
The claim is stated over two families of unitaries of two qubits: the pulse sequences of (8) and the oracles of (6).
The library proves that is unitary for every unitary of a system, which makes , and with it each oracle, a unitary of the two qubits.✦ A product and a tensor product of unitaries are unitary, and is again a state, so that both sides of (12), (13) and (14) are states of the two qubits.