Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Lishman <[email protected]>
  • Loading branch information
mtreinish and jakelishman authored Mar 30, 2022
1 parent 30426f5 commit 5eadae4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions qiskit/transpiler/passes/synthesis/unitary_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def run(self, unitary, **options):
decomposer1q = None

preferred_direction = None
if target:
if target is not None:
decomposer2q, preferred_direction = self._find_decomposer_2q_from_target(
target, qubits, pulse_optimize
)
Expand Down Expand Up @@ -558,7 +558,7 @@ def _synth_natural_direction(
physical_gate_fidelity = None
wires = None
if natural_direction in {None, True} and (
coupling_map or (target and decomposer2q and not preferred_direction)
coupling_map or (target is not None and decomposer2q and not preferred_direction)
):
cmap = coupling_map
neighbors0 = cmap.neighbors(qubits[0])
Expand Down
6 changes: 3 additions & 3 deletions test/python/transpiler/test_unitary_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def test_coupling_map_transpile(self, opt):
bidirectional=[True, False],
dsc=(
"test natural_direction works with transpile using opt_level {opt_level} on"
"target with multiple 2q gates with bidirectional={bidirectional}"
" target with multiple 2q gates with bidirectional={bidirectional}"
),
name="opt_level_{opt_level}_bidirectional_{bidirectional}",
)
Expand Down Expand Up @@ -627,7 +627,7 @@ def test_coupling_map_unequal_durations(self, opt):
bidirectional=[True, False],
dsc=(
"Test direction with transpile using opt_level {opt_level} on"
"target with multiple 2q gates with bidirectional={bidirectional}"
" target with multiple 2q gates with bidirectional={bidirectional}"
),
name="opt_level_{opt_level}_bidirectional_{bidirectional}",
)
Expand Down Expand Up @@ -657,7 +657,7 @@ def test_coupling_unequal_duration_with_backendv2(self, opt_level, bidirectional
opt_level=[0, 1, 2, 3],
dsc=(
"Test direction with transpile using opt_level {opt_level} on"
"target with multiple 2q gates"
" target with multiple 2q gates"
),
name="opt_level_{opt_level}",
)
Expand Down

0 comments on commit 5eadae4

Please sign in to comment.