OnsiteTerms¶
full name: tenpy.networks.terms.OnsiteTerms
parent module:
tenpy.networks.terms
type: class
-
class
tenpy.networks.terms.
OnsiteTerms
(L)[source]¶ Bases:
object
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
- Lint
Number of sites.
- Attributes
- Lint
Number of sites.
- onsite_termslist of dict
Filled by meth:add_onsite_term. For each index i a dictionary
{'opname': strength}
defining the onsite terms.
Methods
add_onsite_term
(self, strength, i, op)Add a onsite term on a given MPS site.
add_to_graph
(self, graph)Add terms from
onsite_terms
to an MPOGraph.add_to_nn_bond_Arrays
(self, H_bond, sites, …)Add
self.onsite_terms
into nearest-neighbor bond arrays.remove_zeros
(self[, tol_zero])Remove entries close to 0 from
onsite_terms
.to_Arrays
(self, sites)Convert the
onsite_terms
into a list of np_conserved Arrays.to_TermList
(self)Convert
onsite_terms
into aTermList
.-
add_onsite_term
(self, strength, i, op)[source]¶ Add a onsite term on a given MPS site.
- Parameters
- strengthfloat
The strength of the term.
- iint
The MPS index of the site on which the operator acts. We require
0 <= i < L
.- opstr
Name of the involved operator.
-
add_to_graph
(self, graph)[source]¶ Add terms from
onsite_terms
to an MPOGraph.- Parameters
- graph
MPOGraph
The graph into which the terms from
onsite_terms
should be added.
- graph
-
remove_zeros
(self, tol_zero=1e-15)[source]¶ Remove entries close to 0 from
onsite_terms
.- Parameters
- tol_zerofloat
Entries in
onsite_terms
with strength < tol_zero are considered to be zero and removed.
-
add_to_nn_bond_Arrays
(self, H_bond, sites, finite, distribute=(0.5, 0.5))[source]¶ Add
self.onsite_terms
into nearest-neighbor bond arrays.- Parameters
- H_bondlist of {
Array
| None} The
coupling_terms
rewritten assum_i H_bond[i]
for MPS indicesi
.H_bond[i]
acts on sites(i-1, i)
,None
represents 0. Legs of eachH_bond[i]
are['p0', 'p0*', 'p1', 'p1*']
. Modified in place.- siteslist of
Site
Defines the local Hilbert space for each site. Used to translate the operator names into
Array
.- 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]
).- finitebool
Boundary conditions of the MPS,
MPS.finite
. If finite, we distribute the onsite term of the
- H_bondlist of {