Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

fix(core): Prevent Flat-Bottom Potential from Softening Hardcore Clashes#35

Merged
TKanX merged 10 commits intomainfrom
bugfix/33-flat-bottom-potential-delta-incorrectly-softens-severe-atomic-clashes
Aug 17, 2025
Merged

fix(core): Prevent Flat-Bottom Potential from Softening Hardcore Clashes#35
TKanX merged 10 commits intomainfrom
bugfix/33-flat-bottom-potential-delta-incorrectly-softens-severe-atomic-clashes

Conversation

@TKanX
Copy link
Member

@TKanX TKanX commented Aug 17, 2025

Summary:

Corrected the behavior of the flat-bottom potential functions (apply_flat_bottom_vdw and apply_flat_bottom_hbond) to prevent them from incorrectly softening the energy of severe atomic clashes. The previous implementation applied the softening delta parameter across the entire repulsive region, which could lead to an underestimation of steric penalties. This fix introduces a "hardcore" repulsive boundary, ensuring that only the raw, unsoftened potential is used for very short inter-atomic distances.

Changes:

  • Introduced Hardcore Repulsive Core:

    • Added a REPULSIVE_CORE_SCALE_FACTOR to both apply_flat_bottom_vdw and apply_flat_bottom_hbond.
    • If the inter-atomic distance is less than this fraction of the ideal distance, the flat-bottom softening logic is now bypassed, applying the full repulsive penalty.
    • This ensures the potential correctly models severe steric clashes while still softening the energy landscape for near-native conformations.
  • Updated and Added Unit Tests:

    • Refined existing test cases to accurately reflect the three distinct regions of the potential: hardcore repulsion, soft repulsion (flat-bottom), and the attractive tail.
    • Added new tests specifically to verify that the softening effect is correctly disabled within the new hardcore boundary.

@TKanX TKanX self-assigned this Aug 17, 2025
Copilot AI review requested due to automatic review settings August 17, 2025 22:59
@TKanX TKanX added the bug 🐛 Something isn't working label Aug 17, 2025
@TKanX TKanX linked an issue Aug 17, 2025 that may be closed by this pull request
2 tasks
Copy link
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 fixes a critical issue in flat-bottom potential functions where softening was inappropriately applied to severe atomic clashes, potentially underestimating steric penalties. The fix introduces hardcore repulsive boundaries that bypass softening for very short inter-atomic distances.

  • Added hardcore repulsive core boundaries to prevent softening of severe clashes
  • Updated test cases to reflect the three distinct potential regions (hardcore, soft repulsion, attractive)
  • Added specific tests to verify correct behavior in the new hardcore boundary zones

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@TKanX TKanX merged commit fcecfed into main Aug 17, 2025
2 checks passed
@TKanX TKanX deleted the bugfix/33-flat-bottom-potential-delta-incorrectly-softens-severe-atomic-clashes branch August 17, 2025 23:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flat-Bottom Potential (delta) Incorrectly Softens Severe Atomic Clashes

2 participants