Constructing convex_hull and Pourbaix diagrams with newly calculated data

Hi all,
I understand the convex hull and pourbaix diagrams present in MaterialsProject are constrcuted by using VASP based data with specific energy corrections. I was wondering whether following the same compositions, is there any way to construct these diagrams using the energies/formation energies which we calculate ourselves. I came acrosss the PhaseDiagram module in pymatgen which could be a possible tool for this but I am not sure how exactly this could be done if you are only interested in some the compositions from that given there. Any hint addressing this would be appreciated.

Hi @Akhil_S,

Yes this is easy to do with pymatgen. You will need to parse your VASP calculation outputs into ComputedEntry objects and supply them to the PhaseDiagram class. You can provide any set of entries you want so long as you also have entries for all the corresponding terminal elements. It’s easy to create these computed entries directly from VASP using pymatgen.io.vasp.outputs, see the method linked below:

https://pymatgen.org/pymatgen.io.vasp.outputs.html#pymatgen.io.vasp.outputs.Vasprun.get_computed_entry

warning: you should not mix MP entries with your own entries if you have not used the same VASP input parameters. If you have, you will also need to process the corrections using the same correction scheme as MP.

You can also create these ComputedEntry objects manually by providing the relevant parameters:

from pymatgen.entries.computed_entries import ComputedEntry
composition = ### 
energy = ###
correction = ###
example_entry = ComputedEntry(composition, energy, correction)

To create and plot your phase diagram, you just need to run something like this:

from pymatgen.analysis.phase_diagram import PhaseDiagram, PDPlotter

entries = ### collection of entries you want to put in a phase diagram
pd = PhaseDiagram(entries)
plotter = PDPlotter(pd)
plotter.get_plot()
1 Like

Dear Matt,
Many thanks for your reply. Is it possible to follow the same approach if the DFT calculations are carried out with a code other than VASP and if no energy corrections are preffered to be included? Also do you have same method to create Pourbaix diagram also by giving energies and compositions externally?

Thanks

Yes, compositional phase diagrams are general. You only need compositions and their respective energies. Corrections are not mandatory but are often suitable for getting good agreement between theory & experiment.

You can look for support for your specific DFT code in the various pymatgen.io folders: pymatgen.io namespace — pymatgen 2023.1.30 documentation

I don’t work with Pourbaix diagrams, but it is almost certainly generalizable as well. I suggest you check out the PourbaixDiagram class in pymatgen.analysis.pourbaix_diagram for more info.