I get good performance increases by caching get_gate_matrix to prevent separate allocations for each instance of a gate. For my hacky scripts I just add a functools.cache decorator to get_gate_matrix, but this is probably a bad idea to globally cache. Could run_circuit have a local gate matrix cache?
I get good performance increases by caching
get_gate_matrixto prevent separate allocations for each instance of a gate. For my hacky scripts I just add afunctools.cachedecorator toget_gate_matrix, but this is probably a bad idea to globally cache. Couldrun_circuithave a local gate matrix cache?