Open eneas77 opened 1 year ago
Hi,
Any updates about this?
Thanks,
E77
Hope you don't mind but I edited the issue to make the error/code easier to read
Thanks for raising –this looks like an optimiser bug to me, probably present since v1.3.0 – I'll take a look. I'm hoping @shoubhikraj might have fixed it already in #262
I cant reproduce this error but there's definitely something bad going on – it shouldn't take 68 iterations to converge N2O3 & fail to run the internals->cartesians transform 😞
@shoubhikraj would you mind trying ade.Molecule(smiles='[O-][N+](=O)N=O').optimise(method=ade.methods.NWChem())
with the trim optimiser when you have the chance? thanks!
@t-young31 @eneas77
I do not have access to NWChem right now, but I can reproduce the error even with xTB and the new optimiser:
>>> import autode as ade
>>> mol = ade.Molecule(smiles='[O-][N+](=O)N=O')
>>> opt = ade.opt.optimisers.HybridTRMOptimiser(maxiter=100,gtol=1.e-3,etol=1.e-4)
>>> opt.run(mol, method=ade.methods.XTB())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "G:\autodE\autode\opt\optimisers\base.py", line 135, in run
self._step() # Update self._coords
File "G:\autodE\autode\opt\optimisers\trm.py", line 174, in _step
self._coords = self._coords + step # finally, take the step!
File "G:\autodE\autode\opt\coordinates\base.py", line 264, in __add__
new_coords.iadd(other)
File "G:\autodE\autode\opt\coordinates\dic.py", line 243, in iadd
raise RuntimeError(
RuntimeError: Iterative back-transform did not converge
>>> mol.coordinates
Coordinates([[-1.38900795 -0.83276619 0.04883061]
[-0.58297449 0.02862588 -0.01147048]
[-0.67159798 1.20019831 -0.15331935]
[ 0.90290826 -0.58392015 0.17367619]
[ 1.74067215 0.18786215 -0.05771697]] Å)
The optimiser throws the error much earlier (~16 iterations) when the dic-> cartesian transform fails. I suspect the problem is coming from the nearly 180 degree dihedral angle. When I restart the optimisation (which rebuilds the internal coordinates) it works (I assume because the dihedrals are now excluded from the primitive set):
>>> opt = ade.opt.optimisers.HybridTRMOptimiser(maxiter=100,gtol=1.e-3,etol=1.e-4)
>>> opt.run(mol, method=ade.methods.XTB())
>>> mol.coordinates
Coordinates([[-1.44320967e+00 -8.13930256e-01 8.45857398e-02]
[-5.93660808e-01 -5.68579976e-04 -1.19083114e-02]
[-5.96507906e-01 1.17034244e+00 -1.76402679e-01]
[ 9.38350317e-01 -6.14585625e-01 1.07541973e-01]
[ 1.69502807e+00 2.58742025e-01 -3.81672248e-03]] Å)
If you look at the final optimised structure, the two O-N-N-O dihedral angles are 179.773 and -0.264 degrees:
One way to solve this could be to modify the optimisers so that whenever the back-tranform fails to converge, it will rebuild internal coordinates or perhaps switch to Cartesians.
Hi,
Did you try to run this example when you closed the enhancement on #151 ? I suppose the answer, as there is no one, is you didn't run it.
Perhaps you should include that basic QC: every case ending in bug/enhancement should be tested once the fork job is done. :-)
Just my two shilings on this matter.
Thanks a lot.
E77
Hi,
Resuming the reaction below discussed in #143 ,
it crashes with the following:
This is the .py script
Any hints about what is happening? Did you try to run this example when you closed the enhancement on #151 ?
Thank you,
E77