Skip to main content
b01t programs are hardware-agnostic until you compile them to a backend. The Qiskit backend takes a b01t IRProgram and produces a Qiskit QuantumCircuit that you can simulate locally, transpile, or submit to real quantum hardware. For programs built with @coherent, there is a two-step path: first lower the ExactProgram to IRProgram, then emit to QuantumCircuit. For @parametric and @adaptive programs, skip the first step — they already produce IRProgram directly from .build().

Prerequisites

Install Qiskit before using the backend:
If Qiskit is not installed, calling QiskitBackend().emit() raises:

Compiling a @coherent program

@coherent programs produce an ExactProgram. Before passing to the Qiskit backend, lower it to IRProgram with lower_exact_program():
lower_exact_program() handles ancilla coalescing — sequential ancilla registers share physical qubits to minimize qubit count. The returned IRProgram carries is_safe=True from the original certification.
Do not run is_safe_program() on an IR produced by lower_exact_program(). The broad-path safety checker does not understand the APPLY-pattern ancilla blocks that lowering may produce, and will give a false negative. Safety was already proven by the exact path.

Compiling @parametric and @adaptive programs

@parametric and @adaptive programs produce IRProgram directly from .build(), so you can pass them straight to the backend:

Complete example

Here is a full walkthrough from definition to printed circuit, using the Bernstein-Vazirani oracle as an example:

Supported gates

The Qiskit backend maps b01t gate names to Qiskit circuit methods as follows: Measurement operations (measure, measure_all) add classical registers automatically. Classical if_then is not supported in the current backend — attempting to emit an IfOp raises DSLValidationError.

Running the circuit

Once you have a QuantumCircuit, use any Qiskit-compatible runner:
Or submit to IBM Quantum hardware using qiskit-ibm-runtime. The QuantumCircuit produced by b01t is a standard Qiskit circuit — any Qiskit tutorial or documentation applies directly.
Use circuit.draw("mpl") to render a matplotlib diagram of your circuit, or circuit.draw("text") for a terminal-friendly ASCII diagram.