jhrmnn / pyberny

Molecular structure optimizer
Mozilla Public License 2.0
110 stars 21 forks source link

Missing test framework #2

Closed jhrmnn closed 6 years ago

jhrmnn commented 7 years ago

Having good tests will be crucial for a geometry optimizer, because it's very easy to unconsciously break existing behavior.

For that, there should be a fast, lightweight method (force field?) for getting energies and gradients, that has a Python API and works for both molecules and crystals.

isayev commented 7 years ago

Hey, @azag0 do you have a working example with MOPAC or any QM code? I am trying to use pyberny with my ML empirical potential, but could not converge optimization for any molecule. Thanks.

BTW, Down the road ANI-1 could be a choice to run fast tests, because you could also do reactions with it.

sunqm commented 7 years ago

Seems working alright with pyscf https://github.com/sunqm/pyscf/blob/master/pyscf/geomopt/berny_solver.py#L60

jhrmnn commented 7 years ago

I've added a pytest test framework in 5033ea4. At the moment, it contains a single basic test using a Mopac2016 driver. There is no documentation, let's see first if it's the right approach.

jhrmnn commented 7 years ago

@isayev See this Jupyter notebook for examples with Mopac2016 and Pyscf. (Pyscf has also its own native interface to pyberny.)

There were some issues with convergence with Mopac. I didn't investigate much, but I believe that the accuracy of the gradients from Mopac might not be enough, which throws off the quadratic step once close to the equilibrium structure. Setting the convergence criteria for the step length larger than the defaults "solves" this. (The gradient criteria are still default and quite tight.)

isayev commented 7 years ago

Thanks a lot, @azag0 ! Those two solver examples are very useful 👍