pykbe.two_time_var module#
- class pykbe.two_time_var.TwoTimeVar(shape, ntimes=1, dt=0.1, dtype=<class 'numpy.float64'>, restricted=True)[source]#
Bases:
objectClass to store two-time variables.
Methods
alloc([ntimes])Allocate memory.
calc_propagator(Hfunc)Second order Magnus scheme to get \(U(t)\) from \(H(t)\).
free()Free memory.
from_time_dependent_H(Hfunc[, dm, mu])Driver to calculate free \(G\) from time-dependent \(H\).
from_time_independent_H(H[, dm, mu])Driver to calculate free \(G\) from time-independent \(H\).
les_at(i, j)save(filename, groupname)Save variable to HDF5 file.
tri_idx(i, j)Index into a packed lower triangular array.
ret_at
- alloc(ntimes=None)[source]#
Allocate memory.
- Parameters:
- ntimes
int, optional number of time points; by default None
- ntimes
- calc_propagator(Hfunc)[source]#
Second order Magnus scheme to get \(U(t)\) from \(H(t)\).
The propagator is stored in the propagator attribute.
\[U(t) = \mathrm{Texp}\left(-i\int_{t_0}^t H(t')\, dt'\right)\]- Parameters:
- Hfunc
callable() Time-dependent Hamiltonian.
- Hfunc
- from_time_dependent_H(Hfunc, dm=None, mu=0.0)[source]#
Driver to calculate free \(G\) from time-dependent \(H\).
- from_time_independent_H(H, dm=None, mu=0.0)[source]#
Driver to calculate free \(G\) from time-independent \(H\).
- pykbe.two_time_var.calc_lescomp_free(dm, ntimes, lescomp, retcomp)[source]#
Calculate \(G^{<}(t_1, t_2)\) from density matrix and \(G^\mathrm{R}\).
Handles only the case \(t_1 \geq t_2\).
\[G^{<}(t_1, t_2) = G^\mathrm{R}(t_1, t_0) G^{<}(t_0, t_0) G^\mathrm{R}(t_2, t_0)^\dagger\]where \(G^{<}(t_0, t_0) = -i \rho\) is calculated from the density matrix.
- pykbe.two_time_var.retcomp_fast_from_propagator(ntimes, prop, retcomp)[source]#
Calculate \(G^\mathrm{R}(t_1, t_2)\) from propagator.
Handles only the case \(t_1 \geq t_2\).
\[G^\mathrm{R}(t_1, t_2) = -i \theta(t_1 - t_2) U(t_1) U^\dagger(t_2)\]
- pykbe.two_time_var.retcomp_fast_time_independent_H(heigs, heigvecs, ntimes, dt, retcomp)[source]#
Calculate \(G^\mathrm{R}(t_1, t_2)\) from time-indep. Hamiltonian.
Handles only the case \(t_1 \geq t_2\).
\[\begin{split}G^\mathrm{R}(t_1, t_2) &= -i \theta(t_1 - t_2) U(t_1) U^\dagger(t_2) \\ &= -i \theta(t_1 - t_2) \exp\left(-i H (t_1 - t_2)\right).\end{split}\]