NLESC-JCER / QMCTorch

Pytorch Implementation of Real Space Quantum Monte Carlo Simulations of Molecular Systems
https://qmctorch.readthedocs.io/
Apache License 2.0
23 stars 1 forks source link

adf kffile read error in kftools #31

Closed Rik-Breebaart closed 4 years ago

Rik-Breebaart commented 4 years ago

When using adf I optain a error from the calculator/adf.py file for kffile.read. This is probably a error on my side with regards to the plams package. The error I obtain when using adf as calculator:

Traceback (most recent call last): File "/home/breebaart/dev/QMCTorch/example/optimization/h2.py", line 20, in unit='bohr') File "/usr/lib/python3.6/qmctorch/wavefunction/molecule.py", line 78, in init self.basis = self.calculator.run() File "/usr/lib/python3.6/qmctorch/wavefunction/calculator/adf.py", line 40, in run basis = self.get_basis_data(t21_path) File "/usr/lib/python3.6/qmctorch/wavefunction/calculator/adf.py", line 85, in get_basis_data basis.TotalEnergy = kf.read('Total Energy', 'Total energy') File "/home/breebaart/.local/lib/python3.6/site-packages/scm/plams/tools/kftools.py", line 301, in read ret = self.reader.read(section, variable) AttributeError: 'NoneType' object has no attribute 'read'

NicoRenaud commented 4 years ago

yes I think the PLAMS library is not linked properly. Could you execute the following :

from scm import plams
print(plams.KFFile)
Rik-Breebaart commented 4 years ago

This returns: <class 'scm.plams.tools.kftools.KFFile'>

NicoRenaud commented 4 years ago

are you also running that from VSCode ? Because then the path of the ADF output file (Tape21 file) file will be all wrong.

Rik-Breebaart commented 4 years ago

Yes, I am running from VSCode.

NicoRenaud commented 4 years ago

and in the terminal you are in the directory where the python script is ?

NicoRenaud commented 4 years ago

I think it's because your ADF calculation failed. Not because of QMCTorch. Did you run a simple ADF calculation to check that it was working ?

Rik-Breebaart commented 4 years ago

The ADF calculation from the PLAMS toturial fails so it indeed is an error in my ADF calculation