pytc.solver.bug_core.truncate_sym

pytc.solver.bug_core.truncate_sym(M, tau, rmin=1, max_rank=None, rule='relative', energy_metric=None, dense_core='device')[source]

Tolerance-truncate a symmetric core M.

rule sets what tau bounds: 'relative' keeps |s| > tau*max|s|, 'absolute' keeps |s| > tau, and 'energy' keeps the modes whose energy share |e_i| exceeds tau (Hartree), where e_i = s_i w_i^T G w_i for G = energy_metric so that the energy is sum_i e_i. An absolute cut is the same in every system, so its error is extensive and cancels in energy differences; a relative one moves with each system’s largest amplitude. dense_core picks where the eigendecomposition runs (run_dense()).

Returns (W, s, info): the retained eigenvectors (the caller forms U_new = U_aug @ W), the retained eigenvalues, and TruncInfo.

Parameters:
  • tau (float)

  • rmin (int)

  • max_rank (int | None)

  • rule (str)

  • dense_core (Literal['device', 'host'])