Add dense matrix support for PauliProductRotation#15927
Add dense matrix support for PauliProductRotation#15927Adithyaphani wants to merge 1 commit intoQiskit:mainfrom
Conversation
|
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:
|
|
Hi @ShellyGarion , just a gentle reminder on this PR whenever you have a chance to review it. This is a follow-up focused only on the required Thank you. |
4b5e7a0 to
27d8136
Compare
|
@1ucian0 and @ShellyGarion I’ve pushed a fix that clears the macOS CI failure. Could you please Re-run all jobs for this PR. |
|
@1ucian0 thanks for the rerun. At this point the remaining failure appears limited to the macOS-15 / Python 3.10 install-dependencies step. The log shows a runner/setup-side conflict while installing Rust tooling ( I restored the accidental workflow-file change and have not made further source or workflow edits to avoid widening the PR scope again. If helpful, I’d appreciate another rerun or any guidance on the next step from your side. Thank you. |
|
@1ucian0 .Unfortunately, the PR was closed earlier, but I have now reopened it. All required checks are passing in the latest commit. For reference, I’ve attached a screenshot in the comments. Leaving this as a gentle follow-up for review whenever convenient. I hope the branch can be successfully merged after this re-run. If any further changes are needed, I’d be happy to make them. |
|
This PR does not address the functionality requested in #15869 and does not add a |
|
@ShellyGarion ,I’ll ensure better efficiency in future fixes. Thanks for your guidance! |

AI tool used: ChatGPT (OpenAI GPT-5.4 Thinking) for understanding the issue clearly and not relying on it completely.
Fixes #15869.
Summary
This PR adds the missing dense Pauli-matrix helper required by the existing
PauliProductRotation::matrix()implementation.Details and comments
This PR is intentionally minimal and limited to:
crates/circuit/src/gate_matrix.rsIt adds
pauli_zx_to_matrix(z, x)so the existingPauliProductRotation::matrix()path inoperations.rscan construct the dense Pauli-product matrix and return the dense rotation matrix correctly.The resulting matrix follows:
cos(theta / 2) * I - i * sin(theta / 2) * PValidation run locally:
cargo fmt --allcargo check -p qiskit-circuit --lib --all-featurescargo clippy -p qiskit-circuit --lib --all-features -- -D warnings