Geometry Optimization with Brent's Algorithm: CP2K and VASP

189 views
Skip to first unread message

Nicholas Winner

unread,
Jul 21, 2022, 7:12:53 PM7/21/22
to cp2k
Hi all, 

I'm working with some people that are using VASP while I am using CP2K. While CP2K has really fast SCF procedure, it seems to be slower when it comes to geometry optimization for some reason.

I've dug into VASP's manual and they claim that their CG method uses "a modified version of Brent's algorithm." No further details are given. Normally with CP2K, I use 2PNT line search with my CG minimizations, and I think this is pretty standard for everyone else. I do know that CP2K supports FIT and GOLD line search options which use Brent's algorithm (actually I don't 100% know how FIT and Brent's Algorithm are related, but gold uses it at least). However, GOLD line search is very slow in CP2K, as we are warned in the manual.

So, my hunch, is that CP2K with some type of gold or fit line search would be able to match this "modified Brent's algorithm" and provide faster minimization than what I am currently getting. Are there some insights that people can provide for choosing settings for gold line search that can give decent results? To remind, the flags we have to play with are:

BRACK_LIMIT {Real}
Limit in 1D bracketing during line search in Conjugate Gradients Optimization.
Default value: 1.00000000E+002


BRENT_MAX_ITER {Integer}
Maximum number of iterations in brent algorithm (used for the line search in Conjugated Gradients Optimization)
Default value: 100

BRENT_TOL {Real}
Tolerance requested during Brent line search in Conjugate Gradients Optimization.
Default value: 1.00000000E-002

INITIAL_STEP {Real}
Initial step size used, e.g. for bracketing or minimizers. Might need to be reduced for systems with close contacts
Default value: 2.00000000E-001


Could it be that VASP uses a loose value for BRENT_TOL, or maybe a small number of max steps? Furthermore, what is the tolerance in the algorithm? Tolerance for the atomic position refinement, or forces?


If anyone has any ideas, it would be much appreciated.

-Nick

Filipe Menezes

unread,
Jul 22, 2022, 4:02:26 AM7/22/22
to cp...@googlegroups.com
Hi Nicholas,

I’ve experience two problems in line searches. One is that some of them require too many SCF calculations. For instance, Fletcher proposed a few quadratic line searches, and at each point you end up evaluating the function and its gradients (the function here is the SCF). In my test calculations, for each line search, I was calling 5 SCF. This resulted in extremely (perhaps painfully) slow geometry optimization. 

The other problem is related to the confidence radius. If the line search is not in optimal conditions, it will penalize the step scaling, sometimes too much. For instance, some line searches are based on the Wolfe conditions, and if you do not have all criteria checked, you basically allow for a step of norm 1e-4 (Angstrom) or even less. Consequently, you don’t get out of the point you are, and this behaviour is kept for long. In many mathematical applications this is however better than shooting off and killing your root finding or minimization. 

My first guess from checking a few papers of others is that something like the second point is happening with CP2K's Brent line search. The Brent method uses a mixture of golden section and quadratic fit of the function, and I believe that if you play around with the criteria that decides whether to use one or another, you will be able to improve results. The cost of the modification might however be that you will sacrifice the convergence properties of well behaved systems.
An alternative, if you like a bit of programming and code digging, would be to implement other methods. I can also give you some advice, since I spent some time on that problem.

Best
Filipe

--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/c3f8726c-7587-4240-8e97-c2a97f3ebdafn%40googlegroups.com.

Krack Matthias (PSI)

unread,
Jul 22, 2022, 6:44:39 AM7/22/22
to cp...@googlegroups.com

Hi Nick

 

According to my experience BFGS works best (fastest) in GEO_OPT and CELL_OPT runs. I suggest to disable the default USE_MODEL_HESSIAN with BFGS. For larger systems (>3000 atoms), I suggest LBFGS.

 

Matthias

--

Nicholas Winner

unread,
Jul 24, 2022, 3:29:06 PM7/24/22
to cp2k
Hi Matthias, normally I use BFGS.  In my case of an adsorbate on metal, BFGS just hops around the minimum with no clear progress. CG (2pnt) does slowly work toward the minimum which is why I switched to it, its just slower.

I disabled USE_MODEL_HESSIAN and the convergence become much worse.

Still looking at some variations of the settings in "GOLD" line search to match Filipe's recommendation, but to no avail. So, so far, 2 point line search seems the best option, but there's something better hiding in the settings I can feel.

Krack Matthias (PSI)

unread,
Jul 25, 2022, 11:58:53 AM7/25/22
to cp...@googlegroups.com

Hi Nick

 

Such convergence problems are usually caused by noisy forces and/or a very flat PES. Did you also try a smaller trust radius (e.g. 0.1) and/or rational function optimization with BFGS?

Nicholas Winner

unread,
Jul 30, 2022, 2:05:07 PM7/30/22
to cp2k
I reduced the trust radius and the relaxation is dramatically more stable. In the manual it says the trust radius used to be 0.1 but was increased to 0.25 for some reason. Not sure why, stability seems pretty good with 0.1

Thanks for helping.

Nick

Reply all
Reply to author
Forward
0 new messages