Quantum Programming and Simulation

Chapter 12
Variational and Hybrid Quantum–Classical Programming

Diploma in Quantum Computing
Quantum Programming and Simulation   •   Diploma

Variational and Hybrid Quantum–Classical Programming

Introduction

Most useful near-term quantum algorithms are hybrid: a classical computer chooses parameters, a quantum processor evaluates a circuit, and a classical optimizer updates the parameters. This arrangement is necessary because present-day quantum devices are noisy, have limited connectivity, and do not generally support long fault-tolerant computations. Variational programming provides a flexible way to use such hardware while placing the computationally difficult state preparation and measurement tasks on a quantum device.

The central pattern is a parameterized quantum circuit (PQC). A circuit prepares a state that depends on a parameter vector θ, measurements estimate a cost function, and a classical routine searches for parameters that minimize or maximize that cost. Variational quantum eigensolvers (VQE), the quantum approximate optimization algorithm (QAOA), and several introductory quantum machine-learning models use this pattern.

The approach is powerful but not automatically advantageous. Performance depends on ansatz design, cost-function scaling, measurement variance, optimizer behavior, noise, classical overhead, and the quality of the problem-to-circuit mapping. This chapter develops the programming concepts needed to construct and assess variational workflows responsibly.

Learning Objectives

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

  1. Explain the architecture of a hybrid quantum–classical algorithm.
  2. Build a parameterized circuit and identify its trainable parameters.
  3. Formulate expectation-value cost functions for VQE and related tasks.
  4. Describe parameter-shift and finite-difference gradient estimation.
  5. Compare common optimizers and ansatz-selection strategies.
  6. Explain QAOA, introductory quantum machine learning, barren plateaus, and sampling cost.
  7. Interpret noisy optimization results and design a reproducible experiment.
  8. Use AI tools appropriately for coding support, documentation, and debugging without delegating scientific judgment.

1. The Hybrid Programming Model

A quantum circuit with parameters θ = (θ₁, θ₂, …, θₚ) implements a unitary U(θ). Starting from a reference state |ψ₀⟩, it prepares

|ψ(θ)⟩ = U(θ)|ψ₀⟩

The quantum processor measures one or more observables. For an observable O, its ideal expectation value is

C(θ) = ⟨O⟩_θ = ⟨ψ(θ)|O|ψ(θ)⟩

The classical optimizer attempts to find

θ* = arg min_θ C(θ)

or, for a maximization problem, an arg max solution. The quantity C(θ) is called a cost, objective, or loss function. It is not necessarily an energy; the name depends on the application.

A typical iteration is:

  1. The classical program selects θₜ.
  2. The quantum program executes U(θₜ) repeatedly.
  3. Measurements estimate C(θₜ), usually from finite samples called shots.
  4. The classical optimizer computes an update.
  5. The process repeats until a stopping criterion is met.
Hybrid quantum classical optimization loop Classical optimizerupdates θ Parameterized circuitU(θ)|ψ₀⟩ Measurementestimate C(θ) cost and gradient information
Hybrid quantum classical optimization loop
Figure: Hybrid quantum classical optimization loop

Figure: The repeated information flow in a hybrid quantum–classical optimization loop.

The quantum device normally returns classical bit strings rather than exact expectation values. Consequently, variational programming is a stochastic numerical-optimization problem even when the circuit itself is deterministic.

2. Parameterized Quantum Circuits and Ansatz Design

An ansatz is a chosen family of trial states. It should be expressive enough to contain a good approximation to the desired solution, but structured enough to train efficiently and execute within hardware limits. A circuit may contain parameterized rotations such as Rₓ(θ), Rᵧ(θ), or R_z(θ), together with entangling gates.

A simple two-qubit hardware-efficient ansatz is

U(θ) = [Ry(θ₂) ⊗ Ry(θ₁)] · CNOT0,1 · [Ry(θ₄) ⊗ Ry(θ₃)]

The tensor-product notation means that the rotations act on separate qubits. The exact multiplication order follows the circuit convention being used; programmers must verify whether gates are written from left to right or right to left.

Important ansatz families include:

