MomentumMPS

Inheritance Diagram

Inheritance diagram of tenpy.networks.momentum_mps.MomentumMPS

Methods

MomentumMPS.__init__(Xs, uMPS, p[, n_sites])

MomentumMPS.copy()

Returns a copy of self.

MomentumMPS.from_hdf5(hdf5_loader, h5gr, subpath)

Load instance from a HDF5 file.

MomentumMPS.get_X(i[, copy])

Return (view of) X at site i.

MomentumMPS.save_hdf5(hdf5_saver, h5gr, subpath)

Export self into a HDF5 file.

MomentumMPS.set_X(i, X)

Set X at site i.

class tenpy.networks.momentum_mps.MomentumMPS(Xs, uMPS, p, n_sites=1)[source]

Bases: object

A Matrix Product State, finite (MPS) or infinite (iMPS).

Parameters:
  • Xs (list of Array) – Excitation tensors for each site of the unit cell.

  • uMPS (UniformMPS) – The uniform MPS on which the excitations are based.

  • p (float) – The momentum of the state.

  • n_sites (int) – Number of sites for each excitation.

dtype

The data type of the _X.

Type:

type

_X

The excitation matrices of the MPS. Labels are vL, p1, ..., p{n_sites-1}, vR.

Type:

list of Array

uMPS_GS

The uniform MPS, representing the ground state.

Type:

UniformMPS

p

The momentum of the state.

Type:

float

n_sites

Number of sites for each excitation.

Type:

int

copy()[source]

Returns a copy of self.

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().

Specifically, it saves _X as "tensors", uMPS_GS as "GS_uMPS", and p as "momentum". Moreover, it saves n_sites as HDF5 attributes.

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.

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

get_X(i, copy=False)[source]

Return (view of) X at site i.

Parameters:
  • i (int) – Index choosing the site.

  • copy (bool) – Whether to return a copy even if form matches the current form.

Returns:

X – The excitation ‘matrix’ X at site i with leg labels 'vL', 'p1', ..., 'p{n_sites-1}', 'vR'. May be a view of the matrix (if copy=False) or a copy (if copy=True).

Return type:

Array

set_X(i, X)[source]

Set X at site i.

Parameters:
  • i (int) – Index choosing the site.

  • X (Array) – The ‘matrix’ at site i. No copy is made! Should have leg labels 'vL', 'p1', ..., 'p{n_sites-1}', 'vR' (not necessarily in that order).