Quantum Mechanics for Computer Science

Chapter 6
Unitary Evolution and Quantum Gates

Diploma in Quantum Computing
Quantum Mechanics for Computer Science   •   Diploma

Unitary Evolution and Quantum Gates

Introduction

Quantum computing processes information through controlled transformations of quantum states. Unlike an ordinary bit, a qubit may occupy a superposition of basis states, and its evolution must preserve the total probability of all possible measurement outcomes. This requirement leads to the central mathematical model of closed-system quantum dynamics: unitary evolution.

Quantum gates are physical or abstract operations represented by unitary matrices. They transform amplitudes without destroying the quantum information encoded in a state. Familiar gates such as the Pauli, Hadamard, phase, and rotation gates form the basic vocabulary for constructing quantum algorithms and circuits.

For computer scientists, these gates are important for three related reasons. First, they provide a precise description of reversible computation. Second, they connect quantum-mechanical principles with circuit design. Third, they offer a bridge between abstract matrices and physical operations, such as controlled electromagnetic pulses acting on atoms, ions, superconducting circuits, or spins.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Explain why closed quantum evolution is unitary and reversible.
  2. Verify whether a matrix is unitary.
  3. Apply Pauli, Hadamard, phase, and rotation gates to qubit states.
  4. Interpret global and relative phase correctly.
  5. Relate gate matrices to physical quantum dynamics.
  6. Construct and analyse simple gate sequences and circuits.
  7. Recognise practical limitations of ideal unitary gates.

1. Quantum States and Reversible Evolution

A qubit is represented by a normalized state vector in a two-dimensional complex Hilbert space. In the computational basis, the state is

|ψ⟩ = α|0⟩ + β|1⟩

where α and β are complex probability amplitudes. Normalization requires

|α|² + |β|² = 1

The quantities |α|² and |β|² are probabilities, so they are real, non-negative, and dimensionless. Measurement in the computational basis gives 0 with probability |α|² and 1 with probability |β|².

For a closed quantum system, evolution from an initial state |ψ⟩ to a final state |ψ′⟩ is represented by a linear operator U:

|ψ′⟩ = U|ψ⟩

The operator must preserve normalization for every possible input state. This is achieved when U is unitary, meaning

U†U = UU† = I

Here U† is the conjugate transpose of U, and I is the identity matrix. The condition implies that U has an inverse:

U⁻¹ = U†

Thus, ideal quantum evolution is reversible. If a final state is known and the gate operation is known, the initial state can be recovered by applying U†.

1.1 Why unitarity preserves probability

Suppose |ψ′⟩ = U|ψ⟩. Its squared norm is

⟨ψ′|ψ′⟩ = ⟨ψ|U†U|ψ⟩

If U†U = I, then

⟨ψ′|ψ′⟩ = ⟨ψ|ψ⟩ = 1

Therefore, unitary evolution preserves normalization. More generally, it preserves inner products and hence transition probabilities, angles, and distinguishability relationships between states.

A non-unitary process can still occur in quantum mechanics. Measurement, environmental interaction, and noise are examples. However, these processes require a broader description involving measurement operators, larger systems, or density matrices. An ideal quantum gate acting on a closed register is unitary.

2. Verifying Unitarity

For a square complex matrix U, the standard test is to calculate U†U. If the result is the identity matrix, U is unitary.

For a 2 × 2 matrix

U = [ a b ; c d ]

its conjugate transpose is

U† = [ a* c* ; b* d* ]

where * denotes complex conjugation. The columns of a unitary matrix form an orthonormal set: each column has norm 1, and distinct columns have inner product 0.

Worked Example 1: Checking a gate

Consider the Hadamard matrix

H = 1/√2 [ 1 1 ; 1 −1 ]

It is real and symmetric, so H† = H. Therefore,

H†H = H² = 1/2 [ 1 1 ; 1 −1 ][ 1 1 ; 1 −1 ]

Multiplying gives

H†H = 1/2 [ 2 0 ; 0 2 ] = [ 1 0 ; 0 1 ] = I

The Hadamard gate is unitary.

Global phase

Two state vectors that differ only by an overall phase represent the same physical state:

eiγ|ψ⟩

where γ is a real angle. This is called a global phase and cannot be observed in measurement probabilities. A relative phase, by contrast, occurs between components of a superposition and can affect interference.

For example, the states

(|0⟩ + |1⟩)/√2

and

(|0⟩ − |1⟩)/√2

have identical computational-basis probabilities, but they are physically distinct because their relative phases differ. A later gate can convert this phase difference into a measurable probability difference.

3. Single-Qubit Gates

A single-qubit gate is a 2 × 2 unitary matrix. In the ordered computational basis {|0⟩, |1⟩}, the basis states are represented as

|0⟩ = [1; 0], |1⟩ = [0; 1]

The columns of a gate matrix specify the images of |0⟩ and |1⟩.

3.1 The identity gate

The identity gate does nothing:

I = [1 0; 0 1]

For any state |ψ⟩, I|ψ⟩ = |ψ⟩. It is useful in circuit descriptions and as a reference operation.

3.2 Pauli-X gate

The Pauli-X gate is

X = [0 1; 1 0]

Its action is

X|0⟩ = |1⟩, X|1⟩ = |0⟩

For a general state,

X(α|0⟩ + β|1⟩) = β|0⟩ + α|1⟩

It is analogous to a classical NOT operation, although its action also applies linearly to superpositions. Since X² = I, X is its own inverse.

3.3 Pauli-Z gate

The Pauli-Z gate is

Z = [1 0; 0 −1]

It leaves |0⟩ unchanged and changes the phase of |1⟩:

Z|0⟩ = |0⟩, Z|1⟩ = −|1⟩

Consequently,

Z(α|0⟩ + β|1⟩) = α|0⟩ − β|1⟩

The minus sign is a relative phase, not a change in the immediate computational-basis probabilities.

3.4 Pauli-Y gate

The Pauli-Y gate combines a bit flip with phase factors:

Y = [0 −i; i 0]

Its action is

Y|0⟩ = i|1⟩, Y|1⟩ = −i|0⟩

The factors i and −i are phases. Like X and Z, Y is unitary and satisfies Y² = I.

The three Pauli matrices are Hermitian as well as unitary. They are fundamental in quantum mechanics because they represent spin observables along the x, y, and z axes, with appropriate physical scaling when used as observables.

3.5 Hadamard gate

The Hadamard gate is

H = 1/√2 [1 1; 1 −1]

Its action on basis states is

H|0⟩ = (|0⟩ + |1⟩)/√2

and

H|1⟩ = (|0⟩ − |1⟩)/√2

Thus H creates equal superpositions from computational-basis states. It also reverses itself because H² = I.

A useful interference identity is

H(H|0⟩) = |0⟩

The first H creates two paths with equal amplitudes; the second H recombines them constructively for |0⟩ and destructively for |1⟩.

Worked Example 2: Hadamard followed by a phase flip

Start with |0⟩. Apply H and then Z:

|0⟩ → H|0⟩ = (|0⟩ + |1⟩)/√2

Then

Z H|0⟩ = (|0⟩ − |1⟩)/√2

Applying H once more gives

H(|0⟩ − |1⟩)/√2 = |1⟩

The relative phase introduced by Z becomes a definite computational-basis result after interference.

4. Phase Gates

The general single-qubit phase gate is

P(φ) = [1 0; 0 eiφ]

where φ is a real phase angle measured in radians. Its action is

P(φ)(α|0⟩ + β|1⟩) = α|0⟩ + βeiφ|1⟩

The phase gate leaves |0⟩ unchanged and rotates the phase of |1⟩ relative to |0⟩. It is unitary because |e^{iφ}| = 1 and

P(φ)†P(φ) = I

Important special cases include:

GateMatrixPhase angle
Z[1 0; 0 −1]π
S[1 0; 0 i]π/2
T[1 0; 0 e^{iπ/4}]π/4

The S and T gates are especially important in fault-tolerant quantum computing. The T gate is not generally a Clifford gate, and its inclusion enables universal gate constructions when combined with suitable Clifford operations.

5. Rotation Gates and Physical Dynamics

Quantum gates can be interpreted as rotations of a qubit’s state on the Bloch sphere. The standard rotation gates are

