gradient

cosmax.tools.gradient(field: Array, delta: float) Array

Compute the gradient of a field using central differences. Periodic boundary conditions are used.

Parameters:
  • field – field to differentiate

  • delta – grid spacing

Returns:

The gradient of the field