ó
    EñiÊK  ã            	       ó¸  • S SK r S SKrS SKrSSKJr  SSKJrJrJ	r	J
r
  SSKJrJrJrJr  / SQr " S S5      r\" \	S	S
S S9r	\	R$                  S 5       r\	R(                  S 5       r\" \SSS S9r\R$                  S 5       r\R*                  S 5       r\R,                  S 5       r\R(                  S 5       r\" \SSSSS S9r\R$                  S 5       r\R.                  S 5       r\R(                  S 5       r\" \SSSSS S9r\R$                  S 5       r\R.                  S 5       r\R*                  S  5       r\R,                  S! 5       r\R(                  S" 5       r\" \S#S$S S9r\R$                  S% 5       r\R(                  S& 5       r\" \S'S(S S9r\R$                  S) 5       r\R*                  S* 5       r\R,                  S+ 5       r\R(                  S, 5       r\" \
S-S.S/S S09r
\
R$                  S1 5       r\
R(                  S2 5       r\" \S3S4S/S S09r\R$                  S5 5       r\R*                  S6 5       r\R,                  S7 5       r\R(                  S8 5       rg)9é    Né   ©Ú_nonneg_int_or_fail)Ú
legendre_pÚassoc_legendre_pÚsph_legendre_pÚ
sph_harm_y)Úlegendre_p_allÚassoc_legendre_p_allÚsph_legendre_p_allÚsph_harm_y_all)r   r   r   r
   r	   r   r   r   c                   ó`   • \ rS rSrSSS.S jjr\S 5       rS rS rS	 r	S
 r
S rS rS rSrg)Ú
MultiUFuncé   NF)Úforce_complex_outputc                ó´  • [        U[        R                  5      (       dö  [        U[        R                  R
                  5      (       a  UR                  5       nO7[        U[        R                  R                  5      (       a  UnO[        S5      e[        5       nU H[  n[        U[        R                  5      (       d  [        SU 35      eUR                  [        S UR                   5       5      5        M]     [        U5      S:”  a  [        S5      eX l        Xl        X0l        X@l        XPl        S U l        S U l        S U l        S U l        S U l        g )Nz7ufunc_or_ufuncs should be a ufunc or a ufunc collectionz2All ufuncs must have type `numpy.ufunc`. Received c              3   óH   #   • U  H  oR                  S 5      S   v •  M     g7f)z->r   N)Úsplit)Ú.0Úxs     ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/scipy/special/_multiufuncs.pyÚ	<genexpr>Ú&MultiUFunc.__init__.<locals>.<genexpr>+   s   é € Ð.UÊÀA¯w©w°t«}¸QÖ/?Êùs   ‚ "r   z*All ufuncs must take the same input types.c                  ó   • g)N© r   ©ÚargsÚkwargss     r   Ú<lambda>Ú%MultiUFunc.__init__.<locals>.<lambda>7   s   € ¸2ó    c                  ó   • 0 $ ©Nr   r   s     r   r   r    8   s   € ¹Rr!   )Ú
isinstanceÚnpÚufuncÚcollectionsÚabcÚMappingÚvaluesÚIterableÚ
ValueErrorÚsetÚaddÚ	frozensetÚtypesÚlenÚ__name__Ú_ufunc_or_ufuncsÚ_MultiUFunc__docÚ!_MultiUFunc__force_complex_outputÚ_default_kwargsÚ_resolve_out_shapesÚ_finalize_outÚ_keyÚ_ufunc_default_argsÚ_ufunc_default_kwargs)	ÚselfÚufunc_or_ufuncsÚnameÚdocr   Údefault_kwargsÚufuncs_iterÚseen_input_typesr&   s	            r   Ú__init__ÚMultiUFunc.__init__   s'  € ä˜/¬2¯8©8×4Ñ4Ü˜/¬;¯?©?×+BÑ+B×CÑCØ-×4Ñ4Ó6‘Ü˜O¬[¯_©_×-EÑ-E×FÑFØ-‘ä ð "5ó 6ð 6ô
  #›uÐÛ$�Ü! %¬¯©×2Ñ2Ü$ð &2Ø2AÐ1Bð&Dó Eð Eà ×$Ñ$¤YÑ.UÈÏÊÓ.UÓ%UÖVñ	 %ô
 Ð#Ó$ qÓ(Ü Ð!MÓNÐNàŒØ /ÔØŒ
Ø&:Ô#Ø-ÔØ#'ˆÔ Ø!ˆÔØˆŒ	Ù#=ˆÔ Ù%?ˆÕ"r!   c                 ó   • U R                   $ r#   )r4   )r<   s    r   Ú__doc__ÚMultiUFunc.__doc__:   s   € à�z‰zÐr!   c                 ó   • Xl         g)z3Set `key` method by decorating a function.
        N)r9   ©r<   Úfuncs     r   Ú_override_keyÚMultiUFunc._override_key>   s	   € ð �	r!   c                 ó   • Xl         g r#   )r:   rI   s     r   Ú_override_ufunc_default_argsÚ'MultiUFunc._override_ufunc_default_argsC   s   € Ø#'Õ r!   c                 ó   • Xl         g r#   )r;   rI   s     r   Ú_override_ufunc_default_kwargsÚ)MultiUFunc._override_ufunc_default_kwargsF   s   € Ø%)Õ"r!   c                 óF   • UR                   c  SUl         SUl        Xl        g)z9Set `resolve_out_shapes` method by decorating a function.Nz2Resolve to output shapes based on relevant inputs.Úresolve_out_shapes)rF   r2   r7   rI   s     r   Ú_override_resolve_out_shapesÚ'MultiUFunc._override_resolve_out_shapesI   s#   € à�<‰<ÑàHð ŒLà,ˆŒØ#'Õ r!   c                 ó   • Xl         g r#   )r8   rI   s     r   Ú_override_finalize_outÚ!MultiUFunc._override_finalize_outQ   s   € Ø!Õr!   c                 ó®   • [        U R                  [        R                  5      (       a  U R                  $ U R                  " S0 UD6nU R                  U   $ )z.Resolve to a ufunc based on keyword arguments.r   )r$   r3   r%   r&   r9   )r<   r   Ú	ufunc_keys      r   Ú_resolve_ufuncÚMultiUFunc._resolve_ufuncT   sI   € ô �d×+Ñ+¬R¯X©X×6Ñ6Ø×(Ñ(Ð(à—I’IÑ' Ñ'ˆ	Ø×$Ñ$ YÑ/Ð/r!   c                 óÚ  • U R                   U-  nXR                  " S0 UD6-  nU R                  " S0 UD6nXR                  * S   Vs/ s H  n[        R
                  " U5      PM     nnU R                  " S0 UD6nU R                  Gb7  [        S U 5       5      nU R                  " / US UR                  *  QUQUR                  P70 UD6n[        S U 5       5      n	[        US5      (       a2  X“R                  S-  -   n
UR                  U
5      n
X£R                  * S  nO][        R                  " U	6 n[        R                  " U[        R                  5      (       d  [        R                  nUR                  U4-  nU R                   (       a  [        S U 5       5      n[        S [#        X‹5       5       5      nXÖS'   U" U0 UD6nU R$                  b  U R%                  U5      nU$ s  snf )	Nc              3   óN   #   • U  H  n[         R                  " U5      v •  M     g 7fr#   )r%   Úshape©r   Ú	ufunc_args     r   r   Ú&MultiUFunc.__call__.<locals>.<genexpr>j   s   é € Ð$UÊ*¸Y¤R§X¢X¨i×%8Ð%8Ê*ùó   ‚#%c              3   óš   #   • U  HA  n[        US 5      (       a  UR                  O[        R                  " [        U5      5      v •  MC     g7f)ÚdtypeN)Úhasattrrf   r%   Útypera   s     r   r   rc   o   s?   é € ð %Bâ6@¨ô 9@À	È7×8SÑ8S Y§_¢_Ü*,¯(ª(´4¸	³?Ó*Cô&Dâ6@ùs   ‚A	AÚresolve_dtypesr#   c              3   óP   #   • U  H  n[         R                  " S U5      v •  M     g7f)y              ð?N)r%   Úresult_type)r   Úufunc_out_dtypes     r   r   rc      s&   é € ð )RÚ@P¨_ô *,¯ª¸¸O×)LÐ)LÚ@Pùs   ‚$&c              3   óN   #   • U  H  u  p[         R                  " XS 9v •  M     g7f))rf   N)r%   Úempty)r   Úufunc_out_shaperl   s      r   r   rc   ‚   s&   é € ð DâBñ =˜Oô Ÿš ÖHâBùrd   Úoutr   )r6   r:   r\   Úninr%   Úasarrayr;   r7   ÚtupleÚnoutrg   ri   rk   Ú
issubdtypeÚinexactÚfloat64r5   Úzipr8   )r<   r   r   r&   ÚargÚ
ufunc_argsÚufunc_kwargsÚufunc_arg_shapesÚufunc_out_shapesÚufunc_arg_dtypesÚufunc_dtypesÚufunc_out_dtypesrl   rp   s                 r   Ú__call__ÚMultiUFunc.__call__]   s  € Ø×%Ñ%¨Ñ.ˆà×(Ò(Ñ2¨6Ñ2Ñ2ˆà×#Ò#Ñ- fÑ-ˆð 26·y±y°j°kÑ1BÓCÒ1B¨#”b—j’j –oÑ1Bˆ
ÐCà×1Ò1Ñ;°FÑ;ˆà×$Ñ$Ò0Ü$Ñ$UÉ*Ó$UÓUÐØ#×7Ò7ð  B¸¸kÀÇ	Á	¸zÐ9Jð  BØ9Ið BØKPÏ:É:ò Bà:@ñ BÐô  %ñ %Bá6@ó%Bó  BÐô �uÐ.×/Ñ/Ø/·*±*¸wÑ2FÑF�Ø$×3Ñ3°LÓA�Ø#/·±°°Ð#=Ñ ä"$§.¢.Ð2BÐ"C�ÜŸš o´r·z±z×BÑBÜ&(§j¡j�Oà#(§:¡:°Ð0BÑ#BÐ à×*×*Ü#(ñ )RÙ@Pó)Ró $RÐ ô ñ DäÐ/ÔBóDó DˆCð #&˜Ñá�ZÐ0 <Ñ0ˆØ×ÑÑ*Ø×$Ñ$ SÓ)ˆCàˆ
ùòO Ds   Á G()
Ú__docÚ__force_complex_outputr2   r6   r8   r9   r7   r:   r;   r3   )NN)r2   Ú
__module__Ú__qualname__Ú__firstlineno__rC   ÚpropertyrF   rK   rN   rQ   rU   rX   r\   r�   Ú__static_attributes__r   r!   r   r   r      sI   † ð@Ø&+ö@ðB ñó ðòò
(ò*ò(ò"ò0õ/r!   r   r   a¢  sph_legendre_p(n, m, theta, *, diff_n=0)

    Spherical Legendre polynomial of the first kind.

    Parameters
    ----------
    n : ArrayLike[int]
        Degree of the spherical Legendre polynomial. Must have ``n >= 0``.
    m : ArrayLike[int]
        Order of the spherical Legendre polynomial.
    theta : ArrayLike[float]
        Input value.
    diff_n : Optional[int]
        A non-negative integer. Compute and return all derivatives up
        to order ``diff_n``. Default is 0.

    Returns
    -------
    p : ndarray or tuple[ndarray]
        Spherical Legendre polynomial with ``diff_n`` derivatives.

    Notes
    -----
    The spherical counterpart of an (unnormalized) associated Legendre polynomial has
    the additional factor

    .. math::

        \sqrt{\frac{(2 n + 1) (n - m)!}{4 \pi (n + m)!}}

    It is the same as the spherical harmonic :math:`Y_{n}^{m}(\theta, \phi)`
    with :math:`\phi = 0`.
    ©Údiff_nc                 óX   • [        U SSS9n SU s=::  a  S::  d  O  [        SU  S35      eU $ ©Nr‹   F©Ústrictr   é   úGdiff_n is currently only implemented for orders 0, 1, and 2, received: Ú.©r   r,   rŠ   s    r   Ú_r”   ¶   óB   € ä  ¨¸%Ñ@€FØ�Õ˜!ÕÜðØ ˜ ð$ó
ð 	
ð €Mr!   c                 ó2   • [         R                  " U SS5      $ ©Néÿÿÿÿr   ©r%   Úmoveaxis©rp   s    r   r”   r”   Á   ó   € ä�;Š;�s˜B Ó"Ð"r!   r   aì  sph_legendre_p_all(n, m, theta, *, diff_n=0)

    All spherical Legendre polynomials of the first kind up to the
    specified degree ``n``, order ``m``, and all derivatives up
    to order ``diff_n``.

    Output shape is ``(diff_n + 1, n + 1, 2 * m + 1, ...)``. The entry at
    ``(i, j, k)`` corresponds to the ``i``-th derivative, degree ``j``, and
    order ``k`` for all ``0 <= i <= diff_n``, ``0 <= j <= n``, and
    ``-m <= k <= m``.

    See Also
    --------
    sph_legendre_p
    c                 óX   • [        U SSS9n SU s=::  a  S::  d  O  [        SU  S35      eU $ r�   r“   rŠ   s    r   r”   r”   Û   r•   r!   c                 ó   • SS/S/-   0$ ©NÚaxesr   )r   r   r˜   r   rŠ   s    r   r”   r”   æ   s   € à�R�D˜J˜<Ñ'Ð(Ð(r!   c                 ó¤   • [        U [        R                  5      (       a  U S:  a  [        S5      eU S-   S[	        U5      -  S-   4U-   US-   4-   4$ )Nr   ú!n must be a non-negative integer.r   r�   )r$   ÚnumbersÚIntegralr,   Úabs)ÚnÚmÚtheta_shapert   r‹   s        r   r”   r”   ë   sU   € ä�aœ×)Ñ)×*Ñ*¨q°1«uÜÐ<Ó=Ð=à�‰U�Aœ˜A›‘J ‘NÐ# kÑ1°V¸a±Z°MÑAÐCÐCr!   c                 ó2   • [         R                  " U SS5      $ r—   r™   r›   s    r   r”   r”   ó   rœ   r!   r   a—  assoc_legendre_p(n, m, z, *, branch_cut=2, norm=False, diff_n=0)

    Associated Legendre polynomial of the first kind.

    Parameters
    ----------
    n : ArrayLike[int]
        Degree of the associated Legendre polynomial. Must have ``n >= 0``.
    m : ArrayLike[int]
        order of the associated Legendre polynomial.
    z : ArrayLike[float | complex]
        Input value.
    branch_cut : Optional[ArrayLike[int]]
        Selects branch cut. Must be 2 (default) or 3.
        2: cut on the real axis ``|z| > 1``
        3: cut on the real axis ``-1 < z < 1``
    norm : Optional[bool]
        If ``True``, compute the normalized associated Legendre polynomial.
        Default is ``False``.
    diff_n : Optional[int]
        A non-negative integer. Compute and return all derivatives up
        to order ``diff_n``. Default is 0.

    Returns
    -------
    p : ndarray or tuple[ndarray]
        Associated Legendre polynomial with ``diff_n`` derivatives.

    Notes
    -----
    The normalized counterpart of an (unnormalized) associated Legendre
    polynomial has the additional factor

    .. math::

        \sqrt{\frac{(2 n + 1) (n - m)!}{2 (n + m)!}}
    r�   F©Ú
branch_cutÚnormr‹   c                 óZ   • [        USSS9nSUs=::  a  S::  d  O  [        SU S35      eX4$ r�   r“   rª   s      r   r”   r”   #  sE   € ä  ¨¸%Ñ@€FØ�Õ˜!ÕÜðØ ˜ ð$ó
ð 	
ð ˆ<Ðr!   c                 ó   • U 4$ r#   r   rª   s      r   r”   r”   .  ó
   € àˆ;Ðr!   c                 ó2   • [         R                  " U SS5      $ r—   r™   r›   s    r   r”   r”   3  rœ   r!   r   a  assoc_legendre_p_all(n, m, z, *, branch_cut=2, norm=False, diff_n=0)

    All associated Legendre polynomials of the first kind up to the
    specified degree ``n``, order ``m``, and all derivatives up
    to order ``diff_n``.

    Output shape is ``(diff_n + 1, n + 1, 2 * m + 1, ...)``. The entry at
    ``(i, j, k)`` corresponds to the ``i``-th derivative, degree ``j``, and
    order ``k`` for all ``0 <= i <= diff_n``, ``0 <= j <= n``, and
    ``-m <= k <= m``.

    See Also
    --------
    assoc_legendre_p
    c                 ó¬   • [        U[        R                  5      (       a  US:¼  d  [        SU S35      eSUs=::  a  S::  d  O  [        SU S35      eX4$ ©Nr   z1diff_n must be a non-negative integer, received: r’   r�   r‘   )r$   r£   r¤   r,   rª   s      r   r”   r”   M  sl   € ä˜¤× 0Ñ 0×1Ñ1Ø˜!“ÜØ?À¸xÀqÐIó
ð 	
ð �Õ˜!ÕÜðØ ˜ ð$ó
ð 	
ð ˆ<Ðr!   c                 ó   • U 4$ r#   r   rª   s      r   r”   r”   \  r¯   r!   c                 ó   • SSS/S/-   0$ rŸ   r   rª   s      r   r”   r”   a  s   € à�R˜�H 
˜|Ñ+Ð,Ð,r!   c                 ó6  • US   n[        U [        R                  5      (       a  U S:  a  [        S5      e[        U[        R                  5      (       a  US:  a  [        S5      eU S-   S[	        U5      -  S-   4[
        R                  " X#5      -   US-   4-   4$ )Nr‹   r   r¢   z!m must be a non-negative integer.r   r�   ©r$   r£   r¤   r,   r¥   r%   Úbroadcast_shapes)r¦   r§   Úz_shapeÚbranch_cut_shapert   r   r‹   s          r   r”   r”   f  sœ   € à�HÑ€Fä�aœ×)Ñ)×*Ñ*¨q°1«uÜÐ<Ó=Ð=Ü�aœ×)Ñ)×*Ñ*¨q°1«uÜÐ<Ó=Ð=à�‰U�Aœ˜A›‘J ‘NÐ#Ü
×Ò˜GÓ6ñ7Ø:@À1¹*¸ñGð Ið Ir!   c                 ó2   • [         R                  " U SS5      $ r—   r™   r›   s    r   r”   r”   s  rœ   r!   r   a  legendre_p(n, z, *, diff_n=0)

    Legendre polynomial of the first kind.

    Parameters
    ----------
    n : ArrayLike[int]
        Degree of the Legendre polynomial. Must have ``n >= 0``.
    z : ArrayLike[float]
        Input value.
    diff_n : Optional[int]
        A non-negative integer. Compute and return all derivatives up
        to order ``diff_n``. Default is 0.

    Returns
    -------
    p : ndarray or tuple[ndarray]
        Legendre polynomial with ``diff_n`` derivatives.

    See Also
    --------
    legendre

    References
    ----------
    .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special
           Functions", John Wiley and Sons, 1996.
           https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html
    c                 óª   • [        U [        R                  5      (       a  U S:  a  [        SU  S35      eSU s=::  a  S::  d  O  [	        SU  S35      eU $ r²   )r$   r£   r¤   r,   ÚNotImplementedErrorrŠ   s    r   r”   r”   ›  sh   € ä�vœw×/Ñ/×0Ñ0°f¸q³jÜØ?À¸xÀqÐIó
ð 	
ð �Õ˜!ÕÜ!ðØ ˜ ð$ó
ð 	
ð €Mr!   c                 ó2   • [         R                  " U SS5      $ r—   r™   r›   s    r   r”   r”   ©  rœ   r!   r
   aŽ  legendre_p_all(n, z, *, diff_n=0)

    All Legendre polynomials of the first kind up to the specified degree
    ``n`` and all derivatives up to order ``diff_n``.

    Output shape is ``(diff_n + 1, n + 1, ...)``. The entry at ``(i, j)``
    corresponds to the ``i``-th derivative and degree ``j`` for all
    ``0 <= i <= diff_n`` and ``0 <= j <= n``.

    See Also
    --------
    legendre_p
    c                 óX   • [        U SSS9n SU s=::  a  S::  d  O  [        SU  S35      eU $ r�   r“   rŠ   s    r   r”   r”   Á  r•   r!   c                 ó   • SSS/0$ )Nr    r   )r   r˜   r   rŠ   s    r   r”   r”   Ì  s   € à�R˜�MÐ"Ð"r!   c                 ó>   • [        U SSS9n X S-   4U-   US-   4-   4-  $ )Nr¦   FrŽ   r   r   )r¦   r¸   rt   r‹   s       r   r”   r”   Ñ  s2   € ä˜A˜s¨5Ñ1€Aà˜‘E�8˜gÑ%¨°!©¨Ñ5Ð7Ñ7Ð7r!   c                 ó2   • [         R                  " U SS5      $ r—   r™   r›   s    r   r”   r”   Ø  rœ   r!   r	   aÌ  sph_harm_y(n, m, theta, phi, *, diff_n=0)

    Spherical harmonics. They are defined as

    .. math::

        Y_n^m(\theta,\phi) = \sqrt{\frac{2 n + 1}{4 \pi} \frac{(n - m)!}{(n + m)!}}
            P_n^m(\cos(\theta)) e^{i m \phi}

    where :math:`P_n^m` are the (unnormalized) associated Legendre polynomials.

    Parameters
    ----------
    n : ArrayLike[int]
        Degree of the harmonic. Must have ``n >= 0``. This is
        often denoted by ``l`` (lower case L) in descriptions of
        spherical harmonics.
    m : ArrayLike[int]
        Order of the harmonic.
    theta : ArrayLike[float]
        Polar (colatitudinal) coordinate; must be in ``[0, pi]``.
    phi : ArrayLike[float]
        Azimuthal (longitudinal) coordinate; must be in ``[0, 2*pi]``.
    diff_n : Optional[int]
        A non-negative integer. Compute and return all derivatives up
        to order ``diff_n``. Default is 0.

    Returns
    -------
    y : ndarray[complex] or tuple[ndarray[complex]]
       Spherical harmonics with ``diff_n`` derivatives.

    Notes
    -----
    There are different conventions for the meanings of the input
    arguments ``theta`` and ``phi``. In SciPy ``theta`` is the
    polar angle and ``phi`` is the azimuthal angle. It is common to
    see the opposite convention, that is, ``theta`` as the azimuthal angle
    and ``phi`` as the polar angle.

    Note that SciPy's spherical harmonics include the Condon-Shortley
    phase [2]_ because it is part of `sph_legendre_p`.

    With SciPy's conventions, the first several spherical harmonics
    are

    .. math::

        Y_0^0(\theta, \phi) &= \frac{1}{2} \sqrt{\frac{1}{\pi}} \\
        Y_1^{-1}(\theta, \phi) &= \frac{1}{2} \sqrt{\frac{3}{2\pi}}
                                    e^{-i\phi} \sin(\theta) \\
        Y_1^0(\theta, \phi) &= \frac{1}{2} \sqrt{\frac{3}{\pi}}
                                 \cos(\theta) \\
        Y_1^1(\theta, \phi) &= -\frac{1}{2} \sqrt{\frac{3}{2\pi}}
                                 e^{i\phi} \sin(\theta).

    References
    ----------
    .. [1] Digital Library of Mathematical Functions, 14.30.
           https://dlmf.nist.gov/14.30
    .. [2] https://en.wikipedia.org/wiki/Spherical_harmonics#Condon.E2.80.93Shortley_phase
    T)r   r‹   c                 óX   • [        U SSS9n SU s=::  a  S::  d  O  [        SU  S35      eU $ r�   r“   rŠ   s    r   r”   r”   !  r•   r!   c                 óê   • U R                   S   S:X  a  U S   $ U R                   S   S:X  a  U S   U SSS/SS/4   4$ U R                   S   S:X  a$  U S   U SSS/SS/4   U SSS/SS//SS/SS//4   4$ g ©Nr˜   r   ).r   r   r�   .r   é   ©r`   r›   s    r   r”   r”   ,  ó´   € à�	‰	�"‰˜ÓØ�9‰~Ðà�	‰	�"‰˜ÓØ�9‰~˜s 3¨¨A¨°°A°Ð#6Ñ7Ð7Ð7à�	‰	�"‰˜ÓØ�I‘  C¨!¨Q¨°!°Q°Ð$7Ñ 8Ø��q˜!�f˜q !˜fÐ%¨¨A¨°°A°Ð'7Ð7Ñ8ð:ð 	:ð 	r!   r   a˜  sph_harm_y_all(n, m, theta, phi, *, diff_n=0)

    All spherical harmonics up to the specified degree ``n``, order ``m``,
    and all derivatives up to order ``diff_n``.

    Returns a tuple of length ``diff_n + 1`` (if ``diff_n > 0``). The first
    entry corresponds to the spherical harmonics, the second entry
    (if ``diff_n >= 1``) to the gradient, and the third entry
    (if ``diff_n >= 2``)  to the Hessian matrix. Each entry is an array of
    shape ``(n + 1, 2 * m + 1, ...)``, where the entry at ``(i, j)``
    corresponds to degree ``i`` and order ``j`` for all ``0 <= i <= n``
    and ``-m <= j <= m``.

    See Also
    --------
    sph_harm_y
    c                 óX   • [        U SSS9n SU s=::  a  S::  d  O  [        SU  S35      eU $ )Nr‹   FrŽ   r   r�   z=diff_n is currently only implemented for orders 2, received: r’   r“   rŠ   s    r   r”   r”   P  r•   r!   c                 ó   • SSS/S/-   0$ )Nr    r   )r   r   éþÿÿÿr˜   r   rŠ   s    r   r”   r”   [  s   € à�R˜�H Ð/Ñ/Ð0Ð0r!   c                 óÞ   • US   n[        U [        R                  5      (       a  U S:  a  [        S5      eU S-   S[	        U5      -  S-   4[
        R                  " X#5      -   US-   US-   4-   4$ )Nr‹   r   r¢   r   r�   r¶   )r¦   r§   r¨   Ú	phi_shapert   r   r‹   s          r   r”   r”   `  sx   € à�HÑ€Fä�aœ×)Ñ)×*Ñ*¨q°1«uÜÐ<Ó=Ð=à�‰U�Aœ˜A›‘J ‘NÐ#¤b×&9Ò&9¸+Ó&QÑQØ	�!‰�V˜a‘ZÐ ñ!ð #ð #r!   c                 óê   • U R                   S   S:X  a  U S   $ U R                   S   S:X  a  U S   U SSS/SS/4   4$ U R                   S   S:X  a$  U S   U SSS/SS/4   U SSS/SS//SS/SS//4   4$ g rÄ   rÆ   r›   s    r   r”   r”   k  rÇ   r!   )r'   r£   Únumpyr%   Ú_input_validationr   Ú_special_ufuncsr   r   r   r	   Ú_gufuncsr
   r   r   r   Ú__all__r   rK   r”   rX   rQ   rU   rN   r   r!   r   Ú<module>rÓ      sÛ  ðÛ Û Û å 2÷:ó :÷;ó ;ò	€÷tñ tñn ØØð ð@ ñG$€ðN ×Ññó ðð ×&Ñ&ñ#ó 'ð#ñ  ØØðð ñ#Ð ð* ×!Ñ!ñó "ðð ×2Ñ2ñ)ó 3ð)ð ×0Ñ0ñDó 1ðDð ×*Ñ*ñ#ó +ð#ñ ØØð$ðH ˜E¨!ñO(Ð ðV ×Ññó  ðð ×.Ñ.ñó /ðð ×(Ñ(ñ#ó )ð#ñ "ØØðð ˜E¨!ñ#Ð ð* ×#Ñ#ñó $ðð ×2Ñ2ñó 3ðð ×4Ñ4ñ-ó 5ð-ð ×2Ñ2ñ	Ió 3ð	Ið ×,Ñ,ñ#ó -ð#ñ ØØðð8 ñ? €
ðF ×Ññ
ó ð
ð ×"Ñ"ñ#ó #ð#ñ ØØðð ñ€ð& ×Ññó ðð ×.Ñ.ñ#ó /ð#ð ×,Ñ,ñ8ó -ð8ð ×&Ñ&ñ#ó 'ð#ñ ØØð=ðz #¨1ñAA€
ðH ×Ññó ðð ×"Ñ"ñ	:ó #ð	:ñ ØØðð  #¨1ñ'€ð. ×Ññó ðð ×.Ñ.ñ1ó /ð1ð ×,Ñ,ñ#ó -ð#ð ×&Ñ&ñ	:ó 'ñ	:r!   