Install
$ pip install limbo-quantum
Cloud quantum vendor SDKs are optional. Install only the ones you need:
$ pip install qiskit-ibm-runtime # IBM Quantum $ pip install amazon-braket-sdk # AWS Braket $ pip install azure-quantum # Azure Quantum
Quickstart
The DistributedCompilerSDK class is the single entry point. Construct it once with a provider, then call .compile() for every circuit.
from qiskit import QuantumCircuit
from limbo import (
DistributedCompilerSDK,
LocalSimulationProvider,
TelemetryLogger,
)
# Local simulator. Zero credentials, free debugging cycles.
sdk = DistributedCompilerSDK(
provider=LocalSimulationProvider(),
num_qpus=4,
max_capacity_per_qpu=20,
telemetry=TelemetryLogger(),
)
qc = QuantumCircuit(4)
qc.h(0)
for i in range(3):
qc.cx(0, i + 1)
result = sdk.compile(qc, shots=1024)
print(result.counts)
print(result.compiled_qasm[0])
Authentication
Cloud submissions require an API key. Generate one from your dashboard and pass it to CloudProductionProvider:
from limbo import DistributedCompilerSDK, CloudProductionProvider
sdk = DistributedCompilerSDK(
provider=CloudProductionProvider(
api_key="qra_live_YOUR_KEY_HERE",
server_url="https://api.limbosys.dev",
timeout_seconds=60.0,
max_retries=3,
),
num_qpus=4,
max_capacity_per_qpu=20,
)
The key is sent as X-API-Key on every request. It's never persisted in your Python process beyond the constructor call. For multi-environment workflows, the auto_provider() helper reads QRA_API_KEY and QRA_SERVER_URL from the environment and falls back to the local simulator when neither is set:
from limbo import auto_provider, DistributedCompilerSDK
# Reads QRA_API_KEY / QRA_SERVER_URL from env; falls back to local sim.
sdk = DistributedCompilerSDK(provider=auto_provider())
Multi-framework ingestion
The same .compile() call accepts Qiskit circuits, Cirq circuits, or raw OpenQASM-3 source strings. Auto-dispatched by input type:
# Qiskit from qiskit import QuantumCircuit qc = QuantumCircuit(3); qc.h(0); qc.cx(0, 1); qc.cx(0, 2) sdk.compile(qc) # Cirq import cirq q0, q1, q2 = cirq.LineQubit.range(3) cq = cirq.Circuit(cirq.H(q0), cirq.CNOT(q0, q1), cirq.CNOT(q0, q2)) sdk.compile(cq) # OpenQASM 3 source string qasm = """ OPENQASM 3.0; include "stdgates.inc"; qubit[3] q; h q[0]; cx q[0], q[1]; cx q[0], q[2]; """ sdk.compile(qasm)
Local linting
The SDK linter runs before any network call. Capacity violations and interaction-graph hotspots are surfaced on your laptop:
from limbo import CircuitParser, LocalStaticLinter, TopologyCapacityError
ir = CircuitParser.from_qiskit(qc)
linter = LocalStaticLinter(ir, num_qpus=2, max_capacity_per_qpu=4)
try:
linter.capacity_audit()
except TopologyCapacityError as exc:
# Caught locally. No paid API call burned.
print(f"needed {exc.num_qubits} qubits, layout had {exc.target_capacity}")
linter.hotspot_detection(threshold_ratio=0.30) # prints dashboard
Variational runtime (VQE / QAOA)
For parametric circuits, the SDK caches the structural compile after the first iteration. Subsequent calls bind parameters locally and stream only the bound numeric circuit, with no re-partitioning, no re-uploading of the parametric circuit.
from qiskit.circuit import Parameter, QuantumCircuit
from limbo import DistributedCompilerSDK, auto_provider
import scipy.optimize, numpy as np
theta = [Parameter(f"theta_{i}") for i in range(8)]
ansatz = QuantumCircuit(8)
for i, t in enumerate(theta): ansatz.ry(t, i)
for i in range(7): ansatz.cx(i, i+1)
sdk = DistributedCompilerSDK(provider=auto_provider(),
num_qpus=2, max_capacity_per_qpu=6)
def cost(params):
out = sdk.compile(ansatz, parameter_values=params, shots=1024)
# out.template_hit is True from iteration 2 onward
return compute_energy(out.counts)
scipy.optimize.minimize(cost, x0=np.zeros(8), method="COBYLA")
Providers
Three drivers ship in the box:
| Driver | What it talks to | Credentials |
|---|---|---|
| LocalSimulationProvider | qiskit-aer (state-vector or tensor-network) | None |
| CloudProductionProvider | Limbo cloud API → IBM / AWS / Azure | X-API-Key from your dashboard |
| auto_provider() | Picks between the above based on env vars | Reads QRA_API_KEY / QRA_SERVER_URL |
To target a specific cloud quantum vendor, pass device= and credentials= through .compile():
result = sdk.compile(
qc,
shots=1024,
provider="ibm",
device="ibm_brisbane",
credentials={"token": "your_ibm_quantum_token"},
)
API reference
Top-level exports from limbo:
| Symbol | Purpose |
|---|---|
| DistributedCompilerSDK | Master client; one .compile() call drives the whole pipeline. |
| CompileResult | Dataclass returned by .compile() with counts, QASM, metrics, and telemetry. |
| quickstart() | One-liner for laptop dev (LocalSimulationProvider). |
| QuantumProvider | Abstract base for custom execution drivers. |
| LocalSimulationProvider | In-process qiskit-aer driver. |
| CloudProductionProvider | Authenticated HTTP driver against the cloud API. |
| CircuitParser | Multi-framework parser → standardized IR. |
| LocalStaticLinter | Capacity audit + hotspot detection. |
| TopologyCapacityError | Raised when the target layout can't host the circuit. |
| ParametricRuntime | Lower-level variational runtime (used internally by the SDK). |
| TopologicalTemplate | Cached structural compile for parametric circuits. |
| TelemetryLogger | Jupyter / terminal status display. |