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

Remove qiskit-toqm tests and requirements-dev.txt entry #9057

Merged
merged 4 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ seaborn>=0.9.0
reno>=3.4.0
Sphinx>=3.0.0
qiskit-sphinx-theme>=1.6
qiskit-toqm>=0.1.0;platform_machine != 'aarch64' or platform_system != 'Linux'
sphinx-autodoc-typehints~=1.18,!=1.19.3
jupyter-sphinx
sphinx-design>=0.2.0
Expand Down
48 changes: 0 additions & 48 deletions test/python/transpiler/test_preset_passmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@
FakeTokyo,
FakePoughkeepsie,
FakeLagosV2,
FakeLima,
FakeWashington,
)
from qiskit.converters import circuit_to_dag
from qiskit.circuit.library import GraphState
from qiskit.quantum_info import random_unitary
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit.transpiler.preset_passmanagers import level0, level1, level2, level3
from qiskit.utils.optionals import HAS_TOQM
from qiskit.transpiler.passes import Collect2qBlocks, GatesInBasis


Expand Down Expand Up @@ -267,51 +264,6 @@ def counting_callback_func(pass_, dag, time, property_set, count):
self.assertEqual(gates_in_basis_true_count + 1, collect_2q_blocks_count)


@ddt
@unittest.skipUnless(HAS_TOQM, "qiskit-toqm needs to be installed")
class TestToqmIntegration(QiskitTestCase):
"""Test transpiler with TOQM-based routing"""

@combine(
level=[0, 1, 2, 3],
layout_method=[None, "trivial", "dense", "noise_adaptive", "sabre"],
backend_vbits_pair=[(FakeWashington(), 10), (FakeLima(), 5)],
dsc="TOQM-based routing with '{layout_method}' layout"
+ "method on '{backend_vbits_pair[0]}' backend at level '{level}'",
name="TOQM_{layout_method}_{backend_vbits_pair[0]}_level{level}",
)
def test_basic_circuit(self, level, layout_method, backend_vbits_pair):
"""
Basic circuits transpile across all opt levels and layout
methods when using TOQM-based routing.
"""
backend, circuit_size = backend_vbits_pair
qr = QuantumRegister(circuit_size, "q")
qc = QuantumCircuit(qr)

# Generate a circuit that should need swaps.
for i in range(1, qr.size):
qc.cx(0, i)

result = transpile(
qc,
layout_method=layout_method,
routing_method="toqm",
backend=backend,
optimization_level=level,
seed_transpiler=4222022,
)

self.assertIsInstance(result, QuantumCircuit)

def test_initial_layout_is_rejected(self):
"""Initial layout is rejected when using TOQM-based routing"""
with self.assertRaisesRegex(
TranspilerError, "Initial layouts are not supported with TOQM-based routing."
):
transpile(QuantumCircuit(2), initial_layout=[1, 0], routing_method="toqm")


@ddt
class TestTranspileLevels(QiskitTestCase):
"""Test transpiler on fake backend"""
Expand Down