ASE interface to the SIESTA total energy package

1   Introduction

The ASE2 interface to SIESTA is work in progress.

2   Requirements

A script siesta.run must be in the path. This script runs the SIESTA executable. Modify the example siesta.run to match your installation of SIESTA.

A small pseudopotential database for running the examples can be installed like this:

gunzip SIESTA_pspotDB.tar.gz
cat SIESTA_pspotDB.tar.gz | tar xvf -
setenv SIESTA_PSPOT_DATABASE "/your/current/directory/SIESTA_pspotDB"

3   SIESTA Calculator

This section describes the python ASE interface to the SIESTA packages.

3.1   Setting up the atomic configuration

The atoms for SIESTA are defined via the ASE ListOfAtoms object.

A ListOfAtoms object is a collection of atoms. The ASE implementation of a ListOfAtoms can be used like this:

from ASE import Atom, ListOfAtoms
atoms = ListOfAtoms([Atom('C', (0, 0, 0)),
...                  Atom('O', (0, 0, 1.0))],periodic=1)
atoms.SetUnitCell((10,10,10))

This will define a CO molecule, with a CO distance of 1A, in a cubic 10Ax10Ax10A unitcell.

For more details of the ListOfAtoms class see listofatoms in the ASE manual.

The atoms defined here can be attached to a SIESTA calculator by using:

atoms.SetCalculator(calculator)

alternatively, one can attach the atoms to a calculator by using:

calculator.SetListOfAtoms(atoms)

If you do not specify the periodic keyword, then defining the atoms, SIESTA will run a calculation without periodic boundary conditions (Molecular calculation) and SIESTA will ignore any unitcell. SIESTA will define box large enough to accommodate the molecule defined in ListOfAtoms.

3.2   The SIESTA calculator

Siesta specific keywords:

keyword type default value description
NumberPulay int 2 Number of steps between each Pulay density mixing
MixingWeight float 0.1 Pulay mixing weight
Tolerance float 1e-5 Accuracy of convergence
MeshCutoff float 80Ryd  
SolutionMethod str diagon Matrix diagonalization or order-N
SaveHS bool True Save Hamiltonian matrix
MaxSCFIterations int 200  
ghostatoms ListOfAtoms None Ghost atoms
UseSaveDM bool False Reused saved density matrix
keep_siesta_defaults bool False Use siesta own defaults instead of the ones listed above

A corresponding method exists for these keywords:

Set/Get<keyword>,
i.e.
SetMeshCutoff(60)

You can set a general FDF entry using the method:

SetFDFEntry(name,value=newvalue)

General DFT calculators keywords:

keyword type default value description
kT float 0.1 Width of Fermi-distribution
kpts list gamma point k-points
3.2.2   K-points

The method SetBZKPoints(kpts) can be used to define the k-points in the BZ. You can specify a 10x10x10 Monkhorst-Pack 3dimensional set simple by using SetBZKpoint((10,10,10)).

This is the only allowed form at the moment.

3.2.3   Pseudopotentials

The method SetPseudopotentialPath(element,path) can be used to set the pseudopotentials for element, either specified as atomic symbol or number.

The directory path must contain a file named VPSOUT containing the pseudopotential.

3.2.4   Defining a spin-polarized calculation

One can use the method SetSpinPolarized(True) to tell SIESTA that the calculation should be spin-polarized.

One also need to specify an initial magnetic moment for the atoms. You can do this in the construction of the atoms, by using:

>>> from ASE import Atom, ListOfAtoms
>>> atoms = ListOfAtoms([Atom('O', (0, 0, 0),magmom=1.0),
...                      Atom('O', (0, 0, 1.2),magmom=1.0)])

This can also be set using the ListOfAtoms method SetMagneticMoments((1,1)) or setting the SetMagneticMoment method on each atom.

This will define a initial total magnetic moment of 2 Bohr magneton, for the O2 molecule, this being also the self-consistent result.

3.2.5   Ghost atoms

Using the keyword ghostatoms or the method:

SetGhostAtoms

ghost atoms can be added to the SIESTA basis set: The orbitals are generated corresponding to the position of the ghost atoms. ghost_atoms is a nomal ASE ListOfAtoms. The method:

GetGhostAtoms

will return a ASE ListOfAtoms coresponding to the ghost atoms.

3.2.6   Setting a general FDFEntry

The method SetFDFEntry(entry) can be used to define a general FDF entry for SIESTA. As an example, using:

>>> calculator.SetBZKpoints((10,10,10))

correspond to:

value = [[10.,0.0,0.0,0.0],[0.0,10.,0.0,0.0],[0.0,0.0,10.,0.0]]
self.SetFDFEntry("kgrid_Monkhorst_Pack",value=value)

Another example:

The EnergyShift can be set using:

>>> calc.SetFDFEntry('PAO.EnergyShift','0.05 eV')

This parameter should in general be set lower than the default value of 0.2Rydberg

The GridCellSampling can be set using:

value = [[0.0,0.5,0.5],
         [0.5,0.0,0.5],
         [0.5,0.5,0.0]]
calc.SetFDFEntry('GridCellSampling',value=value)

This will reduce the "egg-box" effect on the energy and forces.

3.2.7   Specifying the basis set

To specify a customized basis set you can use the method explained in "Setting a general FDFEntry". As an example we will specify a split type triple zeta - triple polarized (TZTP) basis for Au. The valence states of Au are 5d and 6s and a TZTP basis set will therefore consists of the following orbitals: l=0: 3, l=1: 3, l=2: 3 and the basis set will therefore consist of 3*(2*0+1) + 3*(2*1+1) + 3*(2*2+1) = 27 basis functions per Au atom.

The basis set can be defined by:

value = [['Au',2,'split',0.00], #label, num. of l-shells,type,charge
         [0,3,'P',3],           #l,nzeta,'P'(opt):pol.functions,npolzeta
         [0.00,0.00,0.00],      #rc of basis functions for each zeta function
                                #0.00  => rc determined by PAO.EnergyShift
         [2,3],                 #l,nzeta
         [0.00,0.00,0.00]]      #rc

calc.SetFDFEntry('PAO.Basis',value=value)
3.2.8   Reading from an old calculation

If you want to restart a calculation or read specific information from an old calculation, one have to access the information via the atoms, using:

atoms = SIESTA.ReadAtoms('oldfile')

Now you can get the calculator, attached to the atoms:

calc = atoms.GetCalculator()

4   SIESTA pseudopotential database

In the ASE SIESTA pseudopotential page you can find a local small database of pseudopotentials. You can download or add pseudopotentials to this database.

ase2: SIESTA (last edited 2010-10-20 09:11:15 by localhost)