get_elastic_coeffs

torch_sim.elastic.get_elastic_coeffs(state, deformed_states, stresses, base_pressure, bravais_type)[source]

Calculate elastic tensor from stress-strain relationships.

Computes the elastic tensor by fitting stress-strain relations to a set of linear equations built from crystal symmetry and deformation data.

Parameters:
  • state (SimState) – SimState containing reference structure

  • deformed_states (list[SimState]) – List of deformed SimStates with calculated stresses

  • stresses (Tensor) – Tensor of shape (n_states, 6) containing stress components for each state

  • base_pressure (Tensor) – Reference pressure of the base state

  • bravais_type (BravaisType) – Crystal system (BravaisType enum)

Returns:

  • torch.Tensor: Cij elastic constants

  • tuple containing:
    • torch.Tensor: Bij Birch coefficients

    • torch.Tensor: Residuals from least squares fit

    • int: Rank of solution

    • torch.Tensor: Singular values

Return type:

tuple containing

Notes

The elastic tensor is calculated as Cij = Bij - P, where: - Bij are the Birch coefficients from least squares fitting - P is a pressure-dependent correction specific to each symmetry

Stress and strain are related by: σᵢ = Σⱼ Cᵢⱼ εⱼ