AnsatzMain ideaStrengthMain risk
Hardware-efficientUses native rotations and couplersShallow and hardware-compatibleMay create difficult optimization landscapes
Problem-inspiredEncodes symmetries or domain structureOften more sample-efficientRequires problem knowledge
Unitary coupled-clusterMotivated by quantum chemistryPhysically meaningfulCan be deep and expensive
QAOA ansatzAlternates cost and mixer operatorsSuited to discrete optimizationQuality depends on depth and parameterization

A good ansatz should satisfy several tests:

  • Reachability: Can it represent states relevant to the problem?
  • Symmetry: Does it preserve particle number, parity, or another known invariant when required?
  • Depth: Is it short enough to limit noise?
  • Connectivity: Can it be compiled with few additional routing gates?
  • Trainability: Do useful gradients remain measurable as the system grows?
  • Initialization: Can parameters begin near a physically meaningful state?

More expressive is not always better. Excessive expressibility can produce states close to random states, for which gradients may become exponentially small. This is one source of barren plateaus.

3. Variational Quantum Eigensolver

3.1 Energy minimization

In quantum chemistry and physics, the Hamiltonian H is commonly expressed as a weighted sum of Pauli strings:

H = ∑ᵢ cᵢ Pᵢ

Here cᵢ are real coefficients and Pᵢ are tensor products of I, X, Y, and Z operators. For a normalized trial state, the estimated energy is

E(θ) = ⟨ψ(θ)|H|ψ(θ)⟩ = ∑ᵢ cᵢ ⟨Pᵢ⟩_θ

The variational principle states that

E(θ) ≥ E₀

where E₀ is the ground-state energy, provided H is Hermitian and |ψ(θ)⟩ is normalized. Thus minimizing E(θ) gives an upper bound on the ground-state energy. The bound is exact only if the ansatz can represent a ground state and the minimization reaches it.

Each Pauli term is measured by rotating the relevant basis, measuring computational-basis outcomes, and converting bit strings into eigenvalues ±1. Terms that commute or require the same measurement basis may sometimes be grouped to reduce circuit executions.

3.2 Worked example: estimating a simple energy

Consider the Hamiltonian

H = 0.5Z₀ + 0.5Z₁ + 0.2X₀X₁

Suppose measurements give ⟨Z₀⟩ = −0.8, ⟨Z₁⟩ = −0.6, and ⟨X₀X₁⟩ = 0.5. Then

E = 0.5(−0.8) + 0.5(−0.6) + 0.2(0.5)
E = −0.4 − 0.3 + 0.1 = −0.6

The units of E are the units assigned to H, such as hartrees in a chemistry model. This numerical value is an estimate because the expectation values came from finite samples.

3.3 VQE pseudocode

choose Hamiltonian coefficients cᵢ and Pauli strings Pᵢ
choose ansatz U(θ) and initial parameters θ
repeat:
    for each measurement group:
        execute the parameterized circuit for a chosen number of shots
        estimate the required Pauli expectations
    calculate E(θ) = Σᵢ cᵢ⟨Pᵢ⟩
    estimate gradient or use a gradient-free rule
    update θ using the classical optimizer
until energy change, gradient norm, or iteration limit satisfies stopping rule
validate energy using independent shots and, where possible, classical benchmarks

A practical VQE report should include ansatz depth, number of qubits, shot count, optimizer, initial parameters, termination rule, noise conditions, measurement grouping, and uncertainty estimates. Reporting only the lowest observed energy is insufficient for reproducibility.

4. Gradients and Optimization

4.1 Parameter-shift rule

For many gates generated by Pauli operators, the derivative of an expectation value can be obtained exactly in the ideal circuit model using the parameter-shift rule:

∂C/∂θⱼ = [C(θⱼ + π/2) − C(θⱼ − π/2)]/2

All parameters other than θⱼ remain fixed. This expression applies when the parameterized gate has the standard Pauli-generator form, such as a conventional single-qubit rotation, and when C is evaluated consistently. More general generators may require different shift values or a linear combination of shifted evaluations.

The rule is not noiseless in practice: each shifted expectation is estimated from finite shots and hardware measurements. For p parameters, a straightforward gradient evaluation requires approximately 2p circuit evaluations per cost estimate, multiplied by the number of measurement groups.

Finite differences are more general. A central finite-difference estimate is

∂C/∂θⱼ ≈ [C(θⱼ + δ) − C(θⱼ − δ)]/(2δ)

