Description
The density matrix representation (dNode, dEdge, etc.) is only used in the deterministic noise-aware simulator that is part of mqt-ddsim and nowhere else. Together with the NoiseFunctionality
, the respective code still mostly lives in mqt-core.
While this might have made sense in the beginning, it makes the code of the DD Package in mqt-core substantially more complex. With no one actively working on the noise functionality and no one around for actively maintaining it, this has become more of a burden than a benefit.
I would thus propose to move the density matrix code entirely to mqt-ddsim into a separate DensityMatrixPackage that implements all the respective functionality.
This would entail:
- creating such a class with all the required functionality in mqt-ddsim, which essentially means some degree of code duplication. But I would deem that acceptable here.
- in the course of creating that package, simplifying all the functionality that is now only expected to work on density matrices or related structures.
- move the NoiseFunctionality from mqt-core to mqt-ddsim.
- move the respective tests to mqt-ddsim (deduplicating wherever reasonable)
- after everything is moved and working in mqt-ddsim (at least in a PR), strip all the density matrix functionality from mqt-core and simplify the code wherever feasible.
In the end, this makes the DD Package implementation in mqt-core much more lenient and eliminates quite some special cases. In addition, it also makes the density matrix related code much more straight forward and puts it in the place where it is actually used.
Finally, the density matrix code is then much more "local" and isolated, which hopefully makes it easier to maintain and won't require as much fixing when we change things in mqt-core.
Overall, this should be a win-win for all use cases.