HOWTO /
TimeDependentHamiltoniansSuppose that we want to evolve a state {$\Psi(t=0)\rangle$} according to the Schrödinger equation {$$\frac{\mathrm{d}}{\mathrm{d}t} \Psi(t)\rangle =  \mathrm{i} H(t) \Psi(t)\rangle,$$} where the Hamiltonian operator {$H(t)$} is timedependent. To do this, we can use a time evolution algorithm such as TEBD or TDVP where the Hamiltonian is updated each timestep. While we could simply use {$H(t)$} for a timestep starting at time {$t$}, we can get more a more accurate simulation of the evolution by using a Magnus expansion of the Hamiltonian (see Sec. 5.4 in Ref. [1]). To evolve from time {$t$} to {$t+\Delta t$}, we use the matrix exponential {$$\Psi(t+\Delta t)\rangle = \exp(\Omega(t, \Delta t)) \Psi(t)\rangle,$$} where {$\Omega(t, \Delta t)$} is approximated using a Magnus expansion. By simply using the Hamiltonian at the midpoint, we obtain a secondorder Magnus expansion {$$\Omega^{[2]}(t, \Delta t) = \mathrm{i}\Delta t H \left( t + \frac{\Delta t}{2} \right).$$} For greater accuracy, we could use a fourth order Magnus expansion (Eq. 254 in Ref. [1]) {$$\Omega^{[4]}(t, \Delta t) = \frac{\mathrm{i}\Delta t}{2} (H_1 + H_2) + \frac{\Delta t^2 \sqrt{3}}{12} [H_1, H_2],$$} where {$$H_1 = H\left(t + \left(\frac{1}{2}  \frac{\sqrt{3}}{6}\right) \Delta t\right), \qquad H_2 = H\left(t + \left(\frac{1}{2} + \frac{\sqrt{3}}{6}\right) \Delta t\right).$$} Note that, since we use the commutator of the Hamiltonian at two points in time for the fourthorder Magnus expansion, the MPO used to represent the operator {$\Omega^{[4]}(t, \Delta t)$} will have a larger bond dimension and hence a greater computational cost: we could also use higherorder Magnus expansions, but these will generally involve more nested commutators, which will again increase the computational cost. Currently, timedependent Hamiltonians are implemented in To perform a simulation with a timedependent Hamiltonian using one of these tools, the Hamiltonian is specified as normal, but $ mpitdvp w psi H "lattice:H_zz+(2t/10)*H_x" o psi t 0.01 n 2000 s 10 xd 1e10 Most basic elementary functions (e.g. sin, cos, exp, log) can be used to specify the time depdence of the Hamiltonian. Alternatively, the 0.0 2.00000000 0.1 1.99000833 0.2 1.96013316 0.3 1.91067298 ... 10.0 0.00000000 (where the first column specifies the time and the second specifies {$h_x$}: note that we cannot use files with column headers) then we can use the $ mpitdvp w psi H "lattice:H_zz + filegrid(data.dat, t/0.1, 1) * H_x" o psi t 0.01 n 2000 s 10 xd 1e10 The expressions in the table can be numbers, or any expression which can be read by the toolkit; if the expression contains spaces, then you can use quotes (e.g. References[1] S. Blanes, F. Casas, J.A. Oteo, J. Ros, The Magnus expansion and some of its applications, Physics Reports 470, 151 (2009), doi:10.1016/j.physrep.2008.11.001, arXiv:0810.5488.
