question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: autode.exceptions.CouldNotGetProperty: Could not get energy

See original GitHub issue

Hi! I faced a problem running autodE on my local machine. I run mac and have xtb and Q-Chem installed. I can run calculations with either and they work. Just optimization of a molecule (e.g. water) works well with autodE. However, unfortunately when I try to do “Non-covalent Interaction Complexes” or “Transition States” from your examples, it crashes giving the following error:

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/anaconda3/envs/dft/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/conformers/conformers.py", line 15, in _calc_conformer
    getattr(conformer, calc_type)(method=method,
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/conformers/conformer.py", line 90, in optimise
    super().optimise(method, keywords=keywords, calc=calc, n_cores=n_cores)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 284, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/species/species.py", line 1043, in optimise
    self.energy = calc.get_energy()
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/calculation.py", line 38, in wrapped_function
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/calculation.py", line 281, in get_energy
    return PotentialEnergy(self.method.get_energy(self),
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/wrappers/XTB.py", line 199, in get_energy
    raise CouldNotGetProperty(name='energy')
autode.exceptions.CouldNotGetProperty: Could not get energy
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/eremin/Dropbox/Mac/Documents/autodE/autode_test_local7/water_trimer.py", line 23, in <module>
    trimer.find_lowest_energy_conformer(lmethod=xtb)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/utils.py", line 162, in wrapped_function
    result = func(*args, **kwargs)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/species/species.py", line 1213, in find_lowest_energy_conformer
    self.conformers.optimise(method=lmethod)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/conformers/conformers.py", line 256, in optimise
    return self._parallel_calc('optimise', method, keywords)
  File "/opt/anaconda3/envs/dft/lib/python3.9/site-packages/autode/conformers/conformers.py", line 239, in _parallel_calc
    self[idx] = res.get(timeout=None)
  File "/opt/anaconda3/envs/dft/lib/python3.9/multiprocessing/pool.py", line 771, in get
    raise self._value
autode.exceptions.CouldNotGetProperty: Could not get energy

I use the following python script:

import autode as ade
from autode.input_output import xyz_file_to_atoms

xtb = ade.methods.XTB()
qchem = ade.methods.QChem()

ade.Config.n_cores = 4
ade.Config.max_core = 1000

ade.Config.num_complex_sphere_points = 5                                 # N_s

# and the number of rotations to perform per point on the sphere
ade.Config.num_complex_random_rotations = 3                              # N_r

# Total number of conformers ~(N_s × N_r)^(N-1) for N molecules => ~225

# Make a water molecule and optimise at the XTB level
water = ade.Molecule(name='water', smiles='O')
water.optimise(method=xtb)

# Make the NCI complex and find the lowest energy structure
trimer = ade.NCIComplex(water, water, water, name='water_trimer')
trimer.find_lowest_energy_conformer(lmethod=xtb)
trimer.print_xyz_file()

If I run the same script on USC HPC it goes smoothly. This is likely the issue from my system, however, I do not seem to troubleshoot. If someone can advice, it would awesome. My system: macOS Monterey 12.3.1 2.9 GHz 6-Core Intel Core i9 32 GB 2400 MHz DDR4 conda 4.12.0 xtb 6.4.1 Q-Chem 5.4.2

Thank you in advance!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mit-eremincommented, Apr 7, 2022

@t-young31, cheers! Lesson learned! “Dmitry, do not cut corners!!!” SN2 in water and DA in gas phase both worked. Thank you for guiding. I should have though about problems of the gas phase nucleophile/nucleophuge pair especially with F and Cl. I just removed solvent to ‘save resources’, but the overall algorithm works brilliantly fast with my processor. I will continue exploring. As for removing the folder prior rerunning - I learned that from Gabe Gomes. I have learned a neat feature of autodE to pick up performed calculations in order not to do same job multiple times. This is really slick!!! Cheers!!!

0reactions
t-young31commented, Apr 7, 2022

We’re getting there 👌

That mode might be a result of the lack of solvent in the calculation, as the lowest energy path is H deprotonation, rather than SN2, at XTB in the gas phase (I’ve done the same before!)

rxn = ade.Reaction(Fluoride, MeCl, Chloride, MeF, name='sn2', solvent_name='water')
rxn.calculate_reaction_profile()

should (!) work. But if you do actually want SN2 in gas phase you might need to use QChem as the lcode and add some diffuse functions to the basis set – no guarantees though!

(also might be worth removing the directory when you re-run it)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceptions — autodE documentation - GitHub Pages
exception autode.exceptions.CouldNotGetProperty(*args, name=None)#. Exception for where a property e.g. energy cannot be found in a calculation output file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found