Skip to main content

RealMPS

Base class: Object

Matrix Product State (MPS) of Real values. Compressed representation of a large-dimensional tensor, well suited for state vectors of some 1D many-body quantum mechanics problems.

Factories

random_mps(integer length, integer physical_size, integer bond_size, as_real as_real) -> RealMPS

Generate a random Matrix Product State (MPS) with Real values.

Parameters

  • length: Number of sites in the MPS chain.
  • physical_size: Dimension of the physical index at each site.
  • bond_size: Maximum bond dimension between adjacent sites.
  • as_real: The desired scalar type

Returns

A random RealMPS with the specified dimensions. Each site tensor has shape [bond_size, physical_size, bond_size].

Constructors

RealMPS(integer length) -> RealMPS

Construct a Matrix Product State (MPS) of Real values with the specified number of sites.

Parameters

  • length: Number of sites in the MPS.

RealMPS(const RealMPS other) -> RealMPS

Copy constructor for Matrix Product State (MPS) of Real values.

Parameters

  • other: MPS to copy.

Symbols

NameDescription
*Scalar multiplication of an Matrix Product State (MPS) with Real values.
*=In-place scalar multiplication of an Matrix Product State (MPS) with Real values.
+Compute the sum of two Matrix Product States (MPS) with Real values.
+=In-place addition of two Matrix Product States (MPS) with Real values.
-Compute the difference of two Matrix Product States (MPS) with Real values.
-=In-place subtraction of two Matrix Product States (MPS) with Real values.
/Scalar division of an Matrix Product State (MPS) with Real values.
/=In-place scalar division of an Matrix Product State (MPS) with Real values.
=Assignment operator for Matrix Product State (MPS) of Real values.
[]Access a specific site tensor in the Matrix Product State (MPS) by index. Supports negative indexing. :::tip Use the setter set_site if you want to modify the MPS. :::

Members

NameDescription
adjust_orthogonality_centerUpdate the orthogonality center position without modifying any tensors. Use this after manually transforming the Matrix Product State (MPS) tensors in a way that changes the orthogonality center location.
capacityGet the current capacity of the Matrix Product State (MPS).
compressCompress the Matrix Product State (MPS) using the default truncation options. Uses the truncation tolerance and maximum bond dimension previously set via set_truncation_tol() and set_max_bond() with Real values.
dotCompute the inner product (overlap, dot product) between this Matrix Product State (MPS) and another MPS.
get_orthogonality_centerGet the position of the orthogonality center in the Matrix Product State (MPS).
get_siteGet a copy of the site tensor at the specified index in the Matrix Product State (MPS).
get_truncation_max_bondGet the maximum bond dimension configured for truncation on the Matrix Product State (MPS).
get_truncation_tolGet the truncation tolerance configured on the Matrix Product State (MPS).
is_canonicalCheck if the Matrix Product State (MPS) is in canonical form (has a valid orthogonality center).
matrix_elementCompute the matrix element braO^ket\langle \text{bra} \| \hat{O} \| \text{ket} \rangle of a quantum operator between two Matrix Product State (MPS) states with Real values.
max_bondGet the maximum bond dimension across all bonds in the MPS.
normalizeSet the 2-norm of the Matrix Product State (MPS) to one. Modifies the MPS in place.
normalizedReturn a normalized copy of the Matrix Product State (MPS) with 2-norm equal to one.
open_boundarySet the Matrix Product State (MPS) to open boundary conditions.
periodic_boundarySet the Matrix Product State (MPS) to periodic (closed) boundary conditions.
push_backAppend a site tensor to the end of the Matrix Product State (MPS).
reserveReserve capacity for the Matrix Product State (MPS). Used as system size for otherwise uninitialized MPS operation with Operators
resizeResize a Matrix Product State (MPS) to a target size with empty tensors for position beyond the current end of the MPS.
set_boundary_likeCopy the boundary conditions from another Matrix Product State (MPS) or Matrix Product Operator (MPO).
set_orthogonality_centerSet the orthogonality center to a specific site. This brings the Matrix Product State (MPS) into canonical form with all tensors to the left in left-canonical form and all tensors to the right in right-canonical form.
set_siteSet the site tensor at the specified index in the Matrix Product State (MPS).
set_truncation_max_bondSet the maximum bond dimension kept by lossy SVD-based operations on the Matrix Product State (MPS).
set_truncation_tolSet the truncation tolerance used by lossy SVD-based operations on the Matrix Product State (MPS).
sizeGet the number of sites in the Matrix Product State (MPS).
unset_orthogonality_centerRemove the orthogonality center, marking the Matrix Product State (MPS) as non-canonical. :::tip The MPS content is not modified by this method.:::
vectorConvert a Matrix Product State (MPS) to a full state vector representation.