Dacapo is a total energy program based on density functional theory. It uses a
plane wave basis for the valence electronic states and describes the
core-electron interactions with Vanderbilt ultrasoft pseudo-potentials. The
program performs self-consistent calculations for both Local Density
Approximation (LDA) and various Generalized Gradient Approximation (GGA)
exchange-correlations potentials, using state-of-art iterative algorithms. The
code may perform molecular dynamics / structural relaxation simultaneous with
solving the Schrodinger equations within density functional theory. The
program may be compiled for seriel as well as parallel execution and the code
has been ported to many hardware platforms.

The manual describes how to use the dacapo program from the Campos
Atomistic Simulation enviroment, or for short ASE.

As a minimum for defining a calculation in python you need to specify the atoms
as described above, and you need to set the planewave cutoff and the number of
bands, this will look like this using the python interface:

The method SetPlaneWaveCutoff(planewavecutoff) defines the plavewave cutoff
for the calculation. The unit for planewavecutoff is eV.

The method SetDensityCutoff(densitycutoff) sets the density cutoff.
By default the two cutoffs are equal, corresponding to using just one grid.
For elements like Cu using ultra-soft pseudo potentials the ultra-soft
pseudo-wavefunction are very soft, while the density still requires a
fine grid, in this case it can be advantagous to set a larger value for
densitycutoff that for planewavecutoff.

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.
You could also use, SetMagneticMoments((1,-1)), this will define a
'anti-ferro' magnetic state with total magnetic moment of zero.
If this case probably the end result is still the same (2 Bohr
magneton) but the number of self-consistent iterations will increase.

The method SetBZKPoints(kpts) can be used to define the k-points in the BZ.
In general kpts are a python list of k-points defined in units of the
reciprocal cell. You can however specify a 10x10x10 Monkhorst-Pack 3dimensional set
simple by using SetBZKpoint((10,10,10)).

Below is a list of the special k-points sets that can be used:

MonkhorstPack:

A 3-dimensional Monkhorst-Pack special k-point set.
(see H.J.Monkhorst and J.D.Pack, Physical Review B, vol. 13, page 5188, 1976.
You can defined this k-points set simply using, SetBZKPoints((n1,n2,n3)). This will define a n1 by n2 by n3,
Monkhorst Pack special k-point set.
The size along each reciprocal vector given by n1, n2 and n3, respectively.

The method SetChargeMixing(value) can be used to enable or disable
charge density mixing.

Using SetChargeMixing(True) the program will use Pulay mixing for the density
(default).

Using SetChargeMixing(False) correspond to running
a calculation using the Harris-Foulkes functional using
the input density. See also the Harris calculation example.

The method SetKerkerPreconditioning(value) can be used to set Kerker preconditioning
for the density mixing.
For value=True Kerker preconditiong is used, i.e. q is different from zero, see eq. 82 in
Kresse/Furthmller: Comp. Mat. Sci. 6 (1996). The value of q is fix to give a damping of 20 of
the lowest q vector.
For value=False q is zero and mixing is linear (default).

will add the interslab dipole electrostatic decoupling. Presently, this feature is only active along the third unit cell vector, so you need to choose unit cell accordingly. Corrections for higher electrostatic multipoles are not implemented presently.

The default position of the field discontinuity at the vacuum position farthest from any other atoms on both sides of the slab.

The keyword AdditiveDipoleField, will add a constant electrostatic field along third unit cell vector, corresponding to an external dipole layer. This field is added to the dipole correction field.
The field discontinuity follows the position of the dynamical dipole correction.

Dacapo can calculate the density of states projected onto atomic
orbitals.

Warning

The density of states are not implemented for planewave parallel
calculations,
so the number of nodes must match the number kpoints (after
they have been reduce by symmetry).
So if you for example have 4 IBZ kpoints, you can use
4 or 2 parallel nodes and still get the projected density of
states.

This will return a density of states projected onto the s-orbital
of the first atom (atom numbers starts from 1).

The method:

CalculateAtomicDOS(energywindow=None)

tells the fortran program to calculate the local density of states
projected onto atomic orbitals,
using energywindow for calculating the energy resolved
LDOS in a specific range (must be within the eigenvalue spectrum).

The method:

``GetLDOS(**keywords )``:

returns an instance of AtomProjectedDOSTool (see below).

Keyword for the GetDOS method:

atoms

List of atoms numbers (default is all atoms)

angularchannels

List of angular channel names.
The full list of names are:
's', 'p_x', 'p_y', 'p_z','d_zz','dxx-yy', 'd_xy', 'd_xz', 'd_yz'.
'p' and 'd' can be used as shorthand for all p and all d channels
respectively. (default is all d channels)

spin

List of spins (default all spins)

cutoffradius

'short' or 'infinite'.
For cutoffradius = 'short' the integrals are truncated at 1 Angstrom.
For cutoffradius = 'infinite' the integrals are not truncated.
(default 'infinite')

The resulting DOS are added over the members of the three list (atoms,angularchannels and spin).

GetDOS returns a instance of the class AtomProjectedDOSTool (Thanks to John Kitchen for providing
grace plot and band moments methods).

Methods for AtomProjectedDOSTool:

GetPlot

returns a GnuPlotAvartar for the energy resolved DOS
A parent can be given too combine plot.

GetIntegratedDOS

returns the integral up to the fermi energy

GetData

returns the energy resolved DOS

GetBandMoment(moments)

returns the moments of the projected DOS.
GetBandMoment(0) return the integrated DOS.
GetBandMoment(1,2) returns the first and second moment of the projected DOS
(center and width)

SaveData(filename)

saves the data to the filename

GetGracePlot

makes a GracePlot (if GracePlot is installed)

Note

The eigen values are not relative to the Fermi level,
you can get the fermi level for the calculation using
calc.GetFermilevel()

The direction cosines for which the spherical harmonics are set up are using
the next different atom in the list (cyclic) as direction pointer, so the
z-direction is chosen along the direction to this next atom.
At the moment the rotation matrices is only given in the text file,
you can use
grep 'MUL: Rmatrix' out_o2.txt
to get this information.

This will prevent the dacapo fortran program to terminate and write the full
netcdf output file after each call of GetPotentialEnergy.
Instead it will wait for python to send new positions.
This way of running the program saves IO time and reduce the NFS traffic.

Do not use this mode for NEB calculations, you will end of having 10
fortran programs in memory.

Two methods are defined for general reading and writing of NetCDF
entries. This provides a method for reading and writing any NetCDF variable
defined in the dacapo netcdf manual, so that any settings for the
dacapo fortran program, not defined by the standard sets of method from
the DFT Calculator or from the extra Dacapo method described above,
can be defined. The methods are listed below:

SetNetCDFEntry(variable,att=None,value=None):

Define a general netcdf entry for this calculation.
If the netcdf entry is allready defined, the value are
modified.

GetNetCDFEntry(variable,att=None):

Returns the value of NetCDF entry <variable> or NetCDF attribute
att, if specified.