Skip to content
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

Fix Exp on qubit arrays larger than 2 with single PauliI #2086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Jan 2, 2025

This fixes a bug in the decomposition for Exp that would cause a runtime failure if an array of more than two qubits was used and a single PauliI was passed in the Pauli array. The decomposition ignores PauliI by calling the RemovePauliI helper function, but then incorrectly uses the original arrays when rather than the filtered arrays in the rest of the operation. This adds a test to confirm the fix (without the fix the test triggers a runtime failure in MapPauli).

This fixes a bug in the decomposition for `Exp` that would cause a runtime failure if an array of more than two qubits was used and a single `PauliI` was passed in the Pauli array. The decomposition ignores `PauliI` by calling the `RemovePauliI` helper function, but then incorrectly uses the original arrays when rather than the filtered arrays in the rest of the operation. This adds a test to confirm the fix (without the fix the test triggers a runtime failure in `MapPauli`).
Copy link

github-actions bot commented Jan 2, 2025

Change in memory usage detected by benchmark.

Memory Report for 737b02b

Test This Branch On Main Difference
compile core + standard lib 19600689 bytes 19600737 bytes -48 bytes

@DmitryVasilevsky
Copy link
Contributor

Wow! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants