Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use numpy randint instead of choice for conditional (Qiskit#3248)
The conditional code in qiskit.circuit.random.random_circuit() was creating a list of 2^n_qubits to use np.random.choice() to pick a single integer from that list. However, when you have a large number of qubits, like 53, this will result in a memory error because you're trying to allocate a list larger than is possible. This commit changes the selection of the conditional value to select a random integer directly instead of using a list to select a random integer.
- Loading branch information