Skip to content

Fix pickling of SabreSwap (backport #15074)#15076

Merged
jakelishman merged 1 commit into
stable/2.2from
mergify/bp/stable/2.2/pr-15074
Sep 25, 2025
Merged

Fix pickling of SabreSwap (backport #15074)#15076
jakelishman merged 1 commit into
stable/2.2from
mergify/bp/stable/2.2/pr-15074

Conversation

@mergify

@mergify mergify Bot commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

Summary

This commit fixes the support for pickling SabreSwap. In #14317 a new RoutingTarget rust struct was added to encapsulate the target details, and this was exposed to Python so that the Python class for the transpiler pass was able to reuse the object between multiple runs. However, this new type didn't implement pickle support and it would cause a failure when trying to pickle a SabreSwap instance that had a routing target populated. This commit fixes this oversight and implements pickle support for the RoutingTarget so that SabreSwap can always be pickled.

Details and comments

Fixes #15071


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

This commit fixes the support for pickling SabreSwap. In #14317 a new
RoutingTarget rust struct was added to encapsulate the target details,
and this was exposed to Python so that the Python class for the
transpiler pass was able to reuse the object between multiple runs.
However, this new type didn't implement pickle support and it would
cause a failure when trying to pickle a SabreSwap instance that had a
routing target populated. This commit fixes this oversight and
implements pickle support for the RoutingTarget so that SabreSwap can
always be pickled.

Fixes #15071

(cherry picked from commit a816e64)
@mergify mergify Bot requested a review from a team as a code owner September 25, 2025 10:13
@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 the Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. label Sep 25, 2025
@github-actions github-actions Bot added this to the 2.2.1 milestone Sep 25, 2025
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 18004234820

Details

  • 31 of 38 (81.58%) changed or added relevant lines in 1 file are covered.
  • 12 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.004%) to 88.399%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/transpiler/src/passes/sabre/route.rs 31 38 81.58%
Files with Coverage Reduction New Missed Lines %
crates/circuit/src/parameter/parameter_expression.rs 1 82.79%
crates/qasm2/src/expr.rs 1 93.63%
crates/qasm2/src/lex.rs 4 92.78%
crates/qasm2/src/parse.rs 6 97.09%
Totals Coverage Status
Change from base Build 18002611656: 0.004%
Covered Lines: 92290
Relevant Lines: 104402

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Sep 25, 2025
Merged via the queue into stable/2.2 with commit 5b1d88a Sep 25, 2025
29 checks passed
@jakelishman jakelishman deleted the mergify/bp/stable/2.2/pr-15074 branch September 25, 2025 14:03
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants