A reproducible quantum experiment is more than a circuit that runs successfully once. It is a documented project in which another developer can recover the exact environment, reconstruct the circuit, understand the measurement plan, identify the backend conditions, and compare results without guessing. This guide provides a practical repository template, a metadata checklist, and a review cadence for quantum developers working on benchmarks, tutorials, paper replications, or team handoffs.
Overview
Quantum experiments are especially sensitive to context. The same logical circuit can produce different observations when it is compiled with another SDK version, mapped to a different device topology, executed with a different shot count, or run against hardware with changed calibration data. A simulator run can also differ from a hardware run because noise models, measurement errors, and transpilation choices are not equivalent.
Reproducibility does not require every future run to produce identical counts. It requires the experiment to preserve enough information to explain why results are identical, different, or only approximately comparable. The goal is an auditable workflow rather than a screenshot of a successful job.
A useful quantum computing GitHub project separates source code, configuration, generated results, and interpretation. One possible structure is:
quantum-experiment/
├── README.md
├── pyproject.toml
├── requirements-lock.txt
├── LICENSE
├── src/
│ ├── circuits.py
│ ├── measurements.py
│ └── runners.py
├── experiments/
│ └── experiment-001.yaml
├── notebooks/
├── results/
│ ├── raw/
│ └── processed/
├── reports/
└── tests/The exact filenames are flexible. The important rule is that a reader should be able to distinguish the experiment definition from the output it generated. Keep notebooks useful for exploration, but place the repeatable execution path in scripts or modules that can be run from a clean environment.
What to track
1. Environment and dependency state
Record the programming language version, operating system when relevant, quantum SDK, provider library, simulator package, and numerical dependencies. Pin versions for a formal benchmark or replication. A lockfile is preferable to a short list of minimum versions because transitive dependencies can affect execution.
Also record how the environment was created. A command such as python -m venv .venv followed by documented installation steps is more useful than an unexplained collection of imports. If the experiment depends on a cloud account, private credential, or provider setting, document the requirement without committing secrets. Use environment variables or a secret manager for credentials.
2. Circuit definition and compilation
Store the circuit in a form that another person can inspect. Include the number of qubits and classical bits, gate sequence, parameter values, register layout, measurement mapping, and any assumptions about qubit ordering. If parameters are bound at runtime, save the parameter values with the run configuration.
Compilation details deserve their own record. Capture the target backend, optimization level or pass configuration, initial layout when specified, routing method when specified, basis gates if relevant, and the resulting depth and two-qubit gate count. A circuit-transpilation change can alter hardware behavior even when the algorithmic circuit is unchanged. For background, see this guide to quantum circuit transpilation optimization.
3. Measurement and sampling plan
Record the number of shots, observable definitions, measured registers, post-processing rules, and whether results were aggregated across separate jobs. For expectation-value experiments, specify the Pauli terms and estimator used. If terms are grouped to reduce execution cost, preserve the grouping and basis-rotation details; the Pauli measurement grouping guide provides useful context.
Seeds should be explicit wherever the toolchain supports them. Document circuit-generation seeds, simulator seeds, transpiler seeds, and sampling seeds separately. A seed may make one layer deterministic while leaving other sources of variation uncontrolled, so do not describe a run as fully deterministic unless you have verified the entire path.
4. Backend and execution metadata
For a simulator, record the simulator name, version, noise model, coupling map, basis gates, precision settings, and whether the simulation was state-vector, density-matrix, shot-based, or another mode. For hardware, record the provider, backend name, execution timestamp, job identifier, selected qubits if available, and the calibration snapshot or relevant calibration values.
Useful hardware fields include reported T1 and T2 values, readout error indicators, gate-error indicators, connectivity, queue conditions, and any active error-mitigation or dynamical-decoupling option. Treat these as time-dependent metadata, not permanent properties of the device. This backend selection guide explains why calibration data should be considered alongside nominal device capacity.
5. Raw results and interpretation
Never keep only a chart or a manually copied result. Save raw counts, bitstring conventions, expectation values, metadata, warnings, and job identifiers in a machine-readable format such as JSON or CSV. Add a human-readable report that states the hypothesis, method, observed result, uncertainty or sampling limitation, and known deviations from the planned setup.
A compact run record can include:
experiment_id: exp-001
code_revision: <commit-hash>
run_type: simulator-or-hardware
backend: <backend-name>
sdk_version: <version>
shots: <integer>
seed_values: <recorded-or-not-supported>
transpiled_depth: <integer>
two_qubit_gates: <integer>
calibration_timestamp: <timestamp-or-not-applicable>
raw_result_file: results/raw/<run-id>.jsonCadence and checkpoints
Use a checkpoint at each meaningful stage rather than waiting until the end of a project.
- Before the first run: create the repository, pin the environment, write the experiment configuration, and add a small test circuit. Confirm that a clean installation can import the required packages.
- After circuit construction: save a diagram or serialized representation, verify qubit and classical-bit ordering, and test expected behavior on an ideal simulator where appropriate.
- After compilation: save the transpiled circuit and record depth, gate counts, layout, and compiler settings. Do not compare hardware results using only the uncompiled circuit.
- After every execution: preserve raw output and metadata immediately. Include the job identifier and timestamp before moving to analysis.
- At the end of a benchmark: regenerate the report from stored data, check that no result depends on an interactive notebook state, and tag the repository commit used for the published result.
- Monthly or quarterly: rerun a small smoke test and review dependency, provider, backend, and documentation changes that could affect future execution.
For a team, make these checkpoints part of the pull-request checklist. A review should ask whether a new experiment can be rerun from a clean checkout, whether raw data is present, and whether changes to circuit compilation or measurement semantics are visible in the diff.
How to interpret changes
When two runs disagree, start with controlled comparisons instead of attributing the difference immediately to hardware quality. First check the code revision, dependency versions, circuit hash, transpiled depth, shot count, seed handling, backend, and calibration timestamp. Then compare the raw distributions, not just their most likely bitstrings.
Separate statistical variation from configuration drift. Repeating the same shot-based simulator experiment can produce different counts even when the probability distribution is unchanged. Increasing shots may reduce sampling fluctuation, but it does not correct a changed circuit or a different noise model.
When comparing simulator and hardware, label the comparison clearly. An ideal simulator is a reference for logical behavior, while a noisy simulator may approximate selected error mechanisms. Hardware adds calibration drift, readout effects, connectivity constraints, queue-time conditions, and other operational variables. A fair report states which variables were held constant and which could not be controlled.
Benchmarks should report more than a single success percentage. Depending on the task, include raw distributions, expectation values, confidence or uncertainty treatment, circuit depth, two-qubit gate count, shot count, runtime information, and the exact comparison baseline. For randomized benchmarking or related protocols, preserve the sequence-generation settings and analysis assumptions; this randomized benchmarking guide offers a useful example of methodology-focused reporting.
When to revisit
Revisit the project on a monthly or quarterly schedule, and immediately after any change that could alter execution. The most important triggers are a major SDK or simulator upgrade, a provider API change, a replacement backend, a new transpilation configuration, a changed noise model, or a modification to measurement and post-processing code.
At each scheduled review, run the smoke test first. Next, rebuild the environment from the lockfile, compare circuit hashes and compiled metrics, verify that stored result files still load, and inspect the README for commands that no longer work. If the experiment targets hardware, refresh backend and calibration metadata rather than silently reusing an old snapshot.
Do not overwrite historical results when refreshing a benchmark. Create a new run identifier, commit, and report, then explain the difference from the previous run. If a package update changes results, keep both versions available and record whether the change came from circuit generation, compilation, simulation, execution, or analysis.
To make this workflow actionable, add a small reproducibility checklist to every quantum project:
- Can a new contributor create the environment from documented files?
- Can they reconstruct the exact circuit and measurement mapping?
- Are seeds, shots, backend details, and compilation settings recorded?
- Are raw results preserved separately from charts and conclusions?
- Can the report explain differences between simulator and hardware runs?
- Is there a named date or trigger for the next review?
A disciplined repository turns a one-off quantum computing experiment into a reusable learning asset. It helps a quantum developer debug SDK changes, compare backends responsibly, reproduce a paper result, and hand work to a teammate without transferring undocumented assumptions. For project-based learning, pair this workflow with the quantum developer project roadmap, and update the repository whenever the surrounding toolchain or experiment conditions change.