# Grain Boundaries

Many real, bulk crystalline materials consist of many grains separated by grain boundaries (GBs). GBs are interfaces where crystals of the same phase meet with different orientations. These boundaries strongly affect mechanical, electrical, and chemical properties, making them critical in materials design.

On MP, the GB structures and properties can be accessed through the API or generated via the Crystal Toolkit. The toolkit employs the Coincidence Site Lattice (CSL) method, where two misoriented crystals are superimposed and coincident lattice sites identified. The algorithm (implemented in pymatgen) constructs the GB structure by:<sup>1</sup>

1\. **Lattice Transformation** – transform the unit cell into a CLS unit cell where the *a* and *b* vectors lie parallel to the desired GB plane.

2\. **Grain Creation and Rotation** – build two grains and rotate them relative to each other using the specified axis and angle.

3\. **Grain Stacking** – place the two grains together, adjusting relative shifts along the *a*, *b*, and *c* directions.

4\. **Atom Merging** – remove atoms that are too close, based on a user-defined distance tolerance.

<figure><img src="/files/HGvSyisa8j0vGs5JBppq" alt=""><figcaption></figcaption></figure>

```python
from mp_api.client import MPRester

with MPRester("your_api_key_here") as mpr:
   grain_bdy = mpr.materials.grain_boundaries.search()
```

## References

\[1] Zheng, H. *et al.* Grain boundary properties of elemental metals. *Acta Mater.* vol. 186, pp. 40–49, yr. 2020. ([DOI](https://doi.org/10.1016/j.actamat.2019.12.030))

## Authors

Mona Abdelgaid


---

# 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/grain-boundaries.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.
