The Exercise
A search over items, the indices , is posed by a function that assigns each index a bit; is a solution when . The oracle is a unitary that flips an oracle qubit exactly when the index register, a system with levels whose basis states are the indices, holds a solution. Adjoin an extra qubit to the index, so that the items become the pairs . The exercise asks for an augmented oracle , made from and elementary gates, that marks the pair with a minus sign when is a solution and , and leaves every other pair unmarked.
Systems and States
A quantum system is described by its state space, 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 qudit with levels is the system with state space , and the qubit is the two level system, with state space .
A pure state of a system is a unit vector in the state space of .✦ For a level of the qudit with levels, the computational basis state is the pure state whose vector is the standard basis vector of with entry at and elsewhere; on the qubit these are and .✦ Given pure states of and of , their product is the pure state of whose vector is the tensor product of the two vectors.✦
The oracles act on the composite system of an index register, the qudit with levels, and the two qubits and . The basis states of this composite system are the products of an index with a bit for and a bit for .
Unitaries and Gates
A unitary of a system is an operator on the state space of with , and it carries a pure state of to the pure state . The identity is a unitary of every system.✦ Of two unitaries and of , the product is the unitary that applies first and then .✦ Given unitaries of and of , the product unitary of is the tensor product of their operators; in particular acts with on the last factor and leaves the first alone.
The Pauli gate , the quantum NOT, and the Hadamard gate are the unitaries of the qubit whose matrices in the computational basis are (1) For a unitary of a system , the controlled gate is the unitary of the composite of a control qubit with the target given by (2)✦ The controlled NOT gate (CNOT) is the gate of two qubits, which flips the second qubit when the first is .✦
Three gates act on the two qubits of the oracles alone, and on the oracle qubit and CNOT with as control and as target: (3)
The Oracle and Its Augmentation
A unitary of the index register and the two qubits is a bit flip oracle for when, for every index and all bits and , (4)✦ with addition modulo . The augmented oracle of is the unitary (5)✦
The Claim
A pure state of a system is an eigenstate of a unitary of , with eigenvalue a complex number , when .✦
Theorem 1. Let assign a bit to each index , and let be a bit flip oracle for . For every index and every bit , the basis state is an eigenstate of the augmented oracle : (6)✦
What Is Checked
The claim is stated over a bit flip oracle for an arbitrary , defined by (4), and over the augmented oracle (5) built from it with the gates (3), on the basis states of the index register and the two qubits.
About these constructions the library proves that the controlled gate of (2) is unitary for every unitary , and that the matrices (1) are unitary. Products and of unitaries are again unitary.