Version-6.py: Difference between revisions

From Wiki
Jump to navigation Jump to search
New page: ==CODE== #!/usr/bin/env python import operator import csv import subprocess dict_l = {'1312' : 'HOCH2', '1300' : 'CH3', '1212' : 'HOCH', '1211' : 'OCH2', '1200' : 'CH2', '1112...
 
QiangLi (talk | contribs)
No edit summary
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==CODE==
go back to [[Main Page]], [[Computational Resources]], [[Scripts]], [[Scripts for VASP]]
#!/usr/bin/env python
import operator
import csv
import subprocess


dict_l = {'1312' : 'HOCH2', '1300' : 'CH3', '1212' : 'HOCH', '1211' : 'OCH2',
[[Image:version-6.tgz]]
          '1200' : 'CH2', '1112' : 'HOC', '1111' : 'OCH', '1100' : 'CH',
          '1011' : 'OC', '1000' : 'C', '0000' : '0000'}
dict_r = {'1312' : 'CH2OH', '1300' : 'CH3', '1212' : 'CHOH', '1211' : 'CH2O',
          '1200' : 'CH2', '1112' : 'COH', '1111' : 'CHO', '1100' : 'CH',
          '1011' : 'CO', '1000' : 'C', '0000' : '0000'}


# Function :Get Formulas     
This Script Generates Glycerol Decomposition Network and Complete Intermediates


def Get_formula1(label): # get formula such as HOCH2-CHOH-CH2OH from 1312-1212-1312
    if ':' in label:
        return '%s-%s:%s' %(dict_l.get(label[0:4]), dict_r.get(label[5:9]),dict_r.get(label[10:])  )
    else:
        return '%s-%s-%s' %(dict_l.get(label[0:4]), dict_r.get(label[5:9]),dict_r.get(label[10:])  )


def Get_formula2(label):  # Get formula such as C3H8O3 from 1312-1212-1312
'''How to use it : python version-6.py'''
    if ':' not in label:  # ':' is used to define the broken C--C bonds, for example, 1312-1212:1312 means HOCH-CHOH------CH2OH bond breaks
        C_number = int(label[0]) + int(label[5]) + int(label[10])
        H_number = int(label[1]) + int(label[6]) + int(label[11])
        O_number = int(label[2]) + int(label[7]) + int(label[12])
        return  'C%sH%sO%s' %(C_number, H_number, O_number)
    else: 
        C_number = int(label[0]) + int(label[5])
        H_number = int(label[1]) + int(label[6])
        O_number = int(label[2]) + int(label[7])
        return  'C%sH%sO%s'  %(C_number, H_number, O_number)
#print Get_formula('1312-1212-1312') # test function


def Get_formula3(label): # this function is used to get smaller species (C1)  in C--C bond breaking products:
'''The 1st File Generated: species_list.txt :'''
    return '%s' %(dict_r.get(label[10:]))


# Keep label sequence unique for C3 Species
  ''Lables,            Structures,   Formula, Number_H, Number_O''
def label_reverse(molecular):
''1312-1212-1312,HOCH2-CHOH-CH2OH,  C3H8O3,    8,        3 ''
    if float(molecular[10:]) < float(molecular[0:4]):
        molecular = molecular[10:] + molecular[4:10] + molecular[0:4]
        return   molecular
    else:
        return molecular


# Keep label sequence unique for C2 Species       
'''Note:'''  1312 stands for HOCH2(on left) and CH2OH (on right) :  N_C(1), N_H(3), N_O(1),  O or OH terninated(2),
def label_reverse_C2(molecular):
    if float(molecular[5:]) < float(molecular[0:4]):
        molecular = molecular[5:] + '-' + molecular[0:4]
        return  molecular
    else:
        return molecular


