Script mode of DFTpy

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

JOB

PATH

MATH

PP

CELL

GRID

DENSITY

EXC

KEDF

OUTPUT

OPT

PROPAGATOR

TD

CASIDA

INVERSION

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.

task

calctype

task

The task to be performed.

  • Options : Optdensity, Calculation, Propagate, Casida, Diagonalize, Inversion

  • Default : Optdensity

calctype

The property to be calculated.

  • Options : Energy, Potential, Both, Force, Stress

  • Default : Energy

PATH

Specify the path of needed files.

pppath

cellpath

pppath

The path of pseudopotential.

  • Options :

  • Default : ./

cellpath

The path of input structure.

  • Options :

  • Default : ./

MATH

Some methods and techniques that make DFTpy really fast.

linearii

linearie

twostep

multistep

reuse

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

twostep

A two-step method for performing density optimizations. ‘True’ is equivalent to multistep = 2.

  • Options : True, False

  • Default : False

multistep

A multi-step method for performing density optimizations.

  • Options : 1,2,…

  • Default : 1

reuse

Except in the first step, the initial density is given by the optimized density of the previous step.

  • Options : True, False

  • Default : True

PP

Control of the running job.

  • e.g. :

    Al = Al_lda.oe01.recpot

CELL

Information about the input structure.

cellfile

elename

zval

format

cellfile

The file of input structure.

  • Options :

  • Default : POSCAR

elename

The name of atom.

  • Options :

  • Default : None

zval

The charge of atomic species.

  • Options :

  • Default : None

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.

ecut

spacing

gfull

nr

maxprime

scale

cplx

ecut

The kinetic energy cutoff.

  • Options :

  • Default : 600

  • Unit : eV

spacing

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

  • Options :

  • Default : None

  • Unit : Angstrom

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.

nr

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

  • Options :

  • Default : None

  • e.g. :

    nr = 32 32 32

maxprime

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

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

  • Default : 13

scale

The minimum scale for guess the best number of grid points

  • Options :

  • Default : 0.99

cplx

The type of real space value

  • Options : True, False

  • Default : False

DENSITY

Control the charge density.

nspin

magmom

densityini

densityfile

densityoutput

nspin

non/spin-polarized calculation

  • Options : 1, 2

  • Default : 1

magmom

Total electronic magnetization.

  • Options :

  • Default : 0

densityini

The initial density is given by homogeneous electron gas (HEG) or read from densityfile. If set Read, must given the densityfile.

  • Options : HEG, Read

  • Default : HEG

densityfile

The charge density for initial density, only works when if densityini set Read.

  • Options :

  • Default : None

densityoutput

The output file of final density. The default is not output the density.

  • Options :

  • Default : None

EXC

Control the exchange-correlation functional.

xc

libxc

x_str

c_str

xc

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

  • Options : LDA, PBE

  • Default : None

libxc

The type of exchange-correlation functionals with pylibxc. See available functionals.

  • Options :

  • Default : lda_x lda_c_pz

x_str

See libxc’s available exchange functionals (deprecated).

  • Options :

  • Default : None

c_str

See libxc’s available correlation functionals (deprecated).

  • 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

x

y

alpha

beta

sigma

nsp

interp

kerneltype

symmetrization

lumpfactor

neta

etamax

order

ratio

maxpoints

delta

kdd

rho0

k_str

params

kfmin

kfmax

rhomax

ldw

temperature

temperature0

kedf

The type of KEDF. GGA functionals are available with keywords GGA and LIBXC_KEDF.

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

  • Default : WT

x

The ratio of TF KEDF.

  • Options :

  • Default : 1

y

The ratio of vW KEDF.

  • Options :

  • Default : 1

alpha

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

  • Options :

  • Default : None

beta

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

  • Options :

  • Default : None

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

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

interp

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

  • Options : linear, newton, hermite

  • Default : hermite

kerneltype

The kernel for LWT KEDF.

  • Options : WT, MGP, MGPA, MGPG, HC

  • Default : None

symmetrization

The symmetrization way for MGP KEDF. See MGP_paper.

  • Options : None, Arithmetic, Geometric

  • Default : None

lumpfactor

The kinetic electron for LWT KEDF.

  • Options :

  • Default : None

neta

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

  • Options :

  • Default : 50000

etamax

The max value of eta for kernel in LWT KEDF.

  • Options :

  • Default : 50

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

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.15

maxpoints

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

  • Options :

  • Default : 1000

delta

The gap of spline

  • Options :

  • Default : None

kdd
The kernel density dependent 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 LMGP_paper.

  • Options : 1, 2, 3

  • Default : 3

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

k_str

Functional type for GGA/LIBXC_KEDF

  • Options : LKT, DK, LLP, LLP91, OL1, OL, OL2, T92, THAK, B86A, B86, B86B, DK87, PW86, PW91O, PW91, PW91k, LG94, E00, P92, PBE2, PBE3, PBE4, P82, TW02, APBE, APBEK, REVAPBEK, REVAPBE, VJKS00, LC94, VT84F, SMP, TF, VW, X_TF_Y_VW, TFVW, STV, PBE2M, PG

  • Default : None

Warning

GGA invokes DFTpy’s implementation. LIBXC_KEDF invokes libxc’s implementation (discouraged).

params

Parameters for GGA KEDF functionals

  • Options :

  • Default : None

kfmin

Lower limit of kf

  • Options :

  • Default : None

kfmax

Upper limit of kf

  • Options :

  • Default : None

rhomax

Maximum/cutoff density

  • Options :

  • Default : None

ldw

local density weight

  • Options :

  • Default : None

temperature

The temperature of TF KEDF.

  • Options :

  • Default : None

  • Unit : eV

temperature0

The temperature of TF KEDF (analytical approximation).

  • Options :

  • Default : None

  • Unit : eV

KEDF2

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

copy

active

x

y

kedf

alpha

beta

sigma

nsp

interp

kerneltype

symmetrization

lumpfactor

neta

etamax

order

ratio

maxpoints

delta

kdd

rho0

k_str

params

kfmin

kfmax

rhomax

ldw

temperature

temperature0

copy

  • Options :

  • Default : KEDF

active

  • Options : True, False

  • Default : False

x

The ratio of TF KEDF.

  • Options :

  • Default : 0

y

The ratio of vW KEDF.

  • Options :

  • Default : 0

kedf

The type of KEDF. GGA functionals are available with keywords GGA and LIBXC_KEDF.

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

  • Default : WT

alpha

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

  • Options :

  • Default : None

beta

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

  • Options :

  • Default : None

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

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

interp

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

  • Options : linear, newton, hermite

  • Default : hermite

kerneltype

The kernel for LWT KEDF.

  • Options : WT, MGP, MGPA, MGPG, HC

  • Default : None

symmetrization

The symmetrization way for MGP KEDF. See MGP_paper.

  • Options : None, Arithmetic, Geometric

  • Default : None

lumpfactor

The kinetic electron for LWT KEDF.

  • Options :

  • Default : None

neta

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

  • Options :

  • Default : 50000

etamax

The max value of eta for kernel in LWT KEDF.

  • Options :

  • Default : 50

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

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.15

maxpoints

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

  • Options :

  • Default : 1000

delta

The gap of spline

  • Options :

  • Default : None

kdd
The kernel density dependent 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 LMGP_paper.

  • Options : 1, 2, 3

  • Default : 3

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

k_str

Functional type for GGA/LIBXC_KEDF

  • Options : LKT, DK, LLP, LLP91, OL1, OL, OL2, T92, THAK, B86A, B86, B86B, DK87, PW86, PW91O, PW91, PW91k, LG94, E00, P92, PBE2, PBE3, PBE4, P82, TW02, APBE, APBEK, REVAPBEK, REVAPBE, VJKS00, LC94, VT84F, SMP, TF, VW, X_TF_Y_VW, TFVW, STV, PBE2M, PG

  • Default : None

Warning

GGA invokes DFTpy’s implementation. LIBXC_KEDF invokes libxc’s implementation (discouraged).

params

Parameters for GGA KEDF functionals

  • Options :

  • Default : None

kfmin

Lower limit of kf

  • Options :

  • Default : None

kfmax

Upper limit of kf

  • Options :

  • Default : None

rhomax

Maximum/cutoff density

  • Options :

  • Default : None

ldw

local density weight

  • Options :

  • Default : None

temperature

The temperature of TF KEDF.

  • Options :

  • Default : None

  • Unit : eV

temperature0

The temperature of TF KEDF (analytical approximation).

  • Options :

  • Default : None

  • Unit : eV

OUTPUT

Control the output.

time

stress

electrostatic_potential

time

Output the time information of all parts.

  • Options : True, False

  • Default : True

stress

Output the stress information of all terms.

  • Options : True, False

  • Default : True

electrostatic_potential

Output of electrostatic potential

  • Options :

  • Default : None

OPT

Control the charge density optimization.

method

algorithm

vector

c1

c2

maxls

econv

maxfun

maxiter

xtol

h0

method

The density optimization method.

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

  • Default : CG-HS

algorithm

Direct energy minimization method (EMM), direct residual minimization method (RMM), and one-orbital ensemble self-consistent field (OESCF).

  • Options : EMM, RMM, OESCF

  • Default : EMM

Note

In OESCF solver, the kedf has to contains full vW functional.

vector

The scheme to deal with search direction.

  • Options : Orthogonalization, Scaling

  • Default : Orthogonalization

c1

The wolfe parameters c1

  • Options :

  • Default : 0.0001

c2

The wolfe parameters c2

  • Options :

  • Default : 0.2

maxls

The max steps for line search.

  • Options :

  • Default : 10

econv

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

  • Options :

  • Default : 1e-06

  • Unit : a.u./atom

maxfun

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

  • Options :

  • Default : 50

maxiter

The max steps for optimization

  • Options :

  • Default : 100

xtol

Relative tolerance for an acceptable step.

  • Options :

  • Default : 1e-12

h0

