Governed CLI for AI-assisted quantum programming: LLMs propose circuits, deterministic verifiers (H2-1SC, QCCD noise emulation, HQC budget gates) decide, measure, and record cryptographic receipts.
Models propose; deterministic code decides, measures, and records.
osiris-cli is a local-first, cryptographically auditable console that sits between language models and quantum execution backends (including Quantinuum Nexus H2-1 / H2-2 / Helios, IBM Quantum, and local QCCD/statevector simulators). It prevents AI agents from burning hardware credits on invalid or unapproved circuits by enforcing deterministic pre-flight verification, exact HQC/shot budget caps, and tamper-evident SHA-256 execution receipts.
pip install -e .
osiris propose "5-qubit bit-flip QEC with mid-circuit reset" --target quantinuum --out circuit.qasm
osiris verify circuit.qasm --target H2-1SC --emulate qccd --record-ledgerAutonomous coding agents are useful at proposing quantum circuits and QEC routines—but unreliable at self-verifying them. osiris-cli separates proposal from execution:
- Deterministic Pre-Flight (
H2-1SC& Local QCCD Emulation): Every model-generated OpenQASM / Guppy circuit is statically parsed, qubit-ceiling checked (56qon H2,98qon Helios), lowered to native QCCD gates (PhasedX, virtualRz,ZZMax/ZZPhase), and simulated under realistic trapped-ion trajectory noise with mid-circuit collapse, optical-pumpingreset, and classical feedforward (if(creg == val)) before any paid emulator or QPU call is allowed. - Hard Budget & Tiered Approval Gates: Enforces per-job shot caps (
OSIRIS_MAX_SHOTS), exactDecimalHQC budgets (OSIRIS_MAX_HQC/--budget-hqc), and operator-signed Tier 3 approval tokens bound to(circuit_sha256, target, max_shots, max_hqc)so neither a human typo nor an AI loop can submit an unapproved or mutated hardware job. - Cryptographic Evidence Ledger: Every run writes an immutable
exec-canon-1SHA-256 hash-chained receipt (SIMULATED,PREVIEW_COMPLETE, orHARDWARE_ATTESTED) with circuit hash, native gate breakdown,G-14raw integer shot counts, and HQC estimate—verifiable offline viaosiris ledger verify.
pip install -e .# 1. Generate a candidate circuit with mid-circuit measurement, reset & feedforward
osiris propose "3-qubit bit-flip QEC with mid-circuit syndrome reset" \
--target quantinuum \
--out examples/quantinuum/bitflip_qec.qasm
# 2. Run deterministic pre-flight (H2-1SC static check + local QCCD trajectory emulation)
osiris verify examples/quantinuum/bitflip_qec.qasm \
--target H2-1SC \
--emulate qccd \
--shots 1024 \
--record-ledgerosiris bench examples/quantinuum/steane_7q_x_syndrome.qasm \
--compare quantinuum_h2_1,quantinuum_helios,ibm_fez \
--format markdown# Mint an operator-signed approval token bound to exact circuit SHA-256, target, shots & HQC cap
export OSIRIS_TIER3_TOKEN="$(osiris grant-tier3 examples/quantinuum/bitflip_qec.qasm --target H2-1 --shots 500 --budget-hqc 25 --quiet)"
# Fails closed unless H2-1SC passes, HQC estimate <= budget, and approval token verifies
osiris run examples/quantinuum/bitflip_qec.qasm \
--target H2-1 \
--shots 500 \
--budget-hqc 25 \
--approval-token "$OSIRIS_TIER3_TOKEN"osiris ledger verify| Tier | Targets | Approval Required | Disposition Label |
|---|---|---|---|
| Tier 1 (Free / Local) | Local Statevector, H2-1SC / H2-2SC / Helios-SC Syntax Checkers |
None | SIMULATED |
| Tier 2 (Emulation) | Local QCCD Trajectory Simulator, H2-1E / H2-2E / Helios-E |
Shot & HQC Budget Cap | SIMULATED |
| Tier 3 (Live QPU) | Quantinuum H2-1, H2-2, Helios (via Nexus), IBM Quantum |
Signed Approval Token + HQC Cap | HARDWARE_ATTESTED |
Strict Integrity Guarantee: Simulated, syntax-checker, and pre-flight dry-run executions never emit
hardware: trueorHARDWARE_ATTESTED.
osiris-cli/
├── osiris_cli/
│ ├── osiris_repl.py # Universal CLI & interactive console entrypoint
│ ├── quantinuum_cli.py # Subcommands: propose, verify, bench, grant-tier3, run, ledger
│ ├── quantinuum_gate.py # H2-1SC gatekeeper, Tier 3 signed tokens, SHA-256 Nexus ledger
│ ├── nexus_ledger.py # NexusDisposition hash-chain ledger & receipt uploader
│ ├── quantum_readiness.py # Coherence budget & Kraus noise-sensitivity readiness gate
│ ├── exec_kernel.py # Single governed execution kernel & exec-canon-1 hash chain
│ └── providers/
│ ├── quantinuum_nexus.py# Zero-dependency governed Quantinuum Nexus submission client
│ ├── tket_wrapper.py # Deterministic TKET / OpenQASM 2.0 QCCD compiler & lowerer
│ ├── quantinuum.py # Quantinuum H2 / Helios specs, HQC model, QCCD vs. heavy-hex router
│ └── local_qccd.py # Deterministic OpenQASM/Guppy parser & QCCD trajectory emulator
├── examples/
│ └── quantinuum/ # Runnable QEC & mid-circuit feedforward circuits ([[3,1,1]], [[4,2,2]], [[7,1,3]])
├── tests/ # Deterministic offline pytest suite (Python 3.9–3.12)
├── POLICY.md # Execution governance, Tier 1–3 controls & integrity policy
└── pyproject.toml
Configure governance limits and optional provider credentials via environment variables:
export QUANTINUUM_NEXUS_TOKEN="..." # Quantinuum Nexus API token (Tier 3 only)
export OSIRIS_MAX_SHOTS=10000 # Hard per-job shot ceiling
export OSIRIS_MAX_HQC=50 # Hard per-job HQC budget ceiling
export OSIRIS_TIER3_HMAC_SECRET="..." # Optional HMAC secret (defaults to local Ed25519 keypair)pytest -qAll tests execute deterministically offline with zero external network calls required.
OSIRIS Source-Available Dual License v1.0 — see LICENSE and CITATION.cff.