Skip to content

Conversation

alexanderivrii
Copy link
Member

@alexanderivrii alexanderivrii commented Jun 12, 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.

@alexanderivrii alexanderivrii added this to the 2.1.0 milestone Jun 12, 2025
@alexanderivrii alexanderivrii requested a review from a team as a code owner June 12, 2025 09:18
@alexanderivrii alexanderivrii added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jun 12, 2025
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 12, 2025
@ShellyGarion ShellyGarion added this pull request to the merge queue Jun 17, 2025
Merged via the queue into Qiskit:main with commit ad239bf Jun 17, 2025
26 checks passed
mergify bot pushed a commit that referenced this pull request Jun 17, 2025
* Extending rustiq synthesis plugin to work with PauliEvolutionGates containing SparseObservables

* also propagating label and synthesis aeguments

(cherry picked from commit ad239bf)
github-merge-queue bot pushed a commit that referenced this pull request Jun 17, 2025
…14628)

* Extending rustiq synthesis plugin to work with PauliEvolutionGates containing SparseObservables

* also propagating label and synthesis aeguments

(cherry picked from commit ad239bf)

Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
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.

5 participants