Skip to content

Fix Sabre rebuild with nested Var and Stretch #14488

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

Merged
merged 1 commit into from
May 28, 2025

Conversation

jakelishman
Copy link
Member

The empty_dag helper, used to construct control-flow blocks, in the rebuilder failed to account for Var or Stretch nodes. We have integration tests in test/python/compiler/test_transpiler.py that in theory should have caught this, but in practice failed to because they are accidentally using all-to-all connectivity backends, so Sabre never runs in them.

Summary

Details and comments

This fixes the test failures that #14484 turned up.

The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.
@jakelishman jakelishman added this to the 2.1.0 milestone May 28, 2025
@jakelishman jakelishman requested a review from a team as a code owner May 28, 2025 15:20
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the 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
Copy link
Member Author

@mergify backport stable/1.4

Copy link
Contributor

mergify bot commented May 28, 2025

backport stable/1.4

✅ Backports have been created

@jakelishman
Copy link
Member Author

This won't actually apply cleanly to 1.4 because of the stretches, but the vars part of it does need backporting.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 15304049344

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 87.822%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.48%
Totals Coverage Status
Change from base Build 15301801161: 0.03%
Covered Lines: 79526
Relevant Lines: 90554

💛 - Coveralls

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 fix!

@kevinhartman kevinhartman added this pull request to the merge queue May 28, 2025
Merged via the queue into Qiskit:main with commit 985bd7a May 28, 2025
27 checks passed
mergify bot pushed a commit that referenced this pull request May 28, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.

(cherry picked from commit 985bd7a)

# Conflicts:
#	test/python/transpiler/test_sabre_swap.py
mergify bot pushed a commit that referenced this pull request May 28, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.

(cherry picked from commit 985bd7a)
@jakelishman jakelishman deleted the sabre-inner-vars branch May 28, 2025 16:38
jakelishman added a commit that referenced this pull request May 28, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.
jakelishman added a commit that referenced this pull request May 28, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.

(cherry picked from commit 985bd7a)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2025
…14493)

* Fix Sabre rebuild with nested `Var` and `Stretch` (#14488)

The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.

* Fix test if routing occurs

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
The `empty_dag` helper, used to construct control-flow blocks, in the
rebuilder failed to account for `Var` or `Stretch` nodes.  We have
integration tests in `test/python/compiler/test_transpiler.py` that _in
theory_ should have caught this, but in practice failed to because they
are accidentally using all-to-all connectivity backends, so Sabre never
runs in them.
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 stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants