Description:
To ensure seamless future integration between dreid-forge (parameterization) and dreid-kernel (evaluation), all potential energy parameter structures must be standardized to match the kernel's mathematical conventions.
The kernel uses half-force constants (k_half, v_half, c_half) to eliminate redundant multiplications during SIMD-optimized evaluation. Additionally, several potentials store pre-computed values (e.g., cos0 instead of theta0, r0_sq instead of r0) to minimize runtime operations. Current dreid-forge definitions diverge from these conventions, requiring a systematic refactoring.
Critical: The Inversion potential uses fundamentally different physics — kernel implements $E \propto \cos^2\psi$ while forge uses $E \propto (\chi - \chi_0)^2$. This must be corrected.
Tasks:
Description:
To ensure seamless future integration between
dreid-forge(parameterization) anddreid-kernel(evaluation), all potential energy parameter structures must be standardized to match the kernel's mathematical conventions.The kernel uses half-force constants (
k_half,v_half,c_half) to eliminate redundant multiplications during SIMD-optimized evaluation. Additionally, several potentials store pre-computed values (e.g.,cos0instead oftheta0,r0_sqinstead ofr0) to minimize runtime operations. Currentdreid-forgedefinitions diverge from these conventions, requiring a systematic refactoring.Critical: The Inversion potential uses fundamentally different physics — kernel implements$E \propto \cos^2\psi$ while forge uses $E \propto (\chi - \chi_0)^2$ . This must be corrected.
Tasks:
Phase 1: Topology Structure Refactoring (
src/model/topology.rs)BondPotential::Harmonic:k_force→k_half(storeBondPotential::Morse:d0→de(naming consistency).AnglePotential::CosineHarmonic:(k_force, theta0)→(k_half, cos0).AnglePotential::ThetaHarmonic:k_force→k_half.DihedralPotential:(v_barrier, phase_offset)→(v_half, cos_n_phi0, sin_n_phi0).ImproperPotential: Change formula fromc_half.VdwPairPotential::LennardJones:(sigma, epsilon)→(d0, r0_sq).VdwPairPotential::Exponential6: Addr_fusion_sqfield.HBondPotential:r0→r_hb_sq, addcos_power: u8.Phase 2: Parameter Generation (
src/forge/paramgen.rs)generate_bond_potentials()to computek_half = K/2.generate_angle_potentials()to pre-computecos0 = cos(θ₀).generate_dihedral_potentials()to pre-compute(cos_n_φ₀, sin_n_φ₀).generate_improper_potentials()for cosine-based formula.generate_vdw_potentials()to store squared distances.generate_hbond_potentials()to storer_hb_sqandcos_power.Phase 3: IO & Test Updates
dreid-kernelexpected values.