pytc.solver.bug_rpa.projected_residual

pytc.solver.bug_rpa.projected_residual(U, S, BU, d, *, k=None, how='residual', block_rows=None)[source]

RPA residual D = 2 BU (1+S) + d U S deflated twice against U.

All r columns, or k of them: the largest by norm (how='residual', selected from streamed column norms, so only the chosen columns are ever emitted at full height) or the leading ones (how='top'). Row panels keep every intermediate at panel x r.