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

Inconsitent implicit solvation between tblite and xtb #312

Open
FrancescoTalotta opened this issue Jun 13, 2024 · 9 comments
Open

Inconsitent implicit solvation between tblite and xtb #312

FrancescoTalotta opened this issue Jun 13, 2024 · 9 comments
Labels
bug Something isn't working fixed The issue has been resolved question Further information is requested

Comments

@FrancescoTalotta
Copy link

Hello,

I would like to perform a geometry optimization with crest with charge and solvent. I use this command:

crest geom.xyz --gfn2 --alpb acetonitrile --chrg 2 --T 8 --opt > $JOBOUT 2>&1
However the geometry optimization does not converge. It converges only if I put the charge=0, or if don't use the solvent. Is the --alpb keyword incompatible with a charge>0?

Thank you

Francesco

@pprcht
Copy link
Contributor

pprcht commented Jun 13, 2024

Hi,
ALPB should not have an issue with charges, however, the ALPB implementation in tblite might still have some issues (and is inconsistent with the one in xtb). As I understood it, the tblite developers are working on this.

If you want to have a bit more output (assuming you are using v3.0.1) try creating a toml input file with this:

#This is a CREST input file
input='geom.xyz'
runtype='ancopt'
threads=8

#calculation level
[[calculation.level]]
method="gfn2"
chrg=2
alpb='acetonitrile'
print=true

and run with

crest input.toml > $JOBOUT

Maybe this will give some indication whether the SCC has convergence issues or something similar.

@FrancescoTalotta
Copy link
Author

FrancescoTalotta commented Jun 14, 2024

Hello,

thank you for your reply. I tried with print=true but there is no additional information in the output file. However, I can confirm that the same calculation performed with xtb xtb geom.xyz --gfn2 --alpb acetonitrile --chrg 2 --opt works without any problem. So, it must be a bug in the tblite. Is there a way to perform the calculations with crest-xtb instead of crest-tblite?

Thanks

Francesco

@ledragna
Copy link

Hello,

I'm facing the same problem and want to add that it seems to get worse with the size of the systems.

As already stated by @FrancescoTalotta the optimizations go smoothly with xtb.

I tested crest struc.xyz --gfn2 --alpb water -T 4 --opt command on two structures that I found on your documentation:
alanineglycine and Bacillaene.

On the smaller system optimization proceed giving an acceptable result, though the RMSD of 0.09285 wrt xtb seems a bit too high considering the dimension of the system.
However, on Bacillaene the system seems to be completely destroyed by the optimization procedure:
last_geom

Thanks,

Marco

@pprcht
Copy link
Contributor

pprcht commented Jul 22, 2024

This has been raised in some other issues as well, but currently the implicit solvation implementation of tblite is inconsistent with the xtb implementation. This is what you are seeing.
The tblite developers are somewhat aware of the issue, there has been a pending PR on their side for a few months.... tblite/tblite#142
Can't really do much from the CREST side, unfortunately.

@ledragna
Copy link

I wonder, shouldn't there be a warning in the documentation?
The very first example is with implicit solvent.

@yt203y
Copy link

yt203y commented Jul 23, 2024

From the crest manual, I understood that crest has option for selecting xtb version (this is from crest manual page at https://crest-lab.github.io/crest-docs/page/documentation/keywords.html#general-and-technical-options)

-xnam Specify the name (and path) of the xtb binary that should be used as . The [default] is xtb.

However, when I tried to use this option in crest version 3.0.1, it still use tblite as if I cannot choose tight-binding engine. Perhaps if this option is usable (valid), maybe the switching from tblite to xtb 6.7.0 will help solve this charge/solvent issue for the time being ?

@pprcht
Copy link
Contributor

pprcht commented Jul 25, 2024

I wonder, shouldn't there be a warning in the documentation?
The very first example is with implicit solvent.

Yes, I agree.
Maybe we can also peer-pressure the tblite developers into updating the alpb implementation. I will contact them again.

-xnam Specify the name (and path) of the xtb binary that should be used as . The [default] is xtb.

This is a setting for legacy runtypes, QCG and the sorts. It won't work for geometry optimization.

If you really want a workaround and drive an optimization via xtb system calls you can define it in a toml input file:

#This is a CREST input file
input = 'struc.xyz'
runtype='ancopt'
optlev = 'vtight'

#parallelization
threads = 4

#calculation level
[[calculation.level]]
method = "xtb"
binary='xtb --alpb water --chrg 2'

However, since there is quite some I/O associated with it, I do not recommend using this for conformational sampling. Also, calling xtb directly for an optimization may be quicker in this case anyways.

@yt203y
Copy link

yt203y commented Jul 30, 2024

Thank you very much for your helpful suggestions.

@pprcht pprcht added bug Something isn't working question Further information is requested labels Aug 6, 2024
@pprcht pprcht changed the title Can't optimize with charge and solvent Inconsitent implicit solvation between tblite and xtb Aug 6, 2024
@pprcht pprcht pinned this issue Aug 6, 2024
@pprcht
Copy link
Contributor

pprcht commented Aug 19, 2024

Hi,
I took matters in my own hand and worked a bit on the pending PR in tblite. It might be some time until it is actually merged in from their side, but in the meantime I let the tblite subproject in CREST point towards a fork that already includes the implicit solvation fix. #331 should therefore enable the correct treatment of implicit solvation!

Bacillaene now optimizes just fine for me and converges within 19 opt cycles. Energies for small molecules, e.g. caffeine, are consistent between CREST or tblite and xtb up to ~10-8 Eh, for larger molecules the differences get a bit larger than this, but simply because the back end implementations differ.

The change is present in the master branch now, I will draft a proper 3.0.2 release soon, once I updated the GH release workflow.

@pprcht pprcht added the fixed The issue has been resolved label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed The issue has been resolved question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants