Engine¶
full name: tenpy.algorithms.tebd.Engine
parent module:
tenpy.algorithms.tebd
type: class
Inheritance Diagram
Methods

Initialize self. 

Calculate 
(Real)time evolution with TEBD (time evolving block decimation). 

TEBD algorithm in imaginary time to find the ground state. 


Returns list of necessary steps for the suzuki trotter decomposition. 
Return time steps of U for the Suzuki Trotter decomposition of desired order. 


Evolve by 

Updates the B matrices on a given bond. 

Update a bond with a (possibly nonunitary) U_bond. 

Perform an update suitable for imaginary time evolution. 

Updates either even or odd bonds in unit cell. 
Class Attributes and Properties
truncation error introduced on each nontrivial bond. 

class
tenpy.algorithms.tebd.
Engine
(psi, model, TEBD_params)[source]¶ Bases:
object
Time Evolving Block Decimation (TEBD) ‘engine’.
 Parameters
psi (
MPS
) – Initial state to be time evolved. Modified in place.model (
NearestNeighborModel
) – The model representing the Hamiltonian for which we want to find the ground state.TEBD_params (dict) – Further optional parameters as described in the tables in
run()
andrun_GS()
for more details. Useverbose=1
to print the used parameters during runtime.

verbose
¶ Level of verbosity (i.e. how much status information to print); higher=more output.
 Type

evolved_time
¶ Indicating how long psi has been evolved,
psi = exp(i * evolved_time * H) psi(t=0)
. Type
float  complex

trunc_err
¶ The error of the represented state which is introduced due to the truncation during the sequence of update steps.
 Type

model
¶ The model defining the Hamiltonian.
 Type

_U
¶ Exponentiated H_bond (bond Hamiltonians), i.e. roughly
exp(i H_bond dt_i)
. First list for different dt_i as necessary for the chosen order, second list for the L different bonds. Type
list of list of
Array

_U_param
¶ A dictionary containing the information of the latest created _U. We don’t recalculate _U if those parameters didn’t change.
 Type

_trunc_err_bonds
¶ The local truncation error introduced at each bond, ignoring the errors at other bonds. The ith entry is left of site i.
 Type
list of
TruncationError

_update_index
¶ The indices
i_dt,i_bond
ofU_bond = self._U[i_dt][i_bond]
during update_step.

property
trunc_err_bonds
¶ truncation error introduced on each nontrivial bond.

run
()[source]¶ (Real)time evolution with TEBD (time evolving block decimation).
The following (optional) parameters are read out from the
TEBD_params
.key
type
description
dt
float
Time step.
order
int
 Order of the algorithm.
The total error scales as O(t, dt^order).
N_steps
int
Number of time steps dt to evolve. (The Trotter decompositions of order > 1 are slightly more efficient if more than one step is performed at once.)
trunc_params
dict
Truncation parameters as described in
truncate()
.

run_GS
()[source]¶ TEBD algorithm in imaginary time to find the ground state.
Note
It is almost always more efficient (and hence advisable) to use DMRG. This algorithms can nonetheless be used quite well as a benchmark and for comparison.
The following (optional) parameters are read out from the
TEBD_params
. Useverbose=1
to print the used parameters during runtime.key
type
description
delta_tau_list
list
A list of floats: the timesteps to be used. Choosing a large timestep delta_tau introduces large (Trotter) errors, but a too small time step requires a lot of steps to reach
exp(tau H) > psi0><psi0
. Therefore, we start with fairly large time steps for a quick time evolution until convergence, and the gradually decrease the time step.order
int
Order of the SuzukiTrotter decomposition.
N_steps
int
Number of steps before measurement can be performed
trunc_params
dict
Truncation parameters as described in
truncate()

static
suzuki_trotter_time_steps
(order)[source]¶ Return time steps of U for the Suzuki Trotter decomposition of desired order.
See
suzuki_trotter_decomposition()
for details. Parameters
order (int) – The desired order of the SuzukiTrotter decomposition.
 Returns
time_steps – We need
U = exp(i H_{even/odd} delta_t * dt)
for the dt returned in this list. Return type
list of float

static
suzuki_trotter_decomposition
(order, N_steps)[source]¶ Returns list of necessary steps for the suzuki trotter decomposition.
We split the Hamiltonian as \(H = H_{even} + H_{odd} = H[0] + H[1]\). The SuzukiTrotter decomposition is an approximation \(\exp(t H) \approx prod_{(j, k) \in ST} \exp(d[j] t H[k]) + O(t^{order+1 })\).
 Parameters
order (int) – The desired order of the SuzukiTrotter decomposition.
 Returns
ST_decomposition – Indices
j, k
of the timestepsd = suzuki_trotter_time_step(order)
and the decomposition of H. They are chosen such that a subsequent application ofexp(d[j] t H[k])
to a given statepsi>
yields(exp(N_steps t H[k]) + O(N_steps t^{order+1}))psi>
. Return type

calc_U
(order, delta_t, type_evo='real', E_offset=None)[source]¶ Calculate
self.U_bond
fromself.bond_eig_{vals,vecs}
.This function calculates
U_bond = exp(i dt (H_bondE_offset_bond))
fortype_evo='real'
, orU_bond = exp( dt H_bond)
fortype_evo='imag'
.
For first order (in delta_t), we need just one
dt=delta_t
. Higher order requires smaller dt steps, as given bysuzuki_trotter_time_steps()
. Parameters
order (int) – Trotter order calculated U_bond. See update for more information.
delta_t (float) – Size of the timestep used in calculating U_bond
type_evo (
'imag'  'real'
) – Determines whether we perform real or imaginary timeevolution.E_offset (None  list of float) – Possible offset added to H_bond for realtime evolution.

update
(N_steps)[source]¶ Evolve by
N_steps * U_param['dt']
. Parameters
N_steps (int) – The number of steps for which the whole lattice should be updated.
 Returns
trunc_err – The error of the represented state which is introduced due to the truncation during this sequence of update steps.
 Return type

update_step
(U_idx_dt, odd)[source]¶ Updates either even or odd bonds in unit cell.
Depending on the choice of p, this function updates all even (
E
, odd=False,0) or odd (O
) (odd=True,1) bonds:  B0  B1  B2  B3  B4  B5  B6                  E   E   E              O   O   O       
Note that finite boundary conditions are taken care of by having
Us[0] = None
. Parameters
U_idx_dt (int) – Time step index in
self._U
, evolve withUs[i] = self.U[U_idx_dt][i]
at bond(i1,i)
.odd (bool/int) – Indication of whether to update even (
odd=False,0
) or even (odd=True,1
) sites
 Returns
trunc_err – The error of the represented state which is introduced due to the truncation during this sequence of update steps.
 Return type

update_bond
(i, U_bond)[source]¶ Updates the B matrices on a given bond.
Function that updates the B matrices, the bond matrix s between and the bond dimension chi for bond i. The correponding tensor networks look like this:
 SB1B2 B1B2       theta: U_bond C: U_bond     
 Parameters
 Returns
trunc_err – The error of the represented state which is introduced by the truncation during this update step.
 Return type

update_imag
(N_steps)[source]¶ Perform an update suitable for imaginary time evolution.
Instead of the even/odd brick structure used for ordinary TEBD, we ‘sweep’ from left to right and right to left, similar as DMRG. Thanks to that, we are actually able to preserve the canonical form.
 Parameters
N_steps (int) – The number of steps for which the whole lattice should be updated.
 Returns
trunc_err – The error of the represented state which is introduced due to the truncation during this sequence of update steps.
 Return type

update_bond_imag
(i, U_bond)[source]¶ Update a bond with a (possibly nonunitary) U_bond.
Similar as
update_bond()
; but after the SVD just keep the A, S, B canonical form. In that way, one can sweep left or right without using old singular values, thus preserving the canonical form during imaginary time evolution. Parameters
 Returns
trunc_err – The error of the represented state which is introduced by the truncation during this update step.
 Return type