[ase-users] Import Jacapo Calculator

Hesam hesam.ilati2 at gmail.com
Wed Sep 19 19:01:12 CEST 2012


Hi,

I finally could use Abinit inside the ASE and really enjoyed it. Thanks for
the help.
I have 2 questions now:

*1- *When I try to use GGA exchange correlation with *xc = 'GGA' *I get the
error KeyError: 'GGA'.
I tried to use i*xc = 11 *which sets the exchange correlation function in
abinit but it seems there is no such parameter in ASE interface to abinit.

*2- *I get very bad lattice constant and bulk modulus out of ASE-abinit.
I run abinit with following parameters:

*   Abinit(label='GaN',
              nbands=16,
              xc='LDA',
              ecut=100,   # ev
              mix=0.01,
              nstep=30,
              kpts=[10, 10, 10])*

Considering the fact that unit cell of GaN has *4 atoms, are the parameters
good?*

The positions of atoms in wurtzite crystal:

*a = 3.189*
*c = 2*sqrt(2/3.)*a*
*atoms = Atoms([Atom('Ga', (0,       0,    0)),*
*               Atom('Ga', (1/3., 1/3., 1/2.)),*
*               Atom('N',  (0,       0, 3/8.)),*
*               Atom('N',  (1/3., 1/3., 7/8.))])*
* *
*cell = [(a,             0, 0),*
*        (a/2, a*sqrt(3)/2, 0),*
*        (0,             0, c)]*

Unfortunately I don't get minimum energy at lattice constant and it
decreases with increasing lattice constant and bulk modulus is wrong too:

I have attached the python file.

Many Thanks
Hesam

On Wed, Sep 19, 2012 at 12:58 PM, Hesam <hesam.ilati2 at gmail.com> wrote:

