jhrmnn / pyberny

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

Diverging energy with Mopac #6

Closed jhrmnn closed 6 years ago

jhrmnn commented 7 years ago

[by @isayev]

When I use your default mopac example, Aniline (and most of other complex molecules I tried) diverge with MOPAC2016:

1 Energy: -37.3916665135 2 Energy: -37.3919700706 3 Energy: -37.3931100633 4 Energy: -37.3933052071 5 Energy: -37.3933573925 6 Energy: -37.3936675646 7 Energy: -37.3938858611 8 Energy: -37.3934018603 9 Energy: -36.6168003763 10 Energy: -36.7497072843 11 Energy: -37.1491567655 12 Energy: -36.8690647429 13 Energy: -36.6806972992 14 Energy: -36.5497679222 15 Energy: -36.4247240975 16 Energy: -36.0447673158 17 Energy: -33.6421988409 18 Energy: -33.921989144 19 Energy: -33.9627506826

ValueError Traceback (most recent call last)

in () 1 solver = MopacSolver(cmd='/opt/mopac/MOPAC2016.exe') ----> 2 final = optimize(solver, ethanol, steprms=0.01, stepmax=0.05) /home/olexandr/anaconda3/lib/python3.5/site-packages/berny-0.1-py3.5.egg/berny/berny.py in optimize(solver, geom, **kwargs) 117 optimizer = Berny(geom, log=logger, **kwargs) 118 for geom in optimizer: --> 119 energy, gradients = solver.send(list(geom)) 120 optimizer.send((energy, gradients)) 121 return geom /home/olexandr/anaconda3/lib/python3.5/site-packages/berny-0.1-py3.5.egg/berny/solvers.py in MopacSolver(cmd, method) 25 gradients = [ 26 [float(next(f).split()[6])/kcal*angstrom for _ in range(3)] ---> 27 for _ in range(len(atoms)) 28 ] 29 /home/olexandr/anaconda3/lib/python3.5/site-packages/berny-0.1-py3.5.egg/berny/solvers.py in (.0) 25 gradients = [ 26 [float(next(f).split()[6])/kcal*angstrom for _ in range(3)] ---> 27 for _ in range(len(atoms)) 28 ] 29 /home/olexandr/anaconda3/lib/python3.5/site-packages/berny-0.1-py3.5.egg/berny/solvers.py in (.0) 24 next(f) 25 gradients = [ ---> 26 [float(next(f).split()[6])/kcal*angstrom for _ in range(3)] 27 for _ in range(len(atoms)) 28 ] ValueError: could not convert string to float: 'KCAL/ANGSTROM'
jhrmnn commented 7 years ago

@isayev I moved it to a new issue. Will have a look at it.

jhrmnn commented 7 years ago

There seems to be a general problem with planar geometries. The generated internal coordinates result in some small eigenvalues in the G matrix, which then throws everything off.

I can't find any mentions of special cases for planar structure though when generating the coordinates.

isayev commented 7 years ago

Hmm... try also Taxol, not a planar but crashes too. Do you have any suggestions how to deal with that? Berny algo is used in G09 by default and I never seen it complained like that. Imagine, I have 10K molecules and would like to automate geometry optimization.

jhrmnn commented 7 years ago

I understand that you need a rock-solid geometry optimizer. I'm afraid pyberny is not really there yet. I only now started testing it properly.

I mimicked the Gaussian optimizer in pyberny from the description in the manual, but I don't have the source code, so it's not really equivalent.

jhrmnn commented 6 years ago

Hi @isayev, I think this has been fixed. I'd be grateful if you could retry the problematic molecules.

isayev commented 6 years ago

thanks, @azag0 , I will try asap!