-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
circuit deepcopy too slow: singleton gates #3800
Comments
This issue has been solved in qiskit-terra 0.19 |
A series of merged PR probably fixed this issue. Closing it. Feel free to reopen it if more specific optimization can be done. |
I believe this issue is about making gates singletons and only copying the necessary information instead of the entire gate instances. Currently, we still do store 2000 X-gate instances if we have 2000 X gates in a circuit so I don't think this issue can be closed. |
Reopening. The expected change is refactoring gates as singletons. |
It is currently very slow to copy a circuit. Among other things, one reason is that circuits are defined over gate instances. So a circuit with 2000 H gates and 5000 CX gates will go through that many copy operations, clearly a waste. Can we modify the datastructures to optimize this?
Along the same lines, there are currently other kinds of information in a gate instance that should be static and known before instantiation, like the name, number of qubits, or definitions (for non-parameterized gates, but also maybe for parameterized ones). It seems like a refactoring is in order.
The text was updated successfully, but these errors were encountered: