Flipping with the Pauli X, Y, and Z gates
The Pauli X, Y, and Z gates all act on a single qubit, and perform an action similar to a classical NOT gate, which flips the value of a classical bit. For example, the X gate sends to and vice versa.
As we shall see, the X gate is actually a rotation around the x axis of radians. The same is true for the Pauli Y and Z gates, but along the y and z axes correspondingly.
Mathematically, the X, Y, and Z gates can be expressed as the following unitary matrixes:
This recipe will serve as a sort of template for how to use the sample code that is provided in the chapter. The remaining recipes will largely gloss over the deeper details.
Let's take a look at the Pauli X, Y, and Z gates by running the Quantum Gate UI sample program. It starts by setting up a plain quantum circuit with a single qubit initiated in a state that you select. The gate selected is then added to the circuit, and then the unitary simulator and state...