Skip to content

bloqade.qasm2.rewrite.uop_to_parallel.OptimalMixIn

← Module overview

classOptimalMixInsource

bloqade.qasm2.rewrite.uop_to_parallel.OptimalMixIn

Bases: MergePolicyABC

Merge policy that merges gates together optimally.

class OptimalMixIn

The merge_gates method will merge policy will try to merge every gate into every group of gates, terminating when it finds a group that can be merged with the current gate. This policy has a worst case complexity of O(n^2) where n is the number of gates in the input iterable.

methodmerge_gatessource

bloqade.qasm2.rewrite.uop_to_parallel.OptimalMixIn.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