In qiskit backends, there is Matrix_product_state. With this backend, I can simulate circuit for several qubits. And I found some mysterious problem about MPS. With 25,26,27 qubits, the simulating time takes really really much. So, I asked here why it happened, and I got some answer here. But I want to know more detail about this MPS part. Where can I found the information about two algorithm of MPS? Please help.


1 Answer 1


The performance issue that you see occurs in the measurements at the end of your circuit. Until then there is only one algorithm.

The statevector simulator (note - statevector - not MPS) has an optimization, that is applied when all measurement gates are at the end, and the simulation is not noisy. With this optimization, we perform only 1 shot, even if the user asked say for 1000 shots. We generate counts for 1000 shots from the probabilities at the end.

The MPS simulator cannot have this optimization, therefore for 1000 shots you'll have to apply the measurement gates 1000 times. Therefore, when there are many shots, it is preferable to convert from MPS to statevector for the measurement part. Note that this conversion is expensive, so should not happen for a small number of shots.

Here is a link to the closed pull request that introduced this conversion: https://github.com/Qiskit/qiskit-aer/pull/808

There is also an issue that you can track, following your query: https://github.com/Qiskit/qiskit-aer/issues/944


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.