Skip to main content

ComplexMPS

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

Factories

make_random_mps(integer length, integer physical_size, integer bond_size) -> ComplexMPS

Generate a random Matrix Product State (MPS) with Complex 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.

Returns

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

make_random_mps(integer length, integer physical_size, integer bond_size, as_complex as_complex) -> ComplexMPS

Generate a random Matrix Product State (MPS) with Complex 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_complex: The desired scalar type

Returns

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

Constructors

ComplexMPS(const ComplexMPS other) -> ComplexMPS

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

Parameters

  • other: MPS to copy.

ComplexMPS(integer length) -> ComplexMPS

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

Parameters

  • length: Number of sites in the MPS.

Symbols

NameDescription
*Scalar multiplication of an Matrix Product State (MPS) with Complex values.
*=In-place scalar multiplication of an Matrix Product State (MPS) with Complex values.
+Compute the sum of two Matrix Product States (MPS) with Complex values.
+=In-place addition of two Matrix Product States (MPS) with Complex values.
-Compute the difference of two Matrix Product States (MPS) with Complex values.
-=In-place subtraction of two Matrix Product States (MPS) with Complex values.
/Scalar division of an Matrix Product State (MPS) with Complex values.
/=In-place scalar division of an Matrix Product State (MPS) with Complex values.
=Assignment operator for Matrix Product State (MPS) of Complex 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.
compressCompress the Matrix Product State (MPS) by truncating the bond dimensions based on truncation options. Reduces the bond dimension according to the specified error measure and tolerance with Complex 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 Complex 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.
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.:::