# Background

The **Phase Diagram App** allows a user to create and visualize compositional phase diagrams for 1, 2, 3, and 4 element chemical systems using Materials Project data. It is also possible to create and visualize the corresponding chemical potential diagrams for 2 and 3 element systems. The user has access to some customization features, such as 1) changing the style of plot, 2) selecting data calculated with a certain DFT functional, 3) and using machine learning (ML)-estimated finite temperature data.

## Methodology

The methodology behind thermodynamic energy calculations, phase diagram construction, and chemical potential diagram construction has been extensively discussed in the Methodology section of the MP Docs. See the links below:

{% content-ref url="../../../methodology/materials-methodology/thermodynamic-stability/thermodynamic-stability" %}
[thermodynamic-stability](https://docs.materialsproject.org/methodology/materials-methodology/thermodynamic-stability/thermodynamic-stability)
{% endcontent-ref %}

{% content-ref url="../../../methodology/materials-methodology/thermodynamic-stability/phase-diagrams-pds" %}
[phase-diagrams-pds](https://docs.materialsproject.org/methodology/materials-methodology/thermodynamic-stability/phase-diagrams-pds)
{% endcontent-ref %}

{% content-ref url="../../../methodology/materials-methodology/thermodynamic-stability/chemical-potential-diagrams-cpds" %}
[chemical-potential-diagrams-cpds](https://docs.materialsproject.org/methodology/materials-methodology/thermodynamic-stability/chemical-potential-diagrams-cpds)
{% endcontent-ref %}

{% content-ref url="../../../methodology/materials-methodology/thermodynamic-stability/finite-temperature-estimation" %}
[finite-temperature-estimation](https://docs.materialsproject.org/methodology/materials-methodology/thermodynamic-stability/finite-temperature-estimation)
{% endcontent-ref %}

## App Components

### Search by chemical system

Phase diagrams are created by **chemical system** (i.e., a collection of elements). To create a phase diagram in the Phase Diagram App, first select a set of elements by typing them either as a single string separated by dashes, or by clicking the elements in the periodic table viewer (which will auto-populate the search box).

![Figure 1: Search by chemical system using the periodic table viewer](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-cdd79b7943aaad515bb36d0a0a4aa8315d471831%2FScreen%20Shot%202022-07-14%20at%204.13.26%20PM.png?alt=media)

{% hint style="warning" %}
**Warning**

Phase diagrams can only be plotted for chemical systems containing **1-4 elements**. It is still possible to create phase diagrams for 5 or more elements, but this feature is only currently available in *pymatgen*.
{% endhint %}

### Visualization Viewer

Once a chemical system has been selected (e.g., Li-Fe-O), you will an illustration of the compositional phase diagram for your system of interest load in the the viewer. Within the viewer, you can switch to the chemical potential diagram to view the same phase equilibria but within chemical potential space (see [Methodology](#chemical-potential-diagrams) for more information).

**1) Phase Diagram**

![](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-aa2f35da21b645fc36b1045890e5b76884fa5bb1%2FScreen%20Shot%202022-07-14%20at%204.27.33%20PM.png?alt=media)

**2) Chemical Potential Diagram**

![](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-b5539be31c13eb6bf370d207b1416d1ab48482c0%2FScreen%20Shot%202022-07-14%20at%204.33.40%20PM.png?alt=media)

If you are

### Configure Visualization

The phase diagram viewer can be configured

![](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-bda6cb56922b5a14c13d338f5ebbe42f9a6e83bc%2FScreen%20Shot%202022-07-14%20at%204.25.25%20PM.png?alt=media)

### Advanced Options

![](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-c6963b4b15a7aab233eff6d84383a10272260d1a%2FScreen%20Shot%202022-07-14%20at%204.38.07%20PM.png?alt=media)

### Data Table

![](https://2369879881-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhdHkeirg8PPHDHWitE%2Fuploads%2Fgit-blob-8310130d9112fdeb76893cdfb9431d698c75da70%2FScreen%20Shot%202022-07-14%20at%204.37.51%20PM.png?alt=media)
