pytc.solver.bug_ccsd

BUG-CCSD: adaptive low-rank RCCSD on density-fitted integrals.

The doubles amplitude is kept as T = U diag(S) U^T in occupied-virtual pair space. Each iteration applies the CCSD doubles numerator N(t1, T) to the basis, augments the basis with residual directions, solves the Galerkin (Sylvester) problem in the augmented space and truncates by eigenvalue magnitude (basis update & Galerkin, BUG). N is exact at the retained rank: no dense T2 or residual is stored. The occupied ladder W*tau and the crossed ring Z*T, with their t1-dressed integrals, form one pair-space operator X built once per state on the device (sixth order); everything else is a DF contraction of fifth order.

The action runs on JAX (GPU, or CPU for the tests); the DF factors live on the host and are uploaded once per solve, or streamed in auxiliary chunks when they exceed bug_helper.RESIDENT_LIMIT_BYTES. The reference for N is PySCF’s DF-RCCSD numerator: N(t1, T) V is PySCF’s doubles numerator in pair form applied to V.

Classes

DFDirectBlocks

(kc|ld) occupied row blocks rebuilt on the device from B_ov on demand.

QuadraticOperator

Exact quadratic operator X built once per state, applied as X @ M.

ResidualInfo

Norm decomposition for the doubles residual action.

Functions

_aux_panels

(p, q, naux) -> (npanel, block, p, q), zero-padding the last panel.

_blocks

_df_direct

Apply the direct DF pair kernel (ia|jb) without forming it.

_one_body_actions

Apply the virtual and occupied one-body groups with GEMMs.

_pair_amplitude_action

Apply U diag(S) U^T to a probe block.

_probe_blocks

Apply call to zero-padded probe blocks of V; host output.

_singles_tau_df

The four tau-dependent DF singles groups in explicit N5 order.

_w1_actions

Apply Wvoov and its transpose to two probe blocks in one DF pass.

_w2_actions

Apply Wvovo and its transpose without retaining Wvovo.

build_state

State-dependent intermediates and the exact quadratic operator.

ccsd_residual_action

R2(T) U = N2 U - D U S - U S (U^T D U) and its norms (device arrays).

crossed_amplitude_action

Apply T[(i,a),(k,c)] = T[i,k,c,a] without forming crossed T; host array.

doubles_action

N(t1, T) V for a probe block V (o, v, w); returns (o*v, w).

energy

Matrix-free CCSD correlation energy from (t1, U, S) (canonical HF).

exchange_action

result[k,c,z] = sum_{Q,l,d} B[k,d,Q] V[l,d,z] B[l,c,Q].

exchange_energy

result[z] = sum_{k,c,l,d} (kd|lc) V[k,c,z] V[l,d,z].

low_rank_ccsd

Solve RCCSD with an adaptive symmetric low-rank doubles amplitude.

mp2_start

Low-rank warm start: a few BUG-MP2 iterations on the direct-only amplitude.

projected_doubles

Q^T N(t1, T) Q for new directions Q with U^T Q = 0.

singles_numerator

The singles numerator (t1_new = numerator / eia).

singles_only_action

w1_outer_factors

Wvoov left DF factors (o*v, naux) and the crossed tau DF block.