Skip to main content

Module compiler

Module compiler 

Source
Expand description

Public compiler entry point.

The compiler entry point runs the configured CompilerWorkflow and returns the optimized circuit plus step-level diagnostics. The workflow starts from a logical circuit, applies canonicalization, definition expansion, knowledge-based rewrite, unitary and multi-controlled-gate decomposition, optional device layout/routing, and target lowering.

CompileTarget makes the target contract explicit: compilation is either logical, lowered to a requested basis, or routed and legalized for one concrete device. Device compilation uses the device topology for capacity checks and SABRE routing, then checks every emitted standard operation against the device’s ordered native capabilities before final validation.

CompileMode::Normal selects conservative production defaults. CompileMode::Enhanced keeps the same semantic contract but spends more rewrite, resynthesis, native-optimization, and routing effort, runs additional cleanup around routing and target lowering, and, for a strict device target, selects among fully lowered and validated routes with a bounded SABRE Pareto beam.

Structs§

CompileConfig
User-facing configuration for compile.
CompileResult
Result returned by compile.
DeviceCompilationMetadata
Physical-layout information produced by device compilation.
DeviceCompileTarget
Device-specific compilation inputs.

Enums§

CompileMode
Optimization effort selected for the compiler workflow.
CompileTarget
Target contract selected for a compilation run.

Functions§

compile
Runs the configured compiler workflow over circuit.
compile_owned
Runs the configured compiler workflow by consuming circuit.