Indeed, the composer does not support such a deep circuit. While, the error is counterintuitive (I reported that to the the composer developers already) it kind of makes sense that you are unable to load a circuit with ~20K gates. The composer is useful for toy examples and to simulate the circuit "live" in the browser. As you noticed, simulating the situation you are describing is impractical.
More generally, the situation you are describing is not practical on real hardware neither. As explained, 20K gates is a lot for the current state of the art of quantum hardware.
In any case, I suggest you to use IBM Quantum Lab for non-toy situations.
Here is how to load a QASM file and run it in real hardware using the IBM Quantum Lab:
Go to https://quantum-computing.ibm.com/lab/
Upload your QASM file (
long.qasm in my case) to the environment:
In the notebook (the default has many useful imports already), load the file:
circuit = QuantumCircuit.from_qasm_file('long.qasm') # Creates a circuit from the QASM file
sum(circuit.count_ops().values()) # Total amount of gates to be sure that's your big circuit
- Get the least busy device that is not a simulator and have enough qubits to execute your circuit (5 in this case)
from qiskit.providers.ibmq import least_busy
least_busy_device = least_busy(provider.backends(
simulator=False, filters=lambda b: b.configuration().n_qubits >= 5))
- Execute the circuit in the device:
job = execute(circuit, least_busy_device)
- Take a look to the results:
counts = job.result().get_counts() # This might take some time, since your job will be in the queue.
- You will probably see a lot of noise, because of decoherence.