How to generate vacancy structure and calculate formation energy

Hello, I read this paper “Vacancy Ordering in O3-Type Layered Metal Oxide Sodium-Ion Battery Cathodes”, Toumar described that pymatgen was used to generate potential structures and the formation energy vs Na concentration was plotted in figure 3. If I am right, the pymatgen’s tutorial does not describe how to generate potential structures. Can anyone show please me step by step how to generate Na vacancy structures using pymatgen? Please take O3 layered oxide as an example.
Thank you so much!

Hi @thienbinh92,

I’m not sure exactly the method used in the paper, you would have to ask the authors for that, but approximately:

  1. You construct a disordered Structure object using pymatgen, this structure has sites with fractional occupancies that match the composition you want. You might explicitly include a fraction of “vacancies” here as DummySpecie, but this may not be necessary.
  2. You use a pymatgen transformation to convert the disordered structure into an ordered approximation, which is typically a supercell of your original structure. A suitable transformation is something like OrderDisorderTransformation or EnumerateStructureTransformation.
  3. You relax each of these structures using a DFT code to obtain their total energies, and then import these energies and compositions as PDEntry objects in pymatgen.
  4. You can then use pymatgen’s PhaseDiagram class to construct a phase diagram such as that plotted in Figure 3 (using PDPlotter).

Each individual step is fairly straight forward, but the process as a whole can take some time and can be quite involved. Good luck!