Skip to content

Conversation

mtreinish
Copy link
Member

Summary

The current slowest unit test in the suite is:

test_transpile_does_not_affect_backend_coupling_4_3

which is just sanity checking that a transpile() call doesn't mutate the CouplingMap by mistake. This is is a regression test for an old bug where that happened. However, in the move to use GenericBackendV2 it was creating a 130 qubit target with explicit all-to-all connectivity, which is the default behavior if you don't specify a coupling map argument. This ends up bogging the transpiler down in VF2PostLayout in optimization level 3 because there are a huge number of possible layouts, basically any permutation of 130 qubits. This isn't functionally part of the test because it's just trying to test if the coupling map is mutated by the transpiler. This commit updates the test to use a 130 qubit linear connectivity graph which still tests the circuit but takes a fraction of the time to execute because the target is much more constrained.

Details and comments

The current slowest unit test in the suite is:

test_transpile_does_not_affect_backend_coupling_4_3

which is just sanity checking that a transpile() call doesn't mutate the
CouplingMap by mistake. This is is a regression test for an old bug where
that happened. However, in the move to use GenericBackendV2 it was
creating a 130 qubit target with explicit all-to-all connectivity, which
is the default behavior if you don't specify a coupling map argument.
This ends up bogging the transpiler down in VF2PostLayout in
optimization level 3 because there are a huge number of possible
layouts, basically any permutation of 130 qubits. This isn't
functionally part of the test because it's just trying to test if the
coupling map is mutated by the transpiler. This commit updates the test
to use a 130 qubit linear connectivity graph which still tests the
circuit but takes a fraction of the time to execute because the target
is much more constrained.
@mtreinish mtreinish requested a review from a team as a code owner May 28, 2025 11:37
@mtreinish mtreinish added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog labels May 28, 2025
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@jakelishman jakelishman enabled auto-merge May 28, 2025 11:41
@jakelishman jakelishman added the stable backport potential The bug might be minimal and/or import enough to be port to stable label May 28, 2025
@jakelishman jakelishman added this pull request to the merge queue May 28, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15299147700

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 12 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.004%) to 87.849%

Files with Coverage Reduction New Missed Lines %
crates/transpiler/src/passes/unitary_synthesis.rs 1 94.85%
crates/circuit/src/symbol_expr.rs 2 75.16%
crates/qasm2/src/lex.rs 3 92.73%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 15296293022: -0.004%
Covered Lines: 79840
Relevant Lines: 90883

💛 - Coveralls

Merged via the queue into Qiskit:main with commit 88ce515 May 28, 2025
27 checks passed
mergify bot pushed a commit that referenced this pull request May 28, 2025
The current slowest unit test in the suite is:

test_transpile_does_not_affect_backend_coupling_4_3

which is just sanity checking that a transpile() call doesn't mutate the
CouplingMap by mistake. This is is a regression test for an old bug where
that happened. However, in the move to use GenericBackendV2 it was
creating a 130 qubit target with explicit all-to-all connectivity, which
is the default behavior if you don't specify a coupling map argument.
This ends up bogging the transpiler down in VF2PostLayout in
optimization level 3 because there are a huge number of possible
layouts, basically any permutation of 130 qubits. This isn't
functionally part of the test because it's just trying to test if the
coupling map is mutated by the transpiler. This commit updates the test
to use a 130 qubit linear connectivity graph which still tests the
circuit but takes a fraction of the time to execute because the target
is much more constrained.

(cherry picked from commit 88ce515)
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2025
The current slowest unit test in the suite is:

test_transpile_does_not_affect_backend_coupling_4_3

which is just sanity checking that a transpile() call doesn't mutate the
CouplingMap by mistake. This is is a regression test for an old bug where
that happened. However, in the move to use GenericBackendV2 it was
creating a 130 qubit target with explicit all-to-all connectivity, which
is the default behavior if you don't specify a coupling map argument.
This ends up bogging the transpiler down in VF2PostLayout in
optimization level 3 because there are a huge number of possible
layouts, basically any permutation of 130 qubits. This isn't
functionally part of the test because it's just trying to test if the
coupling map is mutated by the transpiler. This commit updates the test
to use a 130 qubit linear connectivity graph which still tests the
circuit but takes a fraction of the time to execute because the target
is much more constrained.

(cherry picked from commit 88ce515)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
The current slowest unit test in the suite is:

test_transpile_does_not_affect_backend_coupling_4_3

which is just sanity checking that a transpile() call doesn't mutate the
CouplingMap by mistake. This is is a regression test for an old bug where
that happened. However, in the move to use GenericBackendV2 it was
creating a 130 qubit target with explicit all-to-all connectivity, which
is the default behavior if you don't specify a coupling map argument.
This ends up bogging the transpiler down in VF2PostLayout in
optimization level 3 because there are a huge number of possible
layouts, basically any permutation of 130 qubits. This isn't
functionally part of the test because it's just trying to test if the
coupling map is mutated by the transpiler. This commit updates the test
to use a 130 qubit linear connectivity graph which still tests the
circuit but takes a fraction of the time to execute because the target
is much more constrained.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants