KnowledgeCookies logo Understanding the language of quantum science
Quantum Computing

Quantum Logic Gates

QUANTUM COMPUTING AND CIRCUIT ARCHITECTURES

Mathematical Transformations in Multi-Qubit Circuits

An axiomatic guide to unitary operations, matrix representations, and universal gate sets.

1. Mathematical Foundations of Quantum Gates

Quantum gates are mathematical operators that transform a quantum state. Because physical systems must conserve total probability (Postulate 4), every closed-system quantum gate is modeled as a unitary matrix UU.

Unitary condition:   U†U=UU†=I⟷consequence: reversible computation is natively mandatory.\text{Unitary condition: }\;U^\dagger U=UU^\dagger=I\quad\longleftrightarrow\quad\text{consequence: reversible computation is natively mandatory.}

2. Single-Qubit Operations & The Pauli Group

Single-qubit gates manipulate state vectors on the complex Bloch sphere, mapping transformations on the basis states {∣0⟩,∣1⟩}\{|0\rangle,|1\rangle\}.

The Pauli matrices & Hadamard transformation:

X=(0110)Y=(0−ii0)Z=(100−1)H=12(111−1)X=\begin{pmatrix}0&1\\1&0\end{pmatrix}\quad Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}\quad H=\frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}

Superposition generation:

H∣0⟩=∣0⟩+∣1⟩2=∣+⟩andH∣1⟩=∣0⟩−∣1⟩2=∣−⟩H|0\rangle=\frac{|0\rangle+|1\rangle}{\sqrt2}=|+\rangle\qquad\text{and}\qquad H|1\rangle=\frac{|0\rangle-|1\rangle}{\sqrt2}=|-\rangle

3. Multi-Qubit Entangling Gates

Multi-qubit systems scale via tensor products (⊗\otimes). Controlled gates apply a target transformation conditioned strictly on the state of control qubits.

Controlled-NOT (CNOT) operator: flips the target qubit if and only if the control qubit is ∣1⟩|1\rangle.

CNOT=(1000010000010010)mapping:   ∣00⟩→∣00⟩,  ∣01⟩→∣01⟩,  ∣10⟩→∣11⟩,  ∣11⟩→∣10⟩\mathrm{CNOT}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}\qquad\text{mapping: }\;|00\rangle\to|00\rangle,\;|01\rangle\to|01\rangle,\;|10\rangle\to|11\rangle,\;|11\rangle\to|10\rangle

Controlled-phase (CZ) operator: injects a negative phase factor (−1-1) if and only if both system qubits occupy the ∣11⟩|11\rangle state: CZ=diag(1,1,1,−1)\mathrm{CZ}=\mathrm{diag}(1,1,1,-1).

Generating the 3-qubit GHZ state. Global coherence is built sequentially using a mix of single-qubit and multi-qubit entangling operations:

(CNOT2→3)(CNOT1→2)(H⊗I⊗I)∣000⟩=∣000⟩+∣111⟩2(\mathrm{CNOT}_{2\to3})(\mathrm{CNOT}_{1\to2})(H\otimes I\otimes I)|000\rangle=\frac{|000\rangle+|111\rangle}{\sqrt2}

4. Computational Universality

A finite set of quantum gates is classified as universal if any arbitrary unitary operation can be approximated to any desired degree of accuracy ε\varepsilon.

  1. The Clifford set: consisting of {H,S,CNOT}\{H,S,\mathrm{CNOT}\}, this set can be efficiently simulated classically (Gottesman–Knill theorem).
  2. Clifford + TT set: adding the non-Clifford TT gate breaks classical simulatability, yielding universal quantum computational power.

Probing Questions & Answers

Try answering before you open the worked explanation. Browse all probing questions.

How does the final H in HSTH turn a phase into unequal outcome probabilities?

Read the product from right to left. The first H prepares (|0⟩ + |1⟩)/√2. T and S add phases π/4 and π/2 to |1⟩. The final H gives amplitudes (1 + \(\exp(3i\pi /4)\))/2 for |0⟩ and (1 − \(\exp(3i\pi /4)\))/2 for |1⟩.

The probability of 0 is (2 − √2)/4. Before the final H, a Z-basis measurement gives 1/2 for each outcome. This also explains why X-basis measurement exposes the phase flip when Z maps |+⟩ to |−⟩.

What does an H–controlled-U–H circuit report when the target is or is not an eigenstate?

For target |u⟩ with U|u⟩ = \(\exp(i\theta )\)|u⟩, the controlled gate produces (|0⟩ + \(\exp(i\theta )\)|1⟩)|u⟩/√2. The last H gives P(0) = cos²(θ/2). In particular, controlled-X with target |−⟩ kicks back phase π and yields control outcome 1.

For an arbitrary normalized target |v⟩, the branch vectors for the two control outcomes are (I ± U)|v⟩/2. Their squared norms give P(0) = [1 + Re⟨v|U|v⟩]/2 and P(1) = 1 − P(0). The control and target can be entangled before the last H.

What sign check catches an error in a Z–Y–Z decomposition?

Write U = \(\exp(iα)\)Rz(β)Ry(γ)Rz(δ) with Rn(θ) = \(\exp(-i\theta σn/2)\). Set α = β = δ = 0. Then Ry(γ) is a real rotation with diagonal entries cos(γ/2), upper-right entry −sin(γ/2), and lower-left entry +sin(γ/2).

Putting plus signs on both off-diagonals makes the columns nonorthogonal for a generic γ. The surrounding Z rotations multiply the rows and columns by phases and preserve their orthogonality.

How can two qubits prepare a uniform state over exactly three bit strings?

With bits ordered q₀q₁, first rotate q₀ to √(2/3)|0⟩ + √(1/3)|1⟩ with q₁ in |0⟩. Apply H to q₁ conditioned on q₀ being 0. The two q₀ = 0 branches now each carry amplitude 1/√3, and q₀ = 1 contributes |10⟩ with the same amplitude.

This makes (|00⟩ + |01⟩ + |10⟩)/√3. Applying H independently to every qubit instead gives equal magnitudes on all 2ⁿ computational strings.

Interview prep: Quantum Gates34 practice questions with concise answers
Practise ↗
Try the simulationInteractive version of this idea in the Quantum Simulation Lab
Open lab ↗