Skip to content
Snippets Groups Projects
Commit ab7f8fb7 authored by nny50's avatar nny50
Browse files

update

parent 924ce717
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ plt.rcParams['axes.linewidth'] = 1.5 ...@@ -10,7 +10,7 @@ plt.rcParams['axes.linewidth'] = 1.5
def read_regu_all(result_path): def read_regu_all(result_path):
#Eslab and mu are the energies in eV of the slab and the adsorbate alone. #Eslab and mu are the energies (in eV) of the slab and the adsorbate alone.
#It needs to be manually changed to get the adsorption energy Eads=Etot-Eslab-mu #It needs to be manually changed to get the adsorption energy Eads=Etot-Eslab-mu
Eslab=-33.14301679*4 Eslab=-33.14301679*4
mu = -6.762788/2 mu = -6.762788/2
......
### Prerequisites ### Prerequisites
The codes uses SOAP descriptors through the Dscribe Library, Machine Learning tools with scikit-learn library and the Atomic Simulation Environment (ASE) Library. Three main libraries are required to run the code : Dscribe (SOAP descriptors), Scikit-learn (Machine Learning tools) and ASE (Atomic Simulation Environment).
Here is the list of libraries you need to install to execute the code: More precisely :
- python==3.10 - python==3.10
- ase==3.22.1 - ase==3.22.1
- scikit-learn==1.4.1 - scikit-learn==1.4.1
- dscribe==2.1.0 - dscribe==2.1.0
- numpy==1.26.4 - numpy==1.26.4
- scipy==1.12.0 - scipy==1.12.0
- matplotlib==3.8.3 - matplotlib==3.8.3
All of them can be installed via `pip` , e.g. All libraries can be installed via `pip` , e.g.
``` ```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
...@@ -20,26 +20,28 @@ pip install -r requirements.txt ...@@ -20,26 +20,28 @@ pip install -r requirements.txt
## Usage ## Usage
This code purpose is to recreate Energy Adsorption Map (EAM) using machine learning. The code builts Energy Adsorption Maps (EAMs) using machine learning.
running file "run.py" will train a model using an ase "train.traj" object as a training set. It then predicts on a n $\times$ n regular grid above the POSCAR file the adsorption energy. Results are written on "resultat.txt". The file "run.py" (i) trains a model from a training set containing adsorption energies calculated on selected sites (".traj" file), and (ii) predicts adsorption energies of new sites located on a $n$ $\times$ $n$ regular grid. Results are written in the file "result.txt".
train set file, POSCAR file, n value as well as parameters for the SOAP and Gaussian Process Regression can be modify in the "run.py" file. The ".traj" file contains data useful to describe the simulation box, the atomic positions, the grid ($n$) as well as parameters for the SOAP descriptors and the Gaussian Process Regression.
The code to create AEM image like "Ag111_AEM.pdf" is also given and uses matplotlib package. Run in same repository as "results.txt" obtained previously to create AEM pdf map. The code to create the Adsorption Enery Map ("Ag111_AEM.pdf", Working Example) is also given and uses the matplotlib package. Code execution must take place in the same directory as the file "result.txt" previously obtained.
## Data sets ## Data sets
Two data bases are given in this git. The minimum working exemple is focused on the adsorption of Hydrogen on Ag(111), its corresponding train set (3 Hydrogen positions relaxed by DFT) is used by default when running "run.py". We also give the data for Hydrogen adsorption on Al<sub>13</sub>Co<sub>4</sub>(100) on wich the related [paper](https://doi.org/10.1021/acs.jctc.4c00367) focuses. Two data bases are provided.
The data "final.traj" located in the folder "data_Al13Co4" consist of the 20 $\times$ 20 positions above the surface where DFT relaxation is done. In order to recreate results obtained in the [paper](https://doi.org/10.1021/acs.jctc.4c00367), one may create a "train.traj" from a fraction of the "final.traj". In order to select the positions run the code "position_selection.py" which uses the Farthest Point Sampling method ; you can change the value "ncomp" in the first line of this code to choose the number of position selected. Once the "train.traj" is create, you can run code for Al<sub>13</sub>Co<sub>4</sub>(100) after changing the directory in "run.py". The minimum working exemple deals with atomic Hydrogen adsorption on Ag(111), and the training set contains DFT data calculated on 3 distinct surface sites.
The data set corresponding to atomic Hydrogen adsorption on Al<sub>13</sub>Co<sub>4</sub>(100) is the one used in the [paper](https://doi.org/10.1021/acs.jctc.4c00367). The file "final.traj" located in the folder "data_Al13Co4" contains DFT relaxations calculated in 20 $\times$ 20 surface sites. To obtain the results published in the [paper](https://doi.org/10.1021/acs.jctc.4c00367), a "train.traj" file has to be generated from a fraction of the "final.traj" file. The choice of relevant sites can be achieved with the code "position_selection.py" which uses the Farthest Point Sampling method ; The number of selected positions is given by the integer "ncomp" (first line of the code). The training can be performed with the "run.py" code. Both files ("train.traj" and "run.py") have to be located in the same directory.
## Citation ## Citation
``` ```
@inproceedings{Boulangeot24hyd, @article{Boulangeot24hyd,
author = {Boulangeot, Nathan, Brix, Florian, Sur, Frédéric, Gaudry, Émilie}, author = {Nathan Boulangeot and Florian Brix and Frédéric Sur and Emilie Gaudry},
title = {Hydrogen, oxygen and lead adsorbates onAl13Co4(100) : accurate potential energysurfaces at low computational cost bymachine learning and DFT-based data}, title = {Hydrogen, oxygen and lead adsorbates on Al$_{13}$Co$_4$(100) : accurate potential energy surfaces at low computational cost by machine learning and DFT-based data},
journal = {Journal of Chemical Theory and Computation}, journal = {Journal of Chemical Theory and Computation},
year = {2024}, year = {2024},
doi = {10.1021/acs.jctc.4c00367} doi = {10.1021/acs.jctc.4c00367}
...@@ -49,3 +51,4 @@ doi = {10.1021/acs.jctc.4c00367} ...@@ -49,3 +51,4 @@ doi = {10.1021/acs.jctc.4c00367}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment