Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify UnitarySynthesis pass test test_qv_natural #9359

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions test/python/transpiler/test_unitary_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
ConsolidateBlocks,
Optimize1qGates,
SabreLayout,
Depth,
FixedPoint,
Unroll3qOrMore,
CheckMap,
BarrierBeforeFinalMeasurements,
Expand Down Expand Up @@ -478,9 +476,6 @@ def test_qv_natural(self):
qv64 = QuantumVolume(5, seed=15)

def construct_passmanager(basis_gates, coupling_map, synthesis_fidelity, pulse_optimize):
def _repeat_condition(property_set):
return not property_set["depth_fixed_point"]

seed = 2
_map = [SabreLayout(coupling_map, max_iterations=2, seed=seed)]
_unroll3q = Unroll3qOrMore()
Expand All @@ -489,7 +484,6 @@ def _repeat_condition(property_set):
BarrierBeforeFinalMeasurements(),
SabreSwap(coupling_map, heuristic="lookahead", seed=seed),
]
_check_depth = [Depth(), FixedPoint("depth")]
_optimize = [
Collect2qBlocks(),
ConsolidateBlocks(basis_gates=basis_gates),
Expand All @@ -508,9 +502,7 @@ def _repeat_condition(property_set):
pm.append(_unroll3q)
pm.append(_swap_check)
pm.append(_swap)
pm.append(
_check_depth + _optimize, do_while=_repeat_condition
) # translate to & optimize over hardware native gates
pm.append(_optimize)
return pm

coupling_map = CouplingMap([[0, 1], [1, 2], [3, 2], [3, 4], [5, 4]])
Expand Down