The current class Manipulator is a bit of a mix of different responsibilities; also it lives in the util package but somehow depends on everything else, which smells a tiny bit. Its only overarching theme is that it transparently does the correct thing for density operators and wave functions.
The Manipulator class should be split according to the different functionalities.
The various transformations between DVR / FBR should go to the representation package, maybe Representation class, maybe some helper class. done as part of [#144]; moved to RepresentationFunctions.hpp
- adding/removing weights should also be done by free functions (see RepresentationFunctions.hpp)
- The calculation of expectation values and the norm should be moved to independent functions in the operator package (see also [#121])
- there should also be a calculation of the standard deviation of an operator.
- some of the private methods (checking for wavepacket vs. density operator) have already been implemented in the Representation class and could be removed.
Got a bit carried away, and implemented some additional things
- calculation of norm was bad, because norm means something different for wavefunctions and densities. Instead, split into two different concerns / functions: calculation of trace and normalization of a state
- added projection onto some subspace (using a projection operator), because this is also different for wave functions and density operators
- updated the LoggingObserver, which was faulty; it did not consistently normalize states, which would give, e.g., incorrect energies if the state was not normalized (e.g., due to a NIP)
Diff:
Diff:
Related
Tickets:
#121Diff:
Related
Tickets:
#121Diff:
Related
Tickets:
#121Tickets:
#144Diff:
Related
Tickets:
#121Tickets:
#144Diff:
Related
Tickets:
#121Diff: