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

Do not contract control-flow operations during SabreSwap #13790

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

jakelishman
Copy link
Member

Summary

The previous implementation of control-flow handling for SabreSwap caused control-flow blocks to contract away from idle qubit wires as a side effect of its algorithm. This will no longer be always valid with the addition of Box, and besides, that optimisation isn't part of a routing algorithm's responsibilities, so it's cleaner to have it in a separate pass (now ContractIdleWiresInControlFlow) where it can be applied at times other than routing, like in the optimisation loop.

Details and comments

Fix #13768.

ContractIdleWiresInControlFlow is in #13779.

The previous implementation of control-flow handling for `SabreSwap`
caused control-flow blocks to contract away from idle qubit wires as a
side effect of its algorithm.  This will no longer be always valid with
the addition of `Box`, and besides, that optimisation isn't part of a
routing algorithm's responsibilities, so it's cleaner to have it in a
separate pass (now `ContractIdleWiresInControlFlow`) where it can be
applied at times other than routing, like in the optimisation loop.
@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: transpiler Issues and PRs related to Transpiler labels Feb 5, 2025
@jakelishman jakelishman requested a review from a team as a code owner February 5, 2025 14:48
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13160002909

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

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.001%) to 88.669%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 93.98%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 13159806696: 0.001%
Covered Lines: 78964
Relevant Lines: 89055

💛 - Coveralls

@jakelishman jakelishman added this to the 2.0.0 milestone Feb 5, 2025
@kevinhartman kevinhartman self-assigned this Feb 11, 2025
Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the changes!

@kevinhartman kevinhartman added this pull request to the merge queue Feb 11, 2025
Merged via the queue into Qiskit:main with commit 288d2f4 Feb 11, 2025
17 checks passed
@jakelishman jakelishman deleted the sabre/contraction branch February 11, 2025 17:40
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.

Control-flow routing causes idle qubits to be stripped from control-flow blocks
4 participants