Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Elastic Tensors

Let’s do something more interesting that normally takes quite a bit of work in DFT: calculating an elastic constant! Elastic properties are important to understand how strong or easy to deform a material is, or how a material might change if compressed or expanded in specific directions (i.e. the Poisson ratio!).

We don’t have to change much code from above, we just use a built-in recipe to calculate the elastic tensor from quacc. This recipe

  1. (optionally) Relaxes the unit cell using the MLIP

  2. Generates a number of deformed unit cells by applying strains

  3. For each deformation, a relaxation using the MLIP and (optionally) a single point calculation is run

  4. Finally, all of the above calculations are used to calculate the elastic properties of the material

For more documentation, see the quacc docs for quacc.recipes.mlp.elastic_tensor_flow

from __future__ import annotations

from ase.build import bulk
from quacc.recipes.mlp.elastic import elastic_tensor_flow

# Make an Atoms object of a bulk Cu structure
atoms = bulk("Cu")

# Run an elastic property calculation with our favorite MLP potential
result = elastic_tensor_flow(
    atoms,
    job_params={
        "all": dict(
            method="fairchem",
            name_or_path="uma-s-1p2",
            task_name="omat",
        ),
    },
)
Warp DeprecationWarning: The symbol `warp.vec` will soon be removed from the public API. Use `warp.types.vector` instead.
INFO:httpx:HTTP Request: HEAD https://huggingface.co/facebook/UMA/resolve/main/checkpoints/uma-s-1p2.pt "HTTP/1.1 302 Found"
INFO:httpx:HTTP Request: HEAD https://huggingface.co/facebook/UMA/resolve/main/references/iso_atom_elem_refs.yaml "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: HEAD https://huggingface.co/facebook/UMA/resolve/main/references/form_elem_refs.yaml "HTTP/1.1 200 OK"
WARNING:root:device was not explicitly set, using device='cuda'.
INFO:root:Adding 5 untrained task(s): ['oc20_stress', 'oc22_stress', 'odac_stress', 'oc25_stress', 'omol_stress']
WARNING:root:The 'seed' argument is deprecated and will be removed in future versions. Please set the seed in the MLIPPredictUnit configuration instead.
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-07-794508-59941
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-07-794508-59941 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-07-794508-59941
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-07-794508-59941
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-388465-53545
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-388465-53545 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-388465-53545
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-388465-53545
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-662406-40240
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-662406-40240 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-662406-40240
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-662406-40240
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-960556-31762
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-09-960556-31762 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-960556-31762
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-09-960556-31762
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-255135-60545
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-255135-60545 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-255135-60545
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-255135-60545
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-538419-85751
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-538419-85751 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-538419-85751
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-538419-85751
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-822758-47153
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-10-822758-47153 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-822758-47153
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-10-822758-47153
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-187773-82490
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-187773-82490 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-187773-82490
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-187773-82490
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-490692-46278
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-490692-46278 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-490692-46278
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-490692-46278
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-796308-60271
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-11-796308-60271 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-796308-60271
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-11-796308-60271
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-099581-85553
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-099581-85553 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-099581-85553
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-099581-85553
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-417838-11222
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-417838-11222 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-417838-11222
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-417838-11222
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-746244-42646
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-746244-42646 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-746244-42646
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-746244-42646
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-929099-96714
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-12-929099-96714 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-929099-96714
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-12-929099-96714
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-083869-12403
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-083869-12403 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-083869-12403
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-083869-12403
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-344704-67592
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-344704-67592 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-344704-67592
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-344704-67592
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-614968-30322
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-614968-30322 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-614968-30322
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-614968-30322
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-909125-29639
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-13-909125-29639 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-909125-29639
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-13-909125-29639
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-178652-51796
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-178652-51796 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-178652-51796
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-178652-51796
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-401505-31955
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-401505-31955 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-401505-31955
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-401505-31955
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-631877-43752
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-631877-43752 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-631877-43752
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-631877-43752
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-877007-95806
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-14-877007-95806 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-877007-95806
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-14-877007-95806
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-031218-91366
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-031218-91366 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-031218-91366
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-031218-91366
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-204799-86518
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-204799-86518 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-204799-86518
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-204799-86518
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-440002-17798
INFO:quacc.runners.prep:Moving /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2026-04-06-19-13-15-440002-17798 contents to /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-440002-17798
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2026-04-06-19-13-15-440002-17798
result["elasticity_doc"].bulk_modulus
BulkModulus(voigt=148.658, reuss=148.658, vrh=148.658)

Congratulations, you ran your first elastic tensor calculation!