jhrmnn / pyberny

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

ufunc 'bitwise_or' not supported in quart_min() #17

Closed mjw99 closed 6 years ago

mjw99 commented 6 years ago

Seeing this spurious error in 0.3.2 whilst minimising a large set of random conformations of the same molecule:

.....
  File "/home/mw529/workspace/pyscf/pyscf/geomopt/berny_solver.py", line 66, in optimize
    optimizer.send((energy, gradients))
  File "/home/mw529/.conda/envs/rdkit/lib/python2.7/site-packages/berny/core.py", line 65, in Berny
    converged = algo.step(energy, gradients, log=log)
  File "/home/mw529/.conda/envs/rdkit/lib/python2.7/site-packages/berny/core.py", line 115, in step
    log=log
  File "/home/mw529/.conda/envs/rdkit/lib/python2.7/site-packages/berny/core.py", line 198, in linear_search
    t, E = Math.fit_quartic(E0, E1, g0, g1)
  File "/home/mw529/.conda/envs/rdkit/lib/python2.7/site-packages/berny/Math.py", line 98, in fit_quartic
    [minim2, minval2] = quart_min(p2)
  File "/home/mw529/.conda/envs/rdkit/lib/python2.7/site-packages/berny/Math.py", line 85, in quart_min
    minim = r[(r == max(-abs(r))) | r == -max(-abs(r))][0].real
TypeError: ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''