seemps.evolution.euler#
- seemps.evolution.euler(H: MPO, time: float | tuple[float | int | floating | integer, float | int | floating | integer] | Sequence[float | int | floating | integer] | ndarray[tuple[Any, ...], dtype[_ScalarT]], state: MPS, steps: int = 1000, strategy: Strategy = DEFAULT_STRATEGY, callback: Callable[[float, MPS], Any] | None = None, itime: bool = False)[source]#
Solve a Schrodinger equation using the Euler method.
Integrates the Schrodinger equation in real or imaginary time using a first order Euler method. The equation is defined as
\[i\frac{d}{dt}\psi = H(t) \psi\]in real time and as
\[\frac{d}{dt}\psi = -H(t) \psi\]in imaginary time evolution.
The integration algorithm is very simple. It is
\[\psi(t_{n+1}) = \psi(t_{n}) - i \delta t H \psi(t_{n})\]for real time and
\[\psi(t_{n+1}) = \psi(t_{n}) - \delta t H \psi(t_{n})\]for imaginary time evolution. The integration step is deduced from the arguments as explained below.
The time denotes the integration interval.
If it is a single number T, the initial condition is \(t=0\) and the evolution proceeds in steps of \(\delta{t}=T/N\) where N=steps.
If time is a tuple, it contains the initial and final time, and the number of integration steps is deduced from N=steps as \(\delta{t}=T/N\)
If time is a sequence of numbers, starting with the initial condition, and progressing in time steps time[n+1]-time[n].
The Euler algorithm is a very bad integrator and is offered only for illustrative purposes.
- Parameters:
- H
MPO Hamiltonian in MPO form.
- time
Real|tuple[Real,Real] |Sequence[Real] Integration interval, or sequence of time steps.
- state
MPS Initial guess of the ground state.
- steps
int,default= 1000 Integration steps, if not defined by t_span.
- strategy
Strategy,default=DEFAULT_STRATEGY Truncation strategy for MPO and MPS algebra.
- callback
Callable[[float,MPS],Any] |None A callable called after each iteration (defaults to None).
- itimebool,
default=False Whether to solve the imaginary time evolution problem.
- H
- Returns:
- result
MPS|list[Any] Final state after evolution or values collected by callback
- result