heyoka.diff_tensors

Contents

heyoka.diff_tensors#

heyoka.diff_tensors(func: list[expression], diff_args: list[expression] | diff_args, diff_order: int = 1) dtens#

Compute the tensors of derivatives.

Note

A tutorial explaining the use of this function is available.

This function will compute the tensors of derivatives of the vector function func with respect to the arguments diff_args up to the derivative order diff_order. The derivatives will be returned as a dtens object.

Several checks are run on the input arguments. Specifically:

  • the number of function components (i.e., the length of func) cannot be zero,

  • diff_args cannot be empty,

  • diff_args must consist only of variable and/or parameter expressions,

  • diff_args cannot contain duplicates.

Parameters:
  • func – the vector function whose derivatives will be computed.

  • diff_args – the arguments with respect to which the derivatives will be computed.

  • diff_order – the maximum derivative order.

Returns:

the tensor of derivatives of func with respect to diff_args up to order diff_order.

Raises:

ValueError – if one or more input arguments are malformed, as explained above.