# Stress¶

class Stress(configuration, fix_strain=None)

Class for calculating the stress of a configuration.

Parameters: configuration (BulkConfiguration) – Configuration with a calculator that supports stress calculations. fix_strain (FixStrain | None) – Additional constraint parameter. Default: None
evaluate()
Returns: The stress for the given configuration. The shape of the stress tensor is (3,3). PhysicalQuantity with the unit eV * Angstrom**-3
metatext()
Returns: The metatext of the object or None if no metatext is present. str | unicode | None
nlprint(stream=None)

Print a string containing an ASCII table useful for plotting the AnalysisSpin object.

Parameters: stream (python stream) – The stream the table should be written to. Default: NLPrintLogger()
setMetatext(metatext)

Set a given metatext string on the object.

Parameters: metatext (str | unicode | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.

## Usage Examples¶

Calculate and print the stress tensor of a compressed GaAs crystal:

# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=FaceCenteredCubic(5.4*Angstrom),
elements=[Gallium, Arsenic],
cartesian_coordinates=[[ 0.      ,  0.      ,  0.      ],
[ 1.413425,  1.413425,  1.413425]]*Angstrom
)

calculator = LCAOCalculator(
numerical_accuracy_parameters=NumericalAccuracyParameters(
k_point_sampling=(4, 4, 4))
)

bulk_configuration.setCalculator(calculator)

#calculate the stress
stress = Stress(bulk_configuration)
nlprint(stress)


stress.py

## Notes¶

Stress is given by the derivative of the total energy, $$E$$, with respect to a strain $$\epsilon_{\alpha \beta}$$,

$\sigma_{\alpha \beta} = \frac{1}{V}\frac{dE}{d\epsilon_{\alpha \beta}}.$

In this equation, $$V$$, is the volume of the system and the strain tensor displaces positions by

$R^\epsilon_\alpha = \sum_\beta(\delta_{\alpha \beta} + \epsilon_{\alpha \beta}) R_\beta.$

Stress has unit energy per volume element, i.e. eV/Å 3.