Molcas Forum

Support and discussions for Molcas and OpenMolcas users and developers

You are not logged in.

Announcement

Welcome to the Molcas forum.

Please note: The forum's URL has changed. The new URL is: https://molcasforum.univie.ac.at. Please update your bookmarks!

You can choose an avatar and change the default style by going to "Profile" → "Personality" or "Display".

#1 2021-09-01 23:21:51

andrewshyichuk
Member
Registered: 2020-02-13
Posts: 86

Potential bug in geometry optimization

Dear Developers,

I've found a potential bug in geometry optimization.
However, I am not sure it is a bug, hence I post it here.

For a context: I'm trying to catch a shallow local minimum and use a very small step (MAXStep 0.003).

Here's a piece of output:

**********************************************************************************************************************
*                                    Energy Statistics for Geometry Optimization                                     *
**********************************************************************************************************************
                       Energy     Grad      Grad              Step                 Estimated   Geom       Hessian
Iter      Energy       Change     Norm      Max    Element    Max     Element     Final Energy Update Update   Index
  1   -156.30368366  0.00000000 2.594869  2.533983 dEdx003  0.000184* nrc010     -156.30393018 RS-RFO  None      0
  2   -156.30416185 -0.00047819 2.484869  2.421230 dEdx003  0.000214* nrc010     -156.30443792 RS-RFO  BFGS      0
  3   -156.30466027 -0.00049842 2.357160  2.289984 dEdx003  0.000142* nrc010     -156.30483431 RS-RFO  BFGS      0
  4   -156.30502777 -0.00036750 2.272586  2.202837 dEdx003  0.000097* nrc010     -156.30514267 RS-RFO  BFGS      0
  5   -156.30526483 -0.00023707 2.214916  2.143292 dEdx003  0.000077* nrc010     -156.30535353 RS-RFO  BFGS      0
  6   -156.30544642 -0.00018159 2.169277  2.096096 dEdx003  0.000077* nrc010     -156.30553372 RS-RFO  BFGS      0
  7   -156.30560256 -0.00015613 2.123483  2.048666 dEdx003  0.000077* nrc010     -156.30568847 RS-RFO  BFGS      0
  8   -156.30577579 -0.00017324 2.077699  2.001172 dEdx003  0.000078* nrc010     -156.30586031 RS-RFO  BFGS      0
  9   -156.30595127 -0.00017548 2.031758  1.953431 dEdx003  0.000078* nrc010     -156.30603444 RS-RFO  BFGS      0
 10   -156.30611986 -0.00016859 1.985680  1.905458 dEdx003  0.000078* nrc010     -156.30620169 RS-RFO  BFGS      0
 11   -156.30625939 -0.00013952 1.939454  1.857233 dEdx003  0.000079* nrc010     -156.30633989 RS-RFO  BFGS      0
 12   -156.30640343 -0.00014404 1.893119  1.808790 dEdx003  0.000079* nrc010     -156.30648263 RS-RFO  BFGS      0
 13   -156.30658412 -0.00018069 1.846654  1.760096 dEdx003  0.000080* nrc010     -156.30666204 RS-RFO  BFGS      0
 14   -156.30673122 -0.00014711 1.799886  1.710958 dEdx003  0.000080* nrc010     -156.30680785 RS-RFO  BFGS      0
 15   -156.30686375 -0.00013253 1.753061  1.661624 dEdx003  0.000081* nrc010     -156.30693916 RS-RFO  BFGS      0
 16   -156.30703400 -0.00017025 1.705972  1.611859 dEdx003  0.000081* nrc010     -156.30710828 RS-RFO  BFGS      0
 17   -156.30719667 -0.00016267 1.658631  1.561658 dEdx003  0.000082* nrc010     -156.30726985 RS-RFO  BFGS      0
 18   -156.30732587 -0.00012920 1.611000  1.510964 dEdx003  0.000083* nrc010     -156.30739788 RS-RFO  BFGS      0
 19   -156.30748111 -0.00015524 1.563106  1.459781 dEdx003  0.000084* nrc010     -156.30755215 RS-RFO  BFGS      0
 20   -156.30760510 -0.00012399 1.514805  1.407927 dEdx003  0.000085* nrc010     -156.30767517 RS-RFO  BFGS      0
 21   -156.30771017 -0.00010507 1.466157  1.355435 dEdx003  0.000086* nrc010     -156.30777933 RS-RFO  BFGS      0
 22   -156.30789174 -0.00018158 1.417141  1.302241 dEdx003  0.000087* nrc010     -156.30796007 RS-RFO  BFGS      0
 23   -156.30805266 -0.00016092 1.367649  1.248184 dEdx003  0.000089* nrc010     -156.30812027 RS-RFO  BFGS      0
 24   -156.30814038 -0.00008772 1.317664  1.193184 dEdx003  0.000091* nrc010     -156.30820735 RS-RFO  BFGS      0
 25   -156.30834278 -0.00020240 1.267148  1.137129 dEdx003  0.000092* nrc010     -156.30840925 RS-RFO  BFGS      0
 26   -156.30843189 -0.00008910 1.216004  1.079817 dEdx003  0.000095* nrc010     -156.30849801 RS-RFO  BFGS      0
 27   -156.30858754 -0.00015565 1.164213  1.021111 dEdx003  0.000097* nrc010     -156.30865347 RS-RFO  BFGS      0
 28   -156.30867782 -0.00009028 1.111787  0.960874 dEdx003  0.000100* nrc010     -156.30874377 RS-RFO  BFGS      0
 29   -156.30880096 -0.00012314 1.058657  0.898826 dEdx003  0.000103* nrc010     -156.30886723 RS-RFO  BFGS      0
 30   -156.30896676 -0.00016580 1.004801  0.834673 dEdx003  0.000107* nrc010     -156.30903367 RS-RFO  BFGS      0
 31   -156.30909482 -0.00012806 0.950449  0.768326 dEdx003  0.000111* nrc010     -156.30916284 RS-RFO  BFGS      0
 32   -156.30919760 -0.00010278 0.895625  0.699303 dEdx003  0.000115* nrc010     -156.30926746 RS-RFO  BFGS      0
 33   -156.30935477 -0.00015718 0.840692  0.627334 dEdx003  0.000120* nrc010     -156.30942744 RS-RFO  BFGS      0
 34   -156.30952657 -0.00017180 0.786337  0.552275 dEdx003  0.000125* nrc010     -156.30960328 RS-RFO  BFGS      0
 35   -156.30959400 -0.00006742 0.733687  0.474206 dEdx003 -0.000150* nrc002     -156.30967601 RS-RFO  BFGS      0     << Something happens here
 36   -156.30978563 -0.00019163 0.684888 -0.458999 dEdx002 -0.000939* nrc002     -156.31017684 RS-RFO  BFGS      0     << Something happens here
 37   -156.31050652 -0.00072089 0.586473 -0.459910 dEdx002 -0.000976* nrc002     -156.31085352 RS-RFO  BFGS      0
 38   -156.31119837 -0.00069185 0.564875 -0.460188 dEdx002 -0.000983* nrc002     -156.31153633 RS-RFO  BFGS      0
 39   -156.31185922 -0.00066085 0.560410 -0.460164 dEdx002 -0.000985* nrc002     -156.31219526 RS-RFO  BFGS      0
 40   -156.31258967 -0.00073044 0.559230 -0.460003 dEdx002 -0.000986* nrc002     -156.31292514 RS-RFO  BFGS      0
 41   -156.31325679 -0.00066712 0.558612 -0.459789 dEdx002 -0.000986* nrc002     -156.31359193 RS-RFO  BFGS      0
 42   -156.31391736 -0.00066057 0.558108 -0.459554 dEdx002 -0.000987* nrc002     -156.31425220 RS-RFO  BFGS      0
 43   -156.31460024 -0.00068288 0.557629 -0.459306 dEdx002 -0.000987* nrc002     -156.31493480 RS-RFO  BFGS      0
 44   -156.31522911 -0.00062887 0.557157 -0.459054 dEdx002 -0.000987* nrc002     -156.31556339 RS-RFO  BFGS      0
 45   -156.31588965 -0.00066054 0.556687 -0.458795 dEdx002 -0.000987* nrc002     -156.31622365 RS-RFO  BFGS      0
 46   -156.31658762 -0.00069797 0.556220 -0.458541 dEdx002 -0.000988* nrc002     -156.31692134 RS-RFO  BFGS      0
 47   -156.31724971 -0.00066209 0.555752 -0.458273 dEdx002 -0.000988* nrc002     -156.31758316 RS-RFO  BFGS      0
 48   -156.31784637 -0.00059666 0.555289 -0.458028 dEdx002 -0.000988* nrc002     -156.31817953 RS-RFO  BFGS      0
 49   -156.31850655 -0.00066018 0.554833 -0.457730 dEdx002 -0.000988* nrc002     -156.31883943 RS-RFO  BFGS      0
 50   -156.31918261 -0.00067606 0.554397 -0.457531 dEdx002 -0.000988* nrc002     -156.31951523 RS-RFO  BFGS      0
 51   -156.31986649 -0.00068387 0.553942 -0.457175 dEdx002 -0.000988* nrc002     -156.32019884 RS-RFO  BFGS      0
 52   -156.32049763 -0.00063114 0.553427 -0.456974 dEdx002 -0.000989* nrc002     -156.32082967 RS-RFO  BFGS      0
 53   -156.32119023 -0.00069260 0.552950 -0.456690 dEdx002 -0.000989* nrc002     -156.32152199 RS-RFO  BFGS      0
 54   -156.32181420 -0.00062397 0.552484 -0.456418 dEdx002 -0.000990* nrc002     -156.32214568 RS-RFO  BFGS      0
 55   -156.32252347 -0.00070927 0.552015 -0.456145 dEdx002 -0.000990* nrc002     -156.32285467 RS-RFO  BFGS      0
 56   -156.32314625 -0.00062278 0.551552 -0.455875 dEdx002 -0.000990* nrc002     -156.32347717 RS-RFO  BFGS      0
 57   -156.32382412 -0.00067787 0.551085 -0.455602 dEdx002 -0.000990* nrc002     -156.32415476 RS-RFO  BFGS      0
 58   -156.32447169 -0.00064757 0.550618 -0.455322 dEdx002 -0.000990* nrc002     -156.32480205 RS-RFO  BFGS      0
 59   -156.32510864 -0.00063695 0.550156 -0.455060 dEdx002 -0.000991* nrc002     -156.32543872 RS-RFO  BFGS      0
 60   -156.32583571 -0.00072707 0.549692 -0.454754 dEdx002 -0.000991* nrc002     -156.32616550 RS-RFO  BFGS      0
 61   -156.32642352 -0.00058782 0.549251 -0.454531 dEdx002 -0.000991* nrc002     -156.32675305 RS-RFO  BFGS      0
 62   -156.32707107 -0.00064755 0.548813 -0.454162 dEdx002 -0.000991* nrc002     -156.32740034 RS-RFO  BFGS      0
 63   -156.32776052 -0.00068945 0.548329 -0.453979 dEdx002 -0.000991* nrc002     -156.32808950 RS-RFO  BFGS      0
 64   -156.32840017 -0.00063965 0.547826 -0.453670 dEdx002 -0.000992* nrc002     -156.32872886 RS-RFO  BFGS      0
 65   -156.32902453 -0.00062436 0.547359 -0.453381 dEdx002 -0.000992* nrc002     -156.32935294 RS-RFO  BFGS      0

