Is number of opt steps needed available python side?

I’m carrying out a large number of partially constrained DFT optimisations and, in some cases, the structures are far from equilibrium so there has been a fair bit of tweaking of options to get something that works for most of my structures.

One thing that would be handy to have is the number of optimisation steps taken to reach convergence. I can grab this from the output files but it would make things a lot simpler if I could retrieve the number of steps from a variable python side. I don’t think this is currently possible but maybe it will eventually become available once more of the optimisation code moves more into the python domain? (I guess that vaguely makes this a feature request!)

It is currently possible! Just call psi4.variable("OPTIMIZATION ITERATIONS").

Once “the optimization code moves more into the Python domain,” we’ll probably move this information to the wavefunction, so that as long as you still have the wavefunction object around, you can ask how long that particular optimization took.

Looks like that should do the trick! I thought I’d had a good trawl through the code but missed it! I think I was looking for “steps” rather than “iterations”…

Thanks. :grinning:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.