Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up random circuit creation (Qiskit#3249)
The qiskit.circuit.random.random_circuit() function was previously using signature inspection to figure out how many angles a gate needed. While this is fine for smaller circuit creation, when the circuits get really large the time it takes the inspect module to return the signature starts to add up. The use of the signature check isn't required because the number of parameters for gates are fixed. This commit speeds random circuit creation by creating a list of each gate with parameters and just checking if the randomly selected operation is present in one of those.
- Loading branch information