Skip to main content

Python modules for QubitOS quantum control kernel

Project description

QubitOS Core

CI License Python Version Tests Coverage

Open-source quantum control system: pulse optimization, multi-qubit scheduling, calibration management, and hardware abstraction.

Why This Exists

Quantum processors drift. Gate fidelities measured during Tuesday's calibration are wrong by Thursday. Coherence times shift with temperature, TLS defects come and go, and crosstalk changes as you bring neighboring qubits online. Most quantum software treats this as somebody else's problem — Qiskit and Cirq give you circuit-level abstractions and assume calibration data is accurate and static.

QubitOS sits between your compiler output and the hardware. It takes circuit-level instructions, optimizes pulses against current calibration data, schedules them with constraint-aware parallelism, and executes them through a hardware abstraction layer that talks to real backends. The control loop is designed to be fast enough for feedback-based protocols where you need microsecond-scale decisions.

Features

Pulse Optimization (GRAPE)

Multi-qubit gradient ascent pulse engineering with per-qubit envelopes, dimension-scaled learning rates, and ZZ coupling drift Hamiltonians. Single-qubit gates at 99.9%+ fidelity, two-qubit gates at 95%+.

Pulse Scheduling

ASAP scheduling via topological sort with a constraint system (sequential, simultaneous, aligned, max-delay). Automatic qubit-conflict avoidance, crosstalk-aware serialization, and AWG clock grid alignment.

Parametric Gates

Google fSim(θ,φ) family (iSWAP, CZ, Sycamore) and IBM cross-resonance gates with full parameterization for hardware-native gate sets.

Error Budgets

Cumulative error tracking across sequences — gate infidelity, T1/T2 decoherence, leakage, crosstalk, readout errors. Fidelity prediction before execution with coherent noise correction (Wallman & Emerson 2016).

Benchmarking

Single and multi-qubit randomized benchmarking. Symplectic Clifford tableaux (Aaronson-Gottesman) for efficient n-qubit Clifford sampling, RB decay fitting, error-per-Clifford extraction.

Experiment Provenance

Merkle tree tracking with content-addressed storage, automatic diffing between optimization runs, and reproducibility verification.

Quick Start

pip install -e ".[dev]"

Generate a pulse

from qubitos.pulsegen import generate_pulse

# Single-qubit X gate
result = generate_pulse(gate="X", duration_ns=20, target_fidelity=0.999)
print(f"Fidelity: {result.fidelity:.4f}")

# Two-qubit CZ gate
result = generate_pulse(gate="CZ", num_qubits=2, duration_ns=80)
print(f"CZ fidelity: {result.fidelity:.4f}")

Schedule pulses

from qubitos.temporal import PulseScheduler, PulseOp, TemporalConstraint, ConstraintKind

scheduler = PulseScheduler()
ops = [
    PulseOp(pulse_id="h0", qubit_indices=(0,), duration_ns=20),
    PulseOp(pulse_id="h1", qubit_indices=(1,), duration_ns=20),
    PulseOp(pulse_id="cnot01", qubit_indices=(0, 1), duration_ns=40),
]
constraints = [
    TemporalConstraint(kind=ConstraintKind.SEQUENTIAL, pulse_a_id="h0", pulse_b_id="cnot01"),
]
result = scheduler.schedule_asap(ops, constraints=constraints)
print(result.ascii_timeline())

CLI

# Generate a pulse
qubit-os pulse generate --gate X --duration 20 --output x_gate.json

# Check backend health
qubit-os hal health

# Show calibration
qubit-os calibration show

Architecture

qubit-os-core/src/qubitos/
├── pulsegen/       # GRAPE optimizer, Hamiltonians, pulse shapes
├── temporal/       # Time model, pulse scheduling, decoherence budgets
├── calibrator/     # Calibration management, benchmarking, Cliffords
├── error_budget/   # Cumulative error tracking
├── provenance/     # Merkle tree experiment tracking
├── client/         # HAL gRPC client
├── validation/     # AgentBible integration
├── target_unitary.py  # Gate enum (X, Y, Z, H, CZ, CNOT, Toffoli, ...)
└── cli/            # Command-line interface

QubitOS is a three-repo system:

Repository Purpose Language
qubit-os-core Python modules and CLI (this repo) Python
qubit-os-hardware HAL server (Rust + PyO3 + gRPC) Rust
qubit-os-proto Protocol Buffer definitions Protobuf

Development

git clone https://github.com/qubit-os/qubit-os-core.git
cd qubit-os-core
pip install -e ".[dev]"

# Run tests (947 passing)
pytest tests/

# Type checking
mypy src/qubitos/ --ignore-missing-imports --exclude proto_convert

# Lint & format
ruff check src/ tests/
ruff format src/ tests/

Documentation

📖 Full Documentation — guides, tutorials, API reference, Jupyter notebooks.

License

Apache 2.0 — See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qubitos-0.4.0.tar.gz (477.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qubitos-0.4.0-py3-none-any.whl (159.7 kB view details)

Uploaded Python 3

File details

Details for the file qubitos-0.4.0.tar.gz.

File metadata

  • Download URL: qubitos-0.4.0.tar.gz
  • Upload date:
  • Size: 477.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qubitos-0.4.0.tar.gz
Algorithm Hash digest
SHA256 68d4ce0ca8cc0328a9e19a4c1d6527ee5958012f8bae981888dd54ced0b66cbb
MD5 516f19b51655bfcff01a4b2d69754421
BLAKE2b-256 6c40bd11b455f08cb5937f5b8fcc3088d1f18f1607bd3cd352e4e264e240a1e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for qubitos-0.4.0.tar.gz:

Publisher: release.yaml on qubit-os/qubit-os-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qubitos-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: qubitos-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 159.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qubitos-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4618f772f24d3edd533df9bc98d2411de0b5b7404126567fd6565df2c90776e
MD5 02eb56a9dd48a465a16fd111cac5e9d8
BLAKE2b-256 92ccada455a7cd40a99d2245f1c0a11add204733d1b28c252553467d2042ea67

See more details on using hashes here.

Provenance

The following attestation bundles were made for qubitos-0.4.0-py3-none-any.whl:

Publisher: release.yaml on qubit-os/qubit-os-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page