where δ is a small dimensionless parameter shift. This estimate has truncation error for nonzero δ and can amplify statistical noise when δ is too small. Parameter-shift methods avoid that particular trade-off for gates to which their exact rule applies.

4.2 Common optimizers

Gradient descent updates parameters according to

θt+1 = θt − ηt ∇C(θt)

where ηₜ > 0 is the learning rate. The gradient components and parameters must use compatible units; circuit angles are normally dimensionless and expressed in radians.

Useful alternatives include:

  • SPSA: Estimates a gradient from only two perturbed evaluations, regardless of parameter count. It is economical in shots but noisy.
  • Adam: Uses running estimates of first and second gradient moments. It can be effective for machine-learning-style objectives but adds hyperparameters.
  • COBYLA or Nelder–Mead: Gradient-free methods that can be useful when measurements are noisy or gradients are unavailable, though they may require many evaluations.
  • Quantum natural gradient: Uses a geometry-aware metric related to the state manifold. It may improve scaling in some settings but requires additional estimation and regularization.

No optimizer is universally best. A fair comparison should use a fixed evaluation budget, not merely a fixed iteration count, because different methods consume different numbers of circuit executions.

5. QAOA and Approximate Optimization

For a combinatorial problem, a cost Hamiltonian H_C assigns an objective value to computational basis states. A mixer Hamiltonian H_M encourages exploration. A depth-p QAOA state is commonly written as

|ψ(β,γ)⟩ = ∏k=1p e−iβk HMe−iγk HC|+⟩⊗n

where β = (β₁, …, βₚ) and γ = (γ₁, …, γₚ) are variational angles, n is the number of qubits, and the product-order convention must be specified. The objective may be to minimize or maximize

⟨HC⟩ = ⟨ψ(β,γ)|HC|ψ(β,γ)⟩

The mixer and cost unitaries are implemented through gates corresponding to the problem structure. For example, a graph cut objective can be represented using ZZ interactions. The measured expectation is an average objective value; a good sample may be obtained by measuring the final state many times and selecting high-quality bit strings.

QAOA depth increases expressibility and often improves ideal performance, but it also increases circuit depth, noise exposure, parameter count, and optimization difficulty. A claimed advantage should therefore compare against strong classical heuristics under comparable time and energy budgets.

6. Introductory Quantum Machine Learning

A variational quantum classifier typically combines:

  1. Data encoding: maps a classical vector x to a quantum state or gate sequence.
  2. Trainable circuit: applies U(θ) to the encoded state.
  3. Measurement: produces a prediction, such as an expectation m(x, θ).
  4. Classical loss: compares predictions with labels.

For binary labels yᵢ ∈ {−1, +1}, a simple squared-loss objective is

L(θ) = (1/N)∑i=1N[m(xᵢ,θ) − yᵢ]²

where N is the number of training examples. This is a classical loss computed from quantum-derived predictions. Other losses, including cross-entropy, may be appropriate when the output is interpreted as a probability.

Quantum machine learning experiments must be evaluated against classical baselines. A small quantum model with a large classical preprocessing pipeline does not automatically demonstrate a quantum advantage. Important controls include train–test separation, matched parameter counts where reasonable, repeated random seeds, uncertainty reporting, and avoidance of data leakage.

7. Sampling Cost, Noise, and Error Interpretation

For a Pauli observable with outcomes ±1, an estimator based on M independent shots has variance

Var(Ō) = [1 − ⟨O⟩²]/M

and standard error

SE(Ō) = √([1 − ⟨O⟩²]/M)

These expressions assume independent, identically distributed ideal measurements. Hardware noise, correlated errors, readout bias, and drift can increase or alter the observed uncertainty.

For a Hamiltonian H = ∑ᵢ cᵢPᵢ, if each term is estimated independently, a rough variance model is

Var(Ê) ≈ ∑ᵢ cᵢ² Var(Ŝi)

assuming independent term estimators. Covariance terms must be added when estimates are correlated. This approximation helps allocate shots: terms with large coefficients or high variance generally deserve more measurement effort.

A cost estimate may therefore be expensive even when the circuit is short. If there are G measurement groups, S shots per group, and K optimizer evaluations, the rough number of circuit shots is KGS. Gradient methods can multiply K because each gradient component may require shifted circuits.

Noise can distort both objective values and gradients. Mitigation techniques such as readout calibration, zero-noise extrapolation, symmetry verification, and probabilistic error cancellation can reduce selected errors, but they add sampling overhead and may increase variance. Mitigation is not equivalent to error correction and should be validated against known reference cases.

8. Barren Plateaus and Trainability

A barren plateau is an optimization landscape in which gradient expectation values become very small, often with variance that decreases rapidly as system size increases. In that situation, distinguishing a useful gradient from measurement noise becomes difficult.

Potential causes include highly expressive random ansätze, global cost functions, excessive depth, poor initialization, and noise. The phenomenon is not universal: local cost functions, structured circuits, symmetry restrictions, layerwise training, problem-informed initialization, and shallower ansätze can improve trainability in relevant cases.

Practical diagnostics include:

  • measuring gradient magnitudes for several random initializations;
  • plotting cost and gradient estimates against circuit depth;
  • comparing local and global observables;
  • repeating experiments with increased shots;
  • checking whether apparent convergence is merely noise-induced stagnation.

A small gradient is not by itself proof of a barren plateau. It may result from an optimizer step size, an incorrectly implemented derivative, parameter periodicity, measurement error, or an objective whose scale is naturally small.

9. A Professional Implementation Workflow

A robust implementation separates problem definition, circuit construction, measurement, optimization, and evaluation. The following practices are recommended:

  1. Begin with a classical reference. Solve small instances exactly or with a trusted classical method.
  2. Use a simulator first. Test state preparation, observable signs, parameter ordering, and gradient calculations without hardware noise.
  3. Unit-test circuits. Verify simple parameter values for which the output is known.
  4. Declare conventions. Record qubit ordering, tensor-product order, angle units, optimizer settings, and shot allocation.
  5. Use independent validation shots. Do not judge final performance solely from the same noisy evaluations used for training.
  6. Track evaluation budget. Record circuit calls, shots, wall-clock time, and compilation overhead.
  7. Repeat experiments. Report means, variation across seeds, and confidence or uncertainty intervals where appropriate.
  8. Inspect samples, not only expectation values. For optimization problems, the distribution of bit strings may matter more than its mean.
  9. Prefer the smallest adequate ansatz. Increase depth only when evidence shows that it improves the target metric.
  10. Check hardware compilation. A logically shallow circuit may become physically deep after routing and native-gate decomposition.

A stopping rule may combine an iteration limit with a cost-change condition, for example stopping when |Cₜ − Cₜ₋₁| is below a chosen tolerance for several consecutive iterations. The tolerance must be interpreted relative to sampling uncertainty; a change smaller than the standard error may not be scientifically meaningful.

10. Illustrative Case: A Two-Qubit Ground-State Search

Background. Consider the illustrative Hamiltonian H = 0.5Z₀ + 0.5Z₁ + 0.2X₀X₁. A diploma-level laboratory uses a two-qubit hardware-efficient ansatz with four trainable Rᵧ angles and one CNOT.

Problem. The team must estimate the lowest energy using a simulator and then a noisy backend. They need to determine whether optimization failure is caused by the ansatz, the optimizer, or measurement noise.

Analysis. The Hamiltonian requires Z-basis measurements for Z₀ and Z₁ and an X-basis measurement for X₀X₁. Thus at least two measurement settings are required if terms are grouped by basis. The team first calculates a classical benchmark by diagonalizing the 4 × 4 Hamiltonian. They then test the circuit at known angles and compare analytic or parameter-shift gradients with finite differences.

Approach. They run three configurations: (a) simulator with exact expectations, (b) simulator with 1,000 shots per group, and (c) hardware with the same nominal shot budget. Each configuration uses five random seeds and the same maximum number of cost evaluations. The report records the best energy, median energy, standard deviation across seeds, number of shots, and final parameter values.

Outcome. In the ideal simulator, the optimizer approaches the classical benchmark. With finite shots, the final energy varies between seeds and the optimizer sometimes stops because successive changes are smaller than sampling error. On hardware, the energy is biased upward and convergence is less stable. Increasing ansatz depth does not reliably help because additional gates introduce noise and make gradients less informative.

Learning points. The experiment separates representation error from optimization error and hardware error. It also demonstrates why a lower training cost on one run is not sufficient evidence of a better algorithm. Independent validation, repeated trials, and classical comparison are essential.

11. Responsible Use of AI in Variational Workflows

AI coding assistants can help generate circuit templates, explain software errors, produce documentation, suggest test cases, or translate pseudocode between quantum programming frameworks. They can improve productivity, but generated code and explanations require expert verification.

Responsible practice includes:

  • never accepting an unverified Hamiltonian sign, qubit ordering, or gradient formula;
  • testing generated circuits against analytically solvable cases;
  • checking library versions and execution semantics;
  • protecting proprietary data, credentials, and unpublished research;
  • recording where AI assistance was used when required by institutional policy;
  • avoiding fabricated citations, performance claims, or unsupported assertions;
  • retaining human responsibility for scientific interpretation and publication conclusions.

AI may suggest an optimizer, but it cannot determine whether a result represents quantum advantage. That judgment requires a defined baseline, transparent resource accounting, statistically appropriate evaluation, and reproducible evidence.

12. Contemporary Directions and Limitations

Current research explores adaptive ansätze, error-aware optimization, measurement-frugal estimators, symmetry-preserving circuits, quantum natural-gradient methods, and combinations of classical tensor-network or machine-learning techniques with quantum circuits. Hardware improvements may eventually make deeper variational algorithms more reliable, but fault-tolerant operation is not guaranteed by near-term variational success.

The principal limitations are substantial:

  • optimization may require many noisy evaluations;
  • gradient estimates can be statistically expensive;
  • circuit compilation can increase depth;
  • ansatz choices introduce bias;
  • noise and drift complicate comparisons;
  • small demonstrations may have strong classical alternatives;
  • claimed advantages can disappear when preprocessing and measurement costs are included.

A scientifically defensible conclusion is often conditional: a variational method may be promising for a specified instance, hardware model, and resource budget, without establishing a general computational advantage.

Chapter Summary

Variational and hybrid quantum–classical programming alternates quantum measurement with classical parameter updates. A parameterized circuit defines a family of trial states, while a cost function supplies the quantity to optimize. VQE minimizes the expectation of a Hamiltonian and, under the variational principle, provides an upper bound on the ground-state energy. QAOA alternates cost and mixer evolutions for approximate discrete optimization, and quantum machine-learning models combine data encoding, trainable circuits, measurements, and classical losses.

Ansatz design balances expressibility, hardware compatibility, symmetry, depth, and trainability. Parameter-shift gradients are exact for important classes of rotation gates in the ideal model, but finite shots make all practical estimates uncertain. Optimizer choice must be evaluated using circuit-call and shot budgets, not only iteration counts. Sampling cost, noise, barren plateaus, compilation overhead, and classical baselines determine whether a result is meaningful.

Professional practice requires simulation tests, unit tests, explicit conventions, independent validation, repeated trials, uncertainty reporting, and transparent resource accounting. AI can support coding and workflow documentation, but human experts must verify formulas, implementation, data governance, and claims of performance or advantage.

Key Terms

Parameterized quantum circuit: A quantum circuit containing adjustable numerical parameters.

Ansatz: A chosen parameterized family of trial quantum states.

Cost function: A scalar objective minimized or maximized by an algorithm.

Expectation value: The probability-weighted average of measurement outcomes for an observable.

Hamiltonian: A Hermitian operator representing energy or another problem objective.

VQE: A hybrid algorithm that variationally estimates a Hamiltonian’s ground-state energy.

Variational principle: The ground-state energy is no greater than the expectation energy of any normalized trial state.

Pauli string: A tensor product of single-qubit I, X, Y, or Z operators.

Parameter-shift rule: A gradient-estimation rule using shifted circuit parameters.

SPSA: A stochastic optimizer whose gradient estimate uses two perturbed evaluations.

QAOA: A variational algorithm alternating problem and mixer Hamiltonians.

Mixer Hamiltonian: An operator used in QAOA to promote exploration of feasible states.

Shot: One circuit execution followed by measurement.

Measurement grouping: Combining compatible observables into shared measurement settings.

Barren plateau: An optimization landscape with gradients too small to train efficiently.

Ansatz expressibility: The range of states that an ansatz can represent.

Error mitigation: Techniques that reduce estimated error without implementing full error correction.

Hybrid workflow: A computation in which classical and quantum processors exchange information iteratively.

Quantum advantage: A demonstrated performance benefit over an appropriate classical baseline under stated resources.

