Skip to content

Multi-framework ingestion

The same .compile() call accepts Qiskit circuits, Cirq circuits or raw OpenQASM 3 source, dispatched automatically by input type.

from qiskit import QuantumCircuit
qc = QuantumCircuit(3); qc.h(0); qc.cx(0, 1); qc.cx(0, 2)
sdk.compile(qc)
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)
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)

To work with the intermediate representation directly, use CircuitParser. All three front ends produce the same IR shape:

from limbo_quantum import CircuitParser

ir = CircuitParser.from_qiskit(qc)
ir = CircuitParser.from_cirq(cq)
ir = CircuitParser.from_openqasm3(qasm)

The IR is plain JSON with no Python-specific types, so it round-trips cleanly through caches, queues and HTTP. Its schema is exported as limbo_quantum.IRSchema.