> Hi,
>
> I finally could use Abinit inside the ASE and really enjoyed it. Thanks
> for the help.
> I have 2 questions now:
>
> *1- *When I try to use GGA exchange correlation with *xc = 'GGA' *I get
> the error KeyError: 'GGA'.
> I tried to use i*xc = 11 *which sets the exchange correlation function in
> abinit but it seems there is no such parameter in ASE interface to abinit.
>
> *2- *I get very bad lattice constant and bulk modulus out of ASE-abinit.
> I run abinit with following parameters:
>
> *   Abinit(label='GaN',
>               nbands=16,
>               xc='LDA',
>               ecut=100,   # ev
>               mix=0.01,
>               nstep=30,
>               kpts=[10, 10, 10])*
>
> Considering the fact that unit cell of GaN has *4 atoms, are the
> parameters good?*
> [image: Inline image 1]
> The positions of atoms in wurtzite crystal:
>
> *a = 3.189*
> *c = 2*sqrt(2/3.)*a*
> *atoms = Atoms([Atom('Ga', (0,       0,    0)),*
> *               Atom('Ga', (1/3., 1/3., 1/2.)),*
> *               Atom('N',  (0,       0, 3/8.)),*
> *               Atom('N',  (1/3., 1/3., 7/8.))])*
> * *
> *cell = [(a,             0, 0),*
> *        (a/2, a*sqrt(3)/2, 0),*
> *        (0,             0, c)]*
>
> Unfortunately I don't get minimum energy at lattice constant and it
> decreases with increasing lattice constant and bulk modulus is wrong too:
>  I have attached the python file.
>
> Many Thanks
> Hesam
>
> On Sun, Sep 16, 2012 at 1:16 PM, Marcin Dulak <Marcin.Dulak at fysik.dtu.dk>wrote:
>
>>  Hi,
>>
>>
>> On 09/16/12 18:37, Hesam wrote:
>>
>> Thanks Marcin for the help.
>>
>> I installed the python scientific on Ubuntu and now I can import the
>> jacapo successfully but I can't use the jacapo calculator and get an error.
>> i.e. when I want to run
>>
>> *for x in np.linspace (0.95 , 1.05 , 5):
>>   silicon.set_cell (cell * x, scale_atoms =True)
>>   calc = Jacapo (pw =250 ,xc='PBE', nbands =30 , ft =0.1 , kpts =(4 ,4
>> ,4))*
>>
>> I get the following error:
>>
>> *hesam at hesam-VirtualBox:~$ python Test_Jacapo.py
>> Traceback (most recent call last):
>>   File "Test_Jacapo.py", line 15, in <module>
>>     silicon.get_potential_energy ()
>>   File "/usr/lib/python2.7/dist-packages/ase/atoms.py", line 548, in
>> get_potential_energy
>>     return self._calc.get_potential_energy(self)
>>   File
>> "/usr/lib/python2.7/dist-packages/ase/calculators/jacapo/jacapo.py", line
>> 2307, in get_potential_energy
>>     self.calculate()
>>   File
>> "/usr/lib/python2.7/dist-packages/ase/calculators/jacapo/jacapo.py", line
>> 2818, in calculate
>>     f = open(txt, 'r')
>> IOError: [Errno 2] No such file or directory: 'out.txt'
>> *
>>
>> on Ubuntu you need to set additional variables DACAPOPATH,
>> DACAPOEXE_SERIAL and DACAPOEXE_PARALLEL
>>
>> https://wiki.fysik.dtu.dk/dacapo/Installation#installation-of-prebuilt-binaries
>> and in order to run dacapo in parallel you need to create a hostfile file.
>> The following should run dacapo on two cores on ubuntu 12.04 (after
>> configuring dtufys repository):
>> sudo apt-get install dacapo
>> export DACAPOEXE_SERIAL=/usr/bin/dacapo_serial.run
>> export DACAPOEXE_PARALLEL=/usr/bin/dacapo_mpi.run
>> export DACAPOPATH=/usr/share/dacapo-psp
>> echo $'localhost\nlocalhost' > hostfile
>> PBS_NODEFILE=hostfile python
>> /usr/lib/python2.7/dist-packages/ase/test/jacapo/jacapo.py
>>
>> Please consider using GPAW instead (sudo apt-get install gpaw).
>> Dacapo is no longer maintained.
>>
>> Marcin
>>
>>
>> *
>> Thanks
>> Hesam
>> *
>> On Sun, Sep 16, 2012 at 11:37 AM, Marcin Dulak <Marcin.Dulak at fysik.dtu.dk
>> > wrote:
>>
>>>  Hi,
>>>
>>>
>>> On 09/16/12 17:22, Hesam wrote:
>>>
>>> Many Thanks Marcin,
>>>
>>>  I have installed scientific python on windows. However when I try
>>> to import ase.calculators.jacapo I get the following error:
>>>
>>>  >>> import ase.calculators.jacapo
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>>   File
>>> "C:\Python27\lib\site-packages\ase\calculators\jacapo\__init__.py", line
>>> 16, in <module>
>>>     from jacapo import *
>>>   File "C:\Python27\lib\site-packages\ase\calculators\jacapo\jacapo.py",
>>> line 20, in <module>
>>>     from Scientific.IO.NetCDF import NetCDFFile as netCDF
>>>   File "C:\Python27\lib\site-packages\Scientific\IO\NetCDF.py", line
>>> 169, in <module>
>>>     from Scientific_netcdf import *
>>> ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
>>>  i doubt you will be able to compile dacapo on windows, so the effort of
>>> making
>>> ScientificPython to work on windows is probably not worth it.
>>> Moreover, even the ASE itself is not fully functional on windows.
>>>
>>> Marcin
>>>
>>>
>>>
>>>  Is there any package with all libraries in it? Since I installed
>>> pythonxy and I thought it contains all the libraries.
>>>
>>>  Thanks
>>> Hesam
>>>
>>>  On Sun, Sep 16, 2012 at 5:33 AM, Marcin Dulak <
>>> Marcin.Dulak at fysik.dtu.dk> wrote:
>>>
>>>>  On 09/16/12 03:58, Hesam wrote:
>>>>
>>>> Hi,
>>>>
>>>>  yes, you need ScientificPython version at least 2.8 with netcdf
>>>> support.
>>>> On ubuntu:
>>>> sudo apt-get install python-scientific
>>>>
>>>> Marcin
>>>>
>>>>  When I want to import from jacapo calculator I got the error that it
>>>> couldn't find Scientific module.
>>>> Where is that module? Do I need to install some other package?
>>>>
>>>>  >>> from ase.calculators.jacapo import *
>>>>
>>>>  Traceback (most recent call last):
>>>>   File "<pyshell#8>", line 1, in <module>
>>>>     from ase.calculators.jacapo import *
>>>>   File
>>>> "C:\Python27\lib\site-packages\ase\calculators\jacapo\__init__.py", line 1,
>>>> in <module>
>>>>     import Scientific
>>>> ImportError: No module named Scientific
>>>>
>>>>  I can successfully import ase itself but when I try to import from
>>>> jacapo I get the error.
>>>> Thanks
>>>>
>>>>
>>>>
>>>>  --
>>>> ***********************************
>>>>
>>>> Marcin Dulak
>>>> Technical University of Denmark
>>>> Department of Physics
>>>> Building 307, Room 229
>>>> DK-2800 Kongens Lyngby
>>>> Denmark
>>>> Tel.: (+45) 4525 3157
>>>> Fax.: (+45) 4593 2399
>>>> email: Marcin.Dulak at fysik.dtu.dk
>>>>
>>>> ***********************************
>>>>
>>>>
>>>
>>>
>>> --
>>> ***********************************
>>>
>>> Marcin Dulak
>>> Technical University of Denmark
>>> Department of Physics
>>> Building 307, Room 229
>>> DK-2800 Kongens Lyngby
>>> Denmark
>>> Tel.: (+45) 4525 3157
>>> Fax.: (+45) 4593 2399
>>> email: Marcin.Dulak at fysik.dtu.dk
>>>
>>> ***********************************
>>>
>>>
>>
>>
>> --
>> ***********************************
>>
>> Marcin Dulak
>> Technical University of Denmark
>> Department of Physics
>> Building 307, Room 229
>> DK-2800 Kongens Lyngby
>> Denmark
>> Tel.: (+45) 4525 3157
>> Fax.: (+45) 4593 2399
>> email: Marcin.Dulak at fysik.dtu.dk
>>
>> ***********************************
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20120919/e372f7f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 87769 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20120919/e372f7f9/attachment.png>


More information about the ase-users mailing list