+
    ‰°³jÑ  ã                   óZ   € ^RI HtHt ]RR l4       t]R 4       t]R 4       t]R 4       tR# )é   )ÚdefunÚdefun_wrappedNc                óØ  a aaaa	€ S P                  S4      oSf   S P                  oMS P                  S4      oS^ 8  d   \        R4      hSf   SoMS P                  S4      oS^ 8X  d"   S P                  ^ SS,           ,          ,           # SS P                  8H  pSS8H  pV'       d_   \	        S4      ^8¼  d5   V'       d"   SR8X  g   S^8X  d   S P
                  S,          # \        R4      hS^ 8X  d   S P                  S,
          # VP                  R^2S P                  ,          4      o	V'       d"   V'       d   V V	V3R lpS P                  V4      # VV V	VV3R lpS P                  V4      # )aK  
Evaluates the q-Pochhammer symbol (or q-rising factorial)

.. math ::

    (a; q)_n = \prod_{k=0}^{n-1} (1-a q^k)

where `n = \infty` is permitted if `|q| < 1`. Called with two arguments,
``qp(a,q)`` computes `(a;q)_{\infty}`; with a single argument, ``qp(q)``
computes `(q;q)_{\infty}`. The special case

.. math ::

    \phi(q) = (q; q)_{\infty} = \prod_{k=1}^{\infty} (1-q^k) =
        \sum_{k=-\infty}^{\infty} (-1)^k q^{(3k^2-k)/2}

is also known as the Euler function, or (up to a factor `q^{-1/24}`)
the Dedekind eta function.

**Examples**

If `n` is a positive integer, the function amounts to a finite product::

    >>> from mpmath import *
    >>> mp.dps = 25; mp.pretty = True
    >>> qp(2,3,5)
    -725305.0
    >>> fprod(1-2*3**k for k in range(5))
    -725305.0
    >>> qp(2,3,0)
    1.0

Complex arguments are allowed::

    >>> qp(2-1j, 0.75j)
    (0.4628842231660149089976379 + 4.481821753552703090628793j)

The regular Pochhammer symbol `(a)_n` is obtained in the
following limit as `q \to 1`::

    >>> a, n = 4, 7
    >>> limit(lambda q: qp(q**a,q,n) / (1-q)**n, 1)
    604800.0
    >>> rf(a,n)
    604800.0

The Taylor series of the reciprocal Euler function gives
the partition function `P(n)`, i.e. the number of ways of writing
`n` as a sum of positive integers::

    >>> taylor(lambda q: 1/qp(q), 0, 10)
    [1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 11.0, 15.0, 22.0, 30.0, 42.0]

Special values include::

    >>> qp(0)
    1.0
    >>> findroot(diffun(qp), -0.4)   # location of maximum
    -0.4112484791779547734440257
    >>> qp(_)
    1.228348867038575112586878

The q-Pochhammer symbol is related to the Jacobi theta functions.
For example, the following identity holds::

    >>> q = mpf(0.5)    # arbitrary
    >>> qp(q)
    0.2887880950866024212788997
    >>> root(3,-2)*root(q,-24)*jtheta(2,pi/6,root(q,6))
    0.2887880950866024212788997

zn cannot be negativez#q-function only defined for |q| < 1Úmaxtermsc               3   ó0  <"  € ^p V x € ^pSpS^,          p RV,          V,          x € RV,          V,          x € VS^V,          ^,           ,          ,          pVS^V,          ^,           ,          ,          pV^,          pVS8”  g   Ks  SP                   h5i©r   éÿÿÿÿ)ÚNoConvergence)ÚtÚkÚx1Úx2Úctxr   Úqs       €€€Ú\/home/luca/screen-checking/.venv/lib/python3.14/site-packages/mpmath/functions/qfunctions.pyÚtermsÚqp.<locals>.termsf   sŠ   øé € ØˆAØŠGØˆAØˆBØ�A•ˆBØØ˜A•g •lÒ"Ø˜A•g •lÒ"Ø�a˜!˜A�#˜a�%•jÕ �Ø�a˜!˜A�#˜a�%•jÕ �Ø�Q•�Ø�x–<Ø×+Ñ+Ð+ùs   ƒBBÂ
Bc               3   ó®   <"  € ^ p SP                   p ^SV,          ,
          x € VS,          pV ^,          p V S8¼  d   R# V S8”  g   K7  SP                  h5i)é    N)Úoner
   )r   ÚrÚar   r   Únr   s     €€€€€r   ÚfactorsÚqp.<locals>.factorsv   sS   øé € ØˆØ�G‰GˆØØ�a˜•c•'ŠMØ��FˆAØ��FˆAØ�AŒvÙØ�8Ž|Ø×'Ñ'Ð'ùs   ƒAAÁ	Ar	   )
