Skip to content

bloqade.lanes.rewrite.circuit2place.MergeStaticPlacement

← Module overview

classMergeStaticPlacementsource

bloqade.lanes.rewrite.circuit2place.MergeStaticPlacement

Bases: abc.RewriteRule

Merge adjacent StaticPlacement statements using a caller-supplied policy.

Signature
class MergeStaticPlacement(merge_policy: Callable[[place.StaticPlacement, place.StaticPlacement], bool] = always_merge)

Replaces MergePlacementRegions. Policy receives full StaticPlacement statements (not just body regions) so CZ qubit indices can be resolved.

Parameters

NameTypeDefaultDescription
merge_policyCallable[[place.StaticPlacement, place.StaticPlacement], bool]always_merge

Attributes

NameTypeDefaultDescription
merge_policyCallable[[place.StaticPlacement, place.StaticPlacement], bool]always_merge

methodrewrite_Statementsource

bloqade.lanes.rewrite.circuit2place.MergeStaticPlacement.rewrite_Statement

def rewrite_Statement(node: ir.Statement) -> abc.RewriteResult

Parameters

NameTypeDescription
nodeir.Statement

Returns

abc.RewriteResult

source