TermList

Inheritance Diagram

Inheritance diagram of tenpy.networks.terms.TermList

Methods

TermList.__init__(terms, strength)

Initialize self.

TermList.from_hdf5(hdf5_loader, h5gr, subpath)

Load instance from a HDF5 file.

TermList.order_combine(sites)

Order and combine operators in each term.

TermList.save_hdf5(hdf5_saver, h5gr, subpath)

Export self into a HDF5 file.

TermList.to_OnsiteTerms_CouplingTerms(sites)

Convert to OnsiteTerms and CouplingTerms

class tenpy.networks.terms.TermList(terms, strength)[source]

Bases: tenpy.tools.hdf5_io.Hdf5Exportable

A list of terms (=operator names and sites they act on) and associated strengths.

A representation of terms, similar as OnsiteTerms, CouplingTerms and MultiCouplingTerms.

This class does not store operator strings between the sites. Jordan-Wigner strings of fermions are added during conversion to (Multi)CouplingTerms.

Parameters
  • terms (list of list of (str, int)) – List of terms where each term is a list of tuples (opname, i) of an operator name and a site i it acts on. For Fermions, the order is the order in the mathematic sense, i.e., the right-most/last operator in the list acts last.

  • strengths (list of float/complex) – For each term in terms an associated prefactor or strength (e.g. expectation value).

terms

List of terms where each term is a tuple (opname, i) of an operator name and a site i it acts on.

Type

list of list of (str, int)

strengths

For each term in terms an associated prefactor or strength (e.g. expectation value).

Type

1D ndarray

to_OnsiteTerms_CouplingTerms(sites)[source]

Convert to OnsiteTerms and CouplingTerms

Performs Jordan-Wigner transformation for fermionic operators.

Parameters

sites (list of Site) – Defines the local Hilbert space for each site. Used to check whether the operators need Jordan-Wigner strings. The length is used as L for the onsite_terms and coupling_terms.

Returns

order_combine(sites)[source]

Order and combine operators in each term.

Parameters

sites (list of Site) – Defines the local Hilbert space for each site. Used to check whether the operators anticommute (= whether they need Jordan-Wigner strings) and for multiplication rules.

See also

order_and_combine_term()

does it for a single term.

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__ with save_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.