Skip to content

Commit

Permalink
Remove argument decomposer from constructor of ConsolidateBlocks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlapeyre committed Jul 11, 2023
1 parent 7a34941 commit 3da4990
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions qiskit/transpiler/passes/optimization/consolidate_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 3da4990

Please sign in to comment.