# Defination of O--H bond breaking       
if the last number is 2, there must be one OH group. e.g. (1212: CHOH or HOCH)
def OH_breaking(Start_molecular):
    product_list = []
    if Start_molecular[3] == '2' :  # There is a OH here!
        product = label_reverse(str(int(Start_molecular[0:4]) - 101) + Start_molecular[4:])
        product_list.append(product)
    if  Start_molecular[8] == '2' :
        product = label_reverse(Start_molecular[0:5] + str(int(Start_molecular[5:9]) - 101) + Start_molecular[9:])
        product_list.append(product)
    if  Start_molecular[13] == '2' :
        product = label_reverse(Start_molecular[0:10] + str(int(Start_molecular[10:]) - 101) )
        if product not in product_list:
            product_list.append(product)
    return product_list
#print OH_breaking('1312-1212-1312')


# Defination of C--H bond breaking 
if the last number is 1, there must be one terminated O. e.g. (1211: CH2O or OCH2)
def CH_breaking(Start_molecular):
    product_list = []
    if float(Start_molecular[1])  > 1 :  # There is a H attaching to C
        product = label_reverse(str(int(Start_molecular[0:4]) - 100) + Start_molecular[4:])
        product_list.append(product)
    if float(Start_molecular[1]) == 1 :  #  To judge CH or OH
        if float(Start_molecular[3]) <= 1 : # If OH; Start_molecular[3] == 2
            product = label_reverse(str(int(Start_molecular[0:4]) - 100) + Start_molecular[4:])
            product_list.append(product)       
       
    if  float(Start_molecular[6])  > 1 :
        product = label_reverse(Start_molecular[0:5] + str(int(Start_molecular[5:9]) - 100) + Start_molecular[9:])
        product_list.append(product)
    if float(Start_molecular[6])  ==  1 :
        if float(Start_molecular[8]) <= 1 :
            product = label_reverse(Start_molecular[0:5] + str(int(Start_molecular[5:9]) - 100) + Start_molecular[9:])
            product_list.append(product)       
    if  float(Start_molecular[11])  > 1 :
        product = label_reverse(Start_molecular[0:10] + str(int(Start_molecular[10:]) - 100) )
        if product not in product_list:
            product_list.append(product)
    if float(Start_molecular[11])  == 1 :
        if float(Start_molecular[13]) <= 1 :
            product = label_reverse(Start_molecular[0:10] + str(int(Start_molecular[10:]) - 100) )
            if product not in product_list:
                product_list.append(product)
    return product_list
#print CH_breaking('1312-1212-1312')


# Defination of C--O bond breaking, C--OH is not included
if the last two numbers are 00, there is no O or OH. e.g. (1200, CH2)
def CO_breaking(Start_molecular):
    product_list = []
    if  Start_molecular[3] == '1' :  # Start_molecular[3] == 1 means only O terminal
        product = label_reverse(str(int(Start_molecular[0:4]) - 11) + Start_molecular[4:])
        product_list.append(product)
    if  Start_molecular[8] == '1' :
        product = label_reverse(Start_molecular[0:5] + str(int(Start_molecular[5:9]) - 11) + Start_molecular[9:])
        product_list.append(product)
    if  Start_molecular[13] == '1' :
        product = label_reverse(Start_molecular[0:10] + str(int(Start_molecular[10:]) - 11) )
        if product not in product_list:
            product_list.append(product)
    return product_list 
#print CO_breaking('1211-1211-1211')


# Defination of C--OH bond breaking
'''The 2nd File Generated: reaction_list.txt:'''  
def COH_breaking(Start_molecular):
    product_list = []
    if  Start_molecular[3] == '2' : # Start_molecular[3] == 2 means there exist one OH
        product = label_reverse(str(int(Start_molecular[0:4])-112) + Start_molecular[4:])
        product_list.append(product)
    if  Start_molecular[8] == '2' :
        product = label_reverse(Start_molecular[0:5] + str(int(Start_molecular[5:9]) - 112) + Start_molecular[9:])
        product_list.append(product)
    if  Start_molecular[13] == '2' :
        product = label_reverse(Start_molecular[0:10] + str(int(Start_molecular[10:]) - 112) )
        if product not in product_list: 
            product_list.append(product)
    return product_list
#print COH_breaking('1312-1212-1312')


# Defination of C--C bond breaking
''Lables(IS),     Structures(IS),  Lables(FS1),      Structures(FS1),  Lables(FS2), Structures(FS2), Bond_Type, Formula(IS), Formula(FS) ''
def CC_breaking(Start_molecular):
''1312-1212-1312, HOCH2-CHOH-CH2OH, 1212-1312:1312,  HOCH-CH2OH:CH2OH,      1312,        CH2OH,          C-C,      C3H8O3,    C2H5O2 ''
     product_list = []
    if  Start_molecular[10:] != '0000' :
        product1 = label_reverse_C2(Start_molecular[0:9]) + ':' + Start_molecular[10:]
        product2 = label_reverse_C2(Start_molecular[5:]) + ':' + Start_molecular[0:4]
        product_list.append(product1)
        if product2 != product1:
            product_list.append(product2)
    return product_list   
#print CC_breaking('1312-1212-1312')


Start_molecular = '1312-1212-1112'
'''Note:'''  ':' in 1212-1312:1312 means that C--C bond breaks
'''
The 3rd File Generated: label_dic.txt, c1c2c3.txt ''(By hand)'''''


def one_step(Start):
Each specie is given a name (Number label) for  calculation convenience purpose.  
    initial_species = []
    def append_species(products):
        for i in products:
            initial_species.append(i)
    append_species(OH_breaking(Start))
    append_species(CH_breaking(Start))
    append_species(COH_breaking(Start))
    append_species(CO_breaking(Start))
#    append_species(CC_breaking(Start))  # Be cautious!!!!!!!!!!!!!! 
    return initial_species
list_product = []
list_product.append('1312-1212-1312')


#print '1312-1212-1312', one_step('1312-1212-1312')
'''Example1:''' Glycerol (831) the first structure which has 8 H and 3 O atoms.  
for i in one_step('1312-1212-1312'):
    list_product.append(i)
#    print i , one_step(i)
    for j in one_step(i):
        if j not in list_product:
            list_product.append(j)
            for k in one_step(j):
                if k not in list_product:
                    list_product.append(k)
                    for g in one_step(k):
                        if g not in list_product:                           
                            list_product.append(g)
                            for x in one_step(g):
                                if x not in list_product:
                                    list_product.append(x)                               
                                    for y in one_step(x):
                                        if y not in list_product:
                                            list_product.append(y)                                          
                                            for z in one_step(y):
                                                if z not in list_product:
                                                    list_product.append(z)                                                   
                                                    for a in one_step(z):
                                                        if a not in list_product:
                                                            list_product.append(z)                                                           
                                                            for b in one_step(a):
                                                                if b not in list_product:
                                                                    list_product.append(b)
                                                                    for c in one_step(b):
                                                                        if c not in list_product:
                                                                            list_product.append(c)
# write  species' list
subprocess.call('rm reaction_list.txt  species_list.txt -fr', shell = True) # remove old files


final_list_product = sorted(set(list_product))
'''Example2:'''  If there are four isomers with formula of C3H7O3, then they are named as 731, 732, 733, and 734.


sl = open ('species_list.txt', 'wr')
After Finishing 269 structures' geometry calculation, add their energies to species_list.txt, and we get label_dic.txt
for i in final_list_product:
    sl.write('%s,%s,%s,%s,%s\n' %(i, Get_formula1(i), Get_formula2(i), Get_formula2(i)[3], Get_formula2(i)[5] ))
sl.close()


# write reaction list
  ''Lables,        Structures,       Formula, Number_H, Number_O, Number label, E_No_ZPVE,       E_ZPVE ''
rl = open('reaction_list.txt', 'wr')
  ''1312-1212-1312, HOCH2-CHOH-CH2OH, C3H8O3,    8,       3,       831,       -394.75896253,  -391.648156448''
# Print all reactions but C--C bond breakings
for i in final_list_product:
    for j in OH_breaking(i):
         rl.write( '%s,%s,%s,%s,%s,%s,%s,%s,%s\n'  %(i, Get_formula1(i), j , Get_formula1(j),'0101', 'H', 'O-H', Get_formula2(i), Get_formula2(j)))
    for k in CH_breaking(i):
        rl.write( '%s,%s,%s,%s,%s,%s,%s,%s,%s\n'  %(i, Get_formula1(i), k, Get_formula1(k), '0100','H', 'C-H', Get_formula2(i), Get_formula2(k)))
     for l in CO_breaking(i):
        rl.write( '%s,%s,%s,%s,%s,%s,%s,%s,%s\n'  %(i, Get_formula1(i), l, Get_formula1(l), '0011', 'O', 'C-O', Get_formula2(i), Get_formula2(l)))
    for m in COH_breaking(i):
        rl.write( '%s,%s,%s,%s,%s,%s,%s,%s,%s\n' %(i, Get_formula1(i), m, Get_formula1(m), '0112','OH', 'C-OH', Get_formula2(i), Get_formula2(m)))
    for x in CC_breaking(i):
        rl.write( '%s,%s,%s,%s,%s,%s,%s,%s,%s\n'  %(i, Get_formula1(i), x , Get_formula1(x), x[10:], Get_formula3(x), 'C-C', Get_formula2(i), Get_formula2(x) ))
 
rl.close()
# From results above, species_list.txt file can be generated, then the species are given the name such as 731, 732,..(in label_dic.txt)
# Performing DFT calculations about these structures and get their energies. Add energies to label_dic.txt and get c1c2c3.txt file,
# label_dic.txt are only used during Calculation.
# c1c2c3.txt contains C1, C2, C3 species' energies
   
   
####################################################
c1c2c3.txt contains C1, C2, and C3 species' energies.  
#Step2: Get reference energies  relative to Glycerol
####################################################
 
E_slab    = -317.09787996  # Ru(0001) slab
E_H_ads  = -320.9686537675 # H atom on Ru(0001) slab
E_OH_ads  = -327.92243824  # OH on Ru(0001) slab
E_G_gas  = -73.469085999  # Glycerol gas phase energy
 
def dicts_1():
    dict9 = {}
    with open ('c1c2c3.txt', mode = 'r')  as data1:
        reader = csv.reader(data1, delimiter = ',')
        for rows in reader:
            dict9.update({rows[0] : rows[2]})  #  E_DFT_ZPVE_corrected
    return dict9
 
dict9 = dicts_1()


def get_reference_energy(label):
  ''Lables,         E_No_ZPVE,    E_ZPVE''
# get absolute energies for Energy Profile Plotting   
  ''1312-1212-1312,-394.75896253,-391.648156448''
# E_OH, E_H, E_slab, and E_G_gas are used as reference energies for all the species.
'''
     if ':' not in label:
The 4th File Generated: reaction_energy.txt'''
        N_H = float(Get_formula2(label)[3])
        N_O = float(Get_formula2(label)[5])
        E_ref  = (3 - N_O ) * E_OH_ads + (5 + N_O - N_H) * E_H_ads  - (9 - N_H) * E_slab - E_G_gas
        E_label = float(dict9.get(label))  + E_ref
    else :
        N_H = float(Get_formula2(label.replace(':','-'))[3]) # Change Products to Reactants and use its energies 
        N_O = float(Get_formula2(label.replace(':','-'))[5])
        E_ref  = (3 - N_O ) * E_OH_ads + (5 + N_O - N_H) * E_H_ads  - (9 - N_H) * E_slab - E_G_gas
        E_label = float(dict9.get(label[0:9])) + float(dict9.get(label[10:])) - E_slab + E_ref
    return E_label


def reference_energies(IS, FS1, FS2):
  ''E_OH, E_H, E_slab, E_glycerol(gas) are used as reference energies.''
    N_H    =  float(Get_formula2(IS)[3])
    N_O    =  float(Get_formula2(IS)[5])
    E_ref  = (3 - N_O ) * E_OH_ads + (5 + N_O - N_H) * E_H_ads  - (9 - N_H) * E_slab - E_G_gas
    E_refered_IS  =  float(dict9.get(IS))  + E_ref
#Get E_dft_FS 
    if ':' in FS1:
        E_refered_FS  = float(dict9.get(FS1[0:9])) + float(dict9.get(FS1[10:])) - E_slab + E_ref
    else:
        E_refered_FS  = float(dict9.get(FS1)) + float(dict9.get(FS2)) - E_slab + E_ref
   
    Delta_E  = E_refered_FS - E_refered_IS


     return E_refered_IS, E_refered_FS, Delta_E
  '' Lable(IS),    Lable(FS1),      Label(FS2), Bond_Type,  E_IS,          E_FS,          E_TS,        Ea,          Delta_E,  E_IS(abs),    E_FS(abs)
  ''1312-1212-1312,1212-1312:1312,    1312,     C-C,      -1.081190489,-1.008524381,0.135859216145,1.21704970515,0.072666108,-1.081190489,-1.008524381


#1312-1212-1312,HOCH2-CHOH-CH2OH,1212-1312:1312,HOCH-CH2OH:CH2OH,CH2OH,C-C,C3H8O3,C2H5O2
'''Note1:'''  E_IS, E_FS, and E_TS are calculated with reference energies based on IS.


#Write referenced energies and transition states' energies with scaling equations from Ethylene glycol
'''Note2:'''  E_IS(abs), E_FS(abs) are calculated with reference energies based on IS and FS1, separately.


re = open('reaction_energy.txt', 'wr')
'''Diferences:''' The differences between these two energies mainly focus on some reactions correlated with C--OH bond breaking or C--O bond breaking.  
with open('reaction_list.txt', mode = 'r') as data2:
    reader = csv.reader(data2, delimiter = ',' )
    for rows in reader:   
        E1, E2, E3 = reference_energies(rows[0], rows[2], rows[4]) # E1, E2, E3: E_IS, E_FS, Delta_E
        g0 = get_reference_energy(rows[0])
        g2 = get_reference_energy(rows[2])
        r0 = rows[0]
        r2 = rows[2]
        r4 = rows[4] 
        r6 = rows[6]
        if 'O-H' in rows[6]:
            re.write('%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n'
                    %(r0, r2, r4, r6, E1, E2, 0.857*E1+0.251, 0.857*E1+0.251 - E1, E3, g0, g2))
        elif 'C-C' in rows[6]:
            re.write('%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n'
                    %(r0, r2, r4, r6, E1, E2, 0.955*E2+1.099, 0.955*E2+1.099 - E1, E3, g0, g2))
        elif 'C-OH' in rows[6]:
            re.write('%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n'
                    %(r0, r2, r4, r6, E1, E2, 1.062*E2+1.777, 1.062*E2+1.777 - E1, E3, g0, g2))
        elif 'C-H' in rows[6]:
            re.write('%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n'
                    %(r0, r2, r4, r6, E1, E2, 0.903*E2+0.592, 0.903*E2+0.592 - E1, E3, g0, g2))
        else: # C--O breaking, not C--OH !!!
            re.write('%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n'
                    %(r0, r2, r4, r6, E1, E2, 0.732*E2+1.227, 0.732*E2+1.227 - E1, E3, g0, g2)) 
re.close()


subprocess.call("""sed -i "s/\[//g; s/\]//g; s/\'//g; s/ //g" reaction_energy.txt""", shell = True)  # remove '[' and ']' in the output file  
  ''R-C-O-H -> RC-O + H -> R-C(1) + O + H -> R-C  + OH''  '''Vs'''  '' R-C-O-H -> R-C(2) + OH ''


## reaction_list.txt: this file  containes the reactions, barriers, and reaction energies
  ''R-C(1) and R-C(2) have different referenced energy. The difference is reaction energy of O + H -> OH on the surface.   ''
#
#
########################################################################################
## Step 3 Select and  filter  Reactions
########################################################################################
## Select Reactions
#####################################
#
def get_line_number(phrase): # Not used!
    numbers = []
    with open('reaction_energy.txt') as f:
        for i, line in enumerate(f, 0):
            if phrase in line:
                numbers.append(i)
    return numbers
#print get_line_number('1312-1212-1312')


def get_reactions(label):
'''
    lis = []
The 5th File Generated: selected_reactions.txt'''
    Ea  = []
    lis_s = []
    with open('reaction_energy.txt', mode = 'r') as vertical:
        reader = csv.reader(vertical, delimiter=',')
        for rows in reader:
            if label in rows[0]:
                lis.append(rows[:])
# Filter_Step1 : Remove reactions that can not proceed
    for i in lis:
        if i[0][5:9] == '1212' and i[1][5:9] == '1112' : # XXXX-CHOH-XXXX --> XXXX-COH-XXXX
            lis.pop(lis.index(i))  #remove these kinds of reactions 
        elif i[0][5:9] == '1111' and i[1][5:9] == '1011' : # XXXX-CHO-XXXX --> XXXX-CO-XXXX
            lis.pop(lis.index(i))
# Filter_Step2:  Remove reactions with high barriers
    for i in lis:
        Ea.append(float(i[7]))
 
    lowest  = min(i for i in Ea)


    for i in lis:
'''Choose Reactions:'''
        if float(i[7]) - lowest  < 0.300:
            lis_s.append(i)
    return lis_s


## rs: selected reactions
  '''Rule-1:'''  The C--H breaking from the second C (1212, 1111) is impossible as the H is in the gas phase.  
rs = open ('selected_reactions.txt', 'w')
f = open ('species_list.txt')
for line in f:
    for i in get_reactions(line.rstrip().split(',')[0]):
        rs.write('%s\n' %(i))
rs.close()
f.close()


subprocess.call("""sed -i "s/\[//g; s/\]//g; s/\'//g; s/ //g" selected_reactions.txt""", shell = True)  # remove  '[' and ']' in the output file  
  '''Rule-2'''   From one specie, select the reaction with lowest barrier. if the barrier from another reaction is 0.30 eV high than the lowest, delete the reaction


###################################################################################################
'''The 6th File Generated: filtered_reactions.txt'''
###Filter  Reactions
###################################################################################################


def get_reactions_2(label):
  '''Rule-3:''' Some reactions can not happen because it can not produced from previous reaction. Remove these reactions.
    lis = []
    with open('selected_reactions.txt', mode = 'r') as vertical:
        reader = csv.reader(vertical, delimiter=',')
        for rows in reader:
            if label in rows[0]:
                lis.append(rows[:])
    return lis


def cycle(IS):
    reactions = []
    FS = []
    for ele in get_reactions_2(IS):
        if ele[1] not in FS:
            FS.append(ele[1])
        if ele not in reactions:
            reactions.append(ele)
    return reactions, FS   


########Get all Intermediate Species involved in the reaction system ############
'''============================================================================================================================'''
f_list = []
f_list.append('1312-1212-1312')
def list_append(i):
    if i not in f_list:
        f_list.append(i)


for f1 in cycle('1312-1212-1312')[1]:
'''Plotting Energy Profile'''
    list_append(f1)
    for f2 in cycle(f1)[1]:
        list_append(f2)
        for f3 in cycle(f2)[1]:
            list_append(f3)
            for f4 in cycle(f3)[1]:
                list_append(f4)
                for f5 in cycle(f4)[1]:
                    list_append(f5)
                    for f6 in cycle(f5)[1]:
                        list_append(f6)
                        for f7 in cycle(f6)[1]:
                            list_append(f7)
                            for f8 in cycle(f7)[1]:
                                list_append(f8)
                                for f9 in cycle(f8)[1]:
                                    list_append(f9)
fs = open('FS_list.txt', 'w')
for i in f_list:
  fs.write(i + '\n')
fs.close()
#########################################################
### Filter Reactions based on previous FS
#########################################################
fr = open('filtered_reactions.txt', 'w')
fs = open('FS_list.txt')
for line in fs:
    IS = line.rstrip()
    if ':' not in IS:
        for i in get_reactions(IS):
            fr.write('%s\n' %(i)) 
