By using the Qiskit qasm-simulator, I want to simulate a quantum circuit of 40 qubits. However, the number of qubits 40 is greater than maximum number (24) for qasm-simulator. Is there any possibility to increase this number?

  • $\begingroup$ Hey, could you tell me how you found this 24 limit? When searching I have a 30 limits but no 24 anywhere $\endgroup$
    – Lena
    Dec 2 '20 at 9:39
  • 3
    $\begingroup$ The limit is set by the available local RAM. As such, there is variation in the limits. $\endgroup$ Dec 2 '20 at 11:25

Actually, the maximum number of qubits in the local qasm_simulator is 30, and 32 for the ibmq_qasm_simulator. You can see this 30-limit by running Aer.get_backend('qasm_simulator').configuration().to_dict() and you can see the configuration for the simulator, including the max number of qubits.

However, I believe it is possible to play with the matrix product state option to get a little bit more, I am not sure, I invite you to check this tuto from Qiskit, they might go through it :)

EDIT : Actually the 24-limit comes from BasicAer, I invite you to use the simulators from Aer, or the ibmq_qasm_simulator that have better limits. You can also play with the backend options, see in this documentation from Qiskit that explains pretty much everything there is to know!

Hope this helps :)


If you use ibmq_qasm_simulator then the maximum number of qubit supported is 32. And you can't increase this number. Here is Qiskit documentation on this simulator.

Remember that simulating quantum system is very resource extensive, and being able to simulating a system with 32 qubits is pretty impressive.

  • $\begingroup$ On my PC, Qiskit runs under the Windows XP operating system. When I submit the circuit code to the qasm simulator I got the following message back: qiskit.providers.basicaer.exceptions.BasicAerError: 'Number of qubits 40 is greater than maximum (24) for "qasm_simulator'. $\endgroup$
    – L. Lenzini
    Dec 2 '20 at 10:42
  • $\begingroup$ note that there is a difference between qasm_simulator and ibmq_qasm_simulator. The latter run on IBM's cluster which is (I guess) pretty powerful. $\endgroup$
    – KAJ226
    Dec 2 '20 at 11:01

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.