Quantum Algorithms and Complexity

Chapter 10
Hamiltonian Simulation and Quantum Linear Algebra

Diploma in Quantum Computing
Quantum Algorithms and Complexity   •   Diploma

Hamiltonian Simulation and Quantum Linear Algebra

Introduction and Context

Hamiltonian simulation is the task of reproducing the time evolution generated by a physical Hamiltonian on a quantum computer. It is central to quantum chemistry, materials science, condensed-matter physics, nuclear physics, optimisation, and the study of quantum dynamics. Quantum linear algebra extends this idea to computational tasks involving vectors and matrices, including eigenvalue estimation, matrix inversion, regression, and differential equations.

A Hamiltonian is a Hermitian operator H = H^† representing the energy observable of a quantum system. If the Hamiltonian is time independent, the state evolves according to the Schrödinger equation

i\hbar \frac{d}{dt}|ψ(t)⟩ = H|ψ(t)⟩

where |ψ(t)⟩ is the state at time t, i = √{-1}, and ℏ is the reduced Planck constant. Its solution is

|ψ(t)⟩ = e-iHt/\hbar|ψ(0)⟩.

In quantum-information algorithms it is common to use dimensionless time or set ℏ = 1, giving the unitary evolution operator U(t) = e-iHt. The computational challenge is to implement this operator accurately using elementary gates or a suitable oracle model.

Quantum linear-algebra algorithms do not generally output a classical list of all vector entries. Instead, they manipulate quantum states such as

|b⟩ = \sumj=0N-1 bj|j⟩,

where the complex amplitudes satisfy ∑j |bj|2 = 1. This distinction between quantum-state access and classical data access is fundamental to evaluating claimed quantum speedups.

Learning Objectives

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

  1. Explain Hamiltonian simulation and its relationship to quantum dynamics.
  2. Distinguish dense, sparse, oracle-access, and block-encoded input models.
  3. Describe product formulas, including the Trotter–Suzuki approach, and identify their error sources.
  4. Explain block encoding and why it provides a common framework for quantum linear algebra.
  5. Describe phase estimation, eigenvalue problems, and the quantum linear-system algorithm.
  6. Analyse the effects of sparsity, precision, success probability, state preparation, readout, and condition number.
  7. Select an appropriate simulation or linear-algebra method for a practical problem.

1. Hamiltonians and the Simulation Problem

A matrix H is Hermitian if H = H^†, where H^† is the conjugate transpose. Hermiticity guarantees real eigenvalues and makes e-iHt unitary. If

H|uk⟩ = Ek|uk⟩,

then the eigenvectors |uk⟩ form an orthonormal basis and

e-iHt|uk⟩ = e-iEk t|uk⟩.

Thus simulation applies a phase determined by each energy eigenvalue.

The basic simulation problem is:

Given an efficiently described Hamiltonian H, an evolution time t, an initial state |ψ⟩, and an error tolerance ε, construct a circuit producing a state close to e-iHt|ψ⟩.

A standard error measure is the operator norm

\|U - V\| = \max\|x\|=1\|(U-V)|x⟩\|,

where U = e-iHt is the ideal evolution and V is the implemented approximation. An error bound in operator norm applies uniformly to every input state. State-dependent fidelity is another useful measure, but it can conceal large errors on states not tested.

Hamiltonians often decompose as

H = \sumj=1m Hj,

where each Hj is easier to implement. For a local quantum system, each term may act on only a few qubits. For example, a one-dimensional spin model may have terms involving neighbouring Pauli operators. The terms need not commute; noncommutation is the source of product-formula error.

2. Input Models and Sparse Access

The complexity of simulation depends as much on how H is supplied as on its mathematical properties. A statement such as “simulate an N × N matrix” is incomplete unless the input model is specified.

Dense classical input

If all N2 entries are supplied classically, merely reading the matrix requires order N2 data. A quantum algorithm cannot automatically avoid this loading cost. Dense matrices may nevertheless be useful when the matrix is generated by a succinct circuit or has additional structure.

Local decomposition

A Hamiltonian may be given as a list of simple terms, such as Pauli strings. The cost depends on the number of terms, their locality, coefficient magnitudes, and the cost of implementing each term.

Sparse-access model

An s-sparse matrix has at most s nonzero entries in each row and column. A typical sparse-access oracle provides:

OF|j,ℓ⟩ = |j,f(j,ℓ)⟩,

where f(j,ℓ) returns the column index of the ℓth nonzero entry in row j, and a value oracle provides the corresponding matrix element. The exact oracle definition varies between algorithms, so complexity results must not be compared without checking the model.

Sparsity reduces the amount of information needed to describe a matrix, but it does not mean that the matrix is automatically easy to prepare or measure. The algorithm must still access the relevant nonzero entries coherently.

Block-encoding model

A block encoding represents a matrix as a sub-block of a unitary. A unitary UA is an (α,a,ε) block encoding of A if

\left\|A - α(⟨0a| \otimes I)UA(|0a⟩ \otimes I)\right\| ≤ ε.

Here α > 0 is a normalization factor, a is the number of ancilla qubits, and ε is the encoding error. The encoded block is generally nonunitary, while UA must be unitary. The normalization implies that, for an exact encoding, \|A\| ≤ α.

Block encodings unify many input types: sparse matrices, linear combinations of unitaries, data-access oracles, and matrices generated by quantum circuits. Their advantages are powerful composition rules and compatibility with quantum singular-value transformation. Their limitation is that the cost of implementing the block-encoding oracle must be counted.

3. Product Formulas and Hamiltonian Simulation

Suppose H = A+B. If A and B commute, then

e-i(A+B)t = e-iAte-iBt.

If they do not commute, the first-order Lie–Trotter formula approximates the evolution by

e-i(A+B)t ≈ \left(e-iA t/re-iB t/r\right)r,

where r is the number of time slices. For m terms,

S1(∆t) = \prodj=1m e-iHj∆t, \qquad ∆t=t/r,

and the full approximation is S1(∆t)r. The order of the product matters.

The leading error is controlled by commutators. For two bounded terms, the local error scales approximately as

\frac{∆t2}{2}\|[A,B]\|,

where [A,B] = AB-BA. Over r steps, a broad bound scales as order t2\|[A,B]\|/r, ignoring higher-order terms and constants. This is a scaling statement, not an exact equality.

A symmetric second-order formula is

S2(∆t)=e-iA∆t/2e-iB∆te-iA∆t/2.

Its global error generally decreases as order O(t3/r2) for fixed bounded operators, with constants depending on nested commutators. Higher-order Suzuki formulas improve the dependence on precision but require more exponentials per time slice.

Implementing individual terms

If a term is a Pauli string P, then P2=I and

e-iθP = \cos(θ)I - i\sin(θ)P.

A circuit can implement this by changing basis on the affected qubits, collecting parity with controlled-NOT gates, applying a single-qubit rotation, and reversing the basis change. The gate cost depends on the string length and hardware connectivity.

Strengths and weaknesses

Product formulas are conceptually transparent, often practical for local systems, and compatible with near-term devices. They can be inefficient when the evolution time is long, the Hamiltonian has many strongly noncommuting terms, or high precision is required. In addition to approximation error, hardware introduces gate error, decoherence, calibration error, and sampling error.

4. Beyond Product Formulas: Taylor and Quantum-Signal-Processing Methods

More advanced simulation methods use linear combinations of unitaries, qubitisation, and quantum signal processing. In a linear-combination-of-unitaries representation,

H = \sumj αj Uj,

where αj ≥ 0 can be taken nonnegative by absorbing signs or phases into Uj, and each Uj is unitary. The quantity

λ = \sumj αj

is a normalization parameter. Algorithms construct a unitary whose signal encodes H/λ, then use carefully designed sequences of controlled operations to approximate functions of the encoded operator.

Quantum signal processing can implement polynomial transformations of eigenvalues. Quantum singular-value transformation generalises this idea to singular values of non-Hermitian matrices. In idealised settings, modern simulation algorithms achieve near-linear dependence on evolution time and normalization, with logarithmic or polylogarithmic dependence on precision. Exact complexity depends on the access model, promise conditions, and implementation costs.

These methods can substantially outperform basic Trotterisation for large fault-tolerant computations, but they require sophisticated oracle constructions, controlled operations, phase-angle synthesis, and error management. A better asymptotic bound is not automatically a better practical circuit.

5. Eigenvalue Problems and Phase Estimation

For a unitary operator U with eigenstate |u⟩,

U|u⟩ = e2πiφ|u⟩,

where φ is a phase modulo one. Quantum phase estimation (QPE) estimates φ using controlled powers of U, an inverse quantum Fourier transform, and measurements.

For Hamiltonian simulation, choose U=e-iHτ. If H|uk⟩=Ek|uk⟩, then

U|uk⟩=e-iEkτ|uk⟩.

The measured phase is related to Ekτ modulo 2π. To avoid aliasing, the evolution time and the known spectral range must be chosen so that distinct relevant energies map to distinguishable phases. QPE requires an input state having nonzero overlap with the desired eigenstate. If the overlap is small, many repetitions may be needed.

Approximate QPE with n phase qubits typically provides precision on the order of 2-n in the phase, subject to implementation and probability details. The circuit also requires controlled applications of increasing powers of U, making fault-tolerant resource costs significant.

6. Quantum Linear-System Algorithms

Consider the linear system

A x = b,

where A is an N × N matrix and b is a known vector. A quantum linear-system algorithm aims to prepare a state proportional to the solution:

|x⟩ = \frac{x}{\|x\|}.

This is not the same as printing all N components of x. If every component is required classically, tomography or sampling may remove the apparent speedup.

For the standard Hermitian positive-definite case, suppose

A = \sumj λj|uj⟩⟨uj|,

with eigenvalues satisfying 0 < λmin ≤ λj ≤ λmax. Define the condition number

κ = \frac{λmax}{λmin}.

Writing |b⟩=∑j βj|uj⟩, the solution is

A-1|b⟩ = \sumj \frac{βj}{λj}|uj⟩.

The algorithmic challenge is to apply the reciprocal function 1/λ to eigenvalue information while preserving a valid quantum state. A typical conceptual sequence is:

  1. Prepare |b⟩.
  2. Use phase estimation or singular-value processing to obtain information about eigenvalues.
  3. Apply a controlled operation approximating reciprocal scaling.
  4. Uncompute auxiliary information.
  5. Measure an ancilla and postselect, or use amplitude amplification, to obtain |x⟩.

The reciprocal operation cannot be applied arbitrarily near zero. The algorithm therefore assumes a lower spectral bound or uses a cutoff. For a general non-Hermitian matrix, one may embed it into the Hermitian matrix

\widetilde A = \begin{pmatrix}0&A\\A^†&0\end{pmatrix},

whose eigenvalues are related to the singular values of A. This embedding increases dimension but permits Hermitian techniques.

Complexity and condition number

Early quantum linear-system algorithms had complexity polynomial in κ, often with quadratic dependence, and logarithmic dependence on N under strong assumptions. Improved block-encoding and quantum-singular-value-transformation approaches can achieve dependence close to linear in κ for suitable precision and access models. A representative qualitative form is

\widetilde O\left(ακ\,\mathrm{polylog}\left(\frac{1}{ε}\right)\right),

where α is a block-encoding normalization and ε is the target state or operator error. The tilde suppresses logarithmic factors and the expression is not a universal theorem: preparation, measurement, sparsity, success probability, and oracle costs must be added.

The condition number has both numerical and physical significance. If κ is large, small perturbations in A or b may cause large changes in the solution. For perturbations satisfying suitable invertibility conditions, the relative solution error is bounded in the general form

\frac{\|∆x\|}{\|x\|} \lesssim κ\left(\frac{\|∆A\|}{\|A\|}+\frac{\|∆b\|}{\|b\|}\right),

where the symbol \lesssim indicates a bound up to problem-dependent constants and higher-order terms. This explains why condition-number dependence is not merely an artefact of one algorithm.

7. Input, Output, and Readout Constraints

Quantum linear algebra is useful only when the full data pipeline is efficient.

State preparation

Preparing |b⟩ may require loading N classical values. If preparation costs order N, a claimed logarithmic-in-N algorithm may not provide an end-to-end advantage. Efficient preparation is plausible when b is generated by a short circuit, has a compact structure, or is already available as a quantum state.

Output observables

Often the desired result is an expectation value

\langle x|M|x\rangle,

for an observable M, rather than the entire vector. Estimating this quantity to additive error δ by independent bounded measurements generally requires order 1/δ2 samples without additional variance-reduction techniques. The total runtime must include this sampling cost.

Success probability

Postselection may succeed with probability related to the norm and spectral distribution of the solution. Amplitude amplification can improve a success probability p to a scaling of order 1/√p, but it requires coherent repetition and does not eliminate the underlying dependence.

Precision and finite hardware

Finite-precision rotation synthesis, imperfect oracle values, Trotter error, block-encoding error, and measurement uncertainty all contribute to the final error. Error budgets should allocate a total tolerance among these sources rather than treating the algorithmic approximation as the only error.

8. Practical Workflow for Algorithm Selection

A professional workflow is:

  1. Specify the task. Is the goal time evolution, an eigenvalue, a prepared solution state, or an expectation value?
  2. Characterise the matrix. Determine dimension, Hermiticity, sparsity, locality, spectral range, norm, and condition number.
  3. Define access. State whether entries, nonzero locations, Pauli terms, state-preparation circuits, or a block encoding are available.
  4. Set error and probability targets. Separate simulation, synthesis, estimation, and statistical errors.
  5. Estimate data-loading and readout costs. These may dominate the asymptotic quantum circuit.
  6. Choose the method. Product formulas are attractive for local structured Hamiltonians; block-encoding methods are attractive when robust oracle access and fault-tolerant resources are available.
  7. Benchmark realistically. Include ancillas, controlled operations, repetitions, connectivity, and classical preprocessing.

Applied Case: Illustrative Quantum Chemistry Workflow

Background

Consider an illustrative small-molecule simulation in which a molecular Hamiltonian is mapped to a qubit Hamiltonian

H = \sumj=1m αj Pj,

where each Pj is a Pauli string. The objective is to estimate the ground-state energy.

Problem

The Pauli terms do not all commute. A direct classical diagonalisation becomes expensive as the number of spin orbitals grows, while the quantum device has limited coherence and gate fidelity.

Analysis

A product-formula simulation can approximate e-iHt for phase estimation, but increasing precision requires more time slices. The ground-state preparation is also nontrivial: QPE succeeds efficiently only if the initial trial state has meaningful overlap with the ground state. Measurement of the energy requires repeated preparation and sampling of Pauli observables.

Approach and solution

A practical design first groups commuting Pauli terms where possible, reducing circuit overhead. It then compares a low-order Trotter formula with a higher-order formula or a block-encoding method. The comparison uses an explicit error budget: Hamiltonian approximation error, gate-synthesis error, decoherence, state-preparation error, and energy-estimation sampling error. Classical chemistry calculations can provide a trial state and spectral estimates.

Outcome

The best method is not determined by asymptotic simulation complexity alone. For a small noisy device, grouped product formulas may be preferable. For a larger fault-tolerant machine with efficient oracle construction, block-encoding and phase-estimation methods may offer better precision scaling.

Learning points

The case illustrates four general principles: the representation of the input matters; eigenvalue algorithms require state overlap and spectral information; output estimation requires sampling; and hardware costs can reverse the ranking of theoretically superior algorithms.

Limitations, Governance, and Contemporary Directions

Hamiltonian simulation and quantum linear algebra are powerful but assumption-sensitive. Oracle models may hide substantial data structures. “Exponential speedup” claims can be misleading when state preparation or readout is ignored. Numerical stability, reproducibility, and transparent reporting require authors to state norms, precision, success probability, input access, and output requirements.

Ethically, quantum-computing researchers should avoid overstating performance in applications such as drug discovery or financial modelling. Benchmarks should report classical baselines, hardware noise, total wall-clock resources, and uncertainty. Sensitive scientific or industrial data may also require governance controls when quantum-accessible data structures are built.

Current research focuses on fault-tolerant resource reduction, better block encodings, quantum singular-value transformation, preconditioning, variable-time methods, error mitigation, and hybrid quantum–classical workflows. Preconditioning is especially important: transforming A into an equivalent system with a smaller effective condition number can improve performance, but constructing and implementing the preconditioner may itself be expensive.

Best Practices

  • State the matrix access model explicitly.
  • Distinguish operator error from state error and sampling error.
  • Report normalization factors and condition-number assumptions.
  • Include state preparation, oracle, ancilla, and readout costs.
  • Use spectral bounds to prevent phase aliasing and unstable reciprocals.
  • Compare product formulas and block-encoding methods at the target precision.
  • Validate small instances against exact classical calculations.
  • Treat asymptotic speedup as conditional rather than guaranteed.

Chapter Summary

Hamiltonian simulation implements the unitary evolution e-iHt generated by a Hermitian Hamiltonian. Decomposing a Hamiltonian into accessible terms leads to product formulas, whose errors depend on noncommutation and the number of time slices. More advanced methods use linear combinations of unitaries, block encodings, qubitisation, and quantum signal processing.

Sparse-access assumptions reduce matrix-description costs but require coherent oracles. Block encoding places a matrix inside a unitary and supplies a general interface for quantum linear algebra. Phase estimation converts controlled unitary evolution into eigenvalue information. Quantum linear-system algorithms prepare a state proportional to A-1b, rather than necessarily outputting all classical solution entries.

The condition number, state-preparation cost, success probability, precision, sampling, and readout determine whether a theoretical advantage becomes practical. Consequently, complete resource analysis must include the entire input-to-output pipeline.

Key Terms

Hamiltonian: Hermitian operator representing the energy of a quantum system.

Hamiltonian simulation: Approximation of the evolution operator generated by a Hamiltonian.

Unitary evolution: Reversible quantum transformation preserving inner products.

Operator norm: Largest action of an operator on a unit vector.

Commutator: [A,B]=AB-BA, measuring noncommutation.

Product formula: Approximation that decomposes evolution into exponentials of simpler terms.

Trotterisation: Use of repeated first- or higher-order product formulas.

Sparse matrix: Matrix with few nonzero entries per row or column.

Sparse-access oracle: Coherent interface returning locations or values of sparse entries.

Block encoding: Embedding of a scaled matrix as a sub-block of a unitary.

Normalization factor: Scalar α bounding the scale of an encoded matrix.

Phase estimation: Algorithm for estimating the phase of a unitary eigenvalue.

Eigenvalue: Scalar satisfying H|u⟩=E|u⟩.

Quantum linear-system algorithm: Method for preparing a state proportional to a linear-system solution.

Condition number: Ratio of largest to smallest relevant singular value or eigenvalue.

State preparation: Construction of a quantum state encoding input data.

Quantum singular-value transformation: Framework for polynomial transformations of singular values.

Amplitude amplification: Quadratic improvement in repetitions for a known success probability.

Readout bottleneck: Cost of extracting useful classical information from a quantum state.

Preconditioning: Transformation intended to improve the conditioning of a linear system.

Review Questions

