pytc.solver.bug_tΒΆ
BUG-(T): perturbative triples from the factorized T2 alone.
E(T) is evaluated without ever forming T3 or the W intermediate. The doubles arrive from the BUG solver already factored as t2 = U S U^T, and (T) is built by projecting into that pair basis, dividing by the denominator exactly in the projected space, and contracting the r x r x r cores.
Cost: N^5 to assemble the cores, N^6 for the energy contraction, N^4 memory. Canonical (T) is N^7.
Contraction orders are written out by hand, one chain per permutation class.
The energy path uses explicit packed GEMMs. The two inverse cycles and three transpositions are fused by linearity in their permuted C_hat operand, reducing the expensive chains from seven to three. Occupied blocks of the packed pair-overlap matrix are streamed with lax.scan so XLA can reuse their storage.
Functions
Projected V core. |
|
Projected W core C[x,x',x''], independently validated to 1e-15. |
|
Projected W core, streaming the Q-carried N^4 G/H tensors in aux blocks. |
|
Fused (T) energy from the W core and the divided core |
|
Identity plus inverse-cycle phase of the prepared GPU energy. |
|
Transposition phase of the prepared GPU energy. |
|
The symmetrised W core, the two folded C_hat operands and the identity term. |
|
Divide the core by D = d_P + d_Q + d_R exactly, in the projected space. |
|
Return the sum, rather than the average, of all six permutations. |