fr.close()
subprocess.call("""sed -i "s/\[//g; s/\]//g; s/\'//g; s/ //g" filtered_reactions.txt""", shell = True)  # remove  '[' and ']' in the output file 
#############################################################

Latest revision as of 15:11, 10 February 2017

go back to Main Page, Computational Resources, Scripts, Scripts for VASP

File:Version-6.tgz

This Script Generates Glycerol Decomposition Network and Complete Intermediates


How to use it : python version-6.py

The 1st File Generated: species_list.txt :

Lables,            Structures,   Formula, Number_H, Number_O
1312-1212-1312,HOCH2-CHOH-CH2OH,  C3H8O3,    8,        3 

Note: 1312 stands for HOCH2(on left) and CH2OH (on right) : N_C(1), N_H(3), N_O(1), O or OH terninated(2),

if the last number is 2, there must be one OH group. e.g. (1212: CHOH or HOCH)

if the last number is 1, there must be one terminated O. e.g. (1211: CH2O or OCH2)

if the last two numbers are 00, there is no O or OH. e.g. (1200, CH2)

The 2nd File Generated: reaction_list.txt:

Lables(IS),     Structures(IS),   Lables(FS1),      Structures(FS1),   Lables(FS2), Structures(FS2), Bond_Type, Formula(IS), Formula(FS) 
1312-1212-1312, HOCH2-CHOH-CH2OH, 1212-1312:1312,  HOCH-CH2OH:CH2OH,       1312,         CH2OH,           C-C,      C3H8O3,     C2H5O2 

Note: ':' in 1212-1312:1312 means that C--C bond breaks The 3rd File Generated: label_dic.txt, c1c2c3.txt (By hand)

Each specie is given a name (Number label) for calculation convenience purpose.

Example1: Glycerol (831) the first structure which has 8 H and 3 O atoms.

Example2: If there are four isomers with formula of C3H7O3, then they are named as 731, 732, 733, and 734.

After Finishing 269 structures' geometry calculation, add their energies to species_list.txt, and we get label_dic.txt

 Lables,         Structures,       Formula, Number_H, Number_O, Number label, E_No_ZPVE,        E_ZPVE 
 1312-1212-1312, HOCH2-CHOH-CH2OH, C3H8O3,     8,        3,        831,       -394.75896253,  -391.648156448

c1c2c3.txt contains C1, C2, and C3 species' energies.

 Lables,          E_No_ZPVE,     E_ZPVE
 1312-1212-1312,-394.75896253,-391.648156448

The 4th File Generated: reaction_energy.txt

 E_OH, E_H, E_slab, E_glycerol(gas) are used as reference energies.
  Lable(IS),    Lable(FS1),      Label(FS2), Bond_Type,  E_IS,          E_FS,          E_TS,        Ea,           Delta_E,   E_IS(abs),    E_FS(abs)
 1312-1212-1312,1212-1312:1312,    1312,     C-C,       -1.081190489,-1.008524381,0.135859216145,1.21704970515,0.072666108,-1.081190489,-1.008524381

Note1: E_IS, E_FS, and E_TS are calculated with reference energies based on IS.

Note2: E_IS(abs), E_FS(abs) are calculated with reference energies based on IS and FS1, separately.

Diferences: The differences between these two energies mainly focus on some reactions correlated with C--OH bond breaking or C--O bond breaking.

 R-C-O-H -> RC-O + H -> R-C(1) + O + H -> R-C  + OH  Vs    R-C-O-H ->  R-C(2) + OH 
 R-C(1) and R-C(2) have different referenced energy. The difference is reaction energy of O + H -> OH on the surface.   

The 5th File Generated: selected_reactions.txt

Choose Reactions:

  Rule-1:  The C--H breaking from the second C (1212, 1111) is impossible as the H is in the gas phase. 
  Rule-2   From one specie, select the reaction with lowest barrier.  if the barrier from another reaction is 0.30 eV high than the lowest, delete the reaction 

The 6th File Generated: filtered_reactions.txt

 Rule-3:  Some reactions can not happen because it can not produced from previous reaction. Remove these reactions.


============================================================================================================================

Plotting Energy Profile