Skip to content

circuit deepcopy too slow: singleton gates #3800

@ajavadia

Description

@ajavadia

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.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions