pytc.solver.bug_rpa.streamed_orth_directions

pytc.solver.bug_rpa.streamed_orth_directions(W_host, rel_tol=1e-10, *, block_rows, orth_tol=1e-08, max_passes=2, trace_sink=None)[source]

Rank-revealing orthonormal basis of a HOST-resident block.

Returns (Q_host, kept, diagnostics) with Q_host a NumPy array, so nothing of height nov is left on the device.

Three passes over the host data, none of which materialises a tall device array:

  1. R by sequential TSQR (streamed_tsqr_r()).

  2. Pivot the small R and drop the numerically dependent columns – the same rank decision the in-core path makes, on the same matrix.

  3. Emit Q = W T panel by panel, then MEASURE ||Q^T Q - I||; if it is not tight, orthogonalise the emitted Q once more (CholeskyQR2).

The gate in step 3 is not decoration. Recovering Q from a triangular factor loses orthogonality when W is ill-conditioned, and an unorthogonal basis corrupts the projected core silently – the energy stays plausible. Measuring and repeating is the standard remedy.

Parameters:
  • W_host (Any)

  • rel_tol (float)

  • block_rows (int)

  • orth_tol (float)

  • max_passes (int)

  • trace_sink (list | None)