The initial approximation for the inverse Hessian needed by LBFGS.

  • Options :

  • Default : 1

PROPAGATOR

Control of the propagator. DFTpy has an implementation of hydrodynamic TDDFT. This is essentially TDDFT with one orbital only, defined as \({\psi(r,t)=\sqrt{\rho(r,t)}e^{iS(r,t)}}\), and determined by the following time-dependent Schroedinger equation,

\({-\frac{1}{2} \nabla^2 \psi(r,t) + v_s(r,t) \psi(r,t) = i\frac{d}{dt}\psi(r,t)}\),

where \({v_s = v_{xc} + v_H + v_{T_s} - v_{vW} + v_{dyn}}\), See paper.

propagator

order

linearsolver

tol

maxiter

atol

propagator

The type of propagator.

  • Options : crank-nicholson, taylor

  • Default : crank-nicholson

order

The order used for the Taylor expansion propagator.

  • Options :

  • Default : 20

linearsolver

The linear solver used for the Crank-Nicolson propagator. The solvers with a name end with _scipy are from the SciPy package and should be used in serial calculations only.

  • Options : bicg, bicgstab, cg, bicg_scipy, bicgstab_scipy, cg_scipy, cgs_scipy, gmres_scipy, lgmres_scipy, minres_scipy, qmr_scipy

  • Default : cg

tol

The relative tolerance for the linear solver used for the Crank-Nicolson propagator.

  • Options :

  • Default : 1e-10

maxiter

The max amount of iteration steps for the linear solver used for the Crank-Nicolson propagator.

  • Options :

  • Default : 100

atol

The absolute tolerance for the linear solver used for the Crank-Nicolson propagator.

  • Options :

  • Default : None

TD

Control the TDDFT parameters that lie outside the propagator class.

outfile

timestep

tmax

max_pc

tol_pc

atol_pc

direc

strength

max_runtime

restart

restart_input

save_interval

correction

vector_potential

propagate_vector_potential

omega

z_split

outfile

The prefix of the output files.

  • Options :

  • Default : td_out

timestep

The time step in atomic units.

  • Options :

  • Default : 0.001

tmax

The total amount of time in atomic units.

  • Options :

  • Default : 1

max_pc

The max amount of the predictor-corrector steps.

  • Options :

  • Default : 2

tol_pc

The relative tolerance for the predictor-corrector.

  • Options :

  • Default : 1e-08

atol_pc

The absolute tolerance for the predictor-corrector.

  • Options :

  • Default : 1e-10

direc

The direction of the initial kick. 0, 1, 2 stands for x-, y-, z-direction, respectively.

  • Options : 0 or x, 1 or y, 2 or z

  • Default : 0

strength

The strength of the initial kick in atomic units.

  • Options :

  • Default : 0.001

max_runtime

Max amount of running time in seconds before the program saves the intermediate result and quitting.

  • Options :

  • Default : 0

restart

Restart the propagation from a previously saved intermediate result.

  • Options : True, False

  • Default : False

restart_input

Input file for restart data.

  • Options :

  • Default : restart_data.npy

save_interval

The number of time step interval between two saves of states.

  • Options :

  • Default : 1000

correction

  • Options : True, False

  • Default : False

vector_potential

If true, use vector potential for the initial kick.

  • Options : True, False

  • Default : False

propagate_vector_potential

Only matters if vector_potential is true. If true, propagate the vector potential.

  • Options : True, False

  • Default : True

omega

  • Options :

  • Default : 0

z_split

  • Options :

  • Default : 0

CASIDA

Control of the CASIDA.

numeig

diagonalize

tda

numeig

Number of eigenstates used in constructing casida matrix.

  • Options :

  • Default : None

diagonalize

If true, diagonalize the Hamiltonian before construct the Casida matrix. If false, read the eigenstates from a saved file.

  • Options : True, False

  • Default : True

tda

Use Tamm-Dancoff approximation.

  • Options : True, False

  • Default : False

NONADIABATIC

nonadiabatic

cutoff

rho_cutoff

k

nonadiabatic

Name of nonadiabatic Pauli potential.

  • Options :

  • Default : None

cutoff

If :math:’k_F’ is smaller than the cutoff, treat it equal to the cutoff.

  • Options :

  • Default : 0.01

rho_cutoff

  • Options :

  • Default : 0.001

k

  • Options :

  • Default : 2

NONADIABATIC2

copy

active

nonadiabatic

cutoff

rho_cutoff

k

copy

  • Options :

  • Default : NONADIABATIC

active

  • Options : True, False

  • Default : False

nonadiabatic

Name of nonadiabatic Pauli potential.

  • Options :

  • Default : None

cutoff

If :math:’k_F’ is smaller than the cutoff, treat it equal to the cutoff.

  • Options :

  • Default : 0.01

rho_cutoff

  • Options :

  • Default : 0.001

k

  • Options :

  • Default : 2

INVERSION

Control of the INVERSION.

rho_in

v_out

rho_in

Input file for the density.

  • Options :

  • Default : None

v_out

Output file for the potential.

  • Options :

  • Default : None