Optimization of Density¶
Input Files¶
Note
To avoid mixing some files, we strongly recommend setup each calculation (e.g. Optimization of density, relaxation of a structure of an MD simulation) in separate folders.
System Coordinates¶
To carry out any calculation in the eDFTpy package you required a file with the .xyz coordinates, which includes the cell dimension of the system, the form of this file is a typical coordinate file text with an additional line placed before the first atom coordinate which includes the a,b,c lattice cell vectors. For this tutorial, we will use a water dimer coordinates with a vector cell lattice, a = b = c = 12.0 Å.
h2o_2.xyz
6
Lattice="12.0 0.0 0.0 0.0 12.0 0.0 0.0 0.0 12.0" Properties=species:S:1:pos:R:3 pbc="T T T"
O 2.000000000000000 2.000000000000000 2.119262000000000
H 2.000000000000000 2.763239000000000 1.522953000000000
H 2.000000000000000 1.236761000000000 1.522953000000000
O 6.000000000000000 6.000000000000000 6.119262000000000
H 6.000000000000000 6.763239000000000 5.522953000000000
H 6.000000000000000 5.236761000000000 5.522953000000000
Pseudopotential files¶
Before carrying out any calculation on eDFTpy you should provide the pseudopotential files for all the chemical species in your system, Look for them in the GBRV pseudopotential site “QE” version, in this tutorial, user should provide the pseudopotentials for Oxigen: o_pbe_v1.2.uspp.F.UPF and Hydrogen: h_pbe_v1.4.uspp.F.UPF atomic species.
eDFTpy Input File¶
Taking into account that in this tutorial we are dealing with a global system in which subsystems havethe same chemical composition, we will use the automatic definition of subsystems implemented in eDFTpy which we discuss later in this tutorial.
input.ini
[JOB]
task = Optdensity
[PATH]
pp = ./
cell = ./
[PP]
O = o_pbe_v1.2.uspp.F.UPF
H = h_pbe_v1.4.uspp.F.UPF
[OPT]
maxiter = 200
econv = 1e-6
[GSYSTEM]
cell-file = h2o_2.xyz
grid-ecut = 1200
exc-x_str = gga_x_pbe
exc-c_str = gga_c_pbe
kedf-kedf = GGA
kedf-k_str = revAPBEK
density-output = total.xsf
[SUB_KS]
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 0:6
decompose-method = distance
decompose-radius-O = 0.90
decompose-radius-H = 0.60
density-output = .xsf
grid-ecut = 2400
You can use this input.ini file to configure your SCF calculation. In general, this file is divided into six different sections describe below
This flag describes the type of calculation you are going to carry out. Most of the time:
task = Optdensity
Here you should write the location of your pseudopotential files (pp) and your input structure (cell). User can use the abbreviate notation for the location, we assume these files will be locating in the same folder that the input.ini
pp = ./
cell = ./
This section list the chemical species involve in the coordinate file and the name of speudopotential file that you will use for each atom. In the case of water dimer:
O = o_pbe_v1.2.uspp.F.UPF
H = h_pbe_v1.4.uspp.F.UPF
This flag defines the charge density optimization of global system, in this tutorial we are going to use a maximun number of steps for optimization of 200 and the global system converged once the energy difference for the last 2 steps < 1e-6 a.u/atom, using:
maxiter = 200
econv = 1e-6
Structure parameters for the global system:
cell-file = h2o_2.xyz # Global system coordinates file name.
grid-ecut = 1200 # Kinetic energy cutoff (eV)
exc-x_str = gga_x_pbe # Control of the exchange funtional
exc-c_str = gga_c_pbe # Control of the correlation functional
kedf-kedf = GGA # Type of Kinetic Energy Density Functional (KEDF)
kedf-k_str = revAPBEK # Functional type for GGA/LIBXC_KEDF
density-output = total.xsf # Output file name and format of density
Subsystem configuration for the density optimization
calculator = qe # SCF driver for subsystem
embed = KE XC # The embedding potential
cell-split = 0.5 0.5 0.5 # Fraction of the small cell for each direction (scaled)
cell-index = 0:6 # Indices of the atoms for this type of subsytem
Taking into account that we are going to use the automatic method to define the number of subsystems in the global system, we should include the method that we will use to determine each subsystem, in this case, we use the distance means the program will base on the distance of atoms to decompose the subsystem when we used this method we should also include the radius of each element.
decompose-method = distance # Automatic definition of subsystems
decompose-radius-O = 0.90 # Oxigen radius
decompose-radius-H = 0.60 # Hydrogen radius
density-output = .xsf # Output file name and format of density
grid-ecut = 2400 # Kinetic energy cutoff (eV)
Note
Atomic radius value should be determine by the user.
Running eDFTpy¶
Once you setup your input file properly, you can run your claculation typing:
$ mpirun -n 2 python -m edftpy input.ini
Warning
If you are using python3 version you should change all the python command lines wrote here from python to python3.
eDFTpy input file provided in this tutorial assumes that all your files including pseudopotentials are stored in the same working directory.
Note
The number after n defines the number of cores you will use to perform your calculation.
Output Files¶
Once you run your calculation on eDFTpy the program will generates a series of output files clasify between four different categories:
Outputs for Check¶
edftpy_running.json Extended input file which contains all the calculation setup
edftpy_gsystem.xyz Coordinates file for the output strcuture
Outputs of subsytem driver¶
sub_prefix.xyz Output coordinates for each subsystem driver
sub_prefix.out Output file of each susbsytem driver
Temporary files of Subsystem driver¶
sub_ks_prefix.tmp Temporary folder of each subsystem driver
Other properties files defined in input file¶
Density of global system Saved in the total.xsf
Density of each subsystem(s) Saved in sub_prefix.xsf