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
Open
Failure amid $fix atoms and many disconnected fragments when optimizing with the L-ANC#1379DanielWicz wants to merge 2 commits intogrimme-lab:mainfrom
DanielWicz wants to merge 2 commits intogrimme-lab:mainfrom
Conversation
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>
foxtran
reviewed
Jan 28, 2026
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() | ||
|
|
Contributor
There was a problem hiding this comment.
Please, consider to create a separate PR for this.
Contributor
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.