This repository was archived by the owner on Mar 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Implement Foundational Absolute Energy Model #24
Copy link
Copy link
Description
Description:
Implements a foundational refactoring of the energy calculation framework to introduce a scientifically rigorous, absolute energy model. The goal is to replace the current relative "optimization score" with a true TotalSystemEnergy that is comparable across different optimization scopes and always improves upon the input structure.
This will be achieved by decomposing the total energy into a dynamic OptimizationScore (used internally for speed) and a static, pre-calculated EnergyOffsetConstant. All user-facing energies will be reported as the absolute TotalSystemEnergy.
Tasks:
-
Phase 1: Data Structure Enhancement (
core/models)- Introduce a public
AtomRoleenum (Backbone,Sidechain,Ligand, etc.) inatom.rs. - Add a
pub role: AtomRolefield to theAtomstruct. - (Optional but Recommended) Add
sidechain_atoms_cache: Vec<AtomId>andbackbone_atoms_cache: Vec<AtomId>to theResiduestruct for efficient access. - Implement new high-level query methods in
MolecularSystemfor fetching atoms by role (e.g.,get_sidechain_atoms_of_residue,get_fixed_protein_atoms). - Cleanup: Remove the
exact_match_atomsandconnection_pointsfields fromPlacementInfoand update relevant.tomlfiles.
- Introduce a public
-
Phase 2: Logic & Algorithm Refactoring (
core/forcefield&engine/tasks)- In
parameterization.rs:- Modify
Parameterizer::parameterize_systemto be the sole authority for setting theAtom.rolefor every atom in the system, usingPlacementInfoandChainTypeas guides.
- Modify
- In
el_energy.rs:- Refactor
compute_energies_for_unitto ensure thequery_atomsset only contains the atoms of the active sidechain (Sc_A). - Ensure
environment_atomscorrectly includes all other atoms in the system (all backbones, all fixed residues, background, etc.).
- Refactor
- In
total_energy.rs:- Rename the file to
optimization_score.rs. - Rewrite the
runfunction to calculateOptimizationScore = Σ E_EL + E_inter(Sc_A, Sc_A). The interaction term must be calculated between active sidechains only.
- Rename the file to
- In
-
Phase 3: State & Workflow Integration
- In
engine/state.rs:- Refactor
OptimizationState:- Add an
energy_offset: EnergyTermfield. - Rename
current_energytocurrent_score. - Rework
submit_current_solutionto calculatetotal_energy = self.current_score + self.energy_offsetbefore comparing and storing solutions.
- Add an
- Refactor
- In
workflows/place.rs:- Implement the new "Setup & Pre-computation" logic at the beginning of the
runfunction. - Define and partition all atomic sets (
Sc_A,Bb_A,Sc_F,Bb_F,B). - (New Task Call) Create and call a new task
engine/tasks/offset_energy.rsto calculate theEnergyOffsetConstant(E(FixedAtoms, FixedAtoms)). - Calculate the initial
TotalSystemEnergyof the input structure. - Pass the calculated
EnergyOffsetConstanttoOptimizationState::new. - Store the initial input structure and its energy as the first candidate solution.
- Implement the new "Setup & Pre-computation" logic at the beginning of the
- Logging & Reporting: Ensure all user-facing output (logs, final report) displays the
TotalSystemEnergy.
- In
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancement ✨New feature or requestNew feature or request