Skip to content

Preserve atoms in fragmented GFN-FF Hessians - #1432

Merged
thfroitzheim merged 3 commits into
grimme-lab:mainfrom
TyBalduf:fix/issue-1286-fragmented-hessian
Oct 5, 2026
Merged

thfroitzheim merged 3 commits into
grimme-lab:mainfrom
TyBalduf:fix/issue-1286-fragmented-hessian

Conversation

@TyBalduf

@TyBalduf TyBalduf commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #1286

Fragment grid bounds included unused zero-initialized center entries, making the partition depend on the coordinate origin. For translated clusters (like in #1286 where many of the waters were displace 300 Angstroms away from the origin) this could place many disconnected molecules in one oversized block; the splitter for overly large groups assumes they are fully connected, which leads to it only retain the two endpoint components (disconnected waters), leaving the atoms from all the other waters without Hessian modes.

This change computes bounds based on active small fragments, caps merged blocks at the fragment size limit, and ensures already group fragments are skipped. We now check that every atom belongs to exactly one fragment and fall back to full diagonalization if that check fails.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 GFN-FF fragmented Hessian partitioning to be translation-invariant and to avoid dropping atoms/modes when grid-based merging produces oversized, disconnected blocks (as in issue #1286). It refines grid bound computation and adds validation/fallback behavior, plus a unit test covering the regression scenario.

Changes:

  • Compute grid bounds only from active small fragments to remove coordinate-origin dependence.
  • Prevent merged Hessian blocks from exceeding the fragment size limit and skip already-merged fragments during grouping.
  • Validate that every atom is assigned exactly once; if not, disable fragmentation and fall back to full diagonalization.
  • Add a unit test to verify translation invariance and ensure splitting a crowded grid cell doesn’t lose atoms.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/gfnff/frag_hess.f90 Makes fragmentation translation-invariant, caps merging to maxmagnat, skips merged fragments, and adds partition validity checks with fallback.
test/unit/test_gfnff.f90 Adds a unit test for translation-invariant fragmentation and for preserving atoms when splitting crowded grid cells.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/unit/test_gfnff.f90
@TyBalduf
TyBalduf force-pushed the fix/issue-1286-fragmented-hessian branch from 917dd55 to 5913dfd Compare August 10, 2026 17:22
TyBalduf and others added 3 commits August 10, 2026 17:25
Fragment grid bounds included unused zero-initialized center entries, making the partition depend on the coordinate origin. For translated clusters this could place many disconnected molecules in one oversized block; the connectivity splitter then retained only its two endpoint components, leaving most atoms without Hessian modes.

Compute bounds from active small fragments, cap merged blocks at the fragment size limit, and skip consumed group leaders. Validate that every atom occurs exactly once and fall back to full diagonalization for an invalid partition.

Add regression coverage for translation invariance and crowded grid cells.

Fixes grimme-lab#1286

Signed-off-by: Ty Balduf <ty.balduf@schrodinger.com>
The fragmenter populated rmaxab only for atom pairs within the same Hessian block before copying the entire array. Uninitialized cross-block entries can be signaling NaNs in debug builds and trigger an invalid floating-point exception.

Initialize those entries to a large distance, which also represents their intended disconnected graph state.

Signed-off-by: Ty Balduf <ty.balduf@schrodinger.com>
Signed-off-by: Ty Balduf <ty.balduf@schrodinger.com>
@TyBalduf
TyBalduf force-pushed the fix/issue-1286-fragmented-hessian branch from 5913dfd to 35d612b Compare August 10, 2026 17:26
@thfroitzheim
thfroitzheim merged commit e60155e into grimme-lab:main Oct 5, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bench.xyz/1707_0569xWATER.xyz can not be optimized with GFN-FF

3 participants