Optimization of Density with Heterogeneous susbsystems¶
This tutorial assumes the user has already finished the Optimization of Density tutorial, using the automatic definition of subsystems when you have the same chemical nature for each subsystem or have previous experience setting up QE calculations. This tutorial will focus on the details, to run a calculation that requires including a manual definition of subsystems combined with the adaptive definition of subsystems to run an SCF calculation of a global system composed of a binary salt (NaCl) molecule surrounded by a water dimer.
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.
Input Files¶
Following the input description provided in the previous SCF Calculation for a water dimer, you also requiere the global system coordinates and the eDFTpy input file.
salt_h2o_2.xyz
8
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"
Na 2.000000000000000 2.500000000000000 4.200000000000000
Cl 6.000000000000000 7.500000000000000 9.199999999999999
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
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
Na = na_pbe_v1.5.uspp.F.UPF
Cl = cl_pbe_v1.4.uspp.F.UPF
[OPT]
maxiter = 200
econv = 1e-6
[MOL]
charge-Na = 1
charge-H2O = 0
charge-Cl = -1
[GSYSTEM]
cell-file = salt_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
mix-coef = 0.2
[SUB_NA]
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 0:1
grid-ecut = 2400
mix-coef = 0.7
density-output = .xsf
[SUB_CL]
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 1:2
grid-ecut = 2400
mix-coef = 0.7
density-output = .xsf
[SUB_H2O]
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 2:
decompose-method = distance
decompose-radius-O = 0.90
decompose-radius-H = 0.60
grid-ecut = 2400
mix-coef = 0.7
density-output = .xsf
This eDFTpy input file includes the same section’s flags with the addition of some keywords and sections, as described below:
Addition of Sodium(I) and Chloride pseudopotentials
O = O_ONCV_PBE-1.2.upf
H = H_ONCV_PBE-1.2.upf
Na = Na_pbe_v1.5.uspp.F.UPF
Cl = Cl_pbe_v1.4.uspp.F.UPF
This new section includes the charge of the molecules and atoms, note that in this tutorial this section is mandatory due to the presence of charge subsystems, this section should describe the total type of molecules listed in the subsystems section.
charge-Na = 1
charge-H2O = 0
charge-Cl = -1
Note
eDFTpy only can simulate neutral globral systems.
Input definition of the Sodium (I) subsystem
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 0:1
grid-ecut = 2400
mix-coef = 0.7
density-output = .xsf
Input definition of the Chloride subsystem
calculator = qe
embed = KE XC
cell-split = 0.5 0.5 0.5
cell-index = 1:2 # Correspond to the index of the second atom at the coordinates file
grid-ecut = 2400
mix-coef = 0.7 # Mixing parameter
density-output = .xsf
Water subsystems will be defined using the same automatic definition based on the average radii starting at the third atom position of the cell_file
cell-index = 2:
decompose-method = distance
decompose-radius-O = 0.90
decompose-radius-H = 0.60
grid-ecut = 2400
mix-coef = 0.7
Note
Unlike the basic SCF tutorial in this input parameter, we also include a mixing parameter for the water subsystem to keep consistency with the other subsystems, you can use different mixing parameter values for each subsystem if you require it.
Running eDFTpy¶
Type the command below to run the calculation set up before:
$ mpirun -n 4 python -m edftpy input.ini
Warning
To carry out this tutorial you are required to have a computer with at least four (4) available cores of processing, if you would prefer you can use a bigger number of cores if they are available in your computer unit.
Output Files¶
This calculation will generate the same categories of outputs discussed in the SCF base tutorial with additional files for the ions subsystems following:
Outputs to 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_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