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.
InfiniteMPShas a central site, also called orthogonality center. The position of this central site is stored inInfiniteMPS.center_position, and it can be be shifted using theInfiniteMPS.positionmethod.InfiniteMPS.positionuses QR and RQ methods to shiftcenter_position.InfiniteMPScan be initialized either from alistof tensors, or by calling the classmethodInfiniteMPS.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
Tensorobjects. - center_position – The initial position of the center site.
- connector_matrix – A
Tensorof rank 2 connecting different unitcells. A valueNoneis equivalent to an identityconnector_matrix. - backend – The name of the backend that should be used to perform contractions. Available backends are currently ‘numpy’, ‘tensorflow’, ‘pytorch’, ‘jax’
- tensors – A list of
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 Tensorobject atsite.left_envs(sites)measure_local_operator(ops, sites)Measure the expectation value of local operators opssitesites.measure_two_body_correlator(op1, op2, site1, …)Compute the correlator \(\langle\) op1[site1], op2[s]\(\rangle\) betweensite1and all sitessinsites2.position(site, normalize, D, max_truncation_err)Shift center_positiontosite.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_dimensionsA list of bond dimensions of BaseMPSdtypephysical_dimensionsA 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 inSwhich are larger thanpseudo_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:
-
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
- If
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: floatorcomplex
-