Review Questions

Short Answer Questions

  1. What is the role of the classical optimizer in a hybrid quantum algorithm?
  2. State the variational principle used by VQE.
  3. Why can an ansatz with greater expressibility be difficult to train?
  4. What does one shot represent in a quantum experiment?
  5. Name two factors that should be included in a reproducible variational-algorithm report.

Long Answer Questions

  1. Explain the complete VQE workflow, including Hamiltonian decomposition, measurement, optimization, and validation.
  2. Compare hardware-efficient, problem-inspired, and QAOA ansätze in terms of expressibility, depth, and trainability.
  3. Explain the parameter-shift rule and contrast it with central finite differences.
  4. Discuss how finite-shot sampling and hardware noise affect variational optimization.
  5. Describe responsible uses and limitations of AI coding assistants in quantum-programming work.

Analytical / Application Questions

  1. A Hamiltonian is H = 0.6Z₀ − 0.2Z₁ + 0.3X₀X₁. Measured expectations are 0.4, −0.5, and 0.2 respectively. Calculate the estimated energy and state the required measurement bases.
  2. Design an experiment to determine whether increasing QAOA depth improves performance or merely increases noise. Specify controls, metrics, repetitions, and resource accounting.
  3. An optimizer reports nearly zero gradients, but the cost remains far from a classical benchmark. Develop a diagnostic plan that distinguishes a barren plateau from an implementation error, inadequate shot count, or poor initialization.

Multiple Choice Questions with Answers

Question 1

What quantity does VQE minimize when solving a ground-state problem?

A. The number of qubits

B. The expectation value of the Hamiltonian

C. The circuit compilation time

D. The number of classical parameters

Correct Answer: B. The expectation value of the Hamiltonian

Question 2

For a Hamiltonian H = ∑ᵢ cᵢPᵢ, what does cᵢ represent?

A. A measurement shot

B. A qubit index

C. A real coefficient multiplying a Pauli string

D. A circuit depth

Correct Answer: C. A real coefficient multiplying a Pauli string

Question 3

Under the stated parameter-shift conditions, which expression estimates ∂C/∂θⱼ?

A. C(θⱼ)/2

B. C(θⱼ + π) − C(θⱼ − π)

C. [C(θⱼ + π/2) − C(θⱼ − π/2)]/2

D. C(θⱼ + 1) + C(θⱼ − 1)

Correct Answer: C. [C(θⱼ + π/2) − C(θⱼ − π/2)]/2

Question 4

If a Pauli observable has expectation 0 and is measured with M independent shots, its ideal estimator variance is:

A. 0

B. 1/M

C. M

D. 1 − M

Correct Answer: B. 1/M

Question 5

What is a principal purpose of the mixer Hamiltonian in QAOA?

A. To remove all classical optimization

B. To promote exploration of states

C. To prepare a thermal reservoir

D. To replace measurement shots

Correct Answer: B. To promote exploration of states

Question 6

Which ansatz characteristic directly concerns whether the circuit can represent relevant problem states?

A. Reachability

B. File size

C. Compiler version

D. Screen resolution

Correct Answer: A. Reachability

Question 7

Why can parameter-shift gradients be expensive?

A. They require no circuit executions

B. They may require shifted evaluations for many parameters

C. They eliminate all measurements

D. They work only on classical data

Correct Answer: B. They may require shifted evaluations for many parameters

Question 8

Which observation is most consistent with a barren plateau?

A. Large, stable gradients at every parameter

B. Gradients becoming very small as circuits or systems grow

C. A Hamiltonian having Pauli terms

D. A circuit containing a measurement

Correct Answer: B. Gradients becoming very small as circuits or systems grow

Question 9

Why should variational experiments use a classical baseline?

A. To make the quantum circuit deeper

B. To establish whether the result offers meaningful comparative performance

C. To avoid recording shot counts

D. To guarantee zero hardware noise

Correct Answer: B. To establish whether the result offers meaningful comparative performance

Question 10

Which is a responsible use of an AI coding assistant?

A. Publishing generated performance claims without testing

B. Providing confidential credentials in a prompt

C. Generating a draft test case and verifying it against known results

D. Treating generated citations as automatically authentic

Correct Answer: C. Generating a draft test case and verifying it against known results

Quantum Programming and Simulation
Chapter 12 of 15