Rx(θ) = cos(θ/2)I − i sin(θ/2)X
Ry(θ) = cos(θ/2)I − i sin(θ/2)Y
Rz(θ) = cos(θ/2)I − i sin(θ/2)Z

Here θ is a real rotation angle in radians, and X, Y, and Z are Pauli matrices. The factor θ/2 is a characteristic feature of spin-½ systems.

Their explicit matrices are

Rx(θ) = [ cos(θ/2) −i sin(θ/2); −i sin(θ/2) cos(θ/2) ]
Ry(θ) = [ cos(θ/2) −sin(θ/2); sin(θ/2) cos(θ/2) ]
Rz(θ) = [ e−iθ/2 0; 0 eiθ/2 ]

These matrices are unitary because they are exponentials of −i times Hermitian generators. In general,

U(θ) = e−iθG/2

is unitary whenever G is Hermitian. The generator G represents an observable or interaction responsible for the rotation.

Connection with the Schrödinger equation

Continuous closed-system evolution follows the time-dependent Schrödinger equation:

iℏ d|ψ(t)⟩/dt = Hphys(t)|ψ(t)⟩

where ℏ is the reduced Planck constant and H_phys(t) is the Hamiltonian, an energy operator. If the Hamiltonian is time-independent, the evolution over duration t is

|ψ(t)⟩ = U(t)|ψ(0)⟩, U(t) = e−iHphys t/ℏ

Since a Hamiltonian is Hermitian, U(t) is unitary. A practical gate is produced by arranging the interaction strength and duration so that the physical evolution approximates a desired matrix such as R_x(π/2).

For example, a resonant control field may produce an effective Hamiltonian proportional to X:

Hphys = ℏΩX/2

where Ω is an angular control rate in radians per second. After duration τ,

U(τ) = e−iΩτX/2 = Rx(Ωτ)

Thus the gate angle is θ = Ωτ. The product Ωτ is dimensionless, as required for an angle in the exponential.

6. Gate Composition and Order

If U is applied first and V second, the final state is

|ψfinal⟩ = VU|ψinitial⟩

Matrix multiplication is generally non-commutative. In general, UV ≠ VU, so the order of gates matters.

For example, acting on |0⟩:

HX|0⟩ = H|1⟩ = (|0⟩ − |1⟩)/√2

whereas

XH|0⟩ = X(|0⟩ + |1⟩)/√2 = (|0⟩ + |1⟩)/√2

These states differ by a relative phase and are not the same physical state.

The product of unitary matrices is unitary. If U and V are unitary, then

(VU)†(VU) = U†V†VU = U†IU = I

Therefore, an ideal circuit built only from unitary gates is itself reversible.

7. A Practical Gate-Analysis Method

A reliable method for analysing a circuit is:

  1. Write the input state as a column vector or ket expression.
  2. Apply gates from right to left in the matrix product.
  3. Simplify amplitudes after every operation.
  4. Check normalization at the end.
  5. If measurement is requested, square the absolute values of amplitudes.
  6. Distinguish global phase from relative phase.

Worked Example 3: A rotation and measurement

Let the input be |0⟩ and apply R_y(π/2). Since cos(π/4) = sin(π/4) = 1/√2,

Ry(π/2)|0⟩ = (|0⟩ + |1⟩)/√2

The measurement probabilities are

P(0) = |1/√2|² = 1/2

and

P(1) = |1/√2|² = 1/2

The state is normalized because 1/2 + 1/2 = 1.

8. Applied Case: Calibrating a Single-Qubit Control Pulse

The following is an illustrative engineering case.

Background

A laboratory quantum processor uses a physical qubit whose control hardware produces an effective Hamiltonian H_phys = ℏΩX/2. The control system aims to implement an X gate, which requires a rotation angle of π.

Problem

The calibrated angular rate is Ω = 2π × 10 MHz. Determine the ideal pulse duration τ for an X rotation.

Analysis and solution

The required condition is Ωτ = π, so

τ = π/Ω

Substituting Ω = 2π × 10⁷ radians per second gives

τ = π/(2π × 10⁷) = 1/(2 × 10⁷) s = 50 ns

The ideal pulse duration is therefore 50 nanoseconds. In practice, the pulse may not implement a perfect X gate because of frequency detuning, amplitude error, leakage into higher energy levels, decoherence, and distortions in the control electronics.

