Steven GellerQuantum Computing, End to End

Book contents

Current section

Part X. Capstones

  1. Full-Stack Algorithm Trace
  2. Hardware-Constrained Lab
  3. Application Evidence Dossier
  4. Company Diligence Memo
  5. Public Playground MVP

Part X. Capstones · Chapter 83

Full-Stack Algorithm Trace

Follow one quantum algorithm all the way down — problem, mathematics, circuit, code, noise, hardware budget, decision — and publish the trace as an artifact other engineers can inspect. That end-to-end chain is your capstone.

Artifact
In this chapter 9 sections

Build a trace whose problem promise, classical baseline, state evolution, circuit, compiled operations, noise model, resource estimate, and decision consequence are linked by executable small cases and explicit assumptions.

A full-stack trace is a chain of preserved contracts. The four-item Grover instance begins with an oracle promise and basis order, evolves amplitudes through preparation, phase marking and diffusion, compiles gates into an instruction ledger, and ends with measurement, error assumptions, resource counts, and the claim those counts can support.

Capstone brief: one algorithm, every interface

Full-stack four-item Grover trace Grover amplitudes before the oracle, after the phase mark, and after diffusion. Full-stack four-item Grover trace uniformphase markdiffusion
Figure 83.1. For marked index 2, diffusion moves all ideal amplitude to the third bar. The three snapshots preserve normalization.

Use basis order 00,01,10,11\lvert 00\rangle,\lvert 01\rangle,\lvert 10\rangle,\lvert 11\rangle. The ideal uniform state has amplitudes 1/21/2. One oracle call changes the marked amplitude’s sign; inversion about the mean then maps the marked state to amplitude 1 and all others to 0. This exact small case tests correctness, not large-instance advantage.

Trace Grover’s four-item instance by amplitude

Compile the oracle and count the physical consequences

def one_iteration(marked, apply_oracle=True):
    if marked not in range(4) or type(apply_oracle) is not bool:
        raise ValueError("marked must be a four-item oracle index")
    amplitudes = [0.5] * 4
    if apply_oracle:
        amplitudes[marked] *= -1
    assert abs(sum(a*a for a in amplitudes) - 1.0) < 1e-12
    mean = sum(amplitudes) / 4
    amplitudes = [2*mean - a for a in amplitudes]
    assert abs(sum(a*a for a in amplitudes) - 1.0) < 1e-12
    return amplitudes
baseline = one_iteration(2)
alternate = one_iteration(0)
oracle_omitted = one_iteration(2, False)
for marked in range(4):
    result = one_iteration(marked)
    assert result[marked] == 1.0 and sum(abs(a) for i, a in enumerate(result) if i != marked) == 0
assert baseline == [0.0, 0.0, 1.0, 0.0] and alternate == [1.0, 0.0, 0.0, 0.0]
assert oracle_omitted == [0.5, 0.5, 0.5, 0.5]
print(f"PASS: 83 full-stack Grover baseline={baseline} alternate={alternate} no_oracle_success={oracle_omitted[2]**2:.2f}")

For marked index 2, the phase vector is [1/2, 1/2, -1/2, 1/2]. Its mean is 1/4. Applying ai2aˉaia_i\mapsto 2\bar{a}-a_i yields [0, 0, 1, 0]. The table records that state evolution. The code repeats it for all four possible marked indices, checks normalization at every material step, and separates one oracle query from the gates needed to implement that oracle.

Artifact contract. A semantic state table, OpenQASM-adjacent gate ledger, executable amplitude fixture, and resource-account rubric. The fixture normalizes every state, returns the marked item with probability one in the ideal one-iteration case, and the report separates query count from compiled gates, shots, and error assumptions.

Full-stack four-item Grover trace: inspected record
StepAmplitude vector in declared basisInvariantResource boundary
Uniform[1/2, 1/2, 1/2, 1/2]norm 1state preparation
Oracle for index 2[1/2, 1/2, -1/2, 1/2]norm 1one query
Diffusion[0, 0, 1, 0]norm 1logical gates separate
Measurementindex 2 with probability 1probabilities sum 1shots separate

Exact validation command: python3 tools/validate_briefs.py --briefs data/editorial_briefs_64_87.json --from 64 --through 87 --check-rewritten-sources --execute-artifacts

Package a reproducible trace submission

The submission must add a compiled ledger and hardware assumptions without promoting the toy result. Query complexity, logical one- and two-qubit gates, routed gates, depth, shots, physical-error model, and validation are separate rows. A reviewer should be able to replace the oracle and rerun the trace before discussing resource scaling.

Validate the full-stack chain

Prompt. Submit a full-stack trace for the four-item Grover search and one changed oracle.

Deliverable. Problem contract, basis order, state table, circuit, executable fixture, compiled gate ledger, noise assumption, resource table, validation command, and decision note.

Pass condition. Both oracles pass normalization and marked-state tests; query, logical-gate, compiled-gate, shot, and physical-resource statements remain separate; every simplification is labeled.

Model submission and scoring rubric for the trace

Format. Reference two-oracle Grover trace and 100-point analytic rubric.

The reference submission passes all four marked indices and awards correctness points only after basis, oracle, diffusion, normalization, and measurement contracts agree. Its 100-point rubric assigns 25 points to problem and baseline, 25 to state and circuit correctness, 20 to executable reproduction, 20 to complete resource boundaries, and 10 to limitations. Reporting only one query earns no physical-resource credit.

Verification. The fixture returns each marked basis state at unit ideal probability and the rubric awards no resource credit for reporting only oracle queries.

Analytic capstone rubric: 100 points
CriterionPointsEvidence rule
Problem promise and classical baseline25Show the inspectable problem promise and classical baseline record; an unsupported assertion receives no credit.
State evolution and circuit correctness25Show the inspectable state evolution and circuit correctness record; an unsupported assertion receives no credit.
Executable reproduction20Show the inspectable executable reproduction record; an unsupported assertion receives no credit.
Compiled and physical resource boundaries20Show the inspectable compiled and physical resource boundaries record; an unsupported assertion receives no credit.
Limitations and transfer10Show the inspectable limitations and transfer record; an unsupported assertion receives no credit.
Total100All pass conditions remain mandatory regardless of point total.

Companion work

Artifacts for this chapter

These entries resolve to checked-in local source. Commands are reproduced exactly from the chapter manifest, and source-embedded fixtures are exported as direct downloads.

  1. Reproduce or test

    python3 tools/validate_briefs.py --briefs data/editorial_briefs_64_87.json --from 64 --through 87 --check-rewritten-sources --execute-artifacts

Provenance

Sources and review

  1. Lov K. Grover. A fast quantum mechanical algorithm for database search. Proceedings of STOC. 1996primary paper
  2. Robert Beals, Harry Buhrman, Richard Cleve, Michele Mosca, and Ronald de Wolf. Quantum lower bounds by polynomials. Journal of the ACM. 2001primary paper
  3. OpenQASM Technical Steering Committee. OpenQASM 3 specification. Linux Foundation Joint Development Foundation. 2026official technical specification
  4. IBM Quantum. Qiskit documentation. IBM. 2026official documentation
  5. Association for Computing Machinery. Artifact Review and Badging. ACM Publications. 2026official reproducibility policy
  6. Easwar Magesan, J. M. Gambetta, and Joseph Emerson. Scalable and robust randomized benchmarking of quantum processes. Physical Review Letters. 2011primary paper
  7. Lieven M. K. Vandersypen et al.. A look at the full stack. Nature Reviews Physics. 2021peer-reviewed perspective
  8. Timothy Proctor et al.. Benchmarking quantum computers. Nature Reviews Physics. 2025peer-reviewed perspective

The load-bearing claims in the chapter are mapped inline to this registered source set. A citation supports only the bounded claim beside it.

Cite this chapter