Skip to content

bloqade.lanes.rewrite.place2move.InsertMoves

← Module overview

classInsertMovessource

bloqade.lanes.rewrite.place2move.InsertMoves

Bases: RewriteRule

Insert move layers around each quantum statement.

Signature
class InsertMoves(placement_analysis: dict[ir.SSAValue, placement.AtomState])

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.

Parameters

NameTypeDescription
placement_analysisdict[ir.SSAValue, placement.AtomState]

Attributes

NameTypeDescription
placement_analysisdict[ir.SSAValue, placement.AtomState]

methodrewrite_Statementsource

bloqade.lanes.rewrite.place2move.InsertMoves.rewrite_Statement

def rewrite_Statement(node: ir.Statement)

Parameters

NameTypeDescription
nodeir.Statement
source