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 84

Hardware-Constrained Lab

An ideal circuit diagram hides everything that makes quantum hardware hard. In this capstone you build a lab that puts the ideal circuit next to its constrained twin and measures what connectivity, native gates, noise, and timing actually change.

Artifact
In this chapter 9 sections

Freeze the logical experiment and acceptance statistic, map it through the device coupling graph and native basis, account for inserted routing and timing operations, then compare measured output with both an ideal and noise-aware prediction.

A hardware-constrained lab preserves an experimental contract while changing its implementation. The logical Bell task specifies preparation and a parity statistic. Placement, routing, native decomposition, scheduling, calibration, queueing and readout mitigation may change, but the task identifier, logical-bit interpretation, and acceptance rule do not.

Capstone brief: preserve the experiment under constraints

For the ideal reference, Φ+=(00+11)/2\lvert\Phi^+\rangle=(\lvert 00\rangle+\lvert 11\rangle)/\sqrt{2}. Logical qubits occupy physical endpoints 0 and 2 of a line 0–1–2. A routed implementation must publish initial and final layouts so measured physical bits are interpreted as the intended logical pair. Inserted SWAP cost belongs in the ledger.

Three-qubit line-constrained Bell lab Routing a Bell experiment between the endpoints of a three-node line. Three-qubit line-constrained Bell lab p0 / q0p1p2 / q1 SWAP: 3 CNOTs logical entangler after layout update
Figure 84.1. The logical pair begins on p0 and p2. One SWAP makes the endpoints adjacent and adds three CNOT-equivalent operations before the logical entangler.

Route a Bell experiment on a line

Hardware-Constrained Lab: claim and source ledger, frozen 14 August 2026
Bounded claimSupporting records
C-01: Circuit meaning and hardware execution are separated by instruction semantics, compilation, routing, calibration, and measurement.OpenQASM Technical Steering Committee, OpenQASM 3 specification (2026)
IBM Quantum, Qiskit documentation (2026)
Google Quantum AI, Cirq documentation (2026)
Lieven M. K. Vandersypen et al., A look at the full stack (2021)
C-02: Randomized benchmarking characterizes an average error protocol but does not predict every routed circuit outcome.Easwar Magesan, J. M. Gambetta, and Joseph Emerson, Scalable and robust randomized benchmarking of quantum processes (2011)
Timothy Proctor et al., Benchmarking quantum computers (2025)
C-03: Official Qiskit and Cirq documentation expose current routing and execution concepts at the review date.IBM Quantum, Qiskit documentation (2026)
Google Quantum AI, Cirq documentation (2026)
C-04: Artifact review requires environment, result, and reproducibility records for a laboratory claim.Association for Computing Machinery, Artifact Review and Badging (2026)
U.S. Government Accountability Office, Quantum Computing and Communications: Status and Prospects (2021)

OpenQASM supports the circuit-semantics boundary. Qiskit and Cirq documentation supply dated compilation concepts. Randomized benchmarking does not directly predict this routed Bell statistic, which is why calibration and task-level output remain separate. ACM and the benchmark sources require environment and result records.

Timing and readout redefine the acceptance region

The reference router moves one endpoint through the middle node, applies the entangling operation, and tracks the resulting layout. Using the conventional three-CNOT SWAP decomposition, one SWAP adds three two-qubit operations before the logical entangler. The ideal state fixture still checks only Bell parity and normalization; the hardware notebook must record calibration, shots, counts, and mapping.

Three-qubit line-constrained Bell lab: inspected record
Ledger itemLogical recordPhysical consequenceCheck
Initial layoutq0→p0, q1→p2nonadjacent endpointsdeclared
Routingmove one endpoint1 SWAP = 3 CNOTscounted
Entanglerlogical CNOTnative/decomposed operationbackend-specific
Measurementeven paritymap physical to logical bitsacceptance frozen

Artifact contract. A topology diagram, routed operation ledger, executable state fixture, calibration record schema, and acceptance rubric. Routing endpoints are correct, inserted SWAP/CNOT cost is counted, ideal Bell probabilities pass, and hardware claims remain pending without a calibration-stamped run.

from math import isclose
def validate_lab(notebook, minimum_even_parity):
    errors = []
    if notebook.get("scenario") != "line-routed Bell experiment" or not notebook.get("source_ids"):
        errors.append("scenario_or_sources")
    route = notebook.get("route", {})
    if (type(route.get("logical_endpoints")) is not list or len(route.get("logical_endpoints", [])) != 2 or
            type(route.get("swap_count")) is not int or route.get("distance_unit") != "edges"):
        errors.append("route_schema")
    probabilities = notebook.get("ideal_probabilities", {})
    if set(probabilities) != {"00", "01", "10", "11"} or any(type(value) is not float for value in probabilities.values()):
        errors.append("probability_schema")
    elif not isclose(sum(probabilities.values()), 1.0) or probabilities["01"] + probabilities["10"] != 0.0:
        errors.append("ideal_bell_state")
    counts = notebook.get("counts", {})
    shots = notebook.get("shots", {})
    if set(counts) != {"00", "01", "10", "11"} or any(type(value) is not int for value in counts.values()):
        errors.append("counts_schema")
    if type(shots.get("value")) is not int or shots.get("unit") != "shots" or sum(counts.values()) != shots.get("value"):
        errors.append("shots_schema")
    calibration = notebook.get("calibration", {})
    if type(calibration) is not dict:
        errors.append("calibration_schema")
    compiled = route.get("swap_count", 0) * 3 + route.get("logical_entanglers", 0)
    parity = (counts.get("00", 0) + counts.get("11", 0)) / max(shots.get("value", 0), 1)
    stamped = all(calibration.get(name) for name in ("backend", "timestamp", "job_id"))
    if errors:
        decision = "invalid"
    elif parity < minimum_even_parity:
        decision = "acceptance-fail"
    else:
        decision = "hardware-accepted" if stamped else "simulation-only"
    return {"decision": decision, "errors": sorted(set(errors)),
            "compiled_two_qubit_count": compiled, "even_parity": parity, "calibration_stamped": stamped}
notebook = {"scenario": "line-routed Bell experiment", "source_ids": ["openqasm3"],
            "route": {"logical_endpoints": [0, 2], "swap_count": 1,
                      "logical_entanglers": 1, "distance_unit": "edges"},
            "ideal_probabilities": {"00": 0.5, "11": 0.5, "01": 0.0, "10": 0.0},
            "counts": {"00": 4800, "11": 4800, "01": 210, "10": 190},
            "shots": {"value": 10000, "unit": "shots"},
            "calibration": {"backend": "", "timestamp": "", "job_id": ""}}
base_result = validate_lab(notebook, 0.95)
bad_route = {**notebook["route"], "distance_unit": ""}
bad_result = validate_lab({**notebook, "route": bad_route}, 0.95)
strict_result = validate_lab(notebook, 0.97)
assert base_result["compiled_two_qubit_count"] == 4 and base_result["decision"] == "simulation-only"
assert bad_result["decision"] == "invalid" and "route_schema" in bad_result["errors"]
assert strict_result["decision"] == "acceptance-fail" and isclose(strict_result["even_parity"], 0.96)
print(f"PASS: 84 lab notebook gates={base_result['compiled_two_qubit_count']} parity={base_result['even_parity']} claim={base_result['decision']} invalid={bad_result['errors']} strict={strict_result['decision']}")

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

Record calibration beside every result

Freeze a 10,000-shot acceptance band before device access. Store backend identifier, calibration timestamp, job identifier, compiler versions, seed, layout, routed circuit, raw counts, and applied post-processing. If the result fails, compare the ideal fixture, a declared noise model, and the calibration record in that order. Do not tune the band after seeing counts.

Run the constrained-lab validator

Prompt. Route and validate a Bell-state experiment when logical qubits 0 and 2 occupy a three-node line.

Deliverable. Logical circuit, initial/final layout, routed gate ledger, depth and two-qubit count, 10,000-shot ideal fixture, calibration schema, acceptance rule, and exact validation command.

Pass condition. The final measured logical bits are mapped correctly, routing cost is explicit, ideal counts satisfy the statistical band, and no hardware conclusion appears without matching calibration metadata.

Model lab notebook and analytic rubric

Format. Reference routed notebook record and 100-point rubric.

The model notebook earns 20 points for contract and basis, 20 for correct routing and layout, 15 for gate/depth accounting, 15 for the ideal fixture, 20 for calibration-stamped hardware evidence, and 10 for diagnosis. With calibration fields blank, it can score at most 80 and cannot claim hardware validation. The fixture confirms ideal parity and a three-CNOT routing surcharge.

Verification. The embedded simulator passes ideal parity and routing-account checks; the rubric withholds all hardware-evidence points when calibration fields are blank.

Analytic capstone rubric: 100 points
CriterionPointsEvidence rule
Experiment contract and basis20Show the inspectable experiment contract and basis record; an unsupported assertion receives no credit.
Routing and layout correctness20Show the inspectable routing and layout correctness record; an unsupported assertion receives no credit.
Gate, depth, and timing account15Show the inspectable gate, depth, and timing account record; an unsupported assertion receives no credit.
Ideal executable fixture15Show the inspectable ideal executable fixture record; an unsupported assertion receives no credit.
Calibration-stamped hardware record20Show the inspectable calibration-stamped hardware record record; an unsupported assertion receives no credit.
Diagnosis and limits10Show the inspectable diagnosis and limits 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. OpenQASM Technical Steering Committee. OpenQASM 3 specification. Linux Foundation Joint Development Foundation. 2026official technical specification
  2. IBM Quantum. Qiskit documentation. IBM. 2026official documentation
  3. Google Quantum AI. Cirq documentation. Google. 2026official documentation
  4. Easwar Magesan, J. M. Gambetta, and Joseph Emerson. Scalable and robust randomized benchmarking of quantum processes. Physical Review Letters. 2011primary paper
  5. Association for Computing Machinery. Artifact Review and Badging. ACM Publications. 2026official reproducibility policy
  6. U.S. Government Accountability Office. Quantum Computing and Communications: Status and Prospects. GAO. 2021government technology assessment
  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