Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 7, 2025

Summary

The VF2Layout pass is documented as setting a trial limit equivalent to the being based on the number of edges of the interaction or connectivity graph. Additionally it supports being a negative value to run unbounded. However, when vf2 layout was ported to rust in #14056 this behavior was not preserved. It was not able to handle negative values and also a value of None was treated as unbounded. This commit corrects these oversights so the argument to the pass is handled correctly as documented.

Details and comments
This is an automatic backport of pull request #14667 done by Mergify.

* Restore correct max_trials behaviour for VF2Layout pass

The VF2Layout pass is documented as setting a trial limit equivalent to
the being based on the number of edges of the interaction or connectivity
graph. Additionally it supports being a negative value to run unbounded.
However, when vf2 layout was ported to rust in #14056 this behavior was
not preserved. It was not able to handle negative values and also a
value of None was treated as unbounded. This commit corrects these
oversights so the argument to the pass is handled correctly as
documented.

* Improve tests

The previous version of the tests in this module didn't set the seed
correctly, so the rust component was not run. Similarly, the tests
didn't cover the strict direction path. This commit corrects both
oversights so the tests added in this PR cover the fix.

(cherry picked from commit 6e4d83c)
@mergify mergify bot requested a review from a team as a code owner July 7, 2025 08:07
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

  • @Qiskit/terra-core

@github-actions github-actions bot added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: transpiler Issues and PRs related to Transpiler labels Jul 7, 2025
@github-actions github-actions bot added this to the 2.1.1 milestone Jul 7, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16111438866

Details

  • 24 of 25 (96.0%) changed or added relevant lines in 1 file are covered.
  • 21 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.05%) to 87.71%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/transpiler/src/passes/vf2/vf2_layout.rs 24 25 96.0%
Files with Coverage Reduction New Missed Lines %
crates/circuit/src/symbol_expr.rs 1 73.94%
crates/transpiler/src/passes/unitary_synthesis.rs 1 93.43%
crates/transpiler/src/passes/vf2/vf2_layout.rs 1 91.35%
crates/qasm2/src/lex.rs 6 92.01%
crates/qasm2/src/parse.rs 12 97.1%
Totals Coverage Status
Change from base Build 15998564811: 0.05%
Covered Lines: 80092
Relevant Lines: 91315

💛 - Coveralls

@1ucian0 1ucian0 added this pull request to the merge queue Jul 7, 2025
Merged via the queue into stable/2.1 with commit 6f8d3de Jul 7, 2025
29 checks passed
@1ucian0 1ucian0 deleted the mergify/bp/stable/2.1/pr-14667 branch July 7, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog mod: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants