# Understanding Structures and Properties in the Materials Project

#### 1. **Why Structures May Look Different**

When retrieving structures from the new Materials Project (MP) API, you may notice that the lattice parameters and angles do not match the conventional or primitive unit cells you might expect from textbooks or the legacy MP database.

**Key points:**

* **Non-unique representations:** A crystal can be represented in many valid ways. The MP database does **not** store or return the primitive or conventional unit cell by default.
* **Possible supercells:** The stored cell may contain multiple repeat units in a "non-standard" representation.
* **Origin of structures:** Structures often come from experimental sources (e.g., ICSD) or are generated by substitutions on known prototypes, and are typically **not** symmetry-reduced before calculations.
* **Why not always use symmetry reduction?** Automatic numeric symmetry detection can occasionally misidentify a material’s symmetry, leading to incorrect primitive cells.

If you need a **conventional** or **primitive** cell, you can convert the returned structure in Python:

```
from mp_api.client import MPRester

with MPRester("YOUR_API_KEY") as mpr:
    docs = mpr.materials.summary.search(material_ids=["mp-13", "mp-90"])
    structures = {str(doc.material_id): doc.structure for doc in docs}

# Convert to conventional cells
conventional = {mid: s.to_conventional() for mid, s in structures.items()}

# Convert to primitive cells
primitive = {mid: s.get_primitive_structure() for mid, s in conventional.items()}
```

2\. **Changes in Magnetic Moments and Other Properties**

You may also notice differences in computed properties (e.g., magnetic moments, volumes) between the **legacy** MP database and the **new** one.

**Reason:**

* **Legacy MP calculations** were performed with the **PBE GGA** functional.
* **New MP calculations** use the **r²SCAN meta-GGA** functional, which is a higher-level, generally more accurate theory for many material properties.

**Impact of r²SCAN:**

* Improves accuracy for:
  * Magnetic moments in many oxides
  * Magnetic ordering in antiferromagnets
  * Thermodynamic stability
* Known tendency:
  * Overestimates **on-site ferromagnetic moments** in elemental metals (e.g., Fe, Ni) compared to experiment and PBE

#### 3. **Summary Table**

| Aspect                          | Legacy MP               | Newer MP data                             |
| ------------------------------- | ----------------------- | ----------------------------------------- |
| **DFT functional**              | PBE (GGA) and GGA+U     | r²SCAN (meta-GGA)                         |
| **Returned cell type**          | Often conventional cell | Arbitrary non-standard cell (can convert) |
| **Magnetic moments in metals**  | Closer to experiment    | Often overestimated in transition metals  |
| **Thermodynamic accuracy**      | Good                    | Improved                                  |
| **Magnetic ordering in oxides** | Sometimes incorrect     | Improved                                  |

***

#### 4. **Best Practices**

* Always convert to a **primitive** or **conventional** cell if you need a standard representation. The Materials Project uses pymatgen and spglib to determine primitive and conventional cells
* Be aware of **functional differences** when comparing old and new MP data.
* Treat very small deviations (e.g., \~1e-16 in coordinates) as numerical noise.
* Consult the [Materials Project API documentation](https://materialsproject.org/) for updates — this behavior will be documented more clearly in the future.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.materialsproject.org/methodology/materials-methodology/understanding-structures-and-properties-in-the-materials-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
