Skip to main content

vector.compute_gradient

vector.compute_gradient

Computes the gradient of arr.

The gradient is scaled for the size of the unit cell, i.e. two unit cells with identical arr and scaled primitive_lattice_vectors will have identical gradient.

Args:

  • arr: The array for which the gradient is sought.
  • primitive_lattice_vectors: Defines the unit cell coordinates.

Returns:

  • None: The gradient, with shape arr.shape + (2,).