torchref.base.targets.triton.ramachandran module

Triton forward + analytic backward for the Ramachandran NLL target.

The forward fuses two dihedral computes (φ, ψ) and bilinear interpolation on the (n_surfaces, 360, 360) NLL surface into one kernel. The backward chains:

d(NLL)/d(phi_frac) = (1-ψf)(v10−v00) + ψf·(v11−v01) d(NLL)/d(psi_frac) = (1-φf)(v01−v00) + φf·(v11−v10) d(phi_frac)/d(phi_deg) = 1 d(phi_deg)/d(positions) = −(180/π) · F_dihedral

(the leading minus is because the eager target uses -torsions_from_xyz; F_dihedral comes from _dihedral.) Same for ψ.

torchref.base.targets.triton.ramachandran.ramachandran_math_triton(xyz, phi_idx, psi_idx, nll_surfaces, surface_type)[source]

Triton-backed Ramachandran bilinear-interp NLL with analytic backward.