torchref.base.targets.bond module

Bond-length restraint NLL.

torchref.base.targets.bond.bond_math(xyz, idx, references, sigmas)[source]

Bond NLL: gather, distance, Gaussian NLL, sum.

Mirrors BondTarget.forward (geometry/bond) including the bond-length computation from Restraints.bond_lengths.

On CUDA float32 inputs this dispatches to torchref.base.targets.triton.bond_math_triton() (~2.5× faster fwd+bw on A100). All other inputs use the eager implementation.

Parameters: