October 19, 2024

In Digital Circuit

In typical digital circuits, there exist what are known as universal gates. These include the NAND and NOR gates, with the NAND being more commonly used. The advantage of these universal gates lies in their ability to construct any type of logic circuit using only a single type of gate. This simplifies circuit design, reduces costs, and makes the manufacturing process more efficient.

The truth table for a two-input NAND gate is as follows

Input AInput BOutput
001
011
101
110

In Quantum Circuit

Universal Gate Set

In quantum circuits, it appears that with the combination of H (Hadamard), T, and CNOT gates, any quantum computation can be performed.

H Gate

The Hadamard gate (H gate) is a fundamental quantum gate in quantum computing. It operates on a single qubit and transforms it into a state of superposition. Specifically, the H gate changes the state of the bit from ‘0’ to an equal superposition of ‘0’ and ‘1’, or from ‘1’ to an equal superposition of ‘0’ and ‘1’ but with a difference phase.

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

T Gate

The action of the T gate is to shift the phase of a qubit by π/4 (or 45 degrees). In terms of a qubit’s representation on the Bloch sphere, this means that the state vector of the bit rotates 45 degrees around the Z-axis.

The matrix representation of the T gate is as follows:

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

The exponential term represents the phase of a complex number, shifting the phase of the qubit by 45 degrees.

CNOT

The Controlled NOT gate, commonly referred to as the CNOT gate, is goin to operate on two qubits, a control qubit and a target qubit. This operation is conditional. If the control qubit is in the state |1⟩, the state of the target qubit is flipped (i.e., |0⟩ becomes |1⟩ and vice versa). If the control qubit is in the state |0⟩, the target qubit remains unchanged. The CNOT is described as follows unitary:

\text{CNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}

How difficult to compose any gates that users would like to create

HTHTTTHTTTHTTTHTTTHTHTTTHTHTHTTTHTHTTTHTHTHTTTHTTTHTTTHTTTHTTTHTTTHTTTHTTTHTTTHTHTTTHTHTTTHTHTHTTTHTTTHTTTHTHTHTHTTTHTTTHTHTTTHX

Do you know what this character sequence means?

This operation composes a phase-shifting gate for a z-axis rotation of -pi/8 according to a book in reference [1]. It imply that many qubits are required to compose quantum circuits.

By the way, that’s funny.

Reference

[1]量子コンピューティング 嶋田 義皓