ÚconvertÚinfÚ
ValueErrorr   ÚabsÚzeroÚgetÚprecÚsum_accuratelyÚmul_accurately)
r   r   r   r   ÚkwargsÚinfiniteÚsamer   r   r   s
   ffff,    @r   Úqpr(      s*  ü€ ðT 	�‰�A‹€AØ‚yØ�G‰G‰à�K‰K˜‹NˆØˆ1„uÜÐ/Ó0Ð0Ø‚yØ‰à�K‰K˜‹NˆØˆA„vØ�w‰w˜˜A˜a�C�Õ Ð Ø�S—W‘W‘€HØ�‰F€DßÜˆq‹6�QŒ;ß˜˜bœ A¨¤FØ—x‘x !•|Ð#ÜÐBÓCÐCØ�!ŒVØ—7‘7˜Q•;ÐØ�z‰z˜* b¨¯©¥kÓ2€Hß—D÷	,ð ×!Ñ! %Ó(Ð(÷
(ñ 
(ð ×Ñ˜gÓ&Ð&ó    c                óF  € \        V4      ^8”  dC   V P                  V^V,          4      W!^,
          V^,
          ,          R,          ,          ,          # V P                  ! W"R3/ VB V P                  ! W!,          VR3/ VB ,          ^V,
          ^V,
          ,          ,          # )a¦  
Evaluates the q-gamma function

.. math ::

    \Gamma_q(z) = \frac{(q; q)_{\infty}}{(q^z; q)_{\infty}} (1-q)^{1-z}.


**Examples**

Evaluation for real and complex arguments::

    >>> from mpmath import *
    >>> mp.dps = 25; mp.pretty = True
    >>> qgamma(4,0.75)
    4.046875
    >>> qgamma(6,6)
    121226245.0
    >>> qgamma(3+4j, 0.5j)
    (0.1663082382255199834630088 + 0.01952474576025952984418217j)

The q-gamma function satisfies a functional equation similar
to that of the ordinary gamma function::

    >>> q = mpf(0.25)
    >>> z = mpf(2.5)
    >>> qgamma(z+1,q)
    1.428277424823760954685912
    >>> (1-q**z)/(1-q)*qgamma(z,q)
    1.428277424823760954685912

g      à?N)r   Úqgammar(   )r   Úzr   r%   s   &&&,r   r+   r+   ƒ   s…   € ôD ˆ1ƒv�„zØ�z‰z˜!˜A˜a�CÓ  ¨¥c¨A¨a­C¥[°¥_Õ!5Õ5Ð5Ø�6Š6�!˜Ñ' Ñ'Ø�Šˆq�t�Q˜Ñ' Ñ'õ(Ø+,¨Q­3°!°Aµ#­,õ7ð 7r)   c                ó  € V P                  V4      '       dZ   V P                  V4      ^ 8”  dD   \        V P                  V4      4      pV P                  ! W"V3/ VB ^V,
          V,          ,          # V P                  ! V^,           V3/ VB # )a«  
Evaluates the q-factorial,

.. math ::

    [n]_q! = (1+q)(1+q+q^2)\cdots(1+q+\cdots+q^{n-1})

or more generally

.. math ::

    [z]_q! = \frac{(q;q)_z}{(1-q)^z}.

**Examples**

    >>> from mpmath import *
    >>> mp.dps = 25; mp.pretty = True
    >>> qfac(0,0)
    1.0
    >>> qfac(4,3)
    2080.0
    >>> qfac(5,6)
    121226245.0
    >>> qfac(1+1j, 2+1j)
    (0.4370556551322672478613695 + 0.2609739839216039203708921j)

)ÚisintÚ_reÚintr(   r+   )r   r,   r   r%   r   s   &&&, r   Úqfacr1   ª   sm   € ð: ‡y�y�‡|‚|˜Ÿ™ ›
 QœÜ�—‘˜“
‹OˆØ�vŠv�a˜AÑ( Ñ(¨A¨a­C°!­8Õ3Ð3Ø�:Š:�a˜•c˜1Ñ' Ñ'Ð'r)   c                ó¸  a aaaaaa€ S Uu. uF  pS P                  V4      NK  	  upoS Uu. uF  pS P                  V4      NK  	  upoS P                  S4      oS P                  S4      o\        S4      p\        S4      p	^V	,           V,
          oVP                  R^2S P                  ,          4      oVVV VVVV3R lp
S P	                  V
4      # u upi u upi )a–  
Evaluates the basic hypergeometric series or hypergeometric q-series

.. math ::

    \,_r\phi_s \left[\begin{matrix}
        a_1 & a_2 & \ldots & a_r \\
        b_1 & b_2 & \ldots & b_s
    \end{matrix} ; q,z \right] =
    \sum_{n=0}^\infty
    \frac{(a_1;q)_n, \ldots, (a_r;q)_n}
         {(b_1;q)_n, \ldots, (b_s;q)_n}
    \left((-1)^n q^{n\choose 2}\right)^{1+s-r}
    \frac{z^n}{(q;q)_n}

where `(a;q)_n` denotes the q-Pochhammer symbol (see :func:`~mpmath.qp`).

**Examples**

Evaluation works for real and complex arguments::

    >>> from mpmath import *
    >>> mp.dps = 25; mp.pretty = True
    >>> qhyper([0.5], [2.25], 0.25, 4)
    -0.1975849091263356009534385
    >>> qhyper([0.5], [2.25], 0.25-0.25j, 4)
    (2.806330244925716649839237 + 3.568997623337943121769938j)
    >>> qhyper([1+j], [2,3+0.5j], 0.25, 3+4j)
    (9.112885171773400017270226 - 1.272756997166375050700388j)

Comparing with a summation of the defining series, using
:func:`~mpmath.nsum`::

    >>> b, q, z = 3, 0.25, 0.5
    >>> qhyper([], [b], q, z)
    0.6221136748254495583228324
    >>> nsum(lambda n: z**n / qp(q,q,n)/qp(b,q,n) * q**(n*(n-1)), [0,inf])
    0.6221136748254495583228324

r   c               3   ó¦  <"  € S	P                   p V x € ^p^ p^p S F  p^WA,          ,
          pW,          p K  	  S F(  p^Wa,          ,
          pV'       g   \        hW,          p K*  	  V S,          p VRS
,          VS
,          ,          ,          pVS,          pV ^V,
          ,          p V^,          pW,          x € VS8”  g   K«  S	P                  h5ir   )r   r   r
   )r   Úqkr   Úxr   ÚpÚbÚa_sÚb_sr   Údr   r   r,   s          €€€€€€€r   r   Úqhyper.<locals>.terms  sÄ   øé € Ø�G‰GˆØŠØˆØˆØˆØÛ�Ø˜�•H�Ø•’ñ ó �Ø˜�•H�ßÜ$Ð$Ø•’ñ	 ð
 ��FˆAØ�"�q•˜2 �7Õ"Õ"ˆAØ�!�GˆBØ�!�b•&�MˆAØ��FˆAØ•%ŠKØ�8Ž|Ø×'Ñ'Ð'ùs   ƒB=CÃC)r   Úlenr!   r"   r#   )r   r8   r9   r   r,   r%   r   r7   r   Úsr   r:   r   s   fffff,     @@r   Úqhyperr>   Ì   s´   þ€ ñZ $'Ó
'¡3˜aˆ3�;‰;�qŽ>¡3Ñ
'€CÙ#&Ó
'¡3˜aˆ3�;‰;�qŽ>¡3Ñ
'€CØ�‰�A‹€AØ�‰�A‹€AÜˆC‹€AÜˆC‹€AØ	ˆ!�ˆA�€AØ�z‰z˜* b¨¯©¥kÓ2€H÷(ó (ð. ×Ñ˜eÓ$Ð$ùò? (ùÚ
's
   ŒC­C)NN)Ú	functionsr   r   r(   r+   r1   r>   © r)   r   Ú<module>rA      s]   ðß +àó}'ó ð}'ð~ ñ$7ó ð$7ðL ñ(ó ð(ðB ñK%ó òK%r)   