kaist-amsg / JPtNW_Manuscript2021

2 stars 0 forks source link

How to generate ACSF? #1

Open Niuxf16 opened 2 years ago

Niuxf16 commented 2 years ago

Hi,

I recently doing a research using several descriptors such as ACSF and SOAP to predict H adsorption energy on Pt clusters. Your work are impressive and excellent and I've been inspired by your work. I have noticed that your code listed in GitHub used Atomic Energy Network (ænet) to train ANN model. I was confused at what the input and output of the machine learning model? Since I found that in Atomic Energy Network (ænet) we need to provide the calculated structures and it's total energies as the input.

Actually what confuse me is how to build the relationship between Pt adsorption sites with H adsorption energy. When build ACSF or SOAP as descriptor, we need to define the position of the H atom, however define the H atom's position need DFT calculation. I think your work successfully circumvent this problem, I am looking forward to your replay!

Xiangfu

googhgoo commented 2 years ago

Thank you very much for your interest.

The input structure problem is a serious issue in predicting binding energy, and several groups are working on this. We by pass this by using the "labeled site" approach which we developed previously: https://doi.org/10.1021/acs.jpclett.0c00634. For training we remove the adsorbate, but instead we label the binding site atom. For ACSF, you simply change the element of the binding site atom to some random element (e.g., He) to indicate it's a binding site atom. I think giving the manuscript a read will clarify this for you.

Gu

Niuxf16 commented 2 years ago

Thanks for your replay!I am confused at the dimension of the ACSF descriptor, you know for top site, bridge site and hollow site, there are 1,2,3 atoms need to be replaced, for this three situations did the ACSF descriptor have same dimension?

Following is my code used to extract ACSF based on a central H atom, but in this way for 2 or 3 H atoms the dimension of ACSF will increased by 2 or 3 times. Could you see the code, or provide your method to extract ACSF? Thanks a lot

from ase.io import read,write
from ase import Atoms
import numpy as np
import json
from dscribe.descriptors import ACSF
from dscribe.descriptors import SOAP

with open('Data.json','r',encoding='utf8')as fp:
    json_data = json.load(fp)

Energy = []
Feature_ACSF = []

acsf = ACSF(
    species=['H','Pt'],
    rcut=7.11,
    g2_params=[[0.003214,0],[0.035711,0],[0.071421,0],
               [0.124987,0],[0.214264,0],[0.357106,0],
               [0.714213,0],[1.428426,0]
               ],
    g4_params=[[0.000357,1,-1],[0.028569,1,-1],[0.089277,1,-1],
               [0.000357,1,1],[0.028569,1,1],[0.089277,1,1],
               [0.000357,2,-1],[0.028569,2,-1],[0.089277,2,-1],
               [0.000357,2,1],[0.028569,2,1],[0.089277,2,1],
               [0.000357,4,-1],[0.028569,4,-1],[0.089277,4,-1],
               [0.000357,4,1],[0.028569,4,1],[0.089277,4,1]
               ],
    periodic=True,
)

for i in range(len(json_data)):
    Energy.append(json_data[i]['H_adsorption_energy'])
    num_Pt = len(json_data[i]['positions'])-1
    atoms = Atoms('HPt'+str(num_Pt),positions=json_data[i]['positions'],cell=json_data[i]['cell'])
    H_index = atoms.get_chemical_symbols().index('H')
    acsf_h = acsf.create(atoms, positions=[H_index])
    Feature_ACSF.append(acsf_h[0])

np.savetxt('energy.csv',Energy, delimiter=',')
np.savetxt('acsf.csv',Feature_ACSF, delimiter=',')
googhgoo commented 2 years ago

I did not implement the ACSF code. I will refer to the guy who did.

Niuxf16 commented 2 years ago

Excuse me for giving you so much trouble, thanks!