ELASTICITY task computes the second-order elastic tensor of a crystal by:
- Fully relaxing the structure with
OPT. - Applying a set of normal and shear strains to generate deformed structures via
pymatgen.analysis.elasticity.DeformedStructureSet. - Computing the stress tensor of each deformed structure.
- Fitting a linear stress-strain relationship to extract the 6×6 Voigt elastic tensor.
Function signature
Parameters
Input structure. A copy is made internally before relaxation.
Calculator for energy, force, and stress evaluations.
Optimizer passed to the initial
OPT task. See structure optimization for valid values.Extra keyword arguments forwarded to the optimizer constructor.
Cell filter for the initial full relaxation. Defaults to
"FrechetCell" to allow both positions and cell to relax.Extra keyword arguments forwarded to the filter constructor.
Convergence criterion dict forwarded to the
OPT task (e.g. {"fmax": 0.001}).Normal strain magnitudes applied along each of the three Cartesian directions. Default covers ±1% in 4 steps. More points improve the linear fit accuracy.
Shear strain magnitudes applied for the off-diagonal components of the strain tensor. Default covers ±6% in 4 steps. Larger range needed because MLIPs often show weaker shear stiffness.
If
True, the OPT result is persisted to Prefect’s result store.If
True, the OPT result is cached and reused if the same structure and calculator are provided again.Return value
Returns adict on success, or a Prefect State if the initial relaxation fails:
| Key | Type | Description |
|---|---|---|
elastic_tensor | pymatgen.analysis.elasticity.ElasticTensor | Full 3×3×3×3 (Voigt 6×6) elastic tensor in GPa, zeroed below numerical tolerance |
residuals_sum | float | Sum of least-squares residuals from all stress-strain fits — a measure of fit quality |
ElasticTensor object provides derived moduli:
Example
For accurate elastic constants, use a tight convergence criterion (e.g.
fmax=0.001) for the initial relaxation. Poorly relaxed structures produce inconsistent stress-strain data.