From 3da49906528a08a0bdf380e2b82e409af7fc32bc Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Tue, 11 Jul 2023 00:54:53 -0400 Subject: [PATCH] Remove argument `decomposer` from constructor of ConsolidateBlocks This was added in a previous commit in the series of commits for this PR. The code has been redesigned so that this argument is no longer necessary. --- .../transpiler/passes/optimization/consolidate_blocks.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qiskit/transpiler/passes/optimization/consolidate_blocks.py b/qiskit/transpiler/passes/optimization/consolidate_blocks.py index eecddc613788..19114e037bd7 100644 --- a/qiskit/transpiler/passes/optimization/consolidate_blocks.py +++ b/qiskit/transpiler/passes/optimization/consolidate_blocks.py @@ -49,20 +49,19 @@ def __init__( basis_gates=None, approximation_degree=1.0, target=None, - decomposer=None, ): """ConsolidateBlocks initializer. - The decomposer used is determined by the first of the following arguments - with a non-None value: decomposer, kak_basis_gate, basis_gates. If all are None, + The decomposer used is kak_basis_gate if it has non-None value. Otherwise + the decomposer is basis_gates if it has non-None value. If both are None, then a default decomposer is used. + Args: kak_basis_gate (Gate): Basis gate for KAK decomposition. force_consolidate (bool): Force block consolidation. basis_gates (List(str)): Basis gates from which to choose a KAK gate. approximation_degree (float): a float between [0.0, 1.0]. Lower approximates more. target (Target): The target object for the compilation target backend. - decomposer: A 2q gate decomposer. """ super().__init__() self.basis_gates = None @@ -71,8 +70,6 @@ def __init__( self.basis_gates = set(basis_gates) self.force_consolidate = force_consolidate - if decomposer is not None: - self.decomposer = decomposer if kak_basis_gate is not None: self.decomposer = TwoQubitBasisDecomposer(kak_basis_gate) elif basis_gates is not None: