Avoid all-to-all connectivity in slowest test (backport #14483) #14485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The current slowest unit test in the suite is:
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
This is an automatic backport of pull request #14483 done by Mergify.