FlagQuantum compiler and IR implementation map

September 11, 2026 · View on GitHub

Verified against the publication checkout on 2026-09-11.

The current compiler operates on Core-owned CircuitIR. The old private flagquantum._compiler package and its phase-based implementation inventory are not the current source layout. Historical multi-level IR designs remain useful rationale, but their phase completion labels do not describe this tree.

Circuit compilation and execution

ResponsibilityCurrent implementation
Public circuit interchangeflagquantum/core/ir.py
Root compile dispatchflagquantum/_api.py
Optimization and circuit compilationflagquantum/compiler/pipeline.py
Native-gate and topology legalizationcompiler/native_gate_legalization.py, compiler/topology_legalization.py
Target requirements and schedulingcompiler/target_legalization.py, compiler/schedule_legalization.py
Target emission and independent conformancecompiler/target_emission.py, compiler/target_conformance.py
Plan construction and executionruntime/planner/, runtime/execution.py, runtime/plan_execution.py

Paths without the package prefix are relative to flagquantum/. fq.compile exists and dispatches to the native circuit compiler or a requested compiler extension. Native target emission produces audited text; it does not imply a new public executable-artifact API or hardware certification. fq.run(program) composes planning and execution. fq.run(plan) executes the accepted plan without compiling or planning it again.

Private structured programs

flagquantum/compiler/_hybrid/ implements capture, typed SSA values, verification, normalization, specialization, and static/dynamic lowering for bounded quantum-classical profiles. It is absent from the root public exports and does not replace public CircuitIR. Read its implementation details for supported constructs, parameter flow, and lowering restrictions.

The existence of this private path must not be summarized as either “ProgramIR not started” or completion of every proposed multi-level IR phase. Timing, advanced lowering, and provider behavior require their own implementation and evidence; a design document alone establishes none of them.

Verification and further reading

Update this map when implementation ownership or execution paths change. Keep historical approvals in their original context rather than treating them as current code contracts.