Place2move
InsertFill
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.place2move.InsertFill[InsertFill]
click bloqade.lanes.rewrite.place2move.InsertFill href "" "bloqade.lanes.rewrite.place2move.InsertFill"
Emit move.Fill at function entry, with location_addresses collected from place.NewLogicalQubit.location_address in allocation order.
Pre-condition: every NewLogicalQubit has a non-None location_address (established by ResolvePinnedAddresses).
InsertInitialize
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.place2move.InsertInitialize[InsertInitialize]
click bloqade.lanes.rewrite.place2move.InsertInitialize href "" "bloqade.lanes.rewrite.place2move.InsertInitialize"
Emit move.LogicalInitialize for all NewLogicalQubits in a block, with location_addresses, thetas, phis, lams collected directly from each statement. Non-NewLogicalQubit statements (e.g. angle constants) are skipped. The Load/LogicalInitialize/Store triple is inserted before the statement that immediately follows the last NewLogicalQubit.
Pre-condition: every NewLogicalQubit has a non-None location_address (established by ResolvePinnedAddresses).
InsertMoves
dataclass
InsertMoves(placement_analysis: dict[SSAValue, AtomState])
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.place2move.InsertMoves[InsertMoves]
click bloqade.lanes.rewrite.place2move.InsertMoves href "" "bloqade.lanes.rewrite.place2move.InsertMoves"
Insert move layers around each quantum statement.
For plain ExecuteCZ (and other AtomState subtypes): inserts
Load / Move... / Store immediately before the gate.
For ExecuteCZReturn: additionally inserts the palindrome return moves
(return_move_layers) immediately after the gate, so atoms return to
their pre-CZ home layout without a separate pass.
RewriteGates
dataclass
RewriteGates(placement_analysis: dict[SSAValue, AtomState])
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.place2move.RewriteGates[RewriteGates]
click bloqade.lanes.rewrite.place2move.RewriteGates href "" "bloqade.lanes.rewrite.place2move.RewriteGates"
Rewrite R circuit statements to move R statements.