xtb icon indicating copy to clipboard operation
xtb copied to clipboard

Gaussian / xtb interface that provides Hessians

Open clavigne opened this issue 4 years ago • 11 comments

xtb currently ships with a preliminary interface to Gaussian. However, the basic interface doesn't include the ability to pass Hessian information, which is critical for some optimization problems (such as finding transition states), and can be used to improve the speed of Gaussian's own ab initio optimizations by reading xtb Hessians as initial Hessian guesses. In addition, the current xtb-gaussian interface is a bit fragile with respect to paths for input-output files.

For work we are currently engaged in, I coded a basic single-file Perl script that addresses these problems (based on an earlier Python version by @kjelljorner and @gabegomes ). It's located here, it's pretty robust and quite fast. It doesn't use any external perl packages so it should just work out of the box.

I currently have it licensed under MIT, meaning you can just integrate it directly in xtb if you want. I considered submitting it as a PR but I wasn't sure what your opinions are on introducing Perl code or on interop with Gaussian. If you are interested, I can probably write the necessary fortran code to move the feature into xtb proper, but I'm not sure when I will have time to do so.

Thanks for the great program!

clavigne avatar Aug 18 '20 16:08 clavigne

I guess, I start with my usual Gaussian disclaimer. Since I don't have access to Gaussian, I can't test any compatibility features.™

Leaving that aside, thanks for writing this up. Not sure if I want to include something I can't officially support, but I think a link from the documentation, similar to the Orca interface is possible.

Also, I would prefer to fix issues in the xtb codebase first before working around them in a wrapper script, looks like you identified some. Most should be straight-forward to implement in xtb leaving the wrapper script with the job of reshuffling the commandline arguments.

The information used to infer whether Gaussian specific output should be written or not is currently stored in the input file type and accessible everywhere the molecular structure is available:

https://github.com/grimme-lab/xtb/blob/0a0ed2ccddcf41fb423b90d6f16439bc68be4580/src/prog/main.F90#L800-L809

awvwgk avatar Aug 18 '20 17:08 awvwgk

Oh that actually looks way easier than I thought, thanks for the pointer. I guess I can just match the turbomole code by adding fres to writeResultsGaussianExternal?

That's probably what I should have done from the get go :D I'll PR it when it's ready and tested.

clavigne avatar Aug 18 '20 17:08 clavigne

For the hessian it dependents on what Gaussian is expecting, a non-massweighted unprojected hessian is written here: https://github.com/grimme-lab/xtb/blob/0a0ed2ccddcf41fb423b90d6f16439bc68be4580/src/hessian.F90#L475-L478 The projected variant is written a few lines later: https://github.com/grimme-lab/xtb/blob/0a0ed2ccddcf41fb423b90d6f16439bc68be4580/src/hessian.F90#L493-L497 The frequency results object contains only the normal modes and frequencies, it might be necessary to cache the unmodified second deriviatives as well for this purpose.

awvwgk avatar Aug 18 '20 20:08 awvwgk

I'm try to test the xtb (6.3.2) interface with gaussian. The input *.EIn from external guassian it is read well from xtb but the *.EOu external gaussian output (as it present in writeResultsGaussianExternal) it is not created in the working directory. I'm testing only with the --grad command at the moment, above the line I used in the shell: **xtb *.EIn --grad **

Sorry for the dummy question, I tried many way to solve this issue without success.

Really thanks for the great program and methods!

TinacciL avatar Nov 03 '20 21:11 TinacciL

Thank you for contacting Florida State University. The following person(s) you are trying to contact directly or through a distribution list are no longer with the university. Gabriel Gomes ([email protected]) For further assistance, please contact the ITS Service Desk at 850-644-HELP (4357) or help.fsu.edu. This is an automated notification. Replies to this mailbox are not monitored.

gabegomes avatar Nov 03 '20 22:11 gabegomes

Hey so I believe this is the issue fixed by #362 which is not yet in a released version. If that's the case, your folder should contain a file with name .EOu that will be revealed by ls -a

If that is the case, putting a / in the path ( running xtb ./file.Ein) should work.

clavigne avatar Nov 03 '20 22:11 clavigne

It was hidden in the directory! Everything works now.

Thansk for the hint and the great job you did on interfacing the hessian in the guassian external format!

TinacciL avatar Nov 03 '20 22:11 TinacciL

I saw this post and just want to ask is there a way I can run transition structure optimization in xtb? Or is there a way I can calculate hessian using xtb and feed to gaussian to do the transition structure optimization (as in Gaussian there is keyword TS for opt)?

MiloCheng17 avatar Mar 05 '21 18:03 MiloCheng17

xtb does not provide a TS optimizer yet, the closest feature we support is an interface to the growing string method (see https://xtb-docs.readthedocs.io/en/latest/gsm.html). Also the QC package Orca does have an interface to xtb which allows TS optimization and IRC methods.

For Gaussian I can't offer any support here.

awvwgk avatar Mar 05 '21 18:03 awvwgk

I can attest that it does indeed work with Gaussian and all of its TS tools. In fact, that’s one of the applications that we envisioned from the start and I have been using it for that for a while now. Good luck with your tests!

gabegomes avatar Mar 05 '21 18:03 gabegomes

Thank you for your comments. I have tried the gsm with the example, but I got Segmentation fault, don't really know what is the problem. @gabegomes Can you share with more details, an example how to run your calculations for TS optimization will be really helpful?

MiloCheng17 avatar Mar 05 '21 18:03 MiloCheng17