Skip to content

dft.stress

Finite-difference stress diagnostics for orthorhombic DFT cells.

import mlx_atomistic.dft.stress

class StressResult
def __init__(stress: mx.array, pressure: float, displacement: float, samples: tuple[dict, ...])

Diagonal orthorhombic stress estimate.

Parameters

NameTypeDefaultDescription
stressmx.array
pressurefloat
displacementfloat
samplestuple[dict, ...]

Methods

def to_dict() -> dict

Return a JSON-safe stress summary.

Returns

  • dict
def finite_difference_stress(system: DFTSystem, *, config: SCFConfig | None = None, xc_functional: ExchangeCorrelationFunctional | None = None, displacement: float = 0.001) -> StressResult

Estimate diagonal stress by finite-differencing orthorhombic cell lengths.

Parameters

NameTypeDefaultDescription
systemDFTSystem
configSCFConfig | NoneNone
xc_functionalExchangeCorrelationFunctional | NoneNone
displacementfloat0.001

Returns

  • StressResult