I am trying to run a circuit with 32 qubit on a local hpc (not IBM Q HPC) using statevector_simulator backend.

but i got the following error:

Traceback (most recent call last):
  File "testQiskit11.py", line 156, in <module>
    backend = Aer.get_backend('statevector_simulator', max_memory_mb=65536)
  File "/home/UserName/.conda/envs/quantum/lib/python3.7/site-packages/qiskit/providers/aer/aerprovider.py", line 37, in get_backend
    return super().get_backend(name=name, **kwargs)
  File "/home/UserName/.conda/envs/quantum/lib/python3.7/site-packages/qiskit/providers/baseprovider.py", line 53, in get_backend
    raise QiskitBackendNotFoundError('No backend matches the criteria')
qiskit.providers.exceptions.QiskitBackendNotFoundError: 'No backend matches the criteria'

The part of the script that specify the backend and run the simulation is as follow:

backend = Aer.get_backend('statevector_simulator', max_memory_mb=65536)
shots = 1024
job = execute(QCirc, backend)
result = job.result()

You should probably read this tutorial to see how backend filtering works: https://github.com/Qiskit/qiskit-tutorials/blob/master/qiskit/basics/2_the_ibmq_provider.ipynb

Also, Aer is a local simulator, so the amount of memory available is determined by the computer you are running it on. Setting MAX_QUBIT_MEMORY manually will do nothing but cause your computer to freeze if you do not have enough memory to support 32 qubits.

  • $\begingroup$ My job runs locally on an HPC not related to IBM Q. How to calculate the required amount of memory for simulating 32 qubit. According to this the calculation is as follow: MAX_QUBIT_MEMORY = int( log2(local_hardware_info()['memory'] * (1024**3) / 16)) which get the the number of qubits based on the the memory size and that each element in the state vector requires 16 bytes. And i set max_memory_mb=65536 which is the exact amount of memory required for 32 qubit state vector. $\endgroup$ Jul 22 '19 at 13:57
  • $\begingroup$ You cannot set max memory $\endgroup$ Dec 28 '19 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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