grimme-lab / xtb

Semiempirical Extended Tight-Binding Program Package
https://xtb-docs.readthedocs.io/
GNU Lesser General Public License v3.0
588 stars 148 forks source link

Transition state optimization using xtb #494

Open ghost opened 3 years ago

ghost commented 3 years ago

Hello!

I'm currently using xtb to search transition states (using your RSMD-NEB implementation) and I want to optimize the obtained TS.

For now, I'm using ORCA to optimize these TS but the numerical evaluation of hessian is so much slower that your implementation in xtb. I've seen in the .xtbrc file at the git root that there is two instructions in the "$opt" part : "ts=0" and "tsroot=0" but I don't know if it is related to TS optimization (perhaps mode following?)

So I was wondering if a method for optimizing transition states was implemented in xtb.

Thank you in advance for your reply.

awvwgk commented 3 years ago

xtb does not implement a transition state optimizer, but there are viable alternatives available:

kjelljorner commented 3 years ago

If you have access to Gaussian, xtb-gaussian solves exactly that problem.

awvwgk commented 3 years ago

Thanks, Kjell.

I think we could create a new guide at the xtb documentation for projects that allow interfacing with xtb and related software.

kjelljorner commented 3 years ago

That is a good idea. Recently I have also been using PySCF, which allows you to create a custom energy/gradient function and uses pyberny or geometric as backends. geometric has an experimental mode for TS optimizations. Even optimization in Cartesian coordinates with SciPy optimizers is sometimes a feasible option.

Me and possibly @clavigne would be happy to contribute to the guide.

awvwgk commented 3 years ago

TS optimizations with geometric should be available in the QCEngine integration as well than.

I will start with the information I have already collected and ping you once the page is online.

clavigne commented 3 years ago

@awvwgk Sorry to hijack but I was wondering... is TS optimization something of interest for the xtb project or not?

I can see how the additional code complexity might not be desirable or maybe it was tried and it didn't work.

But if the issue is that it simply hasn't been implemented, I could give it a shot. The RF code is very clean. As far as I can tell, TS optimization would require quite small changes. Minimally, modifying

https://github.com/grimme-lab/xtb/blob/afa7bdffd36dee5f58b6f658004a3bac3567aabc/src/optimizer.f90#L690

so that a different eigenvalue can be selected and potentially

https://github.com/grimme-lab/xtb/blob/afa7bdffd36dee5f58b6f658004a3bac3567aabc/src/optimizer.f90#L691-L697

to use a more stable truncation for large steps (as described in https://link.springer.com/article/10.1007/s002140050387).

It would also benefit from adding a flag to recompute the numerical Hessian on every macro iteration.

I'd be interested in giving it a go, but only if it's of interest to the project. I saw that there used to be something similar in xtb (using mode following?) and I'm interested in your experience.

Thanks

awvwgk commented 3 years ago

We had originally a somewhat unstable version in xtb (I think it was based on the mode following algorithm), but we later removed it and so far haven't tried to implement a new version. Having a decent transition state optimizer in xtb would be a major step forward indeed.

If you are interested in working on such a project in xtb you are more than welcome. Let me know if there is anything I can help you with.

kjelljorner commented 3 years ago

I agree that an internal TS optimizer would be of great value to the community. Especially as it would cut down the overhead associated with communicating with external programs.

pwging13 commented 3 years ago

If you have access to Gaussian, xtb-gaussian solves exactly that problem.

I don't see any documentation on using xtb-gaussian. I found this (http://sobereva.com/soft/gau_xtb/) which does I think the same thing.

Do you just drop the xtb-gaussian script in the same director with the xtb executable? Or does Gaussian want it with its executable. Does it matter so long as it is somewhere in your path?

awvwgk commented 3 years ago

@pwging13 Let's open a new thread for this discussion, either here at the xtb repo or at the xtb-gaussian repo.

ghost commented 3 years ago

Thank you for your answers! I hope that this feature will be implemented.

eljost commented 3 years ago

Just to add my 2 cents: my code pysisyphus has full support for TS-Optimization using XTB and it can also run COS methods like GSM in internal coordinates and NEB in various flavors. Additionally it also supports subsequent IRC integration using an efficient algorithm that utilizes Hessian information.

awvwgk commented 3 years ago

@eljost really nice work. I have been following your work in pysisyphus for a while now, but didn't get a chance to try it yet.

awvwgk commented 3 years ago

I started a community resource page. I'll try to fill in more projects I have been tracking and try to categorize them a bit, maybe even get some examples in. You are welcome to contribute to this section at grimme-lab/xtb_docs by adding new pages under source/community.

Erikna00 commented 1 year ago

xtb does not implement a transition state optimizer, but there are viable alternatives available:

  • molecularGSM with the xtb standalone
  • sella together with the xtb Python API and ASE integration
  • pyGSM which interfaces the xtb Python API
  • QCEngine provides some optimizer, but I don't know if any of them is suitable for TS optimization
  • if you have a Turbomole installation, using jobex -level xtb -trans might work as well (requires some hacking in jobex)

How does one call a NEB calculation in default XTB in the commandline? I can´t find such an option in the docs....