-
Notifications
You must be signed in to change notification settings - Fork 370
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
MPS::apply_multi_qubit_gate can crash in some circumstances #2292
Labels
bug
Something isn't working
Comments
aromanro
added a commit
to InvictusWingsSRL/qiskit-aer
that referenced
this issue
Jan 16, 2025
aromanro
added a commit
to InvictusWingsSRL/qiskit-aer
that referenced
this issue
Jan 16, 2025
aromanro
added a commit
to InvictusWingsSRL/qiskit-aer
that referenced
this issue
Jan 16, 2025
It seems that the code that follows expects the matrix to be in a single row format if
|
|
aromanro
added a commit
to InvictusWingsSRL/qiskit-aer
that referenced
this issue
Jan 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Informations
What is the current behavior?
I was testing the MPS simulator with some randomly generated circuits... with some I've got crashes.
This one I noticed after fixing #2291
The call chain was:
AerState::apply_measure
->AerState::flush_ops
->Base::apply_ops
->MatrixProductState::State::apply_op
->MPS::apply_diagonal_matrix
->MPS::apply_matrix
->MPS::apply_multi_qubit_gate
.It crashed on this line:
qiskit-aer/src/simulators/matrix_product_state/matrix_product_state_internal.cpp
Line 798 in 582407a
is_diagonal
wastrue
(as it should be by looking at the call chain),mat
had 1 row and 8 columns (being a diagonal matrix, only the diagonal is given, so it's actually a vector)... but at that line it's used withmat(row, col)
which is generating the crash.Steps to reproduce the problem
Again, this might be quite tough to reproduce, I was generating some random circuits with more than 100 ops to test some things and maybe one in 100 circuits crashed.
What is the expected behavior?
No crash.
Suggested solutions
The problem lines should probably be replaced by something like:
... or maybe a vector
new_mat
should be constructed ifis_diagonal
istrue
The text was updated successfully, but these errors were encountered: