Skip to content

csnp/qbom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

QBOM

Invisible Provenance Capture for Quantum Computing Experiments

One import. Complete reproducibility. Zero code changes.

CI codecov License Python

Why QBOM โ€ข Quick Start โ€ข Features โ€ข Documentation โ€ข Contributing


The Quantum Reproducibility Crisis

Quantum computing experiments are notoriously difficult to reproduce. When a paper claims "We achieved 73% fidelity on Grover's algorithm", reviewers and researchers have no way to verify or reproduce the result because critical information is missing:

What's Reported What's Actually Needed
"Qiskit 1.0" Exact versions of qiskit, qiskit-aer, numpy, scipy...
"IBM Brisbane" Which of the 127 qubits? What were the error rates?
"4096 shots" What optimization level? What routing algorithm?

The challenge? You can't reproduce what you can't document.

QBOM solves this by automatically capturing complete experiment provenanceโ€”with zero code changes required.


Why QBOM

Capability QBOM Manual Logging Notebooks
Zero code changes Yes No No
Automatic capture Yes No No
Calibration data (T1, T2, error rates) Yes Rarely Rarely
Transpilation details Yes Often forgotten Often forgotten
Content verification (hashing) Yes No No
SBOM export (CycloneDX/SPDX) Yes No No
Reproducibility scoring Yes No No
Multi-framework support Yes Custom Custom

Quick Start

Installation

Requires Python 3.10+ (install Python)

Copy and paste this entire block:

git clone https://github.com/csnp/qramm-qbom.git
cd qramm-qbom
pip install -e ".[qiskit]"
qbom --version

Framework options:

pip install -e ".[qiskit]"      # Qiskit support
pip install -e ".[cirq]"        # Cirq support
pip install -e ".[pennylane]"   # PennyLane support
pip install -e ".[all]"         # All frameworks

Basic Usage

import qbom  # Add this single line - that's it!

# Your existing quantum code - unchanged
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

backend = AerSimulator()
job = backend.run(qc, shots=4096)
result = job.result()

# View what was captured
qbom.show()

Output:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ QBOM: qbom_c4b17b13 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Summary: 2 circuits | on aer_simulator | 4,096 shots                         โ”‚
โ”‚ Created: 2025-01-15 14:30:07 UTC                                             โ”‚
โ”‚                                                                              โ”‚
โ”‚ ENVIRONMENT                                                                  โ”‚
โ”‚   Python:  3.11.12                                                           โ”‚
โ”‚   qiskit: 2.2.3, qiskit-aer: 0.17.2, numpy: 1.26.4                          โ”‚
โ”‚                                                                              โ”‚
โ”‚ CIRCUIT                                                                      โ”‚
โ”‚   Name: bell_state | Qubits: 2 | Depth: 3 | Gates: 5                        โ”‚
โ”‚                                                                              โ”‚
โ”‚ HARDWARE                                                                     โ”‚
โ”‚   Backend: aer_simulator | Type: Simulator                                   โ”‚
โ”‚                                                                              โ”‚
โ”‚ EXECUTION                                                                    โ”‚
โ”‚   Shots: 4,096                                                               โ”‚
โ”‚                                                                              โ”‚
โ”‚ RESULTS                                                                      โ”‚
โ”‚   |11โŸฉ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  50.8%                                โ”‚
โ”‚   |00โŸฉ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  49.2%                                โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Try It Out

# Run the included example
python examples/basic_usage.py

# List captured traces
qbom list

# View a trace
qbom show <trace-id>

# Check reproducibility score
qbom score <trace-id>

Features

What QBOM Captures

Category What's Captured
Environment Python version, all package versions
Circuit Gates, depth, qubits, content hash
Transpilation Optimization level, qubit mapping, routing
Hardware Backend, calibration (T1, T2, error rates)
Execution Shots, job ID, timestamps
Results Counts, probabilities, result hash

Supported Frameworks

Framework Status
Qiskit Full support
Cirq Supported
PennyLane Supported
Braket Planned

Reproducibility Score

QBOM calculates a 0-100 score showing how reproducible your experiment is:

Score Meaning
90-100 Excellent - fully reproducible
70-89 Good - minor details missing
50-69 Fair - some info missing
25-49 Poor - major gaps
0-24 Critical - cannot reproduce
$ qbom score qbom_c4b17b13

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Reproducibility Score โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ 71/100 (Good)                                                                โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Component     โ”ƒ Score โ”ƒ Status โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Environment   โ”‚ 20/20 โ”‚ โ—      โ”‚
โ”‚ Circuit       โ”‚ 17/20 โ”‚ โ—      โ”‚
โ”‚ Transpilation โ”‚  7/15 โ”‚ โ—      โ”‚
โ”‚ Hardware      โ”‚  9/25 โ”‚ โ—      โ”‚
โ”‚ Execution     โ”‚ 10/10 โ”‚ โ—      โ”‚
โ”‚ Results       โ”‚  8/10 โ”‚ โ—      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Export Formats

qbom export <id> trace.json              # JSON (default)
qbom export <id> trace.cdx.json -f cyclonedx   # CycloneDX SBOM
qbom export <id> trace.spdx.json -f spdx       # SPDX SBOM
qbom export <id> trace.yaml -f yaml            # YAML

Documentation

Document Description
Installation Detailed installation guide
Usage Guide Complete usage examples
CLI Reference All commands and options
Python API Python API reference
Adapters Framework adapter details
Use Cases Real-world scenarios
Why QBOM? Background and motivation

CLI Reference

qbom list                     List recent traces
qbom show <id>                Display trace details
qbom score <id>               Calculate reproducibility score
qbom validate <id>            Check trace completeness
qbom diff <id1> <id2>         Compare two traces
qbom drift <id>               Analyze calibration drift
qbom export <id> <file>       Export to file
qbom paper <id>               Generate paper statement
qbom verify <file>            Verify trace integrity

qbom list - View Recent Traces

$ qbom list

                          Recent QBOM Traces
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ID            โ”‚ Created          โ”‚ Backend       โ”‚ Circuit โ”‚ Shots โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ qbom_c4b17b13 โ”‚ 2025-01-15 14:40 โ”‚ aer_simulator โ”‚ 2q, d=3 โ”‚ 4,096 โ”‚
โ”‚ qbom_bf522429 โ”‚ 2025-01-15 14:45 โ”‚ aer_simulator โ”‚ 2q, d=3 โ”‚ 1,024 โ”‚
โ”‚ qbom_b8678a13 โ”‚ 2025-01-15 14:46 โ”‚ aer_simulator โ”‚ 2q, d=3 โ”‚ 1,024 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

qbom validate - Check Trace Completeness

$ qbom validate qbom_c4b17b13

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Trace Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ PASS                                                                         โ”‚
โ”‚ Trace is valid with 1 suggestion(s)                                          โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ qbom_c4b17b13 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Circuit:
  โ„น No QASM or JSON representation stored
    Fix: Consider storing QASM for exact circuit reproduction.

0 errors | 0 warnings | 1 info

qbom paper - Generate Paper Statement

$ qbom paper qbom_c4b17b13

Reproducibility Statement

(For Methods section)

Experiments were performed using qiskit==2.2.3 on the aer_simulator simulator.
Circuits were transpiled with optimization level 2. Each experiment used 4,096
shots.

Complete QBOM trace: qbom_c4b17b13
Content hash: a9463e429a524897

Python API

import qbom

# View current trace
qbom.show()

# Get trace object
trace = qbom.current()
print(trace.environment.packages)
print(trace.hardware.backend_name)

# Export
qbom.export("experiment.json")

# Scoped experiments
with qbom.experiment(name="VQE optimization"):
    # quantum code here
    pass

How It Works

import qbom                    # 1. Import hook installed
from qiskit import ...         # 2. Qiskit adapter activates
transpile(circuit, backend)    # 3. Transpilation captured
job = backend.run(circuit)     # 4. Execution captured
result = job.result()          # 5. Results captured, trace saved

Traces are stored in ~/.qbom/traces/.


Architecture

qramm-qbom/
โ”œโ”€โ”€ src/qbom/
โ”‚   โ”œโ”€โ”€ core/           # Data models, trace builder, session
โ”‚   โ”œโ”€โ”€ adapters/       # Qiskit, Cirq, PennyLane hooks
โ”‚   โ”œโ”€โ”€ analysis/       # Scoring, drift, validation
โ”‚   โ”œโ”€โ”€ cli/            # Command-line interface
โ”‚   โ””โ”€โ”€ notebook/       # Jupyter integration
โ”œโ”€โ”€ docs/               # Documentation
โ”œโ”€โ”€ examples/           # Example scripts
โ””โ”€โ”€ tests/              # Test suite

Roadmap

v0.1 (Current)

  • Zero-code provenance capture
  • Qiskit, Cirq, PennyLane support
  • Reproducibility scoring
  • CycloneDX/SPDX export
  • CLI and Jupyter integration

v0.2 (Next)

  • AWS Braket adapter
  • Enhanced drift analysis
  • Remote trace storage

v1.0 (Future)

  • IonQ and Rigetti adapters
  • Web dashboard
  • Team collaboration

Contributing

See CONTRIBUTING.md for guidelines.

# Development setup
git clone https://github.com/csnp/qramm-qbom.git
cd qramm-qbom
pip install -e ".[dev,all]"

# Run tests
pytest

# Type check and lint
mypy src/qbom
ruff check src/qbom

About CSNP

QBOM is developed by the CyberSecurity NonProfit (CSNP), a 501(c)(3) organization dedicated to making cybersecurity knowledge accessible to everyone.

QRAMM Toolkit

QBOM is part of the QRAMM (Quantum Readiness Assurance Maturity Model) toolkit:

Tool Purpose
QBOM Quantum experiment reproducibility
CryptoScan Cryptographic vulnerability discovery
TLS Analyzer TLS/SSL configuration analysis

License

Apache License 2.0 โ€” see LICENSE for details.

Copyright 2025 CyberSecurity NonProfit (CSNP)


Citation

@software{qbom2025,
  title = {QBOM: Quantum Bill of Materials},
  author = {{CyberSecurity NonProfit (CSNP)}},
  year = {2025},
  url = {https://github.com/csnp/qramm-qbom}
}

Built with purpose by CSNP โ€” Advancing cybersecurity for everyone

QRAMM โ€ข CSNP โ€ข Issues

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages