-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe your design idea/issue
Right now, the ActOnArgs hierarchy design is such that ActOnArgs (the base class) contains all the shared stuff like measurement logs, qid shape, etc., and the subclasses contain their quantum representations. This works, but I've always felt it was a little clunky.
A result of this approach is that ActOnArgs.kron()
, etc., do the kronning of the qid shape, and then calls self._on_kron()
, which delegates the subclasses to kron the quantum states. Again, this works but feels clunky.
It may be worth exploring a change where the quantum part is placed into its own class. So we'd have a StateVectorQuantumState, a DensityMatrixQuantumState, etc, that implement a SimulatorQuantumState interface specifying copy
, kron
, etc. Then instead of requiring ActOnArgs subclasses to implement _on_kron
, the new kron routine is just target.quantum_state = self.quantum_state.kron(other.quantum_state)
.
Ultimately from there we may be able to kill off the subclasses and just make ActOnArgs generic like ActOnArgs[TSimulatorQuantumState]
.
xref #4582, perhaps these quantum classes should go into qis
instead of sim
?