Script mode of eDFTpy

eDFTpy is a set of python modules. However, it can be executed by using the edftpy script which is generated at installation time. Here’s a quick guide to the script’s configuration dictionary, or config.

digraph config { a0 [shape=box3d, label="JOB", href="../tutorials/config.html#job", target="_top"]; a1 [shape=box3d, label="PATH", href="../tutorials/config.html#path", target="_top"]; a6 [shape=box3d, label="GSYSTEM", href="../tutorials/config.html#gsystem", target="_top"]; a2 [shape=box3d, label="MATH", href="../tutorials/config.html#math", target="_top"]; a3 [shape=box3d, label="PP", href="../tutorials/config.html#pp", target="_top"]; a5 [shape=box3d, label="OPT", href="../tutorials/config.html#opt", target="_top"]; a4 [shape=box3d, label="OUTPUT", href="../tutorials/config.html#output", target="_top"]; a7 [shape=box3d, label="SUB", href="../tutorials/config.html#sub", target="_top"]; b601 [shape=rectangle, label="cell", href="../tutorials/config.html#cell", target="_top"]; b602 [shape=rectangle, label="grid", href="../tutorials/config.html#grid", target="_top"]; b603 [shape=rectangle, label="density", href="../tutorials/config.html#density", target="_top"]; b604 [shape=rectangle, label="exc", href="../tutorials/config.html#exc", target="_top"]; b605 [shape=rectangle, label="kedf", href="../tutorials/config.html#kedf", target="_top"]; b606 [shape=rectangle, label="decompose", href="../tutorials/config.html#decompose", target="_top"]; b707 [shape=rectangle, label="mix", href="../tutorials/config.html#mix", target="_top"]; b708 [shape=rectangle, label="opt", href="../tutorials/config.html#id2", target="_top"]; b709 [shape=rectangle, label="kpoints", href="../tutorials/config.html#kpoints", target="_top"]; a6->b601[color=blue]; a6->b602[color=blue]; a6->b603[color=blue]; a6->b604[color=blue]; a6->b605[color=blue]; a6->b606[color=blue]; a7->b601; a7->b602; a7->b603; a7->b604; a7->b605; a7->b606; a7->b707; a7->b708; a7->b709; }

Warning

PP is a mandatory input (i.e., no default is avaliable for it).

Note

Defaults work well for most arguments.

When Options is empty, it can accept any value.

JOB

Control of the running job.

calctype

task

task

The task to be performed.

Options : Optdensity, Calculation, Tddft, Optmix

Default : Optdensity

calctype

The property to be calculated.

Options : Energy, Potential, Force, Stress

Default : Energy

PATH

Specify the path of needed files.

cell

pp

pp

The path of pseudopotential.

Options :

Default : ./

cell

The path of input structure.

Options :

Default : ./

MATH

Some methods and techniques that make DFTpy really fast.

linearie

linearii

linearii

Linear-scaling method to deal with Ion-Ion interactions (PME).

Options : True, False

Default : True

linearie

Linear-scaling method to deal with Ion-Electron interactions (PME).

Options : True, False

Default : True

PP

Control of the running job.

e.g. :

Al = Al_lda.oe01.recpot

OUTPUT

Control the output.

electrostatic_potential

sub_temp

time

electrostatic_potential

Output of electrostatic potential

Options :

Default : None

sub_temp

Output all the temporary files of subsystems.

Options : True, False

Default : False

time

Output the time information of all parts.

Options : True, False

Default : True

OPT

Control the charge density optimization of global system.

econv

maxiter

method

ncheck

olevel

pconv

sdft

method

Charge density optimization method

Options : Normal

Default : Normal

econv

Convergence threshold for energy, it will divided by the number of atoms.

Options :

Default : 1e-05

pconv

Convergence threshold for potential. Default is ‘econv’/1E2.

Options :

Default : None

maxiter

The max steps for optimization

Options :

Default : 100

ncheck

How many step satisfy the convergence

Options :

Default : 2

olevel

The level of output energy, large will faster.

Options :

Default : 2

Note

Only set 0, the energy of each cycle is useful

sdft

Subsytem DFT or Partition DFT

Options : sdft, pdft

Default : sdft

TD

Control the TDDFT.

maxiter

olevel

restart

sdft

timestep

maxiter

The max steps for TDDFT

Options :

Default : 1000

olevel

The level of output energy, large will faster.

Options :

Default : 2

Note

Only set 0, the energy of each cycle is useful

sdft

Subsytem DFT or Partition DFT

Options : sdft, pdft

Default : sdft

restart

Start the job from new one, scf results or restart from previous run

Options : initial, scf, restart

Default : initial

timestep

The time step for TDDFT (as)

Options :

Default : 1

SUB

basefile

calculator

cell-cut

cell-elename

cell-file

cell-format

cell-index

cell-split

cell-zval

decompose-adaptive

decompose-method

decompose-radius

decompose-rcut

density-atomic

density-file

density-gaussians_rcut

density-gaussians_scale

density-gaussians_sigma

density-initial

density-magmom

density-ncharge

density-nspin

density-output

density-use_gaussians

embed

exc-c_str

exc-x_str

exc-xc

exttype

grid-cplx

grid-ecut

grid-gfull

grid-maxprime

grid-nr

grid-optfft

grid-scale

grid-spacing

kedf-alpha

kedf-beta

kedf-delta

kedf-etamax

kedf-interp

kedf-k_str

kedf-kdd

kedf-kedf

kedf-kerneltype

kedf-kfmax

kedf-kfmin

kedf-ldw

kedf-lumpfactor

kedf-maxpoints

kedf-neta

kedf-nsp

kedf-order

kedf-params

kedf-ratio

kedf-rho0

kedf-rhomax

kedf-sigma

kedf-symmetrization

kedf-x

kedf-y

kpoints-grid

kpoints-method

kpoints-offset

mix-coef

mix-delay

mix-kf

mix-maxm

mix-predcoef

mix-predecut

mix-predtype

mix-restarted

mix-scheme

nprocs

opt-algorithm

opt-c1

opt-c2

opt-econv

opt-h0

opt-maxfun

opt-maxiter

opt-maxls

opt-method

opt-opt_method

opt-vector

opt-xtol

prefix

subs

task

technique

cell

Structure information of system.

cell-cut

cell-elename

cell-file

cell-format

cell-index

cell-split

cell-zval

cell-file

The file name of input structure.

Options :

Default : None

cell-split

Cut small cell for each direction (scaled).

Options :

Default : None

cell-cut

Base on the subsystem atoms build the small cell, and add the vaccum on each direction. 0 means use whole cell.

Options :

Default : 0

cell-index

The indices of the atoms, support integer and slice.

Options :

Default : None

Note

If not only a slice, you should given the stop for the slice.

cell-elename

The name of atom.

Options :

Default : Al

cell-zval

The charge of atomic species.

Options :

Default : None

cell-format

The format of structure file.

Options : pp, vasp, xsf, snpy, …

Default : None

Note

Only snpy format support parallel read and write

grid

Control the grid.

grid-cplx

grid-ecut

grid-gfull

grid-maxprime

grid-nr

grid-optfft

grid-scale

grid-spacing

grid-ecut

The kinetic energy cutoff (eV).

Options :

Default : None

grid-optfft

Optimize the number of grid points

Options : True, False

Default : True

grid-spacing

The spacing (or gap) separating nearest real space grid points. If set this, ecut is disabled.

Options :

Default : None

grid-gfull

Determines oif the number of grid points in the reciprocal and real space grids are equal. If ‘False’ only use half grid, which will be faster.

Options : True, False

Default : False

Note

gfull=False’ implies that the the number of points of reciprocal space is only half of real space.

grid-nr

The number of grid points in the direction of the three lattice vectors.

Options :

Default : None

e.g. :

nr = 32 32 32

grid-maxprime

The max prime of guess best number of grid points for FFT

Options : 3, 5, 7, 11, 13, 17,…, 97

Default : 13

grid-scale

The minimum scale for guess the best number of grid points

Options :

Default : 0.99

grid-cplx

The type of real space value

Options : True, False

Default : False

density

Control the charge density.

density-atomic

density-file

density-gaussians_rcut

density-gaussians_scale

density-gaussians_sigma

density-initial

density-magmom

density-ncharge

density-nspin

density-output

density-use_gaussians

density-nspin

non/spin-polarized calculation

Options : 1, 2

Default : 1

density-ncharge

Total charge of the system

Options :

Default : None

density-magmom

Total electronic magnetization.

Options :

Default : 0

density-file

The input density file for initial density

Options :

Default : None

density-output

The output file or format of density. The name starts with ‘.’ represent the format.

Options :

Default : None

density-initial

For OFDFT subsystem the default is Ofdft.

Options : None, Atomic, Read, Ofdft, Heg

Default : None

density-atomic

If initial set the Atomic, here need give each elements atomic density

Options :

Default : {}

density-use_gaussians

It will replaces the core densities of the surrounding fragments with a gaussian. This is to avoid problems of electrons leaking in the core region of surrounding fragments when hard pseudopotentials are employed.

Options : True, False

Default : False

density-gaussians_rcut

The cutoff of distance.

Options :

Default : 3

density-gaussians_sigma

The sigma of gaussians.

Options :

Default : 0.3

density-gaussians_scale

The scale of each elements. If not set, will use the number of core electrons.

Options :

Default : {}

exc

Control the exchange-correlation functional.

exc-c_str

exc-x_str

exc-xc

exc-xc

The kind of exchange-correlation functional. If not LDA, must have pylibxc installed. It has higher priority than x_str and c_str

Options : LDA, PBE

Default : None

exc-x_str

The type of exchange functional.

Options :

Default : None

exc-c_str

The type of correlation functional.

Options :

Default : None

kedf

Control the kinetic energy density functional (KEDF). DFTpy features most KEDFs, from GGAs to nonlocal to nonlocal with density dependent kernel.

kedf-alpha

kedf-beta

kedf-delta

kedf-etamax

kedf-interp

kedf-k_str

kedf-kdd

kedf-kedf

kedf-kerneltype

kedf-kfmax

kedf-kfmin

kedf-ldw

kedf-lumpfactor

kedf-maxpoints

kedf-neta

kedf-nsp

kedf-order

kedf-params

kedf-ratio

kedf-rho0

kedf-rhomax

kedf-sigma

kedf-symmetrization

kedf-x

kedf-y

kedf-kedf

The type of KEDF.

Options : TF, vW, x_TF_y_vW, WT, SM, FP, MGP, MGPA, MGPG, LMGP, LMGPA, LMGPG

Default : WT

kedf-x

The ratio of TF KEDF.

Options :

Default : 1

kedf-y

The ratio of vW KEDF.

Options :

Default : 1

kedf-alpha

The alpha parameter typical in nonlocal KEDF \(\rho^{\alpha}\).

Options :

Default : 0.8333333333333333

kedf-beta

The beta parameter typical in nonlocal KEDF \(\rho^{\beta}\).

Options :

Default : 0.8333333333333333

kedf-sigma

A parameter used to smooth with a Gaussian convolution FFTs of problematic functions (e.g., invfft of \({G^2\rho(G)}\) ).

Options :

Default : None

kedf-nsp

The number of \({k_{f}}\) points for splining LWT like nonlocal KEDFs. There are three options to achieve the same goal, the priority is nsp -> delta -> ratio. Default is using ratio.

Options :

Default : None

kedf-interp

The interpolation method for LWT KEDF’s kernel from the kernel table.

Options :

Default : hermite

kedf-kerneltype

The kernel for LWT KEDF.

Options : linear, newton, hermite

Default : WT

kedf-symmetrization

The symmetrization way for MGP KEDF. See paper.

Options : None, Arithmetic, Geometric

Default : None

kedf-lumpfactor

The kinetic electron for LWT KEDF.

Options :

Default : None

kedf-neta

The max number of discrete \(\eta\) for LWT KEDF.

Options :

Default : 50000

kedf-etamax

The max value of eta for kernel in LWT KEDF.

Options :

Default : 50

kedf-order

The order for the interpolation of the kernel in LWT KEDF. ‘0’ means using the value of nearest-neighbor point is used.

Options : 1, 2, 3, 4, 5

Default : 3

kedf-ratio

The ratio of \({k_{f}}\) for spline in LWT KEDF. There are three options to do same thing, the priority is nsp -> delta -> ratio. Default is using ratio.

Options :

Default : 1.2

kedf-maxpoints

The max number of integration points for the evaluation of the MGP kernel.

Options :

Default : 1000

kedf-delta

The gap of spline

Options :

Default : None

kedf-kdd
The kernel density denpendent for LWT KEDF:
  • 1 : The origin LWT KEDF.

  • 2 : Considers the \(\rho^{\beta}(r')\omega(\rho(r),r-r')\) term in the potential.

  • 3 : Also considers the derivative of kernel which is neglected in LWT. See paper.

Options : 1, 2, 3

Default : 3

kedf-rho0

The ‘average’ density used for the definition of the Fermi momentum. Default is None, which means it calculated based on the total charge and system volume.

Options :

Default : None

kedf-k_str

Functional type for GGA/LIBXC_KEDF

Options :

Default : gga_k_revapbe

Warning

The functional type of GGA and LIBXC_KEDF are different.

kedf-params

Parameters for GGA KEDF functionals

Options :

Default : None

kedf-kfmin

Lower limit of kf

Options :

Default : None

kedf-kfmax

Upper limit of kf

Options :

Default : None

kedf-rhomax

Maximum/cutoff density

Options :

Default : None

kedf-ldw

local density weight

Options :

Default : None

decompose

The way to decompose the subsytem to more subsytems

decompose-adaptive

decompose-method

decompose-radius

decompose-rcut

decompose-method

‘manual’ means use the given subsystem; ‘distance’ means base on the distance of atoms to decompose the subsytem.

Options : manual, distance

Default : manual

decompose-adaptive

The decompose method after first step, ‘manual’ will remove all ‘NSUB’

Options : manual, distance

Default : manual

decompose-rcut

The cutoff for decompose the subsytems.

Options :

Default : 3

decompose-radius

The radius of each elements for decompose the subsytems.

Options :

Default : {}

mix

Control the charge density mixing.

mix-coef

mix-delay

mix-kf

mix-maxm

mix-predcoef

mix-predecut

mix-predtype

mix-restarted

mix-scheme

mix-scheme

Density mixing scheme, default is with driver’s own scheme.

Options : Pulay, Linear

Default : None

mix-predtype

The preconditioning method

Options : kerker, inverse_kerker, resta

Default : kerker

mix-predcoef

The parameters for preconditioning

Options :

Default : 1.0 1.0 1.0

mix-predecut

The preconditioning energy cutoff.

Options :

Default : None

mix-maxm

Maximum of iterations used for mixing.

Options :

Default : 7

mix-coef

Options : The mixing parameter.

Default : 0.5

mix-delay

Delay several step to mixing the density

Options :

Default : 2

mix-restarted

Restart the mixer after several step.

Options : True, False

Default : False

mix-kf

Similar as predcoef, not use now.

Options :

Default : auto

opt

Control the charge density optimization for subsytem.

opt-algorithm

opt-c1

opt-c2

opt-econv

opt-h0

opt-maxfun

opt-maxiter

opt-maxls

opt-method

opt-opt_method

opt-vector

opt-xtol

opt-opt_method

Options :

Default : full

opt-maxiter

The max steps for optimization

Options :

Default : 800

opt-method

The density optimization method.

Options : TN, LBFGS, CG-HS, CG-DY, CG-CD, CG-LS, CG-FR, CG-PR

Default : CG-HS

opt-algorithm

The direct minimization method : Energy (EMM) or Residual (RMM).

Options : EMM, RMM

Default : EMM

opt-vector

The scheme to deal with search direction.

Options : Orthogonalization, Scaling

Default : Orthogonalization

opt-c1

The wolfe parameters c1

Options :

Default : 0.0001

opt-c2

The wolfe parameters c2

Options :

Default : 0.2

opt-maxls

The max steps for line search.

Options :

Default : 10

opt-econv

The energy convergence for last three steps (a.u./atom).

Options :

Default : 1e-06

opt-maxfun

The max steps for function calls. For TN density optimization method its the max steps for searching direction.

Options :

Default : 50

opt-xtol

Relative tolerance for an acceptable step.

Options :

Default : 1e-12

opt-h0

The initial approximation for the inverse Hessian needed by LBFGS.

Options :

Default : 1

kpoints

Set the kpoints for subsytem.

kpoints-grid

kpoints-method

kpoints-offset

kpoints-method

The method for generate the kpoints

Options :

Default : auto

kpoints-grid

The grid of kpoints

Options :

Default : None

kpoints-offset

The offset of kpoints

Options :

Default : None

subs

The name of all subsystems in this subsystem

Options :

Default : None

calculator

The SCF driver of subsystem

Options : dftpy, castep, qe

Default : dftpy

technique

The technique (OF|KS) of the driver

Options :

Default : OF

nprocs

The number of processors for the subsystem

Options :

Default : 1

Note

If the minimum of all subsystems is 1, can also be used as ratio of number os processors of each subsystem

embed

The embedding potential

Options : KE, XC

Default : KE XC

exttype

The embeded potential type, which is same as embed.

Options : 0, 1,…, 7

Default : None

basefile

The base input file for subsytem

Options :

Default : None

prefix

The prefix of each subsystem. If not set, it’s same as the name of subsytem.

Options :

Default : None

task

The task to be performed for subsytem. Only works for JOB-task = Optmix.

Options : scf, optical

Default : None

MOL

The information of molecules.

charge

charge

The charge of molecules or atoms.

Options :

Default : {}