Skip to content

Failure amid $fix atoms and many disconnected fragments when optimizing with the L-ANC#1379

Open
DanielWicz wants to merge 2 commits intogrimme-lab:mainfrom
DanielWicz:bugfix/fix-fixset-lancopt
Open

Failure amid $fix atoms and many disconnected fragments when optimizing with the L-ANC#1379
DanielWicz wants to merge 2 commits intogrimme-lab:mainfrom
DanielWicz:bugfix/fix-fixset-lancopt

Conversation

@DanielWicz
Copy link
Copy Markdown
Contributor

I encountered an optimization problem when using $fix. I found that it is related to bugs #1286 and #800 . I attempted to address the issue, and my solution appears to work. It seems that when there are many fragments and/or multiple $fix statements, zero eigenvalues appear, which then cause problems downstream in the optimization protocol. I tried to numerically “patch” this issue, and it seems to work, but it requires additional babysitting and checks to ensure that no artifacts are introduced.

I also added a unit test. The test fails if the patch introduced by the commit is not present. However, the unit test itself also requires careful review.

Daniel Wiczew added 2 commits January 20, 2026 14:53
- For GFN-FF large systems (N>500) ensure nvar accounts for fixset so L-ANC no longer aborts with k<<nvar.
- If the model Hessian has many exact-zero eigenvalues (e.g., disconnected fragments), complete the mode basis with near-zero modes and use opt%hlow as safe curvature, avoiding "ANC generation failed".
- CMake: create ${package}::${package} alias when an un-namespaced target already exists to prevent duplicate-target errors (test-drive).

Signed-off-by: Daniel Wiczew <daniel.wiczew@nebulabio.tech>
Adds a new relaxation-engine unit test that runs L-ANC (lbfgs) ANC generation in GFN-FF mode with N>500 and an exact $fix set.

This used to fail with "ANC generation failed" due to mismatched nvar handling; the test now guards against regressions.

Signed-off-by: Daniel Wiczew <daniel.wiczew@nebulabio.tech>
Comment on lines +28 to +36
# If the dependency was already added by another subproject (e.g., via
# FetchContent) it might only provide the plain target `${package}` without the
# namespaced alias `${package}::${package}` expected by xTB. Create the alias
# early to avoid re-adding the project and triggering duplicate-target errors.
if(TARGET "${package}" AND NOT TARGET "${package}::${package}")
add_library("${package}::${package}" INTERFACE IMPORTED)
target_link_libraries("${package}::${package}" INTERFACE "${package}")
endif()

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.

Please, consider to create a separate PR for this.

@foxtran
Copy link
Copy Markdown
Contributor

foxtran commented Jan 28, 2026

@DanielWicz, please, check CI: https://github.com/grimme-lab/xtb/actions/runs/21176740382/job/60907524977?pr=1379

Looks like your solution is not numerically stable.

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.

2 participants