You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I find that #2056 is still a problem even though it is marked as fixed.
Secondly, at #2059 it was mentioned that I can use max_memory_mb=-1 to ignore the check of required memory. However, even when that is passed, the save_matrix_product_state instruction will fail to create an MPS if the error would have been triggered. Here's a full example:
Traceback (most recent call last):
File "/var/home/garrison/Qiskit/aer-mps-fail.py", line 19, in <module>
sim.run(qc).result().data(0)["mps"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'mps'
However, if you change it to L = 10, it works (at least on my system; these numbers likely need to be tweaked slightly elsewhere).
Steps to reproduce the problem
Code example above
What is the expected behavior?
It should save the matrix product state, especially if given max_memory_mb=-1. And ideally the memory check will be fixed so that passing max_memory_mb=-1 is not necessary, especially when matrix_product_state_max_bond_dimension already provides an upper bound on the memory that can be used.
Suggested solutions
I have not examined the code yet but may soon.
The text was updated successfully, but these errors were encountered:
The error results from the Executor<state_t>::get_max_parallel_shots method here. Basically, even when max_memory_mb=-1 the memory check in that method is still performed, and return std::min(circ.shots * circ.num_bind_params, (max_memory_mb_ / mem)); results in the value 0 when mem is too big, meaning the simulator won't run at all.
An easy fix is to change line 431 to
if (mem == 0 || !check_required_memory_)
which returns the memory-agnostic value. This ensures the above code runs successfully so I'll open a PR with this fix, but it does not deal with the wrong memory estimation for the MPS simulator performed here. I'll try taking a look at this next, but feel free to elaborate if you see the problem.
Informations
What is the current behavior?
First of all, I find that #2056 is still a problem even though it is marked as fixed.
Secondly, at #2059 it was mentioned that I can use
max_memory_mb=-1
to ignore the check of required memory. However, even when that is passed, thesave_matrix_product_state
instruction will fail to create an MPS if the error would have been triggered. Here's a full example:fails with
However, if you change it to
L = 10
, it works (at least on my system; these numbers likely need to be tweaked slightly elsewhere).Steps to reproduce the problem
Code example above
What is the expected behavior?
It should save the matrix product state, especially if given
max_memory_mb=-1
. And ideally the memory check will be fixed so that passingmax_memory_mb=-1
is not necessary, especially whenmatrix_product_state_max_bond_dimension
already provides an upper bound on the memory that can be used.Suggested solutions
I have not examined the code yet but may soon.
The text was updated successfully, but these errors were encountered: