Split static placement
SplitStaticPlacement
dataclass
SplitStaticPlacement(
split_policy: Callable[[Block], list[Block]],
)
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.split_static_placement.SplitStaticPlacement[SplitStaticPlacement]
click bloqade.lanes.rewrite.split_static_placement.SplitStaticPlacement href "" "bloqade.lanes.rewrite.split_static_placement.SplitStaticPlacement"
Split a StaticPlacement body into multiple StaticPlacement statements.
The policy receives the body block (with its fully-threaded state chain) and returns a list of new blocks. Each block becomes one StaticPlacement. If the policy returns ≤1 block the rewriter is a no-op.
The policy is responsible for state threading: each output block must start with a block argument of StateType and end with place.Yield. The last block must carry the classical results from the original Yield.
cz_layer_split_policy
cz_layer_split_policy(body_block: Block) -> list[ir.Block]
Split a StaticPlacement body into CZ-anchored groups (policy A).
Accumulates SQ gates (R, Rz, StarRz); when a CZ is encountered, flushes [accumulated SQ + CZ] as one group. Remaining SQ after the last CZ forms the final group. Returns the original block unchanged if there is at most one CZ (no split needed).
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/rewrite/split_static_placement.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |