Skip to content

Rule

ReorderStaticPlacement rewrite rule.

ReorderStaticPlacement dataclass

ReorderStaticPlacement(
    reorder_policy: Callable[
        [list[_SchedulableStmt]], list[_SchedulableStmt]
    ],
)

Bases: RewriteRule


              flowchart TD
              bloqade.lanes.rewrite.reorder_static_placement.rule.ReorderStaticPlacement[ReorderStaticPlacement]

              

              click bloqade.lanes.rewrite.reorder_static_placement.rule.ReorderStaticPlacement href "" "bloqade.lanes.rewrite.reorder_static_placement.rule.ReorderStaticPlacement"
            

Reorder quantum statements within a StaticPlacement using a pluggable policy.

The policy receives all schedulable statements from the body (R, Rz, StarRz, CZ, Initialize, EndMeasure — everything except the trailing Yield) and returns them in the desired order. Barrier handling (Initialize, EndMeasure) is the policy's responsibility; asap_reorder_policy segments on barriers and schedules each segment independently.

If the body contains any statement type outside that supported set the rewriter skips the node rather than silently dropping unknown statements.