Properties#

Geometry#

The number of sites of MPS/MPO psi can be read as psi.N or len(psi). Iterating through sites is supported by

MpsMpoOBC.sweep(to='last', df=0, dl=0) Iterator[int]#

Generator of indices of all sites going from the first site to the last site, or vice-versa.

Parameters:
  • to (str) – ‘first’ or ‘last’.

  • df (int) – shift iterator by \({\rm df}\ge 0\) from the first site.

  • dl (int) – shift iterator by \({\rm dl}\ge 0\) from the last site.

Symmetry#

The symmetry of the MPS/MPO is inherited from the symmetry of yastn.Tensor’s forming it. The symmetries of those tensors, and other config settings, have to be matching as they are contracted along the virtual dimension. As such, the global MPS/MPO symmetry is a consequence of the symmetry of local tensors. Config of MPS/MPO psi can be accessed via property psi.config.

Index convention#

MPS is built from tensors with a single physical index and two virtual indices. MPO tensors have an additional physical index. The number of physical indices can be accessed through the property psi.nr_phys.

The index convention for MPS/MPO tensors is: 0th index corresponds to the left virtual space, i.e, in the direction of the first MPS/MPO site. 1st index is physical (ket), and 2nd index corresponds to the right virtual space, i.e., in the direction of the last MPS/MPO site. For MPO, the last 3rd index is also physical (bra). We typically assume the signatures \(s=(-1, +1, +1)\) for MPS tensors and \(s=(-1, +1, +1, -1)\) for MPO tensors.

# indices of the individual tensors in MPS
         ___
(-1) 0--|___|--2 (+1)
          |
          1 (ket; +1)

# indices of the individual tensors in MPO. The physical indices
# are ordered consistently with the usual matrix notation,
# i.e., O = \sum_{ij} O_ij |i><j|

          3 (bra; -1)
         _|_
(-1) 0--|___|--2 (+1)
          |
          1 (ket; +1)

Physical and virtual spaces#

In the case of MPS/MPO with no explicit symmetry (dense tensors), the virtual space \(V_{j,j+1}\) for \((j,j+1)\) bond is \(\mathbb{R}^{D_{j,j+1}}\) or \(\mathbb{C}^{D_{j,j+1}}\). Typically, the maximal permitted dimension of these virtual spaces is the control parameter for matrix product representation. For symmetric MPS/MPO the virtual space is a direct sum of simple spaces, dubbed sectors, labeled by symmetry charges \(t\)

\[V_{j,j+1} = \bigoplus_{t} V^t_{j,j+1},\quad \textrm{where}\quad V^t_{j,j+1} = \mathbb{R}^{D^t_{j,j+1}}\ \textrm{or}\ \mathbb{C}^{D^t_{j,j+1}}.\]

The effective control parameter is the maximal total dimension \(D_{\text{total}} = \sum_t D_t\), where the sums goes over blocks labeled by symmetry charges \(t\) and \(D_t\) is corresponding bond dimension.

A number of functions allow extracting this information directly from MPS/MPO:

MpsMpoOBC.get_bond_dimensions() Sequence[int]#

Returns total bond dimensions of all virtual spaces along MPS/MPO from the first to the last site, including “trivial” leftmost and rightmost virtual spaces. This gives a tuple with N+1 elements.

MpsMpoOBC.get_bond_charges_dimensions() Sequence[dict[Sequence[int], int]]#

Returns list of charge sectors and their dimensions for all virtual spaces along MPS/MPO from the first to the last site, including “trivial” leftmost and rightmost virtual spaces. Each element of the list is a dictionary {charge: sectorial bond dimension}. This gives a list with N+1 elements.

MpsMpoOBC.get_virtual_legs() Sequence[yastn.Leg]#

Returns yastn.Leg of all virtual spaces along MPS/MPO from the first to the last site, in the form of the 0th leg of each MPS/MPO tensor. Finally, append the rightmost virtual spaces, i.e., 2nd leg of the last tensor, conjugating it so that all legs have signature -1. This gives a list with N+1 elements.

MpsMpoOBC.get_physical_legs() Sequence[yastn.Leg] | Sequence[tuple(yastn.Leg, yastn.Leg)]#

Returns yastn.Leg of all physical spaces along MPS/MPO from the first to the last site. For MPO return a tuple of ket and bra spaces for each site.