githubEdit

Examples

API query examples with the MPRester client.

Summary Queries

Structure data for silicon (mp-149)

from mp_api.client import MPRester

with MPRester("your_api_key_here") as mpr:
    docs = mpr.summary.search(material_ids=["mp-149"], fields=["structure"])
    structure = docs[0].structure
    # -- Shortcut for a single Materials Project ID:
    structure = mpr.get_structure_by_material_id("mp-149")

Find all Materials Project IDs for entries with dielectric data

from mp_api.client import MPRester
from emmet.core.summary import HasProps

with MPRester("your_api_key_here") as mpr:
    docs = mpr.summary.search(
        has_props = [HasProps.dielectric], fields=["material_id"]
    )
    mpids = [doc.material_id for doc in docs]

Calculation (task) IDs and types for silicon (mp-149)

Band gaps for all materials containing only Si and O

Chemical formulas for all materials containing at least Si and O

Stable materials (on the GGA/GGA+U hull) with large band gaps (>3eV)

Electronic Structure

Band structures for silicon (mp-149)

Density of states for silicon (mp-149)

Phonons

Band structure for silicon (mp-149)

Density of states for silicon (mp-149)

XAS

XAS for TiO2 element O K edge:

Charge Density

Charge density for silicon (mp-149)

Phase Diagram

Phase diagram for the Li-Fe-O chemical system

Last updated

Was this helpful?