Skip to content

Commit

Permalink
Move _basis_gates set creation to __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Aug 28, 2024
1 parent 9828e37 commit 21ccc8f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def __init__(self, basis=None, target=None):
"""
super().__init__()

self._basis_gates = basis
if basis:
self._basis_gates = set(basis)
else:
self._basis_gates = None
self._target = target
self._global_decomposers = None
self._local_decomposers_cache = {}
Expand Down Expand Up @@ -208,15 +211,11 @@ def run(self, dag):
Returns:
DAGCircuit: the optimized DAG.
"""
if self._basis_gates is None:
basis_gates = None
else:
basis_gates = set(self._basis_gates)
euler_one_qubit_decomposer.optimize_1q_gates_decomposition(
dag,
target=self._target,
global_decomposers=self._global_decomposers,
basis_gates=basis_gates,
basis_gates=self._basis_gates,
)
return dag

Expand Down

0 comments on commit 21ccc8f

Please sign in to comment.