Single Qubit Gates

Discussion some of simple single qubit gates
Over the course of this tutorial, we won't be able to go through all possible quantum gates. We will however take time to go through the most important ones, especially ones that we'll use when learning to code later on.

The Identity Gate

A very simple gate, which doesn't change anything at all. It preserves the state of the system as it is - it gives us the identity of the qubit.
Symbol for the Identity gate

Pauli Gates

These gates work by changing the direction of the vector
in either the

Pauli X

The Pauli X gate is exactly the classical NOT gate as we described earlier:
X=[0110]X = \begin{bmatrix}0&1\\1&0\end{bmatrix}
01,10|0\rangle \rightarrow |1\rangle, |1\rangle \rightarrow|0\rangle
And here is how the X gate will be represented on our circuit diagram:
Symbol for the X gate
We can track the result on the Bloch sphere:
An animation showing the rotation of the X gate on the Bloch sphere

Pauli Y

The Pauli Y gate is an interesting machine - we get the same result as the Pauli X gate, but instead of moving through real space we move through imaginary space instead.
Symbol for the y gate
An animation showing the rotation of the Y gate on the Bloch sphere

Pauli Z

The Pauli Z gate changes the state of our qubit along the plane formed by the vectors represented by our two states. This means that no change will occur if we're fully in one state or the other - only if we're somewhere between the two.
Symbol for the Z gate
An animation showing the rotation of the Z gate on the Bloch sphere

Hadamard Gate

The Hadamard gate imposes the uniform superposition on our system. This gate is very important, because often we need to scramble our initial state before we can start computation. The Hadamard gate does this for us in a predictable way.
Symbol for the Hadamard gate
An animation showing the rotation of the Hadamard gate on the Bloch sphere

Phase Gate

The Phase gate is often referred to as the "Z90" gate or the "S" gate. We can see that it's half of our Z gate - instead of going half way around the Bloch sphere, we only go a quarter (a 90 degree turn).
Symbol for the phase gate
An animation showing the rotation of the phase gate on the Bloch sphere

The T Gate

The T gate preforms a
turn on the sphere. It's a quarter of our Z gate, and half of our S gate. You might think that there's a relationship between the T gate and the S gate, and you'd be right - one S gate amounts two the T gate squared:
notation just means to take the constant
to the power of whatever is in the brackets - i.e.
. You'll see this notation used often, so I've left it unconverted here for you.
Symbol for the T gate
An animation showing the rotation of the T gate on the Bloch sphere


We said before that all of our quantum gates need to be reversible. For most of these gates (in fact all of them except the phase gate and T gate) they reverse themselves.
That is to say that if you apply the Pauli X gate twice, for example, it undoes what it did. This makes intuitive sense when we look at the diagram. If we make a 180 degree turn the first time, we would make the same turn when we go the second time, resulting in ending up where we started.

Reverse Phase Gate

The phase gate requires an extra step - we need to do some math to it to find the matrix that reverses it's operations. We denote reverse matrices using the
symbol, so this would be the
S=[100i]S^\dagger = \begin{bmatrix}1&0\\0&-i\end{bmatrix}
Symbol for the reverse phase gate
An animation showing the rotation of the reverse phase gate on the Bloch sphere