baes_eta2_kernel_jax#

jeanspy.baes_eta2.baes_eta2_kernel_jax

jeanspy.baes_eta2.baes_eta2_kernel_jax(u, R_pc, beta_0, beta_inf, r_a, *, n_kernel=96)[source]#

Evaluate the eta=2 BAES kernel from its Appell-F1 representation.

Write:

p = beta_0,
q = beta_inf - beta_0,
a = r_a / R,
z1 = 1 - u^{-2},
z2 = (u^2 - 1) / (u^2 + a^2).

The exact closed form is:

K = sqrt(z1) [
    F1(1;p,q;3/2;z1,z2)
    - p/u^2 F1(1;p+1,q;3/2;z1,z2)
    - q/(u^2+a^2) F1(1;p,q+1;3/2;z1,z2)
].

JAX does not currently provide Appell F1 directly. We therefore evaluate the Euler representation of this closed form on a fixed Gauss–Legendre grid. For a=1 in the first Appell argument:

F1(1;p,q;3/2;z1,z2)
  = integral_0^1 dy
      (1-z1+z1 y^2)^(-p)
      (1-z2+z2 y^2)^(-q).

Combining the three contiguous F1 terms before quadrature avoids cancellation between separately evaluated special functions. The interval is fixed and the endpoint square-root singularity of the original Jeans kernel is absent.

This routine is intended as the JAX-friendly evaluator of the analytic reduction. baes_eta2_kernel_appell_reference below provides an independent high-precision Appell-F1 reference for validation.

Notes

Inputs and units. u>=1 and R_pc > 0, beta_0/beta_inf dimensionless, r_a > 0 in pc, n_kernel static. See the exact signature for supported quadrature options.

Returns and shape. Dimensionless kernel with broadcast array shape.

Validity. Use the documented eta=2 domain and refine quadrature for extreme anisotropies or scales.

Errors. This low-level helper clamps radii/arguments and replaces nonfinite kernel values; a finite output is not evidence of valid inputs. Validate the physical domain before calling it.

Backend. JAX arrays on the configured CPU/GPU, with dtype set before import.

Differentiation. Differentiable continuous physical parameters in the supported regime.

Examples. examples/docs_numerics.py

Parameters:
Return type:

jax.Array