Check out the Hyperspy Workshop May 13-17, 2024 Online

get_single_DisplacementGradientTensor#

pyxem.generators.get_single_DisplacementGradientTensor(Vs, Vu=None, weights=None, return_residuals=False)[source]#

Calculates the displacement gradient tensor from a pairs of vectors.

Determines the 2 x 2 matrix, \(\\mathbf(L)\), that maps unstrained vectors, Vu, onto strained vectors, Vs

The transformation is returned as a 3 x 3 displacement gradient tensor.

Parameters:
  • Vs (numpy.array) – A 2 x n array containing the Cartesian components of two strained basis vectors, V and U, defined as row vectors.

  • Vu (numpy.array) – A 2 x n array containing the Cartesian components of two unstrained basis vectors, V and U, defined as row vectors.

  • weights (list) – of weights to be passed to the least squares optimiser

  • return_residuals (Bool) – If the residuals for the least squares optimiser should be returned.

Returns:

  • D (numpy.array) – A 3 x 3 displacement gradient tensor (measured in reciprocal space).

  • residuals (numpy.array) – The residuals for the least squares fitting.

Notes

n=2 now behaves the same as the n>2 case; see Release Notes for 0.10.0 for details.