qiskit-aer icon indicating copy to clipboard operation
qiskit-aer copied to clipboard

Fix for https://github.com/Qiskit/qiskit-aer/issues/2234

Open aromanro opened this issue 5 months ago • 0 comments

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.

aromanro avatar Sep 21 '24 11:09 aromanro