[ase-users] getting Hamiltonian and overlap matrices from NWChem
Panu Sam-Ang
panu.sam-ang at stonybrook.edu
Wed Jun 28 22:27:14 CEST 2017
Hi Ivan,
I forked your ASE project and cloned it to my computer. I then did "$git
checkout kitnwchem" to switch/get the kitnwchem branch (is this correct)?
I saved your script in the previous email and saved it as "NH3.py" and ran
it using "$python NH3.py$ and got this import error:
Panus-MacBook-Air:ASE Panu$ python NH3.py
Traceback (most recent call last):
File "NH3.py", line 2, in <module>
from ase.calculators.nwchem import KITnwchem
ImportError: cannot import name KITnwchem
Could you tell me how to fix this? I am very new to git and ASE and not
sure what I did wrong here. I am guessing I have to set the new path to
ASE in kitnwchem, is this correct?
Thank you.
Best,
Panu
On Wed, Jun 21, 2017 at 12:46 PM, Kondov, Ivan (SCC) <ivan.kondov at kit.edu>
wrote:
> Dear Panu,
>
>
>
> you can check out this branch
>
>
>
> https://gitlab.com/ikondov/ase/tree/kitnwchem
>
>
>
> For historical reasons the mentioned methods are in a derived class which
> has a slightly different parameter keys. Here a simple use:
>
>
>
> from ase.calculators.nwchem import KITnwchem
>
> from ase.build import molecule
>
> mol = molecule('NH3')
>
> params = {
>
> 'title': 'ammonia',
>
> 'task': 'energy',
>
> 'basis set name': 'sto-3g',
>
> 'total charge': 0,
>
> 'multiplicity': 1,
>
> 'use dft': True,
>
> 'density functional': 'b3lyp'
>
> }
>
> calc = KITnwchem(**params)
>
> mol.set_calculator(calc)
>
> print(calc.get_mos(mol))
>
> print(calc.get_fock_overlap())
>
>
>
> I think this can be used for the time being. I can migrate the relevant
> two or three methods to the base class but for that I will need time.
> Please let me know.
>
>
>
> Best regards,
>
> Ivan
>
>
>
>
>
> *From:* Panu Sam-Ang [mailto:panu.sam-ang at stonybrook.edu]
> *Sent:* Tuesday, June 20, 2017 5:22 PM
> *To:* Kondov, Ivan (SCC)
>
> *Cc:* ase-users at listserv.fysik.dtu.dk
> *Subject:* Re: [ase-users] getting Hamiltonian and overlap matrices from
> NWChem
>
>
>
> Thank you, Ivan. Could you share the code?
>
>
>
> Best,
>
> Panu
>
>
>
> On Tue, Jun 20, 2017 at 6:11 AM, Kondov, Ivan (SCC) <ivan.kondov at kit.edu>
> wrote:
>
> Dear Panu,
>
>
>
> you only need the eigenvectors (the molecular orbitals) and the
> eigenvalues (molecular orbital energies) to restore the fock matrix and the
> overlap matrix. To make nwchem write them out you have to put the line
>
>
>
> print "final vectors analysis" "final vectors"
>
>
>
> in the dft section of the input. See
>
>
>
> http://www.nwchem-sw.org/index.php/Release66:Hartree-
> Fock_Theory_for_Molecules#Printing_Information_from_the_SCF_Module
>
>
>
> I have an own code for all this including reading the orbitals with the
> ASE nwchem calculator. I can share it if you like.
>
>
>
> Best regards,
>
> Ivan
>
>
>
>
>
>
>
> *From:* ase-users-bounces at listserv.fysik.dtu.dk [mailto:ase-users-bounces@
> listserv.fysik.dtu.dk] *On Behalf Of *Panu Sam-Ang via ase-users
> *Sent:* Tuesday, June 06, 2017 10:19 PM
> *To:* Ask Hjorth Larsen
> *Cc:* ase-users at listserv.fysik.dtu.dk
> *Subject:* Re: [ase-users] getting Hamiltonian and overlap matrices from
> NWChem
>
>
>
> Thank you, Ask. That's helpful!
>
>
>
> On Tue, Jun 6, 2017 at 4:15 PM, Ask Hjorth Larsen <asklarsen at gmail.com>
> wrote:
>
> Hi Panu,
>
> 2017-06-06 21:38 GMT+02:00 Panu Sam-Ang <panu.sam-ang at stonybrook.edu>:
> > Hi Ask,
> >
> > Thank you for your suggestion. I just got NWChem installed on my laptop
> and
> > haven't really used it before. I thought ase.calculators.nwchem or
> > ase.calculators.interface would have a function that can do that. But I
> > guess I have to write my own script?
>
> ASE mostly does energies/forces and the more universal electronic
> structure quantities like KS eigenvalues and occupation numbers. Many
> codes do not establish the Hamiltonian explicitly, so this is not part
> of the standard interface. You can probably pass any keywords to
> NWChem through the standard interface, and then manually extract what
> you need from the files saved. (One could add special functions for
> getting the Hamiltonian to the calculator to ease this in the future.)
>
> Best regards
> Ask
>
>
>
>
> >
> > Best,
> > Panu
> >
> > On Tue, Jun 6, 2017 at 12:31 PM, Ask Hjorth Larsen <asklarsen at gmail.com>
> > wrote:
> >>
> >> Hi Panu,
> >>
> >> How would you get these from NWChem normally? I guess the way is to
> >> enable a keyword so it is saved to a file, and then read the file
> >> manually from the script.
> >>
> >> Best regards
> >> Ask
> >>
> >> 2017-06-05 21:48 GMT+02:00 Panu Sam-Ang via ase-users
> >> <ase-users at listserv.fysik.dtu.dk>:
> >> > Hello,
> >> >
> >> > Does anyone know how to get the Hamiltonian and overlap matrices from
> >> > using
> >> > NWChem as the calculator? What is the command?
> >> >
> >> > Thank you,
> >> > Panu
> >> >
> >> > _______________________________________________
> >> > ase-users mailing list
> >> > ase-users at listserv.fysik.dtu.dk
> >> > https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
> >
> >
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170628/ce7e402c/attachment-0001.html>
More information about the ase-users
mailing list