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 for https://github.com/Qiskit/qiskit-aer/issues/2234 #2238

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aromanro
Copy link
Contributor

Calling State::probabilities() crashes for the MPS simulator

Summary

Trying to get all probabilities for a MPS simulator by calling State::probabilities() resulted in a crash.

Details and comments

The call ended up in MPS::find_centralized_indices where the crash occurred because of a conversion of -1 to unsigned int, resulting in a loop over invalid indices. The fix simply adds all qubits in op.qubits in State::probabilities(), to prevent the issue.

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.

1 participant