MPSGeometry

Inheritance Diagram

Inheritance diagram of tenpy.networks.mps.MPSGeometry

Methods

MPSGeometry.__init__(sites, bc[, ...])

MPSGeometry.get_site(i)

Get the i-th site.

MPSGeometry.shift_Array_unit_cells(arr, ...)

Shift an Array by an integer multiple of unit cells.

MPSGeometry.shift_Site_unit_cells(site, ...)

Shift a site by an integer multiple of unit cells.

MPSGeometry.shift_charges_unit_cells(...)

Shift charges by an integer multiple of unit cells.

MPSGeometry.test_sanity()

Class Attributes and Properties

MPSGeometry.L

Number of physical sites; for an iMPS the len of the MPS unit cell.

MPSGeometry.N_sites_per_hor_spacing

Number of sites per horizontal lattice spacing.

MPSGeometry.dim

List of local physical dimensions.

MPSGeometry.finite

Distinguish MPS vs iMPS.

MPSGeometry.nontrivial_bonds

Slice of the non-trivial bond indices, depending on self.bc.

class tenpy.networks.mps.MPSGeometry(sites, bc, unit_cell_width=None)[source]

Bases: object

Base class providing methods regarding the 1D geometry of MPS-like tensornetworks.

Parameters:
  • sites (list of Site) – Defines the local Hilbert space for each site.

  • bc ('finite' | 'segment' | 'infinite') – Boundary conditions as described in the table of the module doc-string.

  • unit_cell_width (int) – See mps_unit_cell_width.

chinfo

The nature of the charge.

Type:

ChargeInfo

sites

Defines the local Hilbert space for each site.

Type:

list of Site

bc

Boundary conditions as described in the table of the module doc-string.

Type:

'finite' | 'segment' | 'infinite'

unit_cell_width

The width (i.e. length along the first dimension) of an MPS unit cell, in units of the lattice spacing. It is given by mps_unit_cell_width. For a Chain, this is just the length of the chain. Is used for Dipole Conservation or MPS.correlation_length2().

Type:

int

property L

Number of physical sites; for an iMPS the len of the MPS unit cell.

property dim

List of local physical dimensions.

property finite

Distinguish MPS vs iMPS.

True for an MPS (bc='finite', 'segment'), False for an iMPS (bc='infinite').

property nontrivial_bonds

Slice of the non-trivial bond indices, depending on self.bc.

property N_sites_per_hor_spacing

Number of sites per horizontal lattice spacing.

This is the number of MPS sites one has to traverse to travel one lattice spacing in the first dimension, such that self.unit_cell_width * N_sites_per_hor_spacing == self.L.

shift_charges_unit_cells(charges, num_unit_cells)[source]

Shift charges by an integer multiple of unit cells.

See the notes on Dipole Conservation.

A unit cell has length L and a shift by one unit cell is purely horizontal and shifts by unit_cell_width lattice spacings.

Essentially, this is a convenience wrapper around \(tenpy.linalg.charges.ChargeInfo.shift_charges_horizontal\).

Parameters:
  • charges (2D ndarray of dtype QTYPE) – The charges to shift.

  • num_unit_cells (int) – The number of unit cells.

Returns:

The shifted charges.

Return type:

2D ndarray of dtype QTYPE

shift_Site_unit_cells(site, num_unit_cells)[source]

Shift a site by an integer multiple of unit cells.

See the notes on Dipole Conservation.

A unit cell has length L and a shift by one unit cell is purely horizontal and shifts by unit_cell_width lattice spacings.

Parameters:
  • site (Site) – The site to shift.

  • num_unit_cells (int) – The number of unit cells.

Returns:

A new site with shifted charges, or the unmodified input site if the shift is trivial.

Return type:

Site

shift_Array_unit_cells(arr, num_unit_cells, inplace: bool = False)[source]

Shift an Array by an integer multiple of unit cells.

See the notes on Dipole Conservation.

A unit cell has length L and a shift by one unit cell is purely horizontal and shifts by unit_cell_width lattice spacings.

Parameters:
  • arr (Array) – The site to shift.

  • num_unit_cells (int) – The number of unit cells.

  • inplace (bool) – If the array (its legs, qtotal) can be modified in-place. Otherwise (default) we make a shallow copy.

Returns:

The shifted array.

Return type:

Array

get_site(i)[source]

Get the i-th site.

This is self.sites[i] if i is in the unit cell and takes care of shifting the charges otherwise.