Skip to content

Conversation

@aromanro
Copy link
Contributor

@aromanro aromanro commented Sep 21, 2024

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.

Link to corresponding issue: #2234

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