pymatgen.analysis.elasticity.elastic module

class ElasticTensor[source]

Bases: pymatgen.analysis.elasticity.tensors.TensorBase

This class extends TensorBase to describe the 3x3x3x3 elastic tensor, C_{ij}, in Voigt-notation

Create an ElasticTensor object. The constructor throws an error if the shape of the input_matrix argument is not 3x3x3x3, i. e. in true tensor notation. Issues a warning if the input_matrix argument does not satisfy standard symmetries. Note that the constructor uses __new__ rather than __init__ according to the standard method of subclassing numpy ndarrays.

Parameters:
  • input_array (3x3x3x3 array-like) – the 3x3x3x3 array-like representing the elastic tensor
  • tol (float) – tolerance for initial symmetry test of tensor
cahill_thermalcond(structure)[source]

Calculates Cahill’s thermal conductivity (in SI units)

Parameters:structure – pymatgen structure object

Returns: Cahill’s thermal conductivity (in SI units)

clarke_thermalcond(structure)[source]

Calculates Clarke’s thermal conductivity (in SI units)

Parameters:structure – pymatgen structure object

Returns: Clarke’s thermal conductivity (in SI units)

compliance_tensor

returns the compliance tensor, which is the matrix inverse of the Voigt-notation elastic tensor

debye_temperature(structure)[source]

Calculates the debye temperature (in SI units)

Parameters:structure – pymatgen structure object

Returns: debye temperature (in SI units)

debye_temperature_gibbs(structure)[source]

Calculates the debye temperature accordings to the GIBBS formulation (in SI units)

Parameters:structure – pymatgen structure object

Returns: debye temperature (in SI units)

energy_density(strain)[source]

Calculates the elastic energy density due to a strain

classmethod from_strain_stress_list(strains, stresses)[source]

Class method to fit an elastic tensor from stress/strain data. Method uses Moore-Penrose pseudoinverse to invert the s = C*e equation with elastic tensor, stress, and strain in voigt notation

Parameters:
  • stresses (Nx3x3 array-like) – list or array of stresses
  • strains (Nx3x3 array-like) – list or array of strains
classmethod from_stress_dict(stress_dict, tol=0.1, vasp=True, symmetry=False)[source]

Constructs the elastic tensor from IndependentStrain-Stress dictionary corresponding to legacy behavior of elasticity package.

Parameters:
  • stress_dict (dict) – dictionary of stresses indexed by corresponding IndependentStrain objects.
  • tol (float) – tolerance for zeroing small values of the tensor
  • vasp (boolean) – flag for whether the stress tensor should be converted based on vasp units/convention for stress
  • symmetry (boolean) – flag for whether or not the elastic tensor should fit from data based on symmetry
g_reuss

returns the G_r shear modulus

g_voigt

returns the G_v shear modulus

g_vrh

returns the G_vrh (Voigt-Reuss-Hill) average shear modulus

homogeneous_poisson

returns the homogeneous poisson ratio

k_reuss

returns the K_r bulk modulus

k_voigt

returns the K_v bulk modulus

k_vrh

returns the K_vrh (Voigt-Reuss-Hill) average bulk modulus

kg_average

returns a list of Voigt, Reuss, and Voigt-Reuss-Hill averages of bulk and shear moduli similar to legacy behavior

long_v(structure)[source]

Calculates longitudinal sound velocity (in SI units) using the Voigt-Reuss-Hill average bulk modulus

Parameters:structure – pymatgen structure object

Returns: longitudinal sound velocity (in SI units)

snyder_ac(structure)[source]

Calculates Snyder’s acoustic sound velocity (in SI units)

Parameters:structure – pymatgen structure object

Returns: Snyder’s acoustic sound velocity (in SI units)

snyder_opt(structure)[source]

Calculates Snyder’s optical sound velocity (in SI units)

Parameters:structure – pymatgen structure object

Returns: Snyder’s optical sound velocity (in SI units)

snyder_total(structure)[source]

Calculates Snyder’s total sound velocity (in SI units)

Parameters:structure – pymatgen structure object

Returns: Snyder’s total sound velocity (in SI units)

trans_v(structure)[source]

Calculates transverse sound velocity (in SI units) using the Voigt-Reuss-Hill average bulk modulus

Parameters:structure – pymatgen structure object

Returns: transverse sound velocity (in SI units)

universal_anisotropy

returns the universal anisotropy value

voigt_symmetrized

Reconstructs the elastic tensor by symmetrizing the voigt notation tensor, to allow for legacy behavior

y_mod

Calculates Young’s modulus (in SI units) using the Voigt-Reuss-Hill averages of bulk and shear moduli

generate_pseudo(strain_states)[source]

Generates the pseudoinverse for a given set of strains

get_symbol_list(dim, rank)[source]
toec_fit(strains, stresses, eq_stress=None, zero_crit=1e-10)[source]

A third-order elastic constant fitting function based on central-difference derivatives with respect to distinct strain states. The algorithm is summarized as follows:

  1. Identify distinct strain states as sets of indices for which nonzero strain values exist, typically [(0), (1), (2), (3), (4), (5), (0, 1) etc.]
  2. For each strain state, find and sort strains and stresses by strain value.
  3. Find first and second derivatives of each stress with respect to scalar variable corresponding to the smallest perturbation in the strain.
  4. Use the pseudoinverse of a matrix-vector expression corresponding to the parameterized stress-strain relationship and multiply that matrix by the respective calculated first or second derivatives from the previous step.
  5. Place the calculated second and third-order elastic constants appropriately.
Parameters:
  • strains (nx3x3 array-like) – Array of 3x3 strains to use in fitting of TOEC and SOEC
  • stresses (nx3x3 array-like) – Array of 3x3 stresses to use in fitting of TOEC and SOEC. These should be PK2 stresses.
  • eq_stress (3x3 array-like) – stress corresponding to equilibrium strain (i. e. “0” strain state). If not specified, function will try to find the state in the list of provided stresses and strains. If not found, defaults to 0.
  • zero_crit (float) – value for which strains below are ignored in identifying strain states.