9.2 From gates to circuits
A quantum register is a collection of qubits we use for computation. By convention, we number the qubits in the register as q0, q1, …, qn. All qubits in a register are initialized to state |0⟩.
A quantum circuit is a sequence of gates applied to one or more qubits in a quantum register.
In some algorithms we group qubits into one or more labeled registers to better delineate their roles. It’s common to have an ‘‘upper register’’ and a ‘‘lower register,’’ for example. [20, Chapter 2]
Let’s look at some simple example circuits to see how they are put together and what the components are called.
9.2.1 Constructing a circuit
The simplest circuit is
Here qubit q0 is initialized to |0⟩ and we do an immediate measurement. |m0⟩ holds its measurement state which, of course, must be |0⟩...