JuliaQuantumControl / QuantumPropagators.jl

Propagators for Quantum Dynamics and Optimal Control
https://juliaquantumcontrol.github.io/QuantumPropagators.jl/
MIT License
16 stars 4 forks source link

Implement lazy Generator / Operator types #33

Closed goerz closed 1 year ago

goerz commented 1 year ago

We implement a data structure for a time-dependent generator and a static operator that can be evaluated lazily. That is, H(t) = H₀ + ϵ₁(t) H₁ + ϵ₂(t) H₂ is applied to a state |Ψ⟩ by first applying ϵ₂(t) H₂, then ϵ₁(t) H₁, and lastly H₀ and summing the resulting states. This is in contrast to summing up the terms of H(t) into a single matrix and then applying that to the vector. The lazy approach is significantly faster, by at least a factor of 3, and possibly much more for sparse matrices.

This commit also includes some larger changes: