Home

Published

-

Single and Multiple Qubit Gates: Building Quantum Circuits

img of Single and Multiple Qubit Gates: Building Quantum Circuits

Quantum gates are unitary operations applied to qubits.

Single Qubit Gates

Pauli-X (bit flip)

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

Action:

  • X0=1X|0\rangle = |1\rangle
  • X1=0X|1\rangle = |0\rangle

Hadamard (creates superposition)

H=12[1111]H = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}

Action on 0|0\rangle:

H0=0+12H|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}

Multiple Qubit Gates

CNOT (controlled X)

CNOT flips the target if control is 1|1\rangle.

  • 0000|00\rangle \to |00\rangle
  • 0101|01\rangle \to |01\rangle
  • 1011|10\rangle \to |11\rangle
  • 1110|11\rangle \to |10\rangle

This gate can create entanglement.

Circuit Example: Bell State

Start in 00|00\rangle.

  1. Apply HH on qubit 0.
  2. Apply CNOT with qubit 0 as control and qubit 1 as target.

Result:

Φ+=00+112|\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}

This is an entangled state and a key resource in quantum protocols.

Rotation Gates and Continuous Control

Many devices implement parameterized rotations:

Rx(θ)=eiθX/2,Ry(θ)=eiθY/2,Rz(θ)=eiθZ/2R_x(\theta)=e^{-i\theta X/2}, \quad R_y(\theta)=e^{-i\theta Y/2}, \quad R_z(\theta)=e^{-i\theta Z/2}

These allow smooth state steering on the Bloch sphere and are central to variational algorithms.

Universality (Why Small Gate Sets Are Enough)

A finite gate library can approximate any unitary to arbitrary precision. In practice, one common universal set is:

  • Single qubit rotations
  • CNOT

This means complex algorithms are synthesized from simple primitives, just like classical logic from NAND like building blocks.

Cost Model for Real Devices

Two qubit gates are usually noisier than single qubit gates. So when optimizing circuits, a practical rule is:

  • Minimize two qubit gate count.
  • Keep depth low to stay within coherence time.
  • Prefer equivalent decompositions with fewer entangling operations.

This is where theory meets engineering in modern quantum programming.