IMLCV.tools.spherical_bessel
============================

.. py:module:: IMLCV.tools.spherical_bessel


Attributes
----------

.. autoapisummary::

   IMLCV.tools.spherical_bessel._lax_const


Functions
---------

.. autoapisummary::

   IMLCV.tools.spherical_bessel.jint
   IMLCV.tools.spherical_bessel.spb1
   IMLCV.tools.spherical_bessel._spb1_maclaurin
   IMLCV.tools.spherical_bessel._spb1_maclaurin_jvp
   IMLCV.tools.spherical_bessel.envj
   IMLCV.tools.spherical_bessel.msta1
   IMLCV.tools.spherical_bessel.msta2
   IMLCV.tools.spherical_bessel.csphjy
   IMLCV.tools.spherical_bessel.csphjy_jvp


Module Contents
---------------

.. py:data:: _lax_const

.. py:function:: jint(n)

.. py:function:: spb1(x: jax._src.typing.ArrayLike, /) -> jax._src.typing.Array

   Calculate the spherical Bessel functions j_1(z).
   Follows existing implementation of jnp.sinc for safety around 0,
   using a Maclaurin series to keep continuous derivatives.

   :param x: The argument of the function.

   :returns: The function j_1(z).
   :rtype: csj


.. py:function:: _spb1_maclaurin(k, x)

.. py:function:: _spb1_maclaurin_jvp(k, primals, tangents)

.. py:function:: envj(n, x)

   Helper function for msta1 and msta2.



.. py:function:: msta1(x, mp)

   Calculate the number of terms required for the spherical Bessel function.


.. py:function:: msta2(x, n, mp)

   Calculate the number of terms required for the spherical Bessel function.


.. py:function:: csphjy(n, z)

   Spherical Bessel functions of the first and second kind, and their derivatives.
   Follows the implementation of https://github.com/emsr/maths_burkhardt/blob/master/special_functions.f90, but with the derivatives.
   :param n: The order of the spherical Bessel function.
   :param z: The argument of the function.

   :returns: The number of terms used in the calculation.
             csj: The function j_n(z).
             cdj: The derivative of the function j_n(z).
             csy: The function y_n(z).
             cdy: The derivative of the function y_n(z).
   :rtype: nm


.. py:function:: csphjy_jvp(n, primals, tangents)

