Quantum × DevOps · a coldqubit project

shotgate

CI/CD quality gates for quantum circuits. Statistically validate probabilistic output, across simulators and real QPUs, defined entirely as code.

CIpodman releasev0.7.0 licenseApache-2.0 python3.10+ statusalpha
zsh · shotgate
$
How it works

Declare. Run. Gate.

workflow.yamlshotgate.dev/v1alpha1
apiVersion: shotgate.dev/v1alpha1
kind: QuantumWorkflow
metadata:
  name: bell-state
defaults:
  backend: { provider: local-aer, shots: 8192 }
jobs:
  - name: bell-pair
    circuit: { format: qasm2, path: bell.qasm }
    assertions:
      - type: chi_square  # χ² goodness-of-fit
        expected: { "00": 0.5, "11": 0.5 }
        significance: 0.01
      - type: allowed_states  # |01⟩,|10⟩ forbidden
        states: ["00", "11"]
        max_leakage: 0.0
01

Declare gates as YAML

Circuits, shots, and statistical assertions live in a QuantumWorkflow file, versioned next to your code.

02

Run in a container

podman pull and go: pinned dependencies, no host Python, identical locally and in CI.

03

Gate the pipeline

Verdicts map to exit codes; a failed assertion fails the build. JUnit XML output drops into any CI dashboard.

Assertion oracles

Statistics, not snapshots.

Quantum output is probabilistic; exact-match testing is meaningless. Each oracle bounds a distribution property, or the circuit's own structure, instead.

Distance & fit
δ

distribution_tvd

Total variation distance between observed and expected counts, bounded above. Interpretable, shot-count agnostic.

max_distance: 0.03
F

hellinger_fidelity

Classical fidelity, bounded below. Deprecation candidate (ADR-0018): the number moves onto distribution_tvd's result.

min_fidelity: 0.99 · deprecation candidate
χ²

chi_square

Pearson goodness-of-fit, gated on a p-value. Simulator-only: fails closed on real hardware.

significance: 0.01 · sim-only
D

kl_divergence

Kullback-Leibler divergence from expected, bounded above (bits). Auto readout-aware on a QPU.

max_divergence: 0.05
Outcome & shape
P

state_probability

Marginal probability of one outcome, held inside a window. The simplest hardware-friendly gate.

min: 0.45 · max: 0.55

most_frequent_outcome

The modal measured outcome must be a given state, optionally above a probability. For single-answer algorithms.

state: 11 · min_probability: 0.7
H

shannon_entropy

Shannon entropy of the measured distribution, held inside a min/max window (bits).

min: 0.9 · max: 1.1
⟨Z⟩

expectation_value

Pauli-Z product expectation ⟨Z..Z⟩ in [-1, 1], via a window or a target. A Bell pair gives +1.

qubits: [0, 1] · min: 0.95
Structural & cross-run

allowed_states

Probability mass observed outside the allowed support set; catches states that should never appear.

max_leakage: 0.0

circuit_depth

Bound the authored circuit's depth in a min/max window. Static and output-independent.

max: 50 · no execution

gate_set

Require the circuit to use only an allowed set of gate names. Static, runs every commit.

allowed: [h, cx, rz, sx] · no execution
Δ

differential

Total variation distance against another job's counts, not a declared expected. Gates a circuit with no closed-form answer.

against_job: baseline · max_distance: 0.05
Backends

Simulators first. Hardware: validated.

v0.2 gates passed on a real QPU: Bell, GHZ, and Grover on ibm_fez at 4096 shots, 2026-06-11. The measured baseline lives in hardware-validation.

local-aerQiskit Aer simulator, baked into the image. Default, fully offline.WORKING
ibmIBM Quantum via Qiskit Runtime. Validated on real hardware: ibm_fez, Bell/GHZ/Grover at 4096 shots.VALIDATED
braketAWS Braket via qiskit-braket-provider. Local simulation works with no AWS account; cloud devices need credentials.WORKING
mitiqError mitigation layer via Mitiq.PLANNED
Drop-in CI gating

One job. Three exit codes.

.github/workflows/quantum.ymlGitHub Actions
jobs:
  validate-circuits:
    runs-on: ubuntu-latest
    container: ghcr.io/coldqubit/shotgate:latest
    steps:
      - uses: actions/checkout@v4
      - run: shotgate run workflow.yaml --junit report.xml
0

All assertions passed. The pipeline proceeds.

1

A statistical gate failed. The build stops here.

2

Bad configuration or runtime error, fix the workflow, not the circuit.