Refactor circuit library to not subclass QuantumCircuit
#12293
Labels
mod: circuit
Related to the core of the `QuantumCircuit` class or the circuit library
type: epic
A theme of work that contain sub-tasks
type: feature request
New feature or request
What should we add?
For qiskit 2.0 it would be good to refactor the circuit library to be a collection of circuit construction functions rather than
QuantumCircuit
subclasses. At the end of the day the majority of the classes in the circuit library are just using the constructor to build aQuantumCircuit
and returning themselves and not specializing the circuit class. Moving to a function that returns aQuantumCircuit
object will remove a layer in the type hierarchy and also make it clearer that the classes are just circuits. It also will make rust implementations of these functions easier after #12205 merges.The one exception are the
BlueprintCircuit
classes. These try to adjust the internals of theQuantumCircuit
to make them dynamically build (or rebuild/reconstruct if the properties change) based on provided properties. However, this functionality is not necessary anymore and it adds a lot of complexity to the classes that use it.__init__
(in non-BlueprintCircuit
classes).BlueprintCircuit
QuantumCircuit
subclasses in the circuit library.The text was updated successfully, but these errors were encountered: