tensornetwork.InfiniteMPS

class tensornetwork.InfiniteMPS(tensors: List[Any], center_position: Optional[int] = None, connector_matrix: Optional[Any] = None, backend: Union[str, tensornetwork.backends.abstract_backend.AbstractBackend, None] = None)

An MPS class for infinite systems.

MPS tensors are stored as a list. InfiniteMPS has a central site, also called orthogonality center. The position of this central site is stored in InfiniteMPS.center_position, and it can be be shifted using the InfiniteMPS.position method. InfiniteMPS.position uses QR and RQ methods to shift center_position.

InfiniteMPS can be initialized either from a list of tensors, or by calling the classmethod InfiniteMPS.random.

__init__(tensors: List[Any], center_position: Optional[int] = None, connector_matrix: Optional[Any] = None, backend: Union[str, tensornetwork.backends.abstract_backend.AbstractBackend, None] = None) → None

Initialize a InfiniteMPS.

Parameters:
  • tensors – A list of Tensor objects.
  • center_position – The initial position of the center site.
  • connector_matrix – A Tensor of rank 2 connecting different unitcells. A value None is equivalent to an identity connector_matrix.
  • backend – The name of the backend that should be used to perform contractions. Available backends are currently ‘numpy’, ‘tensorflow’, ‘pytorch’, ‘jax’

Methods

__init__(tensors, center_position, …) Initialize a InfiniteMPS.
apply_one_site_gate(gate, site) Apply a one-site gate to an MPS.
apply_transfer_operator(site, direction, …) Compute the action of the MPS transfer-operator at site site.
apply_two_site_gate(gate, site1, site2, …) Apply a two-site gate to an MPS.
canonicalize(left_initial_state, …) Canonicalize an InfiniteMPS (i.e.
check_canonical() Check whether the MPS is in a canonical form.
check_orthonormality(which, site) Check orthonormality of tensor at site site.
get_tensor(site) Returns the Tensor object at site.
left_envs(sites)
measure_local_operator(ops, sites) Measure the expectation value of local operators ops site sites.
measure_two_body_correlator(op1, op2, site1, …) Compute the correlator \(\langle\) op1[site1], op2[s]\(\rangle\) between site1 and all sites s in sites2.
position(site, normalize, D, max_truncation_err) Shift center_position to site.
random(d, D, dtype, backend, …) Initialize a random InfiniteMPS.
right_envs(sites)
save(path)
transfer_matrix_eigs(direction, int], …) Compute the dominant eigenvector of the MPS transfer matrix.
unit_cell_transfer_operator(direction, int], …)

Attributes

bond_dimensions A list of bond dimensions of BaseMPS
dtype
physical_dimensions A list of physical Hilbert-space dimensions of BaseMPS
canonicalize(left_initial_state: Optional[Any] = None, right_initial_state: Optional[Any] = None, precision: Optional[float] = 1e-10, truncation_threshold: Optional[float] = 1e-15, D: Optional[int] = None, num_krylov_vecs: Optional[int] = 50, maxiter: Optional[int] = 1000, pseudo_inverse_cutoff: Optional[float] = None) → None

Canonicalize an InfiniteMPS (i.e. bring it into Schmidt-canonical form).

Parameters:
  • left_initial_state – An initial guess for the left eigenvector of the unit-cell mps transfer matrix
  • right_initial_state – An initial guess for the right eigenvector of the unit-cell transfer matrix
  • precision – The desired precision of the dominant eigenvalues (passed to InfiniteMPS.transfer_matrix_eigs)
  • truncation_threshold – Truncation threshold for Schmidt-values at the boundaries of the mps.
  • D – The maximum number of Schmidt values to be kept at the boundaries of the mps.
  • num_krylov_vecs – Number of Krylov vectors to diagonalize transfer_matrix
  • maxiter – Maximum number of iterations in eigs
  • pseudo_inverse_cutoff – A cutoff for taking the Moore-Penrose pseudo-inverse of a matrix. Given the SVD of a matrix \(M=U S V\), the inverse isd is computed as \(V^* S^{-1}_+ U^*\), where \(S^{-1}_+\) equals S^{-1} for all values in S which are larger than pseudo_inverse_cutoff, and is 0 for all others.
Returns:

None

classmethod random(d: List[int], D: List[int], dtype: Type[numpy.number], backend: Union[str, tensornetwork.backends.abstract_backend.AbstractBackend, None] = None) → tensornetwork.matrixproductstates.infinite_mps.InfiniteMPS

Initialize a random InfiniteMPS. The resulting state is normalized. Its center-position is at 0.

Parameters:
  • d – A list of physical dimensions.
  • D – A list of bond dimensions.
  • dtype – A numpy dtype.
  • backend – An optional backend.
Returns:

InfiniteMPS

transfer_matrix_eigs(direction: Union[str, int], initial_state: Optional[Any] = None, precision: Optional[float] = 1e-10, num_krylov_vecs: Optional[int] = 30, maxiter: Optional[int] = None) → Any

Compute the dominant eigenvector of the MPS transfer matrix.

Ars:
direction:
  • If '1','l' or 'left': return the left dominant eigenvalue and eigenvector
  • If '-1','r' or 'right': return the right dominant eigenvalue and eigenvector

initial_state: An optional initial state. num_krylov_vecs: Number of Krylov vectors to be used in eigs. precision: The desired precision of the eigen values. maxiter: The maximum number of iterations.

Returns:The dominant eigenvalue. Tensor: The dominant eigenvector.
Return type:float or complex