OnsiteTerms¶
full name: tenpy.networks.terms.OnsiteTerms
parent module:
tenpy.networks.terms
type: class
Inheritance Diagram
Methods

Initialize self. 

Add a onsite term on a given MPS site. 

Add terms from 

Add 

Load instance from a HDF5 file. 

Remove entries close to 0 from 

Export self into a HDF5 file. 

Convert the 
Convert 

class
tenpy.networks.terms.
OnsiteTerms
(L)[source]¶ Bases:
tenpy.tools.hdf5_io.Hdf5Exportable
Operator names, site indices and strengths representing onsite terms.
Represents a sum of onsite terms where the operators are only given by their name (in the form of a string). What the operator represents is later given by a list of
Site
withget_op()
. Parameters
L (int) – Number of sites.

onsite_terms
¶ Filled by meth:add_onsite_term. For each index i a dictionary
{'opname': strength}
defining the onsite terms. Type
list of dict

add_to_graph
(graph)[source]¶ Add terms from
onsite_terms
to an MPOGraph. Parameters
graph (
MPOGraph
) – The graph into which the terms fromonsite_terms
should be added.

to_Arrays
(sites)[source]¶ Convert the
onsite_terms
into a list of np_conserved Arrays.

remove_zeros
(tol_zero=1e15)[source]¶ Remove entries close to 0 from
onsite_terms
. Parameters
tol_zero (float) – Entries in
onsite_terms
with strength < tol_zero are considered to be zero and removed.

add_to_nn_bond_Arrays
(H_bond, sites, finite, distribute=(0.5, 0.5))[source]¶ Add
self.onsite_terms
into nearestneighbor bond arrays. Parameters
H_bond (list of {
Array
 None}) – Thecoupling_terms
rewritten assum_i H_bond[i]
for MPS indicesi
.H_bond[i]
acts on sites(i1, i)
,None
represents 0. Legs of eachH_bond[i]
are['p0', 'p0*', 'p1', 'p1*']
. Modified in place.sites (list of
Site
) – Defines the local Hilbert space for each site. Used to translate the operator names intoArray
.distribute ((float, float)) – How to split the onsite terms (in the bulk) into the bond terms to the left (
distribute[0]
) and right (distribute[1]
).finite (bool) – Boundary conditions of the MPS,
MPS.finite
. If finite, we distribute the onsite term of the

to_TermList
()[source]¶ Convert
onsite_terms
into aTermList
. Returns
term_list – Representation of the terms as a list of terms.
 Return type

classmethod
from_hdf5
(hdf5_loader, h5gr, subpath)[source]¶ Load instance from a HDF5 file.
This method reconstructs a class instance from the data saved with
save_hdf5()
.

save_hdf5
(hdf5_saver, h5gr, subpath)[source]¶ Export self into a HDF5 file.
This method saves all the data it needs to reconstruct self with
from_hdf5()
.This implementation saves the content of
__dict__
withsave_dict_content()
, storing the format under the attribute'format'
. Parameters
hdf5_saver (
Hdf5Saver
) – Instance of the saving engine.h5gr (:class`Group`) – HDF5 group which is supposed to represent self.
subpath (str) – The name of h5gr with a
'/'
in the end.