8000 Extending rustiq synthesis plugin to work SparseObservables (backport #14582) by mergify[bot] · Pull Request #14628 · Qiskit/qiskit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extending rustiq synthesis plugin to work SparseObservables (backport #14582) #14628

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
Jun 17, 2025

Conversation

mergify[bot]
Copy link
Contributor
@mergify mergify bot commented Jun 17, 2025

Summary

In #13301, we introduced a synthesis plugin PauliEvolutionSynthesisRustiq for objects of type PauliEvolutionGate. At the time, the operator of a PauliEvolutionGate could be either a Pauli or a SparsePauliOp (or a list of such objects). Later, in #13836, we extended PauliEvolutionGate to also support operators of type SparseObservable, leading to impressive gains for the default synthesis plugin for PauliEvolutionGate. However, we forgot to extend PauliEvolutionSynthesisRustiq as well. As the result, the following code could run without raising any errors, but produced incorrect output circuits:

from qiskit.circuit.library import PauliEvolutionGate
from qiskit.quantum_info import SparseObservable, Operator
from qiskit.transpiler.passes.synthesis.hls_plugins import PauliEvolutionSynthesisRustiq

obs = SparseObservable.from_sparse_list([("1+XY", (0, 1, 2, 3), 1.5)], num_qubits=4)
evo = PauliEvolutionGate(obs, 1)
qct = PauliEvolutionSynthesisRustiq().run(evo)
assert Operator(qct) == Operator(evo)

This PR fixes the above problem by converting within the rustiq plugin SparseObservables to SparsePauliOps (note that this might exponentially increase the number of terms). In addition, the Qiskit Rust interface to rustiq has been extended to raise an error when the pauli input strings are invalid.


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

* Extending rustiq synthesis plugin to work with PauliEvolutionGates containing SparseObservables

* also propagating label and synthesis aeguments

(cherry picked from commit ad239bf)
@mergify mergify bot requested a review from a team as a code owner June 17, 2025 12:59
@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 this to the 2.1.0 milestone Jun 17, 2025
@github-actions github-actions bot added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jun 17, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15707918102

Details

  • 22 of 23 (95.65%) changed or added relevant lines in 2 files are covered.
  • 10 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.005%) to 87.988%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/synthesis/hls_plugins.py 15 16 93.75%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.23%
crates/qasm2/src/lex.rs 3 92.48%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 15689037371: 0.005%
Covered Lines: 83054
Relevant Lines: 94392

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Jun 17, 2025
Merged via the queue into stable/2.1 with commit daa105d Jun 17, 2025
29 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/2.1/pr-14582 branch June 17, 2025 15:03
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0