Skip to main content

Module native_optimization

Module native_optimization 

Source
Expand description

Exact physical optimization after device instruction lowering.

NativeOptimizer closes a bounded loop over independent stage branches. Every round evaluates baseline -> A, baseline -> B -> C, and A -> B -> C, where A/C are local one-qubit optimization and B is exact-physical two-qubit resynthesis. Each legalized stage is a returnable quality checkpoint. A non-improving intermediate may feed its dependent stage inside one branch, but it cannot replace the round cursor or suppress a sibling branch. Every transform recursively visits structured control-flow bodies.

Candidate circuits are accepted under a Native-only quality policy. The balanced policy first protects the immutable entry circuit’s entangler count/depth, total depth, calibrated error, and makespan in every control-flow scope; candidates inside that envelope are then ranked against the best returnable circuit. This avoids assigning arbitrary execution counts to conditional or loop bodies. The optimizer restores the best whole circuit seen; independently optimal control-flow bodies are never spliced together.

One immutable exact-physical synthesis context is shared by resynthesis, local optimization, and scope costing for the lifetime of a single run. The catalog is rebuilt transactionally only when scope costing finds an unprepared root; a prepared-but-unsupported root remains a real failure.

Structs§

NativeOptimizationResult
Result of one bounded exact-physical native optimization run.
NativeOptimizationSummary
NativeOptimizer
Bounded native optimization loop with minimum-point restoration.