Skip to content

Conversation

Tetracarbonylnickel
Copy link
Contributor

@Tetracarbonylnickel Tetracarbonylnickel commented Aug 5, 2025

This PR introduces a modular and configurable framework for switching between two models during a simulation based on customizable conditions and transition schemes.

Key Features

  • SwitchSchedule class:
    • Encapsulates logic for triggering and executing the model switch.
    • Uses a two-step strategy:
      • A condition function (CONDITION_FN) to determine when to switch.
      • A switching function (SWITCHING_FN) to compute the transition factor over time.
  • Switching conditions (CONDITION_FN):
    • additive_impact: triggers switching when the last atom’s z-position drops below a given impact_height.
    • instant_switching: enables immediate switching (useful for testing or benchmarking).
  • Switching functions (SWITCHING_FN):
    • linear: linearly interpolates the switching factor from 0 to 1.
    • sigmoid: smoothly interpolates the switching factor using a logistic sigmoid ramp (parameterized by k).

Motivation

Switching between ML models (e.g., triplet → singlet) often requires:

  • Careful handling of when to switch
  • Smooth transitions to avoid unphysical forces
    This design supports plug-and-play extension for new switching conditions or ramping strategies.

TODO

  • Handling auxiliary energy and force functions of the two models to ensure correct energy forces and their uncertainties.

@Tetracarbonylnickel Tetracarbonylnickel added the enhancement New feature or request label Aug 5, 2025
@Tetracarbonylnickel Tetracarbonylnickel marked this pull request as ready for review August 6, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant