https://github.com/mineralscloud/epaw
A code for evolutionary optimization of PAW datasets especially for high-pressure applications
https://github.com/mineralscloud/epaw
density-functional-theory fortran materials-science paw-datasets python quantum-espresso scientific-computing
Last synced: about 2 months ago
JSON representation
A code for evolutionary optimization of PAW datasets especially for high-pressure applications
- Host: GitHub
- URL: https://github.com/mineralscloud/epaw
- Owner: MineralsCloud
- License: gpl-3.0
- Created: 2018-07-06T17:32:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-15T20:12:04.000Z (almost 2 years ago)
- Last Synced: 2025-03-30T10:11:15.536Z (3 months ago)
- Topics: density-functional-theory, fortran, materials-science, paw-datasets, python, quantum-espresso, scientific-computing
- Language: Fortran
- Homepage: https://www.sciencedirect.com/science/article/pii/S0010465518301826
- Size: 76.2 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
#The prerequisites to run the EPAW codes:
a) ATOMPAW
b) Quantum ESPRESSO
c) python
d) Gnuplot
e) at least 10*neos processors/cores, where neos is the number of volume points at which SCF calculations will be performed at each generation/iteration step using Quantum ESPRESSO.#There are two parent directories:
a) 'SOURCE': having three subdirectories containing the source files and one script file 'compile' to compile the source files.
b) 'EXAMPLE': contains the necessary files to run the executables.#################################
#STEPS FOR PREPARING INPUT FILES:
#################################
1) i) Go to directory 'SOURCE'.
ii) Change the compiler (ifort or gfortran) according to preference in the file 'compile'.
iii) Make the file 'compile' readable, writable and executable with the following command:
chmod 777 compile
iv) Run the file 'compile' with the following command:
./compile
# It will compile the fortran codes located in the subdirectories using gfortran/ifort compiler and create three executables: EPAWsetup.exe; EPAWmparent.exe; EPAWopt.exe and move them to the parent directory 'SOURCE'.
v) Create a working folder/directory in which optimizations will be performed.
vi) Set Your $PATH variables permanently using .bashrc 'or' place the executables to the 'EXAMPLE' directory.
vii) Copy all the contents of the 'EXAMPLE' directory to your working directory.
2) Go to the working directory to execute following steps:
i) open the file named as 'APAW.sh', replace the 'atompaw' command (command to RUN ATOMPAW program), if required, according to your settings.ii) edit the contents of the following files based on the system under consideration: INPUT_FILES, IN_TARGET, INITIAL_ATOMPAW, IN_DUMMY, script.py, USER_INPUTS as follows:
A) INPUT_FILES # Contains names for the required/optional input files (We recommend not to change the names to avoid unnecessary complicacies.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INITIAL_ATOMPAW -MUST #|File name for Initial standard PAW dataset generator
IN_DUMMY -MUST #|File name for dummy indexes of standard PAW dataset generator
IN_PARENT -OPTIONAL #|File name for Initial parent population
IN_GAPRMTR -OPTIONAL #|File name for GAs parameters to start with
IN_TARGET -MUST/OPTIONAL #|File name for TARGET EoS
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
B) INITIAL_ATOMPAW # The initial guess of ATOMPAW input file, we recommend use a standard library file (e.g., JTH data-set library) to start with. Here an example file for the atom Calcium is included.
C) IN_DUMMY # Contains dummy indexes to recognize variables, parameters and keywords in the INITIAL_ATOMPAW file. This data needs careful preparation as follows. Here an example file for the atom Calcium is included.
a) copy the INITIAL_ATOMPAW file to IN_DUMMY.
b) put 0 for the keywords or for the entries in the INPUT_DATASET data that will not change in the course of optimization.
c) put 7 for redundant lines in the INPUT_DATASET file.
d) set 1,2,3,4 depending upon the number of iradial value entries in the INPUT_DATASET file (e.g., rc, rshape, rvloc, rcore)
1 if rc
2 if rc, rshape
3 if rc, rshape, rvloc
4 if rc, rshape, rvloc, rcore
e) put 5 for energies for additional basis function.
f) Put 6 for matching radius for partial waves.
D) IN_PARENT # Contains initial population of trial solution vector comprising of rc, rshape, rvloc, rcore, matching radii for pseudo and projector functions, reference energies for additional wave functions. i.e., a population of npop (10, for this version of the code) numbers different dataset. One with proficient expertise in ATOMPAW code should prepare this file otherwise choose not to provide any data and there should not be any IN_PARENT file. The code will extract the solution vector from the INITIAL_ATOMPAW file and replicate that npop times to start with.
E) IN_GAPRMTR # Contains essential parameters to run genetic algorithms. Again to play with these settings one need some expertise in global optimization algorithms.
F) USER_INPUTS: # One can run the codes interactively, but we recommend to use this fil to avoid unnecessary complicacies.
Put 0 for EoS; 1 for Delta optimization # This version of code supports only 0
Put 0 for scratch; 1 for predefined parent population
Put Cardinality of parent population (e.g. 10) # This version of code supports 10
Put Maximum allowed value for r_c >= r_{MT} (INPUT_DATASET) MT= muffin-tin
Put Minimum allowed value for r_c_ must be >=r_{MT}/2
Put Minimum allowed value (other distance parameters)
Put 1.00 for all of these if no preferenece for any pressure region. or e.g. P_ext=1.00d0,P_h=1.00d0,P_m=1.00d0,P_l=0.95
Put tolerance limit for wf and PSwf < 10
Put Number of volume points at which electronic structure calculations will be performed
Put No. of PV data in < IN_TARGET > file = 400
Put E0, V0, B0, B0p guess for WIEN2k # although never used;
Put Vmin, Vmax for WIEN2k # required only if IN_ELAST file is used
Put 0 for default; 1 for manual entry for rc constraints of each member of parent population # 0 is recommended; if 1 then put Rc max; Rc min; Rci min for each solution in the populationG) IN_TARGET: # contains 400 (should be same as mentioned in the above USER_INPUTS file: line number 10) equally spaced EoS data (volume and pressure) of the reference that the optimization attempts to achieve. In this work, we take the WIEN2k results as our target reference. There are other two alternative file options: EvsVRyBohr.dat file containing volume and energy data obtained from all-electron calculations or IN_ELAST file containing equilibrium volume (V_O), Bulk modulus (B_0) and its derivative (B\prime) from the reference all electron calculation.
iii) Edit the file 'makeEoSinputs.py' (with descriptive commentary) according to the system under consideration.
specially the following line numbers: line number 12, 17, 19, 20, (23-31, if ibrav=0), 35-38, 45 (adding more lines here will change the following line numbers. so we recommend to change it at the end), 68-69 (according to the available system settings), 72-73, 78 (uncomment when ibrav=0), 79 (comment when ibrav=0), 80 (check ntyp, nspin), 81 (ecutwfc= kinetic energy cutoff (Ry) for wavefunctions, ecutrho= Kinetic energy cutoff (Ry) for charge density and potential), 82 (smearing), 87 (mixing_beta), 90 (Convergence threshold for selfconsistency), 91, 101 (atomic Symbol), 106-110 (uncomment when ibrav=0), 113 (atomic Symbol), 132 (0.78-1.06, scale of contraction to expansion of equilibrium lattice constant according to the target all-electron reference calculation)
#################################
# RUN THE FORTRAN EXECUTABLES:
#################################
1) Change the shell script 'SETUP_FILES' as executable with "chmod 777 SETUP_FILES" and run the shell script. It will create necessary folders, run the first fortran executable 'EPAWsetup.exe' in the folder '1_FORMAT_FILES' to format necessary files for the next stepsi and finally copy required files to the necessary folders.
It will create the files: 'PARAMETERS', 'CONSTRAINTS', and if not present: 'IN_GAPRMTR', 'IN_PARENT', 'IN_TARGET'.2) The next step is to make diverse parents. In that case, this step will help to create a good initial populationi using the single string based code 'CARMHC'.
# This step is necessary if one find difficulties in optimizing data-sets in the final step.
Go to the directory '2_MAKE_PARENT/' and run the following command:
./EPAWmparent.exescf.out & # here and beneath 4 is the number of cores per SCF calculations.
orig=`echo "$orig + 4" | bc`
sleep 1
cd ../../
done
done
wait
# For the above setting we need at least 10*15*4=600 cores/processors in each iteration steps.
# We recommend not to change the cardinality of the GA population, i.e., npop=10.
# Now if one reduce the number of volume points at which electronic structure calculations will be performed to 7, and assign one core per job then the total number of required processors will be
# 10*7*1=70
# Therefore, according to the available system adjust the numbers.
#
The rest of the part should be unaltered.
#
iii) change the number of nodes and tasks-per-node in the 'jobscript' file.
This is the final step: submission of the 'jobscript'.
It will create a 'SUPERINDIVIDUAL' folder that will store the best data-set in each generation alongwith 'O_ARCHV', 'O_EVOLFITNESS', 'O_SUPERINDV'. 'O_ARCHV' stores best npop number of solutions in terms of minimum area under the EoS curves generated by refernce all electron approach and PAW calculations whereas 'O_SUPERINDV' stores the best solution vector alongwith its objective value, 'O_EVOLFITNESS' stores the objetive values of the npop best string in each generation/iteration step.
###############################################
# Check the goodness of the generated data-set
###############################################
chmod 777 Goodness.py
./Goodness.py