duartegroup / autodE

automated reaction profile generation
https://duartegroup.github.io/autodE/
MIT License
166 stars 51 forks source link

sn2 test fails #226

Closed mit-eremin closed 1 year ago

mit-eremin commented 1 year ago

Describe the bug SN2 test calculation fails after F– optimization after complete update of autodE and conda

To Reproduce input

import autode as ade

#Runs by default on 4 processing cores

rxn = ade.Reaction("CCl.[F-]>>CF.[Cl-]", solvent_name="water")
rxn.calculate_reaction_profile()

output for reactant optimization stage

2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting the availability of qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO qchem is available
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Optimising reactants and products with qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running optimisation of r0_CClH3
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting the availability of qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO qchem is available
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Using keywords: Functional(pbe0) BasisSet(def2-SVP) 'jobtype opt' DispersionCorrection(d3bj) EffectiveCorePotential(def2-ECP) to optimise with QChem(available = True)
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running calculation: r0_CClH3_opt
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Generating input file(s) for r0_CClH3_opt_qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO No calculations have been performed here yet
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO QChem *jobtype* already defined - not appending
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running r0_CClH3_opt_qchem.in using qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting the availability of qchem
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO qchem is available
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Creating tmpdir to work in: /var/folders/3g/ql738tyj73nbp0fd9q1qgrf00000gn/T/tmpeek52el7
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying ['r0_CClH3_opt_qchem.in']
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Function   ...running
2023-01-13 15:12:42 Dmitrys-MBP.usc.edu autode.log.log[1224] WARNING STDERR: 'head: illegal line count -- 0\n'
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO            ...done
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying back r0_CClH3_opt_qchem.in
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying back r0_CClH3_opt_qchem.out
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Removing temporary directory
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting output file lines
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Getting energy from r0_CClH3_opt_qchem.out
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] WARNING Failed to set partial charges
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Keeping input files
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Checking required properties exist
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Checking for r0_CClH3_opt_qchem.out normal termination
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running optimisation of r1_F
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting the availability of qchem
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO qchem is available
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Using keywords: Functional(pbe0) BasisSet(def2-SVP) 'jobtype opt' DispersionCorrection(d3bj) EffectiveCorePotential(def2-ECP) to optimise with QChem(available = True)
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running calculation: r1_F_opt
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Generating input file(s) for r1_F_opt_qchem
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO This calculation has not yet been run
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] WARNING Cannot optimise a single atom
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Running r1_F_opt_qchem.in using qchem
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting the availability of qchem
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO qchem is available
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Creating tmpdir to work in: /var/folders/3g/ql738tyj73nbp0fd9q1qgrf00000gn/T/tmpwabccjce
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying ['r1_F_opt_qchem.in']
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Function   ...running
2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] WARNING STDERR: 'head: illegal line count -- 0\n'
2023-01-13 15:12:47 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO            ...done
2023-01-13 15:12:47 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying back r1_F_opt_qchem.in
2023-01-13 15:12:47 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Copying back r1_F_opt_qchem.out
2023-01-13 15:12:47 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Removing temporary directory
2023-01-13 15:12:47 Dmitrys-MBP.usc.edu autode.log.log[1224] INFO Setting output file lines
Traceback (most recent call last):
  File "/Users/eremin/Dropbox/Mac/Documents/autodE/local/test_after_update_9/./ade.py", line 6, in <module>
    rxn.calculate_reaction_profile()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 350, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/reactions/reaction.py", line 153, in calculate_reaction_profile
    calculate(self)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 154, in wrapped_function
    result = func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/reactions/reaction.py", line 142, in calculate
    reaction.optimise_reacs_prods()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 530, in wrapped_function
    result = func(reaction)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 154, in wrapped_function
    result = func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/reactions/reaction.py", line 609, in optimise_reacs_prods
    mol.optimise(h_method)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 288, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/species/species.py", line 1211, in optimise
    calc.run()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/calculations/calculation.py", line 116, in run
    self._executor.run()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/calculations/executors.py", line 82, in run
    self.set_properties()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 383, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/calculations/executors.py", line 153, in set_properties
    self.molecule.coordinates = self.method.coordinates_from(self)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/species/species.py", line 251, in coordinates
    rmsd = calc_rmsd(
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/geom.py", line 216, in calc_rmsd
    assert coords1.shape == coords2.shape
AssertionError

Expected behavior Calculate the reaction profile

Environment

Additional context updated conda and autode followed by some tests. molecule optimization, conformer search for water cluster, DA, 1,2-shift reactions all went smoothly, but no matter how I set up SN2 reaction, it fails at the same stage. I might be missing something...

t-young31 commented 1 year ago

Hey @mit-eremin, thanks a lot for raising this – looks like a bug to me.

Did this work in 1.3.3? Nothing changed in the QChem wrapper in the latest release but I wouldn't be too surprised if this has been broken for some time. I'll have a look a it now but without a QChem install to hand I may become stuck!

t-young31 commented 1 year ago

just had a look and the input file looks somewhat sensible to me. does the output file look alright? just noticed

2023-01-13 15:12:45 Dmitrys-MBP.usc.edu autode.log.log[1224] WARNING STDERR: 'head: illegal line count -- 0\n'

in the logs

mit-eremin commented 1 year ago

@t-young31, sorry for a slow response. I was on 1.2.2 version for awhile. and now updated straight to 1.3.4.

mit-eremin commented 1 year ago

Regarding the line count, the warning has always been there, but I don't see any issues in the outputs. I mean, iQMol does not give warnings when I open either and I do not see warnings in text format either. I know it is a separate issue, but we can think how to debug it and I am more than happy to help.

t-young31 commented 1 year ago

@t-young31, sorry for a slow response. I was on 1.2.2 version for awhile. and now updated straight to 1.3.4.

cool – I imagine I broke it in v1.3.0 then.. will be an easy fix.

Regarding the line count, the warning has always been there, but I don't see any issues in the outputs. I mean, iQMol does not give warnings when I open either and I do not see warnings in text format either. I know it is a separate issue, but we can think how to debug it and I am more than happy to help.

thanks for the explanation –all good then 👍🏼