pytc.solver.bug_core.amplitude_step

pytc.solver.bug_core.amplitude_step(S_new, S, cross, U_new, U_old, *, conv, amplitude_tol=None, scale=None, block_rows=8192)[source]

(||U' diag(S') U'^T - U diag(S) U^T||_F, valid) with cross = U'^T U.

The rank-sized Gram form S'.S' + S.S - 2 S'(C*C)S is a difference of O(||T||^2) terms, so it resolves a step only down to ~sqrt(eps)||T||. It decides the step when it is clearly above every stop threshold. Otherwise the step is recomputed without cancellation from the part of the old basis outside the new one, E = U - U' C with H = E^T E (row panels, rank-sized result): ||K||^2 + 2 tr((CS)^T (CS) H) + sum_ij S_i S_j H_ij^2, where CS = C diag(S) and K = diag(S') - CS C^T. Every term is nonnegative, so that form is always valid. Ranks may differ.