One-Qubit Gate

What are quantum gates?

Quantum logic Gates, also called quantum gates, are fundamental components in the field of quantum computing. Similar to classical logic gates which are the building blocks of classical circuits, quantum gates are used to construct quantum circuits. These gates manipulate quantum bits, from one quantum state \(|\psi>\) to another state \(|\psi'>\).

For example, consider a quantum gate denoted as U. The relationship between the input quantum state \(|\psi>\) and output state \(|\psi'>\) can be expressed:

\[|\psi'> = U|\psi>\]

Here, the quantum state \(|\psi>\) and \(|\psi'>\) are unitary vectors, so the operator U is unitary. This unitary is the most important property of quantum gates, as it ensures the preservation of probability and the reversibility of quantum operations.

What is one-qubit gate?

A one-qubit gate is a quantum gate that operates on a single qubit, applying a unitary transformation to change its state. These gates are the quantum analogs of classical logic gates but work on superpositions of states, represented as vectors in a 2D complex Hilbert space.

One-qubit gates include Pauli Gates, Hadamard Gate, Phase Gates, Rotation Gates.

X gate

X gate: also known as the Pauli-X gate or quantum Not gate, flips the state of a qubit from |0> to |1> and vice versa. It performs the same function as the NOT gate in classical computing, which flips a bit. While the classical NOT gate operates on classical bits, the quantum X gate operates on quantum states.

Because the one-qubit input and output of X gate are represented by vectors, the X gate is expressed as a matrix. This matrix representation of the X gate is a concise way to describe the operation performed by the gate on qubits.

The matrix representation of X gate is given by:

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

This matrix shows how the gate flips the basis states |0> and |1>. Understanding the matrix representation of quantum gates can be crucial for predicting the final quantum states after complex quantum circuits have been applied.

To illustrate how the X gate operates on a qubit, consider an example where X gate is applied to an input qubit \(|\psi>\).

Suppose the input qubit is in the state:

\[|\psi> = \alpha|0> + \beta|1>\]

where \(\alpha\) and \(\beta\) are complex amplitudes of |0> and |1> respectively.

To find the output state \(\psi'>\) after applying X gate, perform the matrix multiplication of X with the vector representation of \(\psi>\):

\[ \begin{align} |\psi'> &= X|\psi> \\ &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \\ \end{pmatrix} \begin{pmatrix} \alpha \\ \beta \\ \end{pmatrix} \\ &= \begin{pmatrix} \beta \\ \alpha \\ \end{pmatrix} \\ &= \beta|0> + \alpha|1> \end{align} \]

Thus, the outcome state \(|\psi'>\) is:

\[|\psi'> = \beta|0> + \alpha|1>\]

This output shows that the X gate flips the amplitude of |0> and |1>.

Y Gate

Y gate: also known the Pauli-Y gate, introduces a phase shift of 180 degrees when applied to |1>, and -180 degrees when applied to |0>. In other words, Y gate flips the basis states and introduces a complex phase shift.

The matrix representation of the Y gate is given by:

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

To illustrate the operation of Y gate on a qubit, consider the input qubit state \(|\psi>\).

\[|\psi> = \alpha|0> + \beta|1>\]

After applying Y gate to the input qubit:

\[ \begin{align} |\psi'> &= Y|\psi> \\ &= \begin{pmatrix} 0 & -i \\ i & 0 \\ \end{pmatrix} \begin{pmatrix} \alpha \\ \beta \\ \end{pmatrix}\\ &= \begin{pmatrix} i\beta \\ -i\alpha \\ \end{pmatrix} \\ &= i\beta|0> - i\alpha|1> \end{align} \]

Thus, the outcome state \(|\psi'>\) is:

\[|\psi'> = - i\alpha|1> + i\beta|0>\]

When the input qubit is |0>, it means that \(\alpha\) = 1 and \(\beta\) = 0, and the output state is -i|1>.

When the input qubit is |1>, it means that \(\alpha\) = 0 and \(\beta\) = 1, and the output state is i|0>.

Z Gate

Z gate:, also known as the Paulit-Z gate, introduces a phase flip of 180 degrees when applied to |1>, and no changing when applied to |0>.

The matrix representation of Z gate is given by:

\[Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \\ \end{pmatrix}\]

To illustrate the operation of the Z gate on a qubit, consider the input qubit \(|\psi>\)

\[|\psi> = \alpha|0> + \beta|1>\]

where \(\alpha\) and \(\beta\) are the amplitude of the quantum state |0> and |1>.

After applying Z gate to the input qubit \(|\psi>\),

\[ \begin{align} |\psi'> &= Z|\psi> \\ &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \\ \end{pmatrix} \begin{pmatrix} \alpha \\ \beta \\ \end{pmatrix} \\ & = \begin{pmatrix} \alpha \\ -\beta \\ \end{pmatrix} \\ &= \alpha|0> - \beta|1> \end{align} \]

Thus, the outcome state \(|\psi'>\) is:

\[|\psi'> = \alpha|0> - \beta|1>\]

Hadamard Gate

Hadamare gate: often denoted as H gate, is a fundamental block used to create superposition states. When applied to a qubit |0> or |1>, the H gate changes the basis state into an equal probability of being |0> and |1>.

The matrix representation of H gate is given by:

\[H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \\ \end{pmatrix}\]

To illustrate the operation of the H gate on a qubit, Z gate is applied to the input qubit |0> and |1> respectively,

\[|\psi'> = H|0> = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \\ \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \\ \end{pmatrix} = \frac{1}{\sqrt{2}}(|0> + |1>)\]

\[|\psi'> = H|1> = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \\ \end{pmatrix} \begin{pmatrix} 0 \\ 1 \\ \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \\ \end{pmatrix} = \frac{1}{\sqrt{2}}(|0>-|1>)\]

From the outcome, we can see that the H gate creates a superposition when applyied H gate on a qubit |0> or |1>.

We consider a general case, the input qubit \(|\psi>\),

\[|\psi> = \alpha|0> + \beta|1>\]

After applying H gate to the input qubit \(|\psi>\),

\[ \begin{align} |\psi'> &= H(\alpha|0> + \beta|1>) \\ &= \alpha(\frac{1}{\sqrt{2}}(|0> + |1>)) + \beta(\frac{1}{\sqrt{2}}(|0> - |1>)) \\ &=\frac{\alpha+\beta}{\sqrt{2}}|0>+\frac{\alpha-\beta}{\sqrt{2}}|1> \end{align} \]

Here, X, H and Z gate has relations, Z gate obtained by X and H gate, and X gate obtained by Z and H gate. \[ X = HZH \\ Z = HXH \]

Reader can verify the relation between X, H and Z gate through linear algebra.

S Gate

S gate: is called phase gate, which is a rotation of a qubit about z-axis by \(\pi\).

The matrix representation of S gate:

\[ T = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}\]

T Gate

T gate: is called phase gate, which is a rotation of a qubit about z-axis by \(\frac{\pi}{2}\).

The matrix representation of T gate:

\[ T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\frac{\pi}{4}} \end{pmatrix}\]

Rotation Gate

A Rotation Gate in quantum computing is a single-qubit gate that rotates the state of a qubit around a specific axis of the Bloch sphere by a given angle. Rotation gates are parameterized by the angle of rotation and the axis of rotation.

Rotation X Gate: also known as Rx gate, performs a rotation of a qubit around the x-axis by a specified angle \(\theta\).

The matrix representation of Rx gate:

\[R_{x}(\theta) = \begin{pmatrix} \cos\frac{\theta}{2} & -i \sin\frac{\theta}{2} \\ -i \sin\frac{\theta}{2} & \cos\frac{\theta}{2}\\ \end{pmatrix}\]

where \(\theta\) is the angle by which the qubit's state is rotated around the x-axis.

Rotation Y Gate

Rotation Y Gate: also known as Ry gate, performs a rotation of a qubit around the y-axis by a specified angle \(\theta\).

The matrix representation of Ry gate:

\[R_{y}(\theta) = \begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2}\\ \end{pmatrix}\]

where \(\theta\) is the angle by which the qubit's state is rotated around the y-axis.

Rotation Z Gate

Rotation Z Gate: also known as Rz gate, performs a rotation of a qubit around the z-axis by a specified angle \(\theta\).

The matrix representation of Rz gate:

\[R_{z}(\theta) = \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \\ \end{pmatrix}\]

where \(\theta\) is the angle by which the qubit's state is rotated around the z-axis.