OnsiteTerms
full name: tenpy.networks.terms.OnsiteTerms
parent module:
tenpy.networks.termstype: class
Inheritance Diagram

Methods
|
|
|
Add a onsite term on a given MPS site. |
|
Add terms from |
|
Add |
|
Load instance from a HDF5 file. |
Maximum range of the terms. |
|
|
Remove entries close to 0 from |
|
Export self into a HDF5 file. |
|
Convert the |
Convert |
- class tenpy.networks.terms.OnsiteTerms(L)[source]
Bases:
Hdf5ExportableOperator 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
Sitewithget_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.
- add_to_graph(graph)[source]
Add terms from
onsite_termsto an MPOGraph.- Parameters:
graph (
MPOGraph) – The graph into which the terms fromonsite_termsshould be added.
- to_Arrays(sites)[source]
Convert the
onsite_termsinto a list of np_conserved Arrays.
- remove_zeros(tol_zero=1e-15)[source]
Remove entries close to 0 from
onsite_terms.- Parameters:
tol_zero (float) – Entries in
onsite_termswith 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_termsinto nearest-neighbor bond arrays.- Parameters:
H_bond (list of {
Array| None}) – Thecoupling_termsrewritten assum_i H_bond[i]for MPS indicesi.H_bond[i]acts on sites(i-1, i),Nonerepresents 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_termsinto 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().- Parameters:
hdf5_loader (
Hdf5Loader) – Instance of the loading engine.h5gr (
Group) – HDF5 group which is represent the object to be constructed.subpath (str) – The name of h5gr with a
'/'in the end.
- Returns:
obj – Newly generated class instance containing the required data.
- Return type:
cls
- 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'.