Skip to content

refactor(model): Standardize Potentials to dreid-kernel Format#16

Merged
TKanX merged 38 commits intomainfrom
feature/15-standardize-potential-parameters-to-align-with-dreid-kernel-api-contract
Feb 17, 2026
Merged

refactor(model): Standardize Potentials to dreid-kernel Format#16
TKanX merged 38 commits intomainfrom
feature/15-standardize-potential-parameters-to-align-with-dreid-kernel-api-contract

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Feb 17, 2026

Summary:

Refactored the model::topology module to align potential energy structures with the dreid-kernel library's API. All potential types (BondPotential, AnglePotential, etc.) now store precomputed, kernel-ready parameters (e.g., k_half, cos_n_phi0) instead of raw physical constants. This eliminates redundant computations during energy evaluation and standardizes the interface between the parameter generation layer and future simulation kernels.

Changes:

  • Integrated dreid-kernel:

    • Added dreid-kernel v0.4.1 dependency.
    • Updated paramgen.rs to use dreid-kernel's precompute() functions for converting physical constants (from TOML) into optimized kernel parameters.
  • Standardized Potential Structs:

    • Bond: Updated Harmonic to store k_half and r0. Updated Morse to store de, alpha, r0.
    • Angle: Introduced CosineLinear for 180° angles. Updated CosineHarmonic to store c_half and cos0. Updated ThetaHarmonic to store k_half and theta0.
    • Torsion: Renamed DihedralPotential to TorsionPotential. Now stores v_half, n, cos_n_phi0, and sin_n_phi0.
    • Inversion: Renamed ImproperPotential to InversionPotential. Now stores c_half (and cos_psi0 for Umbrella).
    • VdW: Renamed Exponential6 to Buckingham. Now stores r_max_sq and two_e_max for proper energy reflection handling.
    • H-Bond: Updated HBondPotential to store d_hb and r_hb_sq.
  • Refactored Topology Model:

    • Updated Potentials struct fields: dihedralstorsions, impropersinversions.
    • Updated IntermediateSystem to match the new nomenclature (IntermediateTorsion, IntermediateInversion).
  • Updated Parameter Generation:

    • Rewrote generate_parameters in paramgen.rs to utilize the new precomputation logic.
    • Implemented 1/3 scaling for planar inversion force constants directly during generation.
    • Updated H-bond generation to use precomputed squared distances.
  • Testing:

    • Added comprehensive unit tests for potential struct construction, equality, and cloning.
    • Updated paramgen tests to verify correct precomputed values against physical expectations.

TKanX added 30 commits February 12, 2026 14:19
…tial with TorsionPotential and ImproperPotential with InversionPotential
@TKanX TKanX self-assigned this Feb 17, 2026
Copilot AI review requested due to automatic review settings February 17, 2026 00:22
@TKanX TKanX added documentation 📖 Improvements or additions to documentation enhancement ✨ New feature or request labels Feb 17, 2026
@TKanX TKanX linked an issue Feb 17, 2026 that may be closed by this pull request
21 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the model::topology module to standardize potential energy structures with the dreid-kernel library's API. All potential types now store precomputed, kernel-ready parameters instead of raw physical constants, eliminating redundant computations during energy evaluation and providing a clean interface for future simulation kernels.

Changes:

  • Integrated dreid-kernel v0.4.1 for precomputing optimized potential parameters from physical constants
  • Renamed and restructured all potential types: DihedralPotentialTorsionPotential, ImproperPotentialInversionPotential, Exponential6Buckingham
  • Updated all potential structs to store precomputed values (e.g., k_half, cos_n_phi0, r_hb_sq) and consolidated atom indices into tuples
  • Added CosineLinear angle potential variant for 180° equilibrium angles
  • Updated default parameters TOML to explicitly include vdw_zeta for all atom types (removing the default value function)
  • Comprehensive test coverage for all new structures and precomputation logic

Reviewed changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/model/topology.rs Refactored potential enums/structs with precomputed parameters; renamed DihedralPotentialTorsionPotential, ImproperPotentialInversionPotential; added comprehensive unit tests
src/forge/paramgen.rs Integrated dreid-kernel precompute functions; updated all parameter generation to use kernel API; added extensive test coverage
src/forge/intermediate.rs Renamed IntermediateDihedralIntermediateTorsion, IntermediateImproperIntermediateInversion; updated field names to match dreid-typer v0.5.0
src/forge/typer.rs Updated topology application to use renamed torsion/inversion structures and new field names from dreid-typer
src/forge/params.rs Changed TorsionParams.periodicity from i32 to u8; removed default_vdw_zeta() function; clarified documentation
src/forge/config/potential.rs Renamed AnglePotentialType: CosineHarmonicCosine, ThetaHarmonicTheta; VdwPotentialType: Exponential6Buckingham; updated default to Cosine
src/forge/config/mod.rs Updated default config to use AnglePotentialType::Cosine instead of ThetaHarmonic
src/forge/mod.rs Updated integration tests to use renamed potential collections (torsions, inversions)
src/lib.rs Updated public API exports and documentation to reflect renamed types and new nomenclature
src/bin/dforge/cli.rs Updated CLI enums and defaults; changed default angle potential argument to "cosine"
src/bin/dforge/util/convert.rs Updated CLI→config type conversions for renamed angle and VdW potential types
src/bin/dforge/commands/chem.rs Updated display strings for new angle potential type names
src/bin/dforge/commands/bio.rs Updated display strings for new angle potential type names
src/bin/dforge/display/tables.rs Updated parameter table labels: "Dihedrals"→"Torsions", "Impropers"→"Inversions"
resources/default.params.toml Version bump to 1.1.0; added explicit vdw_zeta values for all atom types; minor parameter value updates
Cargo.toml Added dreid-kernel = "0.4.1"; updated dreid-typer to "0.5.0"; fixed typo "chemoinformatics"→"cheminformatics"
README.md Updated documentation to reflect new terminology and added dreid-kernel to dependency table
MANUAL.md Updated CLI documentation with new angle potential default and simplified option descriptions
ARCHITECTURE.md Comprehensive documentation updates throughout; added dreid-kernel integration details; updated all diagrams and tables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TKanX TKanX merged commit 65ee581 into main Feb 17, 2026
8 checks passed
@TKanX TKanX deleted the feature/15-standardize-potential-parameters-to-align-with-dreid-kernel-api-contract branch February 17, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📖 Improvements or additions to documentation enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize Potential Parameters to Align with dreid-kernel API Contract

2 participants