Skip to content

bloqade.lanes.rewrite.fuse_gates.GateGroup

← Module overview

classGateGroupsource

bloqade.lanes.rewrite.fuse_gates.GateGroup

Bases: ABC, Generic[T]

A run of textually-adjacent fusable statements of one opcode.

class GateGroup

Maintains all_qubits incrementally so disjointness checks are O(1) per statement. Subclasses implement opcode-specific predicate bits (non-qubit SSA arg comparison) and the merged-statement construction.

Attributes

NameTypeDefaultDescription
statementslist[T][]
all_qubitsset[int]set()

methodappendsource

bloqade.lanes.rewrite.fuse_gates.GateGroup.append

def append(stmt: T) -> None

Parameters

NameTypeDescription
stmtT
source

methodmerge_in_placesource

bloqade.lanes.rewrite.fuse_gates.GateGroup.merge_in_place

def merge_in_place() -> bool

If the group has ≥2 stmts, replace the tail with one merged op covering all qubits and delete the earlier statements. Returns True iff a merge was performed.

Returns

bool

source

methodcan_extendsource

bloqade.lanes.rewrite.fuse_gates.GateGroup.can_extend

def can_extend(stmt: T) -> bool

Parameters

NameTypeDescription
stmtT

Returns

bool

source