The Exercise
In nuclear magnetic resonance (NMR) the qubits are nuclear spins, and two of them are coupled by the Hamiltonian , with a real coupling constant and , the Pauli of the first and of the second spin. Rotate each spin by about the axis, then let the pair evolve under for a time , in units with . When the result is the controlled gate up to the global phase , and so it acts on every state of the two spins as the controlled gate does.
The library states both conclusions as theorems, for all real and with , over the definitions that follow.
Two Qubits
A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state of is a unit vector in the state space of .✦ A state of is a positive operator of unit trace on the state space of .✦
The qubit is the two level system whose state space is .✦ The basis states and of the qubit, its computational basis, are the pure states whose vectors are the standard basis vectors and of .✦ The composite system of two systems and is the system whose state space is the tensor product of their state spaces.✦ The two spins form the composite system .
Gates
A unitary of is an operator on the state space of with , and the identity evolution is the unitary . Under a state evolves to the state .✦ For two unitaries and of , after is the unitary : first , then .✦ For a unitary of and a unitary of , the product unitary of is the unitary whose operator is the tensor product of those of and .✦ A gate on the first factor is , with the identity evolution on , and a gate on the last factor is . For a real angle , the global phase gate of is the unitary .✦
The Pauli matrices are (1) and with the Pauli vector , for a real vector in three dimensions . The rotation by a real angle is the matrix (2)✦ written for a unit vector , the rotation about . About it is .✦ The rotation gate is the unitary of the qubit with this matrix in the computational basis, and the Pauli gate, the phase flip, is the unitary of the qubit with matrix .
For a unitary of , the controlled gate is the unitary of , a control qubit and the target , with operator (3)✦ The controlled gate is on two qubits, the first one the control; its matrix in the computational basis is .✦
The Coupling
An observable of is a self adjoint operator on the state space of , .✦ For observables of and of , the observable of has as operator the tensor product of theirs.✦ For a real vector , the Pauli observable is the observable of the qubit with that matrix, and for it is the observable . The coupling Hamiltonian of the two spins with a real coupling constant is the observable (4)✦
The Hamiltonian propagator of an observable of , with Planck’s constant , from time to time is the unitary (5)✦
For a real coupling constant and a time , the NMR controlled sequence is the unitary of the two spins (6)✦ with the propagator of (4) from time to time at .
The Claim
Theorem 1. Let and be real numbers with . Then the sequence (6) is the controlled gate up to a global phase: (7)✦
The phase cancels between and in the evolution of a state.
Theorem 2. Let and be real numbers with . Then every state of the two spins evolves under the sequence as under the controlled gate: (8)✦
What Is Checked
About these constructions the library proves that every gate in them is unitary: for every unitary , the propagator (5) of every observable, the rotation gate , the Pauli gate and the global phase gate, and with and also and . It proves that is again a state, and that and are self adjoint, which makes an observable.