Thanks a lot for the tutorial! It’s super easy to follow and covers a lot of info that’s not on the papers. But I still have a few questions.
First, I’m not sure about the calculations of the ase database and the mixing energy value. For example, another example on the ICET page treats the AgPd system. I tried to recreate the database, but I’m not sure about the calculations of the mixed energy I saw it in this forum . It says E_mix = (E_AgPd - N_Pd * E_Pd - N_Ag * E_Ag) / (N_Pd + N_Ag). Is that correct?
To generate the structures, I’m doing this:
from ase import Atom
from ase.build import bulk, fcc111, add_adsorbate
from ase.db import connect
from icet.tools import enumerate_structures
primitive_structure = bulk(‘Ag’)
db = connect(‘AuPd-fcc.db’)
for structure in enumerate_structures(primitive_structure,
range(1, 9),
[‘Pd’, ‘Ag’]):
db.write(structure)
After that, I relax the cell, but my energy isn’t quite matching the ones in the reference database. Could you give me some pointers on that?
Oh, and I’m also trying to perform a convex hull for the delithiation of LixCoO2 where x is less than 1. In that case, could you comment on the correct way to calculate the formation energy?
Thanks in advance,
Usually peoeple will define mixing energies for a binary of atom type A and B as
e_{mix} = \frac{E_{total} - N_Ae_a - N_B e_b}{N_A+N_B}
where
- e_{mix} is the mixing energy for your structure per atom
- E_{total} is the total energy of the structure of interest
- N_A, N_B is number of atoms of each species in your structure
- e_A is the reference energy for species A per atom
I would think small things like version of DFT code, DFT settings all can lead to small differences, so I dont think this is necessarily a problem.
If you get very different qualitative behaviour, then maybe something is wrong?
Formation energies can be defined in different ways, do you mean vacancy formation energy or formation energy of the LixCoO2 phase etc?
But in principle these formation energies will look very similar to the mixing energy equation above, you have a structure and subtract from its total energy some reference energy for each atom in the structure.
Note with vacancies for cluster expansion with icet you need to provide an energy per lattice site (and not per number of atoms in the structure, and they will differ due to vacanies)
hanks for your reply, Erik! I think my problem with mixing energy was that I was using the full energy for the terms e_a and e_b. For LixCoO2 I mean something like https://pubs.acs.org/doi/10.1021/acsaem.4c01113 figure 2 in this paper. I believe I can generate Vacancy configurations like the MoVC example; however, I am not quite sure how to calculate the correct energy. I assume the normalization is done by formula unit, but I am also not sure how to find the number of formula units in a cell. It would be nice, if not too much to ask, to have an example like this in the future! If I manage to do it, I will for sure share it with you so that you can add it, on top of that I am trying to relax cells with MLIPs so any user can also reproduce the database construction.
however, I am not quite sure how to calculate the correct energy.
Hopefully they spell out how they compute it in the paper so maybe look through it carefully.
My guess based on what they write is that they do
e_{formation} = \frac{E_{total} - \sum_i N_ie_i}{N_{f.u}}
where N_{f.u} is the number of formula unit and \sum_i goes over all atom types in the system. I hope you see how closely this resembles the mixing energy equation above (its pretty much exactly the same).
Now you dont have values for e_i in the Li_xCoO2 system, but since all the structure contains the same amount of Co and O, the values for e_{Co} and e_O doesn’t really matter. But it seems they chose them, including e_{Li}, such that x=0 and x=1 gives e_{formation}=0, which is equivalent to subtracting out the slope in the energy plots between the end points e_{formation}(x=0) and e_{formation}(x=1).
I am also not sure how to find the number of formula units in a cell.
In general this would just be counting number of formula units in your structure/supercell. I dont know if there is some specific convention in the Li_xCoO2 the system, but Id guess if you have a structure with e.g. 8 Co and 16 O atoms that it means 8 formula units (regardless of how many Li atoms).
I will for sure share it with you
Great, feel free to make a merge request to the icet gitlab project if you make such tutorial and think it would be valuable to users.
There is another paper where they state:
“We define the formation energy for a given Li-vacancy arrangement with composition x in LixCoO2 as \Delta E_f = E - x \times E_{LiCoO_2} - (1-x) \times E_{CoO_2}, where E is the total energy of the configuration per Li_x\phi_{1-x}CoO_2 formula unit, E_{LiCoO_2} is the energy of LiCoO2 in the O3 host, and E_{CoO_2} is the energy of CoO2 in the O3 host.”
My problem here is to find the number of Li_x\phi_{1-x}CoO_2 formula units in a cell. I assume that E_{LiCoO_2} should be normalized to the number of LiCoO_2 formula units, and E_{CoO_2} should be normalized to the number of CoO_2 formula units, which is easy to count.
Maybe this is too silly; I hope I am not bothering you any further with this reply.
Yea I think this is the same as the formation energy equation I put above, with some specific choice of energy references e_i.
I dont know about the normalization and counting of formula units, as said above I’d guess that number of Co atoms in a structure is equal to number of formula units.
I think if its just for making a figure you can chose anything probably ;), if u want to reproduce a specific plot in a paper and cant figure out the normalization then email the authors.
For training cluster expansions, and for doing thermodynamic analysis one should be careful with how energies are normalized.