Single Qubit Gates

Let's look at single-qubit operations.

Quantum gates

So far, we’ve only talked about quantum gates in an abstract sense, that they are operations that manipulate the quantum state of a qubit. Let’s take a look at how this works formally.

A vector represents a quantum state. The only way we can manipulate this vector is by rotating it in the state space. We cannot change its length because of the normalization constraint.

Matrices play a key role in transformations. We can think of a vector rotation as a transformation in the state space. A matrix transformation can represent each rotation. We can apply this transformation to a vector by performing a matrix multiplication with the matrix.

We want our quantum gates to be reversible. We can achieve this by representing quantum gates as unitary matrices.

A complex-valued square matrix is unitary if its conjugate transpose is also its inverse.

In other words, applying such a transformation twice will revert the state vector to its original position. Think of it as a clockwise rotation followed by an equal anti-clockwise rotation. We would land at the same place in the state space. The Bloch Sphere will play a vital role here to visualize these rotations.

The Pauli gates

These quantum gates are based on the Pauli spin matrices. We need not go into the details of why they’re called Pauli spin. Let’s just look at the effect of these gates on a qubit.

The X gate

This is the quantum equivalent of the NOT gate. It is defined as follows:

X=[0110]X=\begin{bmatrix}0&1\\1&0\end{bmatrix}

We know that it will convert the 0|0\rangle state to 1|1\rangle and vice versa. Let’s have a look at this operation mathematically:

X0=[0110].[10]=[01]=1X|0\rangle=\begin{bmatrix}0&1\\1&0\end{bmatrix}.\begin{bmatrix}1 \\0\end{bmatrix} = \begin{bmatrix}0 \\1\end{bmatrix} = |1\rangle

X1=[0110].[01]=[10]=0X|1\rangle=\begin{bmatrix}0&1\\1&0\end{bmatrix}.\begin{bmatrix}0 \\1\end{bmatrix} = \begin{bmatrix}1 \\0\end{bmatrix} = |0\rangle

This was straightforward. However, we must also look at the effect of these gates on superposition states. Let’s take an arbitrary superposition state ϕ\phi and apply the XX gate on it:

ϕ=α0+β1|\phi\rangle=\alpha|0\rangle+\beta|1\rangle

Xϕ=[0110].[αβ]=[βα]=β0+α1X|\phi\rangle=\begin{bmatrix}0&1\\1&0\end{bmatrix}.\begin{bmatrix}\alpha \\\beta\end{bmatrix} = \begin{bmatrix}\beta \\\alpha\end{bmatrix} = \beta|0\rangle+\alpha|1\rangle

We can think of this as swapping the amplitudes of components in the superposition state.

Visually, we can think of an XX-gate operation as a rotation of π\pi radians around the X-axis of the Bloch sphere.

Applying X-gate on |0> to get |1> [Image via Qiskit]
Applying X-gate on |0> to get |1> [Image via Qiskit]

The Y gate

The Pauli-YY gate is defined as follows:

Y=[0ii0]Y=\begin{bmatrix}0&-i\\i&0\end{bmatrix}

The easiest way to understand this gate is by thinking of it as a rotation of π\pi radians across the Y-axis of the Bloch Sphere.

If you visualize this rotation in the 3-D space you’ll notice this gate also converts the 0 ...

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy