Adaptive

Contents

Adaptive#

diffaaable.adaptive.adaptive_aaa(z_k_0: ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy._typing._array_like._ScalarType_co]], f: callable, evolutions: int = 2, cutoff: float = None, tol: float = 1e-09, mmax: int = 100, radius: float = None, domain: tuple[complex, complex] = None, f_k_0: ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy._typing._array_like._ScalarType_co]] = None, sampling: callable = Partial(<function next_samples>), prev_z_n: ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy._typing._array_like._ScalarType_co]] = None, return_samples: bool = False, aaa: callable = Partial(<jax._src.custom_derivatives.custom_jvp object>))[source]#

An 2x adaptive Antoulas–Anderson algorithm for rational approximation of meromorphic functions that are costly to evaluate.

The algorithm iteratively places additional sample points close to estimated positions of poles identified during the past iteration. By this refinement scheme the number of function evaluations can be reduced.

It is JAX differentiable wrt. the approximated function f, via its other arguments besides z. f should be provided as a jax.tree_util.Partial with only positional arguments pre-filled!

Parameters:
  • z_k_0 (np.ndarray) – Array of initial sample points

  • f (callable) – function to be approximated. When using gradients f should be provided as a jax.tree_util.Partial with only positional arguments pre-filled. Furthermore it should be compatible to jax.jvp.

  • evolutions (int) – Number of refinement iterations

  • cutoff (float) – Maximum absolute value a function evaluation should take to be regarded valid. Otherwise the sample point is discarded. Defaults to 1e10 times the median of f(z_k_0)

  • tol (float) – Tolerance used in AAA (see diffaaable.aaa)

  • radius (float) – Distance from the assumed poles for nex samples

  • domain (tuple[complex, complex]) – Tuple of min (lower left) and max (upper right) values defining a rectangle in the complex plane. Assumed poles outside of the domain will not receive refinement.

  • f_k_0 – Allows user to provide f evaluated at z_k_0

Returns:

  • z_j (np.array) – chosen samples

  • f_j (np.array) – f(z_j)

  • w_j (np.array) – Weights of Barycentric Approximation

  • z_n (np.array) – Poles of Barycentric Approximation