iMPS

Tools for converting finite to infinite MPS.

MPS_to_iMPS

Constructs an iMPS by comparing two finite MPS.

overlap_schmidt

Overlap or optimal basis rotation between two sets of Schmidt vectors.

basis_rotation

Overlap or optimal basis rotation between two sets of Schmidt vectors.

iMPSError

Container of the approximation errors accrued by MPS_to_iMPS().

temfpy.iMPS.MPS_to_iMPS(mps_short, mps_long, sites_per_cell, cut, unitary_tol=1e-06, schmidt_tol=1e-06)[source]

Constructs an iMPS by comparing two finite MPS.

The two MPS are expected to represent the ground states of a gapped, translation invariant Hamiltonian on two system sizes that differ by one repeating unit cell.

For sufficiently large systems, therefore, they are of the form

...(A...B)(A...B)...
...(A...B)(A...B)(A...B)...

up to gauge transformations. The repeating unit cell (A...B) is extracted from the longer chain, and its gauge is fixed by comparing its left and right environments to the Schmidt vectors of the shorter chain.

Parameters:
  • mps_short (MPS) – MPS of the shorter chain.

  • mps_long (MPS) – MPS of the longer chain.

  • sites_per_cell (int) – Size of the iMPS unit cell.

  • cut (int) – First site of the repeating unit cell in mps_long.

  • unitary_tol (float) – Maximum deviation of the gauge rotation matrices from unitarity before a warning is raised.

  • schmidt_tol (float) – Maximum mixing of unequal Schmidt values by the gauge rotation matrices before a warning is raised.

Return type:

tuple[MPS, iMPSError]

Returns:

  • iMPS (MPS) – iMPS with unit cell size sites_per_cell, constructed from the additional unit cell of mps_long.

  • validation_metric (iMPSError) – Errors introduced during the conversion.

temfpy.iMPS.overlap_schmidt(bra, ket, mode)[source]

Overlap or optimal basis rotation between two sets of Schmidt vectors.

Parameters:
  • bra (MPS) – Bra Schmidt vectors.

  • ket (MPS) – Ket Schmidt vectors.

  • mode (str) – If the overlap is between “left” or “right” Schmidt vectors.

Returns:

overlap – The overlaps \((C_0)_{\alpha\beta} = \langle L_\alpha'|L_\beta \rangle\) or \((D_0)_{\alpha\beta} = \langle R_\beta'|R_\alpha \rangle\), depending on mode.

Legs are labelled "vL" (incoming) and "vR" (outgoing).

Return type:

Array

temfpy.iMPS.basis_rotation(overlap, Schmidt_bra, Schmidt_ket, mode, form='B', unitary_tol=1e-06, schmidt_tol=1e-06)[source]

Overlap or optimal basis rotation between two sets of Schmidt vectors.

Parameters:
  • overlap (Array) –

    The overlaps \((C_0)_{\alpha\beta} = \langle L_\alpha'|L_\beta \rangle\) or \((D_0)_{\alpha\beta} = \langle R_\beta'|R_\alpha \rangle\), depending on mode.

    Legs should be labelled "vL" (incoming) and "vR" (outgoing).

  • Schmidt_bra (ndarray) – Schmidt values corresponding to the bra Schmidt vectors \(\langle L'|\) or \(\langle R'|\).

  • Schmidt_ket (ndarray) – Schmidt values corresponding to the ket Schmidt vectors \(|L \rangle\) or \(|R \rangle\).

  • mode (str) – If the overlap is between “left” or “right” Schmidt vectors.

  • form (str) – Whether the basis rotation is to be used for a left (“A”) or a right (“B”, default) canonical MPS tensor.

  • unitary_tol (float) – Highest allowed deviation from unitarity (weighted with Schmidt values) in the overlaps before a warning is raised.

  • schmidt_tol (float) – Highest allowed mixing between unequal Schmidt value sectors before a warning is raised.

Return type:

tuple[Array, float, float]

Returns:

  • rotation_matrix (Array) – If True, the optimal unitary basis rotation matrix \(C\) that minimises the iMPS conversion error.

    Legs are labelled "vL" (incoming) and "vR" (outgoing).

  • unitary_error (float) – Deviation of the overlap matrix from unitarity, measured as the square root of the trace of \(S_{\rm ket} (C_0^\dagger C_0 - \mathbb{I}) S_{\rm ket}\).

  • schmidt_error (float) – Degree of mixing of Schmidt vectors with unequal Schmidt values, measured as the norm of either \(S_{\rm bra} C - C_0 S_{\rm ket}\) or \((C - C_0) S_{\rm ket}\), depending on mode and form.

class temfpy.iMPS.iMPSError(left_unitary: float, left_schmidt: float, right_unitary: float, right_schmidt: float)[source]

Container of the approximation errors accrued by MPS_to_iMPS().

left_unitary: float

Deviation of left environment from unitarity.

left_schmidt: float

Mixing between unequal Schmidt values by the left environment.

right_unitary: float

Deviation of left environment from unitarity.

right_schmidt: float

Mixing between unequal Schmidt values by the right environment.

property left_total: float

Total approximation error of the left environment.

property right_total: float

Total approximation error of the right environment.

property total_error: float

Total approximation error.