Short Answer Questions

  1. Why must a Hamiltonian be Hermitian for standard quantum time evolution?
  2. What information does a sparse-access oracle provide?
  3. Define a block encoding in words and state the role of the normalization factor.
  4. Why do noncommuting Hamiltonian terms cause product-formula error?
  5. What does a quantum linear-system algorithm normally output?

Long Answer Questions

  1. Explain first- and second-order product formulas, including their accuracy trade-offs.
  2. Describe phase estimation for extracting an eigenvalue of a Hamiltonian.
  3. Explain how the condition number affects both numerical stability and quantum complexity.
  4. Compare sparse-access and block-encoding input models.
  5. Discuss why state preparation and readout can eliminate an apparent quantum speedup.

Analytical / Application Questions

  1. A Hamiltonian is given as many local Pauli terms, most of which can be grouped into commuting sets. Recommend a simulation strategy and justify your choice.
  2. A linear-system problem has a very large condition number but an efficiently prepared right-hand side. Analyse two possible remedies and their hidden costs.
  3. Design an end-to-end resource assessment for estimating an expectation value involving the solution of a quantum linear system. Identify at least four distinct error or cost contributions.

Multiple Choice Questions with Answers

Question 1

Which property of a Hamiltonian guarantees that its standard time-evolution operator is unitary?

A. It is sparse

B. It is Hermitian

C. It is diagonal in the computational basis

D. It has integer entries

Correct Answer: B. It is Hermitian

Question 2

In the first-order product formula for H = A + B, what controls the leading noncommutation error?

A. The commutator [A,B]

B. The determinant of A

C. The number of measurement shots only

D. The dimension of the identity matrix only

Correct Answer: A. The commutator [A,B]

Question 3

What does a sparse-access oracle typically return?

A. Every matrix entry simultaneously as classical data

B. The locations or values of selected nonzero entries

C. The exact ground-state energy without computation

D. A measurement outcome independent of the matrix

Correct Answer: B. The locations or values of selected nonzero entries

Question 4

A block encoding represents a matrix as what?

A. A classical diagonal table only

B. A sub-block of a unitary, up to scaling and error

C. A probability distribution with no ancillas

D. A non-normalised quantum state that need not arise from a unitary

Correct Answer: B. A sub-block of a unitary, up to scaling and error

Question 5

If U|u⟩ = e^{2πiφ}|u⟩, what quantity does phase estimation estimate?

A. The determinant of U

B. The phase φ

C. The number of qubits in U

D. The trace of the input state

Correct Answer: B. The phase φ

Question 6

For a positive-definite matrix, which expression defines the condition number in the eigenvalue formulation?

A. λ_min + λ_max

B. λ_max − λ_min

C. λ_max ÷ λ_min

D. λ_min ÷ λ_max

Correct Answer: C. λ_max ÷ λ_min

Question 7

What is the usual quantum output of a quantum linear-system algorithm?

A. A state proportional to the solution vector

B. All solution entries printed with no measurements

C. The inverse matrix as a classical array

D. Only the matrix dimension

Correct Answer: A. A state proportional to the solution vector

Question 8

Why can state preparation undermine a claimed logarithmic dependence on dimension?

A. Quantum states cannot contain amplitudes

B. Loading arbitrary classical data may itself require order N work

C. Hermitian matrices cannot be prepared

D. Phase estimation always takes order N measurements

Correct Answer: B. Loading arbitrary classical data may itself require order N work

Question 9

For a fixed target evolution time, increasing the number of first-order Trotter steps generally does what?

A. Increases product-formula error

B. Reduces product-formula error, while increasing circuit cost

C. Makes all Hamiltonian terms commute

D. Removes the need for a Hamiltonian representation

Correct Answer: B. Reduces product-formula error, while increasing circuit cost

Question 10

What is the main purpose of preconditioning a linear system?

A. To increase the condition number

B. To reduce the effective condition number

C. To remove the right-hand side

D. To convert every matrix into a sparse matrix at no cost

Correct Answer: B. To reduce the effective condition number

Quantum Algorithms and Complexity
Chapter 10 of 14