# truncate¶

tenpy.algorithms.truncation.truncate(S, options)[source]

Given a Schmidt spectrum S, determine which values to keep.

Parameters
• S (1D array) – Schmidt values (as returned by an SVD), not necessarily sorted. Should be normalized to np.sum(S*S) == 1..

• options (dict-like) – Config with constraints for the truncation, see truncation. If a constraint can not be fullfilled (without violating a previous one), it is ignored. A value None indicates that the constraint should be ignored.

Returns

• mask (1D bool array) – Index mask, True for indices which should be kept.

• norm_new (float) – The norm of the truncated Schmidt values, np.linalg.norm(S[mask]). Useful for re-normalization.

• err (TruncationError) – The error of the represented state which is introduced due to the truncation.

Options

config truncation
option summary

chi_max

Keep at most chi_max Schmidt values.

chi_min

Keep at least chi_min Schmidt values.

degeneracy_tol

Don't cut between neighboring Schmidt values with [...]

svd_min

Discard all small Schmidt values S[i] < svd_min.

trunc_cut

Discard all small Schmidt values as long as [...]

verbose (from Config) in Config

How much to print what's being done; higher means print more. [...]

Deprecated since version 0.5.1: Renamed symmetry_tol to degeneracy_tol, and don’t use log in the condition any more.

option chi_max: int

Keep at most chi_max Schmidt values.

option chi_min: int

Keep at least chi_min Schmidt values.

option degeneracy_tol: float

Don’t cut between neighboring Schmidt values with |log(S[i]/S[j])| < symmetry_tol, or equivalently |S[i] - S[j]|/S[j] < exp(symmetry_tol) - 1 ~= symmetry_tol for small symmetry_tol. In other words, keep either both i and j or none, if the Schmidt values are degenerate with a relative error smaller than symmetry_tol, which we expect to happen in the case of symmetries.

option svd_min: float

Discard all small Schmidt values S[i] < svd_min.

option trunc_cut: float

Discard all small Schmidt values as long as sum_{i discarded} S[i]**2 <= trunc_cut**2.