After step 35, dEdx003 is no longer the element with the largest gradient, dEdx002 is.
It's gradient is negative, resulting in negative StepMax and GradMax.
Also, note how StepMax increases by an order of magnitude.
At this point, all trends break: energy starts going down faster, while GradNorm no longer decreases.

My thinking: somewhere a gradient limit is not using absolute values, and when the maximum element becomes negative, the scaling also becomes negative, leading to the weird stuff.

So, is it a bug?

Thanks.

Offline

#2 2021-09-02 11:28:56

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,085

Re: Potential bug in geometry optimization

Grad Max and Step Max refer to individual components of the gradient and step, and they can be negative (max, of course, means maximum in absolute value). The energy keeps going down, so I don't see anything wrong. Maybe the shallow minimum doesn't exist (at your level of theory and accuracy).

Offline

#3 2021-09-02 15:11:42

andrewshyichuk
Member
Registered: 2020-02-13
Posts: 86

Re: Potential bug in geometry optimization

That makes sense, there might be no minimum. However, GradNorm stops going down, while energy change and StepMax increase abruptly.

Also, doing this same optimization with a larger step eventually leads to energy increases (the system kinda jumps around).

I will do some more tests though.

Offline

Board footer

Powered by FluxBB 1.5.11

Last refresh: Today 20:03:55