[ase-users] getting Hamiltonian and overlap matrices from NWChem

Panu Sam-Ang panu.sam-ang at stonybrook.edu
Thu Jun 29 22:11:37 CEST 2017


Hi Ivan,

Thank you for your answer.  I followed your instruction and I still got the
same error message.  Below is the screenshot of the result:

[image: Inline image 1]

I also tried to switched branches again and got the same thing:

[image: Inline image 2]

[image: Inline image 3]

Do you know why this is so?

Best,
Panu

On Thu, Jun 29, 2017 at 12:29 PM, Kondov, Ivan (SCC) <ivan.kondov at kit.edu>
wrote:

> Hi Panu,
>
>
> you do not have to configure new PYTHONPATH if you have any git branch of
> ASE on your computer, then you should do:
>
>
> git checkout master
>
> git checkout -b kitnwchem
>
> git remote add ikondov_ase https://gitlab.com/ikondov/ase.git
>
> git pull ikondov_ase kitnwchem
>
>
> You can switch any time to your master branch with "git checkout master"
>
>
> If you have cloned kitnwchem branch directly into a new folder named
> 'kitnwchem', for example with
>
>
> git clone https://gitlab.com/ikondov/ase kitnwchem
>
>
> then you should set PYTHONPATH correspondingly.
>
>
> Best regards,
>
> Ivan
>
>
>
> ------------------------------
> *Von:* Panu Sam-Ang <panu.sam-ang at stonybrook.edu>
> *Gesendet:* Mittwoch, 28. Juni 2017 22:27
> *An:* Kondov, Ivan (SCC)
> *Cc:* ase-users at listserv.fysik.dtu.dk
> *Betreff:* Re: [ase-users] getting Hamiltonian and overlap matrices from
> NWChem
>
> 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 at 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/20170629/3c22a026/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-06-29 at 4.09.47 PM.png
Type: image/png
Size: 24730 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170629/3c22a026/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-06-29 at 4.10.25 PM.png
Type: image/png
Size: 18112 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170629/3c22a026/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-06-29 at 3.08.09 PM.png
Type: image/png
Size: 133139 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170629/3c22a026/attachment-0005.png>


More information about the ase-users mailing list