qiskit/test/python/transpiler
Jake Lishman bfa4ceba0c
Fix tests that assume a trivial layout from compilation (#14192)
These tests all have a built-in assumption that if the trivial layout
produces a routed circuit, it will automatically be used at optimisation
levels 2 and 3.  This is not formally the case; only optimization levels
0 and 1 set that by default.

An implementation detail of the current VF2Layout pass causes it to
short-circuit out on the first possible solution without scoring, if the
number of virtual qubits matches the number of physical qubits.  This
allowed these tests to pass without any flakiness, even though some of
them used unseeded randomness in `GenericBackendV2`.  This
short-circuiting in VF2Layout is based on a false premise that all
"complete" isomorphic layouts must have the same score, but this is not
actually correct, and follow-on modifications to the VF2 pass might
change this.
2025-04-07 23:09:20 +00:00
..
__init__.py Remove coding: utf-8 per PEP 3120 (#4914) 2020-08-12 08:29:16 -04:00
_dummy_passes.py Do not raise deprecation warnings for internal uses of dag.duration and dag.unit (#14133) 2025-03-31 15:01:43 +00:00
test_1q.py Remove fake backends based on `BackendV1` and related tools (#13805) 2025-02-28 12:46:24 +00:00
test_adjacent_barriers.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_apply_layout.py Support standalone `Var` throughout transpiler (#12322) 2024-05-02 14:13:34 +00:00
test_barrier_before_final_measurements.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_basic_swap.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_basis_translator.py Fix global phase update in `BasisTranslator` Pass (#14078) 2025-03-25 13:51:47 +00:00
test_check_gate_direction.py Oxidize CheckGateDirection (#13042) 2024-09-08 12:10:30 +00:00
test_check_map.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_clifford_passes.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_collect_2q_blocks.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_collect_multiq_blocks.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_commutation_analysis.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_commutative_cancellation.py Fix string and standard gate mismatch in commutation checker (#13991) 2025-03-12 13:27:09 +00:00
test_commutative_inverse_cancellation.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_consolidate_blocks.py Minor fix to UnitarySynthesis with RZZ and CZ gates (#13987) 2025-03-11 15:18:15 +00:00
test_containsinstruction.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_contract_idle_wires_in_control_flow.py Add representation of `box` (#13869) 2025-03-06 00:41:52 +00:00
test_count_ops_longest_path_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_count_ops_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_coupling.py Add generic V1 Fake Backends, replace use in tests (#10952) 2024-02-01 05:59:55 +00:00
test_csp_layout.py Add generic V1 Fake Backends, replace use in tests (#10952) 2024-02-01 05:59:55 +00:00
test_dag_fixed_point_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_dag_longest_path_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_decompose.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_dense_layout.py Add generic V1 Fake Backends, replace use in tests (#10952) 2024-02-01 05:59:55 +00:00
test_depth_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_dynamical_decoupling.py Remove calibrations APIs and related functionality (#13861) 2025-03-02 16:40:07 +00:00
test_elide_permutations.py Delegate `BasePass.__call__` to `PassManager.run` (#13820) 2025-03-06 02:01:25 +00:00
test_enlarge_with_ancilla_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_error.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_filter_op_nodes.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_fixed_point_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_full_ancilla_allocation.py Spellcheck Done [Unitary Hack 2024] (#12501) 2024-06-19 15:50:03 +00:00
test_gate_direction.py Remove calibrations APIs and related functionality (#13861) 2025-03-02 16:40:07 +00:00
test_gates_in_basis_pass.py Deprecate BackendV1 and `qiskit.providers.models` (#12629) 2024-07-31 10:53:40 +00:00
test_generic_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_high_level_synthesis.py HLS plugin for new MCX Decompositions (#14143) 2025-04-07 15:26:35 +00:00
test_hoare_opt.py Bug fix in `HoareOptimizer` (#13083) 2024-09-04 15:32:52 +00:00
test_instruction_durations.py Remove fake backends based on `BackendV1` and related tools (#13805) 2025-02-28 12:46:24 +00:00
test_inverse_cancellation.py Remove `CXCancellation` (deprecated in 1.1) (#13426) 2024-12-05 10:12:16 +00:00
test_kak_over_optimization.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_layout.py Move `Bit` and `Register` to live in Rust space (#13860) 2025-03-07 21:31:52 +00:00
test_layout_score.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_layout_transformation.py https://github.com/Qiskit/rustworkx/pull/897 is merged (#11766) 2024-02-12 09:19:05 +00:00
test_light_cone.py Light Cone Transpiler Pass (#12814) 2025-03-04 07:27:29 +00:00
test_linear_functions_passes.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_lookahead_swap.py Add generic V1 Fake Backends, replace use in tests (#10952) 2024-02-01 05:59:55 +00:00
test_mappers.py Remove deprecated stochastic swap transpiler pass (#13791) 2025-02-25 02:23:59 +00:00
test_minimum_point.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_naming_transpiled_circuits.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_optimize_1q_commutation.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_optimize_1q_decomposition.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_optimize_1q_gates.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_optimize_annotated.py Conjugate reduction in optimize annotated pass (#11811) 2024-05-02 17:34:15 +00:00
test_optimize_swap_before_measure.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_parameterizedgate_translator.py Update remaining unit tests to use `FakeGeneric` (#10918) 2024-01-31 19:42:44 +00:00
test_pass_call.py Delegate `BasePass.__call__` to `PassManager.run` (#13820) 2025-03-06 02:01:25 +00:00
test_pass_scheduler.py Remove consider-using-f-string lint rule and updates (#12423) 2024-06-19 07:05:56 +00:00
test_passmanager.py Delegate `BasePass.__call__` to `PassManager.run` (#13820) 2025-03-06 02:01:25 +00:00
test_passmanager_config.py Remove calibrations APIs and related functionality (#13861) 2025-03-02 16:40:07 +00:00
test_passmanager_run.py Deprecate BackendV1 and `qiskit.providers.models` (#12629) 2024-07-31 10:53:40 +00:00
test_preset_passmanagers.py Fix tests that assume a trivial layout from compilation (#14192) 2025-04-07 23:09:20 +00:00
test_property_set.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_remove_barriers.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_remove_diagonal_gates_before_measure.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_remove_final_measurements.py Move `Bit` and `Register` to live in Rust space (#13860) 2025-03-07 21:31:52 +00:00
test_remove_final_reset.py Add RemoveFinalReset pass (#11266) 2024-03-19 20:53:13 +00:00
test_remove_identity_equivalent.py Use average gate fidelity in the commutation checker (#13874) 2025-03-06 00:03:15 +00:00
test_remove_reset_in_zero_state.py Add RemoveFinalReset pass (#11266) 2024-03-19 20:53:13 +00:00
test_reset_after_measure_simplification.py Move `Bit` and `Register` to live in Rust space (#13860) 2025-03-07 21:31:52 +00:00
test_resource_estimation_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_sabre_layout.py Remove deprecated stochastic swap transpiler pass (#13791) 2025-02-25 02:23:59 +00:00
test_sabre_pre_layout.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_sabre_swap.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_scheduling_padding_pass.py Remove calibrations APIs and related functionality (#13861) 2025-03-02 16:40:07 +00:00
test_setlayout.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_size_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_solovay_kitaev.py Move `Bit` and `Register` to live in Rust space (#13860) 2025-03-07 21:31:52 +00:00
test_split_2q_unitaries.py Correctly handle non-UnitaryGate gates named "unitary" (#14109) 2025-03-27 13:13:58 +00:00
test_stage_plugin.py Remove deprecated stochastic swap transpiler pass (#13791) 2025-02-25 02:23:59 +00:00
test_staged_passmanager.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_star_prerouting.py Port `star_preroute` to rust (#12761) 2024-07-29 15:14:25 +00:00
test_swap_strategy.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_swap_strategy_router.py Bump `rand` to 0.9 and associated crates (#13806) 2025-02-14 14:52:24 +00:00
test_target.py Update transpiler pipeline to (only) use target internally (#12850) 2025-03-06 16:25:55 +00:00
test_template_matching.py Remove pulse module files, pulse visualization and final cleanup (#13872) 2025-03-06 03:01:30 +00:00
test_tensor_factor_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00
test_token_swapper.py Spellcheck Done [Unitary Hack 2024] (#12501) 2024-06-19 15:50:03 +00:00
test_transpile_layout.py Bump `rand` to 0.9 and associated crates (#13806) 2025-02-14 14:52:24 +00:00
test_trivial_layout.py Add generic V1 Fake Backends, replace use in tests (#10952) 2024-02-01 05:59:55 +00:00
test_unitary_synthesis.py Fix tests that assume a trivial layout from compilation (#14192) 2025-04-07 23:09:20 +00:00
test_unitary_synthesis_plugin.py Oxidize `UnitarySynthesis` path using `basis_gates` (#13704) 2025-02-17 17:24:33 +00:00
test_unroll_3q_or_more.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_unroll_custom_definitions.py Support standalone `Var` throughout transpiler (#12322) 2024-05-02 14:13:34 +00:00
test_unroll_forloops.py Remove condition/c_if, duration, and unit from instructions (#13506) 2025-02-24 15:33:45 +00:00
test_vf2_layout.py Port the full VF2Layout pass to Rust (#14056) 2025-04-07 19:27:42 +00:00
test_vf2_post_layout.py Remove calibrations APIs and related functionality (#13861) 2025-03-02 16:40:07 +00:00
test_width_pass.py Remove `qiskit.test` (#10998) 2024-01-31 14:11:41 +00:00