Skip to content

Fix VF2 layout allocation with idle qubits (backport #14938)#14940

Merged
jakelishman merged 1 commit into
stable/2.1from
mergify/bp/stable/2.1/pr-14938
Aug 22, 2025
Merged

Fix VF2 layout allocation with idle qubits (backport #14938)#14940
jakelishman merged 1 commit into
stable/2.1from
mergify/bp/stable/2.1/pr-14938

Conversation

@mergify

@mergify mergify Bot commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

Summary

The two VF2 passes failed to allocate completely idle qubits into the Layout objects they returned. While the mapping doesn't really mean much, it's important for the rest of the pipeline that a Layout object is a complete layout for the incoming virtuals, even if some of the choices are arbitrary.

This typically appeared to users via calls to
TranspileLayout.initial_index_layout(filter_ancillas=True) bugging out, but really anything inspecting the Layout before that was susceptible.

Details and comments

This should fix the bug detected in #14904 (comment).


This is an automatic backport of pull request #14938 done by [Mergify](https://mergify.com).

The two VF2 passes failed to allocate completely idle qubits into the
`Layout` objects they returned.  While the mapping doesn't really _mean_
much, it's important for the rest of the pipeline that a `Layout` object
is a complete layout for the incoming virtuals, even if some of the
choices are arbitrary.

This typically appeared to users via calls to
`TranspileLayout.initial_index_layout(filter_ancillas=True)` bugging
out, but really anything inspecting the `Layout` before that was
susceptible.

(cherry picked from commit 2577bc1)
@mergify mergify Bot requested a review from a team as a code owner August 22, 2025 18:39
@qiskit-bot

Copy link
Copy Markdown
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: Fixed Add a "Fixed" entry in the GitHub Release changelog. mod: transpiler Issues and PRs related to Transpiler labels Aug 22, 2025
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17163279752

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 3 files are covered.
  • 18 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.006%) to 87.743%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.67%
crates/transpiler/src/passes/unitary_synthesis.rs 1 93.43%
crates/qasm2/src/lex.rs 4 93.04%
crates/qasm2/src/parse.rs 12 97.1%
Totals Coverage Status
Change from base Build 17068190916: -0.006%
Covered Lines: 80027
Relevant Lines: 91206

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Aug 22, 2025
Merged via the queue into stable/2.1 with commit 20ba77d Aug 22, 2025
29 checks passed
@jakelishman jakelishman deleted the mergify/bp/stable/2.1/pr-14938 branch August 22, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. mod: transpiler Issues and PRs related to Transpiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants