[go: up one dir, main page]

Menu

#245 Get rid of vectors of states

0.4
done
nobody
None
nobody
2024-08-06
2023-12-16
Ulf Lorenz
No

The concept of a generalized state being a vector of states originated from me trying to be as generic as possible. In practice, these concepts are hardly ever needed, but they pollute all interfaces. And those interfaces that are not polluted (e.g., calculation of expectation values) do not work with these generalized states.

The sole point where you want to have them is "ghost states", where you propagate not only a density matrix, but also auxiliary density matrices that encapsulate perturbative effects on the bath. Examples are HEOM or the auxiliary matrices introduced by David Tannor and generalized by a paper of, I think, Ulf Saalmann.

The idea is to map these realities onto the code and interfaces. Thus, the default should be not to have to deal with generalized states. And if we have generalized states, most code (calculation of expectation values etc.) should only work on the "real" state and never see the ghost states.

Acceptance criteria:
* A state holds a tensor and, optionally, a vector of "ghost" states (tensors for the same grid); usually this vector is empty, unused, and incurs no additional cost.
* Utility functions for accessing, querying, setting them etc. should be added.
* Most code only operates on the "real" state and never cares about the ghost states.
* EquationSystem derives from Expression, but expects a state with a given number of ghosts
* We need a function to setup ghost states; usually they start as zero and only grow during propagation.
* Remove all the traces, mostly in the propagation classes, of using vectors of states; this is handled implicitly by having ghost states and an EquationSystem.
* update demos where the new interface makes more sense. E.g. the MorseOscillator/Thermal demo could use solvers directly, but that is cumbersome right now because you have to deal with vectors suddenly.


I could not get completely rid of the distinction between States and StatesWithAuxiliaries. Because the latter have very specialized use-cases, I decided to implement all interfaces to work with States, and only add rudimentary functionality for the StatesWithAuxiliaries. These have special Solvers (EquationSystemSolvers) with only OdeSolvers implemented right now.

Effects are generally small. For small systems (1D), the changes give a noticeable speedup of 10-15%.

No demo has been added for the equation systems. See, however, (#253), where this should be done.

Discussion

  • Ulf Lorenz

    Ulf Lorenz - 2024-04-01
    • Milestone: 0.5 goal --> 0.4
     
  • Ulf Lorenz

    Ulf Lorenz - 2024-05-09
    • status: open --> assigned
    • assigned_to: Ulf Lorenz
     
  • Ulf Lorenz

    Ulf Lorenz - 2024-05-10
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,3 +11,4 @@
     * EquationSystem derives from Expression, but expects a state with a given number of ghosts
     * We need a function to setup ghost states; usually they start as zero and only grow during propagation.
     * Remove all the traces, mostly in the propagation classes, of using vectors of states; this is handled implicitly by having ghost states and an EquationSystem.
    +* update demos where the new interface makes more sense. E.g. the MorseOscillator/Thermal demo could use solvers directly, but that is cumbersome right now because you have to deal with vectors suddenly.
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2024-08-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -12,3 +12,11 @@
     * We need a function to setup ghost states; usually they start as zero and only grow during propagation.
     * Remove all the traces, mostly in the propagation classes, of using vectors of states; this is handled implicitly by having ghost states and an EquationSystem.
     * update demos where the new interface makes more sense. E.g. the MorseOscillator/Thermal demo could use solvers directly, but that is cumbersome right now because you have to deal with vectors suddenly.
    +
    +----
    +
    +I could not get completely rid of the distinction between States and StatesWithAuxiliaries. Because the latter have very specialized use-cases, I decided to implement all interfaces to work with States, and only add rudimentary functionality for the StatesWithAuxiliaries. These have special Solvers (EquationSystemSolvers) with only OdeSolvers implemented right now.
    +
    +Effects are generally small. For small systems (1D), the changes give a noticeable speedup of 10-15%.
    +
    +No demo has been added for the equation systems. See, however, (#253), where this should be done.
    
    • status: assigned --> done
    • assigned_to: Ulf Lorenz --> nobody
     

Log in to post a comment.