Information on optimization progress when using numerical gradients

20 views
Skip to first unread message

paul.j...@gmail.com

unread,
Jun 18, 2025, 3:50:02 AMJun 18
to dirac-users
Dear DIRAC users and developers,

I'd like to know how to see the progress of the geometry optimization using numerical gradients in the output.

What I mean by that is that when using the .NUMGRAD option, the optimization steps performed by DIRAC are not really transparent. 

I see that apparently the structure is changing after each SCF cycle, but I can find no information on the current optimization iteration step, the calculated gradient, the taken step and the energy at the current structure the way the "Optimization Control Center" nicely compiles when using an analytical gradient. 

I have tried increasing the verbosity using .PRINT in the *OPTIMIZATION subsection, but for my test calculations that does not give any additional information.

Do you have any suggestion how I can enable this information?

Attached are two output files with geometry optimizations using analytical and numerical gradients, respectively, to illustrate my point. (Note that I have stopped the numerical gradient optimization after a couple of steps, but it should be sufficient output to see what i mean)

Thank you and best wishes,

   Paul
opt_gradient_analytical.out
opt_gradient_numerical_stopped.out

Miroslav Iliaš

unread,
Jun 20, 2025, 8:47:14 AMJun 20
to dirac...@googlegroups.com
Dear Paul,

you do not have to increase PRINT level, just watch this type of messages in your output below.

Ideal cases are few atoms and high symmetry.

                             Optimization information
                             ------------------------

 Iteration number               :       9
 End of optimization            :       T
      ****  Geometry optimization has converged  ****
 Energy at this geometry is     :    -115.155510301872
 Energy change from last geom.  : -2.846533D-07 (the threshold is: 1.00D-06)
 Predicted change               : -2.326512D-07
 Ratio, actual/predicted change :  1.223520D+00
 Norm of gradient               :  7.870747D-05 (the threshold is: 1.00D-04)
 Norm of step                   :  3.777747D-03 (the threshold is: 1.00D-04)
 Updated trust radius           : 6.000001D-01
 Total Hessian index            :       0

at the end you get the optimization summary info:

@ Iter          Energy     Change    GradNorm  Index   StepLen    TrustRad #Rej
@ -----------------------------------------------------------------------------
@   0          -115.005301 0.000D+00 8.239D-01    0    0.500000    0.500000   0
@   1          -115.125982-1.207D-01 2.443D-01    0    0.348539*   0.600000   0
@   2          -115.148058-2.208D-02 1.109D-01    0    0.270664*   0.600000   0
@   3          -115.154545-6.487D-03 4.239D-02    0    0.092385*   0.600000   0
@   4          -115.155372-8.269D-04 1.388D-02    0    0.043494*   0.600000   0
@   5          -115.155489-1.169D-04 3.451D-03    0    0.019048*   0.600000   0
@   6          -115.155506-1.706D-05 6.828D-04    0    0.015191*   0.600000   0
@   7          -115.155510-3.353D-06 3.920D-04    0    0.007319*   0.600000   0
@   8          -115.155510-4.431D-07 2.194D-04    0    0.009798*   0.600000   0
@   9          -115.155510-2.847D-07 7.871D-05    0    0.003778*   0.600000   0 

--
You received this message because you are subscribed to the Google Groups "dirac-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dirac-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dirac-users/18f9720f-6c7f-45bc-a605-c075e944f0adn%40googlegroups.com.

paul.j...@gmail.com

unread,
Jun 20, 2025, 11:53:57 AMJun 20
to dirac-users
Dear Miroslav,

Thank you for the reply!

Yes, you are completely correct: For the optimization using analytical gradients (see the file "opt_gradient_analytical.out"), I find this very helpful "Optimization Control Center" progress overview.

However, when I switch to an optimization via numerical gradients (see the file "opt_gradient_numerical_stopped.out"), this information is not printed in the output file.

Screenshot 2025-06-20 175154.png

Is the just the general behavior when using numerical gradients or am I missing something?

Many thanks and best wishes,

   Paul

Hans Jørgen Aagaard Jensen

unread,
Jun 20, 2025, 4:10:55 PMJun 20
to dirac...@googlegroups.com

Dear Paul,

 

You stopped the numerical gradient calculation much too early, this is why you do not see any “Optimization Control center” output.

 

Methanol has 6 atoms, i.e. 18 coordinates. The numerical calculation of the gradient requires 2*18+1 = 37 energy evaluations (numerical gradient evaluations are expensive!). You stopped the calculation after 20 SCF energy evaluations, i.e. still 17 to go for constructing the first gradient needed for the first geometry step!

 

Best regards, Hans Jørgen.

 

 

Fra: <dirac...@googlegroups.com> på vegne af "paul.j...@gmail.com" <paul.j...@gmail.com>
Svar til: "dirac...@googlegroups.com" <dirac...@googlegroups.com>
Dato: onsdag den 18. juni 2025 kl. 09.50
Til: dirac-users <dirac...@googlegroups.com>
Emne: [dirac-users] Information on optimization progress when using numerical gradients

 

--

paul.j...@gmail.com

unread,
Jun 21, 2025, 4:20:46 AMJun 21
to dirac-users
Dear Hans Jørgen,

I see the problem now - thank you for clearing this up!! So it's probably really simply not feasible for a larger system.

Best wishes,

  Paul
Reply all
Reply to author
Forward
0 new messages