Generate Quarternary Phase Diagrams?

Hello Forum Members,

I am currently engaged in the research of a high-temperature superconductor and I would like to utilize the MaterialsProject API to generate quarternary phase diagrams for my study. In particular, I’m interested in creating a marker within a specific phase region of the diagram and calculating the quarternary phase diagrams at finite temperatures using the GGA functional. I have been able to do this to some extent with the “Phase Diagram Tool” on the website.

However, I have found that the web tool lacks the ability to place a marker at a certain composition. Additionally, I would like to view the diagram’s progression with a temperature slider. My idea is to pre-calculate the diagrams and then make them interactive post-calculation. My aim is to try to program this functionality myself and I do have some basic programming knowledge.

My main questions are:

Are the calculations for the quaternary phase diagrams and the functional performed on the server or locally?
Is it possible to perform these calculations on my own machine?

I’ve tried searching the relevant code in the GitHub pages but I wasn’t able to locate it. I’m wondering if anyone could give me a starting point for this endeavor and what I should review to understand how the “Phase Diagram Tool” operates.

Any guidance would be greatly appreciated. Thank you in advance!

Best regards,


All phase diagrams available on the MP Phase Diagram web app were computed using the PhaseDiagram class in pymatgen. See the link here.

You can generate your own phase diagrams using this code for up to ~10 elements, but the plotter class (PDPlotter) only allows you to generate plots for phase diagrams with 1-4 elements. This produces figures using the Plotly package, which you can then modify on your own (e.g., by adding markers).

Here’s some Python code to get you started:

from pymatgen.analysis.phase_diagram import PDPlotter, PhaseDiagram
from mp_api.client import MPRester


with MPRester(API_KEY) as mpr:
    mp_ents = mpr.get_entries_in_chemsys("Y-Ba-Cu-O")
pd = PhaseDiagram(mp_ents)

You could add your own entries to the MP ones if they were computed with the same settings in VASP.

Finally, if you want to use our model for estimating finite temperature effects, you will need to convert the downloaded ComputedStructureEntry objects into GibbsComputedStructureEntry objects and create a phase diagram from those instead:

from pymatgen.entries.computed_entries import GibbsComputedStructureEntry

temp = 1000  # Kelvin
gibbs_entries = GibbsComputedStructureEntry.from_entries(mp_ents, temp=temp)

Hope this helps!

1 Like

Thank you Matt :slight_smile: I’m gonna try it as soon as I can find time