Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALPB and ddCOSMO not rotationally invariant #1119

Open
alanchienSDGR opened this issue Oct 23, 2024 · 5 comments
Open

ALPB and ddCOSMO not rotationally invariant #1119

alanchienSDGR opened this issue Oct 23, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@alanchienSDGR
Copy link

Describe the bug
xtb version 6.7.1 (d42779f) with cpcm-x has small, but significant, energy differences (0.0001 Hartree in the attached example) with respect to rotation of a simple molecule. The energies match up to the 7th decimal when not using cpcm-x.

To Reproduce
Run xtb {input.sdf} --cpcmx water on both the attached ref.sdf and rotated.sdf input files (I can't upload .sdf files apparently so I converted them to txt)
ref_sdf.txt
rotated_sdf.txt

rotated.sdf is just a rotation of the molecule in ref.sdf around the x-axis by 30 degrees.

ref.sdf output with cpcmx
| TOTAL ENERGY -17.598183210842 Eh |
rotated.sdf output with cpcmx
| TOTAL ENERGY -17.598280276499 Eh |

ref.sdf output without cpcmx
| TOTAL ENERGY -17.591235057712 Eh |
rotated.sdf output without cpcmx
| TOTAL ENERGY -17.591235064338 Eh |

Expected behaviour
I expected the total energies to match up to about the 6th or 7th decimal place, similar to the accuracy of the dispersion/nuclear repulsion energies and when running without cpcmx.

@alanchienSDGR alanchienSDGR added the unconfirmed This report has not yet been confirmed by the developers label Oct 23, 2024
@lukaswittmann
Copy link
Member

lukaswittmann commented Oct 24, 2024

Thank you for reporting.

Upon review, we noticed the files you provided were not only rotated but also exhibited an RMSD of 1E-6. For comparison, we conducted a test using the following structures with an RMSD of 1E-11:
struc.xyz.txt
rotated.xyz.txt

Test Results:

(GFN2, solvent: water, energies in Eh)

  xTB gas xTB ddcosmo xTB cpcmx xTB alpb tblite ddcpcm tblite alpb
ref -28.30391089 -28.45055007 -- -28.42249445 -28.36792386 -28.44749431
rot -28.30391087 -28.45043739 -28.47818823 -28.42243534 -28.36814497 -28.44749430
Difference 1.65E-08 1.13E-04 -- 5.91E-05 -2.21E-04 5.09E-09

Observations:

The issues already arise using only the underlying ddCOSMO/ddCPCM which is likely carried over into CPCMX.
We already plan to revise our implementation by implementing ddX and thus replacing our native ddCOSMO/ddCPCM implementations.

Unfortunately, ALPB also does not show rotational invariance in xTB either.
The tblite version is fine only because it does not yet have the corresponding ALPB CDS term implemented.
The CDS term includes an integration over a Lebedev grid surface, which seems to be the issue. ddCOSMO/ddCPCM also utilizes the corresponding routines/grids.

We will further look into this issue.

CC: @thfroitzheim

@lukaswittmann lukaswittmann added bug Something isn't working and removed unconfirmed This report has not yet been confirmed by the developers labels Oct 24, 2024
@lukaswittmann lukaswittmann changed the title CPCM-X energy differences with rotation of a small molecule ALPB and ddCOSMO not rotationally invariant Oct 24, 2024
@alanchienSDGR
Copy link
Author

Hi @lukaswittmann - thanks for confirming the bug! Looking forward to the fix.

In the meantime, are you aware any recommended settings that might mitigate this error? Maybe an option to increase the grid size?

@haneug
Copy link
Member

haneug commented Oct 25, 2024

You can try to increase the grid size: https://xtb-docs.readthedocs.io/en/latest/gbsa.html#available-grids

@lukaswittmann
Copy link
Member

lukaswittmann commented Oct 25, 2024

Increasing the grid does improve the result: Using ddCPCM in tblite with the largest grid (ld5810, equiv. to Gridlevel=extreme in xTB), the error is around 5E-6, which is more than sufficient.

In principle, the issue is known for apparent surface charge PCMs.
Rotational invariance is not strictly preserved since each octahedral Lebedev grid is generated in the laboratory frame before being translated to the target atomic center. While rotational invariance is achievable with an infinitely dense grid. Using Lebedev grids generally results in errors that are minimal enough for practical purposes, i.e. far below <0.1 kcal/mol, normally even much lower (Fig. 4. in the SwiG paper).
However, >1E-4 Eh difference is too high, we would like something more like ~1E-5 Eh; we will look into grid settings and test some ideas.

Regarding the ALPB issue, we have to look more into the details, but the ORCA SMD CDS part is rotationally invariant, which means this should also be applicable to the ALPB CDS part also.

@corinwagen
Copy link

This problem can be solved if you just specify a "standard" molecular orientation, see Johnson/Gill/Pople 1994

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants