NWChem and Python


Just Got Here
Dear all!

I have the following questions. The NWChem can be controlled via snipplets of Python code. However, I do not understand, if the opposite can be done: can some parts (libraries) of NWChem be accesses from a Python interpreter? If the answer is yes, how can I do that? And if the answer is no, then are there some plans for that? It can be a great help of gluing quantum chemistry software to some other numerical codes.

Forum Vet
No, the reverse cannot be done. This would require huge amounts of work as the Python interpreter needs to start up parallel NWChem processes, needs to put all the runtime data NWChem needs in the right places in memory, etc. For example, if you want to get an Fock matrix or SCF energy, Python needs to get all necessary data in the runtime database format NWChem uses, provide an appropriate handle, and then call the task.

Bert


Quote:Oseledets May 1st 5:23 pm
Dear all!

I have the following questions. The NWChem can be controlled via snipplets of Python code. However, I do not understand, if the opposite can be done: can some parts (libraries) of NWChem be accesses from a Python interpreter? If the answer is yes, how can I do that? And if the answer is no, then are there some plans for that? It can be a great help of gluing quantum chemistry software to some other numerical codes.

Gets Around
ASE ( https://wiki.fysik.dtu.dk/ase/) can control nwchem runs.
A task like getting SCF energy looks like (it actually calculates atomization energy of O2):
https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/test/nwchem/nwchem_cmdline.py
ASE is written in python so you have access to numerical tools like numpy, scipy + plotting
with matplotlib.


Forum >> NWChem's corner >> NWChem functionality