Validation procedure

A common calibration experiment prepares |0⟩, applies the pulse, and measures repeatedly. An ideal X gate should produce |1⟩ with probability close to one. Repeating the experiment at different pulse durations produces Rabi oscillations. The duration corresponding to the first maximum in the |1⟩ probability estimates the π-pulse time.

Outcome and learning points

The case demonstrates that a gate matrix is not merely an abstract computational instruction. It is an approximation to continuous physical evolution. Gate quality depends on how accurately the implemented Hamiltonian and control duration produce the intended unitary operation.

9. Limitations and Practical Considerations

Noise and decoherence

Real systems interact with their environment. Energy relaxation, often described by a characteristic time T₁, and phase decoherence, often described by T₂, cause the actual operation to depart from ideal unitary evolution. A circuit model may therefore need density matrices and quantum channels rather than state vectors alone.

Control errors

Errors arise from inaccurate pulse amplitude, duration, phase, or frequency. Crosstalk may cause a control intended for one qubit to affect another. Leakage may move population outside the computational subspace.

Global phase conventions

Although global phase is physically unobservable for an isolated state, phase conventions matter when comparing circuit descriptions, compiling gates, or combining subsystems. A phase that is global for one subsystem may become a relative phase when that subsystem is entangled with another.

Numerical implementation

For n qubits, a state vector contains 2ⁿ complex amplitudes. Direct matrix simulation of a general gate requires care because full matrices become large rapidly. Efficient simulators exploit the fact that most circuit gates act on one or two qubits and update only relevant amplitudes.

Best practices

  • Verify gate matrices using U†U = I.
  • Track the order of operations explicitly.
  • Use normalized input states.
  • Separate amplitudes from probabilities.
  • Check whether a phase is global or relative.
  • Model the physical pulse, not only the ideal matrix, when analysing hardware.
  • Report angle units clearly; rotation angles are normally in radians.
  • Include noise and calibration uncertainty in professional evaluations.

Contemporary Developments

Modern quantum processors increasingly use pulse-level control, in which software instructions are compiled into microwave, laser, or voltage waveforms. Calibration routines estimate gate errors and adjust pulse parameters automatically. Composite pulses and optimal-control methods can reduce sensitivity to systematic errors. Quantum error-correction protocols use carefully designed gate sequences to protect logical information, although the underlying physical operations remain imperfect.

For computer scientists, this creates a layered view of quantum computation: algorithms specify logical operations, compilers decompose them into native gates, and control systems realise those gates through time-dependent physical dynamics. Understanding unitarity helps maintain consistency across all three layers.

Chapter Summary

Closed-system quantum evolution is represented by a unitary operator U satisfying U†U = I. Unitarity preserves normalization, inner products, and reversibility. The Pauli X, Y, and Z gates implement fundamental bit and phase transformations. The Hadamard gate creates and recombines superpositions, making interference visible. Phase gates modify relative phases, while rotation gates describe continuous motion about axes of the Bloch sphere.

Gate operations compose through matrix multiplication, with the rightmost operation acting first. Rotation gates arise physically from Hamiltonian evolution governed by the Schrödinger equation. In real hardware, ideal gates are approximations affected by noise, calibration error, decoherence, and leakage. Consequently, quantum software and hardware analysis must connect matrix representations with physical control processes.

Key Terms

Unitary operator: An operator U satisfying U†U = I.

Conjugate transpose: The transpose of a complex matrix after taking the complex conjugate of each entry.

Reversibility: The ability to recover an input state from an output using the inverse operation.

Quantum gate: A controlled unitary operation on one or more qubits.

Amplitude: A complex coefficient whose squared magnitude gives a measurement probability.

Global phase: An overall phase factor with no observable effect on an isolated state.

Relative phase: A phase difference between components of a superposition that can affect interference.

Pauli-X gate: The quantum analogue of a bit flip.

Pauli-Y gate: A bit-and-phase transformation represented by the Y matrix.

Pauli-Z gate: A phase-flip gate that maps |1⟩ to −|1⟩.

Hadamard gate: A unitary gate that maps computational-basis states to equal superpositions.

Phase gate: A gate that changes the phase of one basis component relative to another.

