[gpaw-users] DFT + U

Marcin Dulak Marcin.Dulak at fysik.dtu.dk
Wed Aug 13 12:11:10 CEST 2014


Hi,

i assume GPAW_SETUP_PATH contains the path to the generated Ce setup.
The default Ce setup generated by the newsetups branch is called: Ce.12e.PBE and one needs to say this to the calculator:

from ase.lattice import bulk
from gpaw import GPAW

b = bulk('Ce', 'fcc', a=4.7)

calc = GPAW(mode='fd',
            kpts=(6,6,6),
            setups={'Ce': '12e:f,4.5'}, # U = 4.5 eV for Ce 4f orbitals
            xc='PBE')
b.set_calculator(calc)
b.get_potential_energy()


Best regards,

Marcin
______________________________________
From: gpaw-users-bounces at listserv.fysik.dtu.dk [gpaw-users-bounces at listserv.fysik.dtu.dk] on behalf of Albert Bruix Fusté [abruix at phys.au.dk]
Sent: Wednesday, August 13, 2014 11:41 AM
To: gpaw-users at listserv.fysik.dtu.dk
Subject: [gpaw-users] DFT + U

Dear GPAW users,

After having successfully generated setups for Ce and being able to run calculations with them, I now attempt to use the DFT+U method on CeO2.

This is what the calculator in the script looks like:
======================================================================

    calc = GPAW(mode='fd',

                h=0.175,

                mixer=Mixer(nmaxold=5, beta=0.1, weight=75),

                convergence={'energy': 0.0005,

                             'density': 1.0e-4,

                             'eigenstates': 5.0e-8,

                             'bands': -10},

                maxiter=199,

                kpts=(10,10,10),

                setups={'Ce': ':f,4.5'}, # U = 4.5 eV for Ce 4f orbitals

                txt='calc_U_{0}.out'.format(str(a)),

                xc='PBE',

                )

======================================================================
Where I have specified using the + U correction as indicated in the tutorial:

https://wiki.fysik.dtu.dk/gpaw/tutorials/hubbardu/hubbardu.html

However, I get the following error:


======================================================================

abruix at fe0:~/CeO2/bulk$ gpaw-python ceo2_U_bulk.py --gpaw=fprojectors=1


You need to set the GPAW_SETUP_PATH environment variable to point to

the directory where the setup files are stored.  See

http://wiki.fysik.dtu.dk/gpaw/install/installationguide.html for details.

Traceback (most recent call last):

  File "ceo2_U_bulk.py", line 54, in <module>

    ceo2_b.get_potential_energy()

  File "/home/abruix/DFT/ase/ase/atoms.py", line 643, in get_potential_energy

    return self._calc.get_potential_energy(self)

  File "/home/abruix/DFT/gpaw/gpaw/aseinterface.py", line 38, in get_potential_energy

    self.calculate(atoms, converge=True)

  File "/home/abruix/DFT/gpaw/gpaw/paw.py", line 233, in calculate

    self.initialize(atoms)

  File "/home/abruix/DFT/gpaw/gpaw/paw.py", line 398, in initialize

    filter, world)

  File "/home/abruix/DFT/gpaw/gpaw/setup.py", line 1307, in __init__

    filter=filter, world=world)

  File "/home/abruix/DFT/gpaw/gpaw/setup.py", line 73, in create_setup

    world=world)

  File "/home/abruix/DFT/gpaw/gpaw/setup_data.py", line 111, in __init__

    self.read_xml(world=world)

  File "/home/abruix/DFT/gpaw/gpaw/setup_data.py", line 124, in read_xml

    PAWXMLParser(self).parse(source=source, world=world)

  File "/home/abruix/DFT/gpaw/gpaw/setup_data.py", line 441, in parse

    setup.symbol))

RuntimeError: Could not find  .PBE-setup for "Ce".

======================================================================


Note that I include the --gpaw=fprojectors=1  part to correctly use the Ce setups generated by me.

In addition, I get the same error when running the examples of the tutorial:


RuntimeError: Could not find .PBE-setup for "Ni".

or:


RuntimeError: Could not find .PBE-setup for "N".



I have also googled around and found another example in:

https://trac.fysik.dtu.dk/projects/gpaw/browser/trunk/gpaw/test/Hubbard_U_Zn.py?rev=11466


Which also yields an error (different one this time):


======================================================================

  File "zn.py", line 25, in <module>

    E_U[spin] = s.get_potential_energy()

  File "/home/abruix/DFT/ase/ase/atoms.py", line 643, in get_potential_energy

    return self._calc.get_potential_energy(self)

  File "/home/abruix/DFT/gpaw/gpaw/aseinterface.py", line 38, in get_potential_energy

    self.calculate(atoms, converge=True)

  File "/home/abruix/DFT/gpaw/gpaw/paw.py", line 251, in calculate

    self.initialize(atoms)

  File "/home/abruix/DFT/gpaw/gpaw/paw.py", line 398, in initialize

    filter, world)

  File "/home/abruix/DFT/gpaw/gpaw/setup.py", line 1307, in __init__

    filter=filter, world=world)

  File "/home/abruix/DFT/gpaw/gpaw/setup.py", line 41, in create_setup

    U = float(lu[2:]) / units.Hartree

ValueError: invalid literal for float(): 3.0,1

======================================================================



Could you please indicate what you think I’m doing wrong? Is the syntax indicated in the tutorial the correct one for using the +U?


GPAW version I use:



  ___ ___ ___ _ _ _

 |   |   |_  | | | |

 | | | | | . | | | |

 |__ |  _|___|_____|  0.9.1.11170

 |___|_|


User:  abruix at fe0

Date:  Wed Aug 13 11:22:06 2014

Arch:  x86_64

Pid:   1425

Dir:   /home/abruix/DFT/gpaw/gpaw

ase:   /home/abruix/DFT/ase/ase (version 3.9.0)

numpy: /home/gpawinst/local/lib/python2.7/site-packages/numpy (version 1.6.2)

scipy: /home/gpawinst/local/lib/python2.7/site-packages/scipy (version 0.11.0)

Thank you very much in advance for your help!

Albert Bruix










More information about the gpaw-users mailing list