Skip to content

Commit

Permalink
Skip level 3 in tests
Browse files Browse the repository at this point in the history
The level 3 preset passmanager by default runs 2q block collection which
is then synthesized into a unitary. As long as we're running that in the
pass manager it's not really possible right now to preserve input
unitaries through the transpilation. A potential follow on PR could
potential skip the synthesis pass if 'unitary' is in the basis so the
optimization pass would just collect 2q blocks into a unitary and pass
that to the backend directly. However, that's not in scope for this PR
(and it's not clear if we want that or not).
  • Loading branch information
mtreinish committed Oct 5, 2021
1 parent 49fcc41 commit 99a52af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/python/transpiler/test_preset_passmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def test_level0_keeps_reset(self):
result = transpile(circuit, basis_gates=None, optimization_level=0)
self.assertEqual(result, circuit)

@combine(level=[0, 1, 2, 3], name="level{level}")
# Level 3 is skipped because the 2q synthesis optimization pass decomposes
# the unitary
@combine(level=[0, 1, 2], name="level{level}")
def test_unitary_is_preserved_if_in_basis(self, level):
"""Test that a unitary is not synthesized if in the basis."""
qc = QuantumCircuit(2)
Expand Down

0 comments on commit 99a52af

Please sign in to comment.