Rotation gate: A unitary operation representing rotation about a Bloch-sphere axis.

Hamiltonian: The Hermitian operator representing energy and governing continuous evolution.

Bloch sphere: A geometrical representation of a single-qubit pure state.

Interference: The enhancement or cancellation of amplitudes when quantum paths combine.

Rabi oscillation: Periodic population transfer produced by a driven quantum system.

Decoherence: Loss of quantum coherence through environmental interaction.

Crosstalk: Unintended influence of a control operation on another qubit or transition.

Review Questions

Short Answer Questions

  1. What mathematical condition defines a unitary matrix?
  2. Why does a unitary operator preserve probability normalization?
  3. What is the difference between global phase and relative phase?
  4. State the action of the Pauli-X and Pauli-Z gates on |0⟩ and |1⟩.
  5. Why does the order of quantum gates matter?

Long Answer Questions

  1. Derive the condition under which U|ψ⟩ has the same norm as |ψ⟩.
  2. Explain the operation of the Hadamard gate and its role in interference.
  3. Compare Pauli gates, phase gates, and rotation gates in terms of their matrix representations and physical meaning.
  4. Explain how the Schrödinger equation leads to a unitary gate operation.
  5. Discuss why ideal unitary circuit models differ from real quantum hardware.

Analytical / Application Questions

  1. Starting with |0⟩, calculate the state obtained by applying H, then Z, then H. What computational-basis result is obtained on measurement?
  2. A qubit is driven with Ω = 2π × 5 MHz. Calculate the duration of an ideal X rotation using τ = π/Ω.
  3. A proposed 2 × 2 gate has columns [1/√2; 1/√2] and [1/√2; 1/√2]. Determine whether it is unitary and justify your answer.

Multiple Choice Questions with Answers

Question 1

Which condition must a matrix U satisfy to represent an ideal quantum gate?

A. U†U = I

B. U†U = 0

C. U = U† for every gate

D. det(U) = 0

Correct Answer: A. U†U = I

Question 2

What does the Pauli-X gate do to |0⟩?

A. Maps it to −|0⟩

B. Maps it to |1⟩

C. Leaves it unchanged

D. Maps it to i|0⟩

Correct Answer: B. Maps it to |1⟩

Question 3

What state results from applying H to |0⟩?

A. |1⟩

B. (|0⟩ − |1⟩)/√2

C. (|0⟩ + |1⟩)/√2

D. 0|0⟩ + 1|1⟩

Correct Answer: C. (|0⟩ + |1⟩)/√2

Question 4

Which gate changes the relative phase of |1⟩ by π while leaving |0⟩ unchanged?

A. X

B. Y

C. H

D. Z

Correct Answer: D. Z

Question 5

If U is applied first and V second, which expression gives the final state?

A. UV|ψ⟩

B. VU|ψ⟩

C. U†V†|ψ⟩

D. (U + V)|ψ⟩

Correct Answer: B. VU|ψ⟩

Question 6

For a normalized state α|0⟩ + β|1⟩, what is the probability of measuring 1 in the computational basis?

A. |α|²

B. |β|²

C. α + β

D. |αβ|²

Correct Answer: B. |β|²

Question 7

Which expression represents a z-axis rotation gate?

A. R_z(θ) = e^(−iθZ/2)

B. R_z(θ) = θZ

C. R_z(θ) = Z/θ

D. R_z(θ) = e^(θZ) without i

Correct Answer: A. R_z(θ) = e^(−iθZ/2)

Question 8

An effective Hamiltonian is H_phys = ℏΩX/2. What rotation angle is produced after time τ?

A. Ω/τ

B. τ/Ω

C. Ωτ

D. ℏΩτ

Correct Answer: C. Ωτ

Question 9

For Ω = 2π × 10 MHz, what duration produces an ideal X rotation?

A. 5 ns

B. 10 ns

C. 25 ns

D. 50 ns

Correct Answer: D. 50 ns

Question 10

Which statement about global phase is correct?

A. It always changes measurement probabilities

B. It is physically unobservable for an isolated state

C. It makes a matrix non-unitary

D. It is the same as measurement collapse

Correct Answer: B. It is physically unobservable for an isolated state

Quantum Mechanics for Computer Science
Chapter 6 of 14