Skip to content

bloqade.qasm2.rewrite.uop_to_parallel.GreedyMixin

← Module overview

classGreedyMixinsource

bloqade.qasm2.rewrite.uop_to_parallel.GreedyMixin

Bases: MergePolicyABC

Merge policy that greedily merges gates together.

class GreedyMixin

The merge_gates method will merge policy will try greedily merge gates together. This policy has a worst case complexity of O(n) where n is the number of gates in the input iterable.

methodmerge_gatessource

bloqade.qasm2.rewrite.uop_to_parallel.GreedyMixin.merge_gates

Signature
def merge_gates(gate_stmts: Iterable[ir.Statement]) -> List[List[ir.Statement]]

Parameters

NameTypeDescription
gate_stmtsIterable[ir.Statement]

Returns

List[List[ir.Statement]]

source