ó
    ‰*£hH  ã                  óÐ   • S SK Jr  SSKJr  SSKJrJrJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  S S	KJr  S S
KJrJr  S SKJr  S SKJrJr  S SKJr  S SKJrJr   " S S\5      rS r g)é    )Úannotationsé   )ÚExprWithIntLimits)ÚSumÚ	summationÚ)_dummy_with_inherited_properties_concrete)ÚExpr)Úfactor_terms)Ú
Derivative)ÚMul)ÚS)ÚDummyÚSymbol)ÚRisingFactorial)ÚexpÚlog)ÚKroneckerDelta)ÚquoÚrootsc                  ó¨   • \ rS rSr% SrSrS\S'   S rS r\	S 5       r
\
rS	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rSrg)ÚProducté   a§  
Represents unevaluated products.

Explanation
===========

``Product`` represents a finite or infinite product, with the first
argument being the general form of terms in the series, and the second
argument being ``(dummy_variable, start, end)``, with ``dummy_variable``
taking all integer values from ``start`` through ``end``. In accordance
with long-standing mathematical convention, the end term is included in
the product.

Finite products
===============

For finite products (and products with symbolic limits assumed to be finite)
we follow the analogue of the summation convention described by Karr [1],
especially definition 3 of section 1.4. The product:

.. math::

    \prod_{m \leq i < n} f(i)

has *the obvious meaning* for `m < n`, namely:

.. math::

    \prod_{m \leq i < n} f(i) = f(m) f(m+1) \cdot \ldots \cdot f(n-2) f(n-1)

with the upper limit value `f(n)` excluded. The product over an empty set is
one if and only if `m = n`:

.. math::

    \prod_{m \leq i < n} f(i) = 1  \quad \mathrm{for} \quad  m = n

Finally, for all other products over empty sets we assume the following
definition:

.. math::

    \prod_{m \leq i < n} f(i) = \frac{1}{\prod_{n \leq i < m} f(i)}  \quad \mathrm{for} \quad  m > n

It is important to note that above we define all products with the upper
limit being exclusive. This is in contrast to the usual mathematical notation,
but does not affect the product convention. Indeed we have:

.. math::

    \prod_{m \leq i < n} f(i) = \prod_{i = m}^{n - 1} f(i)

where the difference in notation is intentional to emphasize the meaning,
with limits typeset on the top being inclusive.

Examples
========

>>> from sympy.abc import a, b, i, k, m, n, x
>>> from sympy import Product, oo
>>> Product(k, (k, 1, m))
Product(k, (k, 1, m))
>>> Product(k, (k, 1, m)).doit()
factorial(m)
>>> Product(k**2,(k, 1, m))
Product(k**2, (k, 1, m))
>>> Product(k**2,(k, 1, m)).doit()
factorial(m)**2

Wallis' product for pi:

>>> W = Product(2*i/(2*i-1) * 2*i/(2*i+1), (i, 1, oo))
>>> W
Product(4*i**2/((2*i - 1)*(2*i + 1)), (i, 1, oo))

Direct computation currently fails:

>>> W.doit()
Product(4*i**2/((2*i - 1)*(2*i + 1)), (i, 1, oo))

But we can approach the infinite product by a limit of finite products:

>>> from sympy import limit
>>> W2 = Product(2*i/(2*i-1)*2*i/(2*i+1), (i, 1, n))
>>> W2
Product(4*i**2/((2*i - 1)*(2*i + 1)), (i, 1, n))
>>> W2e = W2.doit()
>>> W2e
4**n*factorial(n)**2/(2**(2*n)*RisingFactorial(1/2, n)*RisingFactorial(3/2, n))
>>> limit(W2e, n, oo)
pi/2

By the same formula we can compute sin(pi/2):

>>> from sympy import combsimp, pi, gamma, simplify
>>> P = pi * x * Product(1 - x**2/k**2, (k, 1, n))
>>> P = P.subs(x, pi/2)
>>> P
pi**2*Product(1 - pi**2/(4*k**2), (k, 1, n))/2
>>> Pe = P.doit()
>>> Pe
pi**2*RisingFactorial(1 - pi/2, n)*RisingFactorial(1 + pi/2, n)/(2*factorial(n)**2)
>>> limit(Pe, n, oo).gammasimp()
sin(pi**2/2)
>>> Pe.rewrite(gamma)
(-1)**n*pi**2*gamma(pi/2)*gamma(n + 1 + pi/2)/(2*gamma(1 + pi/2)*gamma(-n + pi/2)*gamma(n + 1)**2)

Products with the lower limit being larger than the upper one:

>>> Product(1/i, (i, 6, 1)).doit()
120
>>> Product(i, (i, 2, 5)).doit()
120

The empty product:

>>> Product(i, (i, n, n-1)).doit()
1

An example showing that the symbolic result of a product is still
valid for seemingly nonsensical values of the limits. Then the Karr
convention allows us to give a perfectly valid interpretation to
those products by interchanging the limits according to the above rules:

>>> P = Product(2, (i, 10, n)).doit()
>>> P
2**(n - 9)
>>> P.subs(n, 5)
1/16
>>> Product(2, (i, 10, 5)).doit()
1/16
>>> 1/Product(2, (i, 6, 9)).doit()
1/16

An explicit example of the Karr summation convention applied to products:

>>> P1 = Product(x, (i, a, b)).doit()
>>> P1
x**(-a + b + 1)
>>> P2 = Product(x, (i, b+1, a-1)).doit()
>>> P2
x**(a - b - 1)
>>> simplify(P1 * P2)
1

And another one:

>>> P1 = Product(i, (i, b, a)).doit()
>>> P1
RisingFactorial(b, a - b + 1)
>>> P2 = Product(i, (i, a+1, b-1)).doit()
>>> P2
RisingFactorial(a + 1, -a + b - 1)
>>> P1 * P2
RisingFactorial(b, a - b + 1)*RisingFactorial(a + 1, -a + b - 1)
>>> combsimp(P1 * P2)
1

See Also
========

Sum, summation
product

References
==========

.. [1] Michael Karr, "Summation in Finite Terms", Journal of the ACM,
       Volume 28 Issue 2, April 1981, Pages 305-350
       https://dl.acm.org/doi/10.1145/322248.322255
.. [2] https://en.wikipedia.org/wiki/Multiplication#Capital_Pi_notation
.. [3] https://en.wikipedia.org/wiki/Empty_product
© z tuple[tuple[Symbol, Expr, Expr]]Úlimitsc                ó:   • [         R                  " X/UQ70 UD6nU$ ©N)r   Ú__new__)ÚclsÚfunctionÚsymbolsÚassumptionsÚobjs        ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/concrete/products.pyr   ÚProduct.__new__Ä   s!   € Ü×'Ò'¨ÐO¸ÒOÀ;ÑOˆØˆ
ó    c                óf   • [        [        [        U R                  5      /U R                  Q76 5      $ r   )r   r   r   r   r   )ÚselfÚargsÚkwargss      r#   Ú_eval_rewrite_as_SumÚProduct._eval_rewrite_as_SumÈ   s$   € Ü”3”s˜4Ÿ=™=Ó)Ð8¨D¯K©KÒ8Ó9Ð9r%   c                ó    • U R                   S   $ )Nr   )Ú_args©r'   s    r#   ÚtermÚProduct.termË   s   € à�z‰z˜!‰}Ðr%   c                ó†   • U R                   (       a  gU R                  R                  nUSL a  gU R                  (       a  U$ g )NFT)Úhas_empty_sequencer/   Úis_zeroÚhas_finite_limits)r'   Úzs     r#   Ú_eval_is_zeroÚProduct._eval_is_zeroÐ   s:   € Ø×"×"Øà�I‰I×ÑˆØ�Š9ØØ×!×!àˆHð "r%   c                óR   • U R                   (       a  gU R                  R                  $ ©NT)r2   r   Úis_extended_realr.   s    r#   Ú_eval_is_extended_realÚProduct._eval_is_extended_realÛ   s   € Ø×"×"Øà�}‰}×-Ñ-Ð-r%   c                ó„   • U R                   (       a  gU R                  R                  (       a  U R                  (       a  gg g r9   )r2   r   Úis_positiver4   r.   s    r#   Ú_eval_is_positiveÚProduct._eval_is_positiveá   s/   € Ø×"×"ØØ�=‰=×$×$¨×)?×)?Øð *@Ð$r%   c                ó„   • U R                   (       a  gU R                  R                  (       a  U R                  (       a  gg g r9   )r2   r   Úis_nonnegativer4   r.   s    r#   Ú_eval_is_nonnegativeÚProduct._eval_is_nonnegativeç   s/   € Ø×"×"ØØ�=‰=×'×'¨D×,B×,BØð -CÐ'r%   c                ó`   • U R                   (       a  gU R                  R                  (       a  gg r9   )r2   r   Úis_extended_nonnegativer.   s    r#   Ú_eval_is_extended_nonnegativeÚ%Product._eval_is_extended_nonnegativeí   s#   € Ø×"×"ØØ�=‰=×0×0Øð 1r%   c                ó(   • U R                   (       a  gg r9   )r2   r.   s    r#   Ú_eval_is_extended_nonpositiveÚ%Product._eval_is_extended_nonpositiveó   s   € Ø×"×"Øð #r%   c                ó`   • U R                   (       a  U R                  R                  (       a  gg g r9   )r4   r   Ú	is_finiter.   s    r#   Ú_eval_is_finiteÚProduct._eval_is_finite÷   s"   € Ø×!×! d§m¡m×&=×&=Øð '>Ð!r%   c                ó’  • 0 nU R                    H  n[        U5      nU(       d  M  XBUS   '   M      U(       a™  UR                  5        VVs0 s H  u  pVXe_M	     nnnU R                  U5      R                  " S0 UD6n[        U[        5      (       a,  [        U V	s/ s H  o™R                  U5      PM     sn	5      nU$ UR                  U5      nU$ SSKJn
  U R                  n[        U R                   5       H‘  u  pÍUu  pžnXþ-
  nUR                  (       a  UR                  (       a  US-   US-
  pþSU-  nU R                  X¹Xï45      nUS [        R                  4;   a(  U R                   " U
" U5      /U R                   US  Q76 s  $ UnM“     UR#                  SS5      (       a  UR                  " S0 UD6$ U
" U5      $ s  snnf s  sn	f )Nr   )Úpowsimpr   ÚdeepTr   )r   r   ÚitemsÚxreplaceÚdoitÚ
isinstanceÚtupleÚsympy.simplify.powsimprQ   r   Ú	enumerateÚ
is_integerÚis_negativeÚ_eval_productr   ÚNaNÚfuncÚget)r'   ÚhintsÚrepsÚxabÚdÚkÚvÚundoÚdidÚirQ   ÚfÚindexÚlimitÚaÚbÚdifÚgs                     r#   rU   ÚProduct.doitû   s’  € ð ˆØ—;”;ˆCÜ9¸#Ó>ˆAßˆqØ �S˜‘V“ñ ö Ø%)§Z¡Z¤\Ô2¢\™T˜Q�A’D¡\ˆDÑ2Ø—-‘- Ó%×*Ò*Ñ3¨UÑ3ˆCÜ˜#œu×%Ñ%Ü±sÓ;²s°!ŸZ™Z¨Ö-±sÑ;Ó<�ð ˆJð —l‘l 4Ó(�ØˆJå2Ø�M‰MˆÜ% d§k¡kÖ2‰LˆEØ‰GˆA�!Ø‘%ˆCØ�~�~ #§/§/Ø˜1‘u˜a !™e�1Ø˜‘E�à×"Ñ" 1¨! iÓ0ˆAØ�Tœ1Ÿ5™5�MÓ!Ø—y’y¡¨£ÐB¨d¯k©k¸%¸&Ð.AÒBÒBà’ñ 3ð �9‰9�V˜T×"Ñ"Ø—6’6‘?˜E‘?Ð"á˜1“:Ðùó5 3ùò <s   ÁF>ÂGc                ól   • U R                   " U R                  R                  5       /U R                  Q76 $ r   )r^   r   Ú	conjugater   r.   s    r#   Ú_eval_conjugateÚProduct._eval_conjugate   s'   € Ø�yŠy˜Ÿ™×0Ñ0Ó2ÐA°T·[±[ÒAÐAr%   c                óH  • Uu  p4nX1R                   ;  a.  US-
  R                  (       a  [        R                  $ XU-
  S-   -  $ XE:X  a  UR	                  X45      $ SSKJnJn  UR                  [        5      (       a  U" XS   5      (       a  U" X5      $ XT-
  nUR                  n	U	(       a  US:  a  U R                  X5      $ UR                  U5      (       aá  UR                  U5      n
[        R                  =n=pÍ[        U
5      nSnUR                  5        H/  u  nnUU-  nU[!        UU-
  XT-
  S-   5      U-  -  nXÕU-
  U-  -  nM1     XúR#                  5       :  a<  [%        X­R                  U5      5      nU R'                  UX4U45      R)                  5       nU
R+                  5       XT-
  S-   -  U-  U-  $ UR,                  (       a1  [/        USS9nUR0                  (       a  U R3                  UX4U45      $ GOUR0                  (       Ga  UR5                  U5      u  nn[7        U5      S:¼  a™  / / nnU H>  nU R3                  UX4U45      nUb  UR9                  U5        M-  UR9                  U5        M@     U(       d  g UR:                  " U6 n[=        U6 nU R'                  UX4U45      R)                  5       nUXT-
  S-   -  U-  U-  $ U R3                  US   X4U45      nUc%  U R'                  US   X4U45      R)                  5       nUXT-
  S-   -  U-  $ UR>                  (       a˜  UR@                  R                  U5      (       d'  [C        URD                  X4U45      nUR@                  U-  $ URD                  R                  U5      (       d0  U R3                  UR@                  X4U45      nUb  UURD                  -  $ ON[G        U[H        5      (       a9  UR)                  5       nU R3                  UU5      nUc  U R'                  UU5      $ U$ U	(       a  U R                  X5      $ g )Nr   )ÚdeltaproductÚ_has_simple_deltar   éd   T)Úfractioné   )%Úfree_symbolsr3   r   ÚOneÚsubsÚdeltarv   rw   Úhasr   Ú
is_IntegerÚ_eval_product_directÚis_polynomialÚas_polyr   rS   r   Údegreer   r^   rU   ÚLCÚis_Addr
   Úis_Mulr\   Úas_coeff_mulÚlenÚappendÚ_new_rawargsr   Úis_PowÚbaser   r   rV   r   )r'   r/   r   rd   rl   Únrv   rw   rn   ÚdefiniteÚpolyÚAÚBÚQÚ	all_rootsÚMÚrÚmÚargÚfactoredÚ	without_kÚwith_kÚexcludeÚincludeÚtÚpÚsÚ	evaluatedri   s                                r#   r\   ÚProduct._eval_product#  sÃ  € à‰	ˆˆqà×%Ñ%Ó%Ø�q‘×!×!Ü—u‘u�Ø˜a™% !™)Ñ$Ð$à‹6Ø—9‘9˜Q“?Ð"ç:Ø�8‰8”N×#Ñ#Ñ(9¸$ÀqÁ	×(JÑ(JÙ Ó-Ð-à‰eˆØ—>‘>ˆÞ˜˜s›Ø×,Ñ,¨TÓ:Ð:à×Ñ ×"Ñ"Ø—<‘< “?ˆDäŸ™ÐˆAÐ�ä˜d›ˆIàˆAØ!Ÿ™Ö)‘��1Ø�Q‘�Ø”_ Q¨¡U¨A©E°A©IÓ6¸Ñ9Ñ9�Ø˜!‘e˜a‘Z‘’ñ *ð
 —;‘;“=Ó Ü˜$§	¡	¨!£Ó-�Ø—I‘I˜c A¨! 9Ó-×2Ñ2Ó4�à—7‘7“9˜q™u q™yÑ)¨AÑ-°Ñ1Ð1à�[�[Ü# D°4Ñ8ˆHØ��Ø×)Ñ)¨(°Q¸1°IÓ>Ð>ñ ð �[�[ˆ[à $× 1Ñ 1°!Ó 4ÑˆI�vä�6‹{˜aÓà#% r˜�Û�AØ×*Ñ*¨1¨q°Q¨iÓ8�Aà‘}ØŸ™ qÖ)àŸ™ qÖ)ñ  ö Øà×+Ò+¨WÐ5�CÜ˜W˜�AØŸ	™	 #¨¨a yÓ1×6Ñ6Ó8�AØ$ q¡u¨q¡yÑ1°!Ñ3°aÑ7Ð7ð ×&Ñ& v¨a¡y°1¸°)Ó<�Ø‘9ØŸ	™	 &¨¡)¨a°A¨YÓ7×<Ñ<Ó>�AØ  1¡5¨1¡9Ñ-¨aÑ/Ð/ð �[�[Ø—9‘9—=‘= ×#Ñ#Ü˜dŸh™h¨¨q¨	Ó2�à—y‘y !‘|Ð#Ø—X‘X—\‘\ !—_‘_Ø×&Ñ& t§y¡y°1¸°)Ó<�à‘=Ø˜dŸh™h™;Ð&øä˜œg×&Ñ&ØŸ	™	›ˆIØ×"Ñ" 9¨fÓ5ˆAØ‰yØ—y‘y ¨FÓ3Ð3à�æØ×,Ñ,¨TÓ:Ð:ð r%   c                óX   • SSK Jn  U" U 40 UD6nUS   (       a  UR                  5       $ U$ )Nr   )Úproduct_simplifyrU   )Úsympy.simplify.simplifyr¤   rU   )r'   r)   r¤   Úrvs       r#   Ú_eval_simplifyÚProduct._eval_simplify„  s+   € Ý<Ù˜dÑ- fÑ-ˆØ" 6ŸNˆr�w‰w‹yÐ2°Ð2r%   c                ó�   • U R                   (       a5  U R                  " U R                  R                  5       /U R                  Q76 $ g r   )Úis_commutativer^   r   Ú	transposer   r.   s    r#   Ú_eval_transposeÚProduct._eval_transpose‰  s3   € Ø××Ø—9’9˜TŸ]™]×4Ñ4Ó6ÐE¸¿¹ÒEÐEØr%   c           
     ó†   • Uu  p4n[        [        XT-
  S-   5       Vs/ s H  oaR                  X4U-   5      PM     sn6 $ s  snf )Nr   )r   Úranger}   )r'   r/   r   rd   rl   rŽ   rh   s          r#   r�   ÚProduct._eval_product_directŽ  s@   € Ø‰	ˆˆqÜ´%¸¹À¹	Ô2BÓCÒ2B¨Q—Y‘Y˜q a¡%Ö(Ñ2BÑCÐDÐDùÒCs   �>c           	     óð  • [        U[        5      (       a  XR                  ;  a  [        R                  $ U R
                  [        U R                  5      p2UR                  S5      nU(       a  U R                  " U/UQ76 nUu  pVnXR                  ;   d  XR                  ;   a  g [        5       n[        [        X%XhS-
  45      [        X%US-   U45      -  [        X!SS9R                  XX5      -  X†U45      n	U	$ )Néÿÿÿÿr   T)Úevaluate)rV   r   r{   r   ÚZeror   Úlistr   Úpopr^   r   r   r   r   r}   )
r'   Úxri   r   rk   rh   rl   rm   Úhr¦   s
             r#   Ú_eval_derivativeÚProduct._eval_derivative’  sÖ   € Ü�aœ× Ñ  Q×.?Ñ.?Ó%?Ü—6‘6ˆMØ—M‘M¤4¨¯©Ó#4ˆ6Ø—
‘
˜2“ˆÞØ—	’	˜!Ð%˜fÒ%ˆAØ‰ˆˆaØ—‘Ó !§~¡~Ó"5ØÜ‹GˆÜ”'˜! ¨¡E˜]Ó+¬g°a¸QÀ¹UÀA¸Ó.GÑGÌ*ÐUVÐdhÑJi×JnÑJnÐopÓJtÑtÐwxÐ}~Ðvó  AˆØˆ	r%   c                ó:  • U R                   n[        U5      nU R                  n [        U/UQ76 R	                  5       nU$ ! [
         aO    [        US-
  /UQ76 R                  5       [        R                  L a  [        R                  s $ [        SU-  5      ef = f)a]  
See docs of :obj:`.Sum.is_convergent()` for explanation of convergence
in SymPy.

Explanation
===========

The infinite product:

.. math::

    \prod_{1 \leq i < \infty} f(i)

is defined by the sequence of partial products:

.. math::

    \prod_{i=1}^{n} f(i) = f(1) f(2) \cdots f(n)

as n increases without bound. The product converges to a non-zero
value if and only if the sum:

.. math::

    \sum_{1 \leq i < \infty} \log{f(n)}

converges.

Examples
========

>>> from sympy import Product, Symbol, cos, pi, exp, oo
>>> n = Symbol('n', integer=True)
>>> Product(n/(n + 1), (n, 1, oo)).is_convergent()
False
>>> Product(1/n**2, (n, 1, oo)).is_convergent()
False
>>> Product(cos(pi/n), (n, 1, oo)).is_convergent()
True
>>> Product(exp(-n**2), (n, 1, oo)).is_convergent()
False

References
==========

.. [1] https://en.wikipedia.org/wiki/Infinite_product
r   zJThe algorithm to find the product convergence of %s is not yet implemented)	r   r   r   r   Úis_convergentÚNotImplementedErrorÚis_absolutely_convergentr   Útrue)r'   Úsequence_termÚlog_sumÚlimÚis_convs        r#   r¼   ÚProduct.is_convergent   s¤   € ð` Ÿ™ˆÜ�mÓ$ˆØ�k‰kˆð	TÜ˜'Ð( CÒ(×6Ñ6Ó8ˆGð ˆøô #ó 	TÜ�= 1Ñ$Ð+ sÒ+×DÑDÓFÌ!Ï&É&ÒPÜ—v‘v’Ü%ð 'AØDQñ'Só Tð Tð	Tús   ¥A ÁABÂBc                óh  • [        U5      n[        U5       H/  u  p4[        U[        5      (       a  M  U R	                  U5      X#'   M1     Sn/ n[        U R
                  5       H4  u  p7UnX2;   a  U* nUS   US   S-   US   S-
  4nUR                  U5        M6     [        U R                  U-  /UQ76 $ )a¸  
Reverse the order of a limit in a Product.

Explanation
===========

``reverse_order(expr, *indices)`` reverses some limits in the expression
``expr`` which can be either a ``Sum`` or a ``Product``. The selectors in
the argument ``indices`` specify some indices whose limits get reversed.
These selectors are either variable names or numerical indices counted
starting from the inner-most limit tuple.

Examples
========

>>> from sympy import gamma, Product, simplify, Sum
>>> from sympy.abc import x, y, a, b, c, d
>>> P = Product(x, (x, a, b))
>>> Pr = P.reverse_order(x)
>>> Pr
Product(1/x, (x, b + 1, a - 1))
>>> Pr = Pr.doit()
>>> Pr
1/RisingFactorial(b + 1, a - b - 1)
>>> simplify(Pr.rewrite(gamma))
Piecewise((gamma(b + 1)/gamma(a), b > -1), ((-1)**(-a + b + 1)*gamma(1 - a)/gamma(-b), True))
>>> P = P.doit()
>>> P
RisingFactorial(a, -a + b + 1)
>>> simplify(P.rewrite(gamma))
Piecewise((gamma(b + 1)/gamma(a), a > 0), ((-1)**(-a + b + 1)*gamma(1 - a)/gamma(-b), True))

While one should prefer variable names when specifying which limits
to reverse, the index counting notation comes in handy in case there
are several symbols with the same name.

>>> S = Sum(x*y, (x, a, b), (y, c, d))
>>> S
Sum(x*y, (x, a, b), (y, c, d))
>>> S0 = S.reverse_order(0)
>>> S0
Sum(-x*y, (x, b + 1, a - 1), (y, c, d))
>>> S1 = S0.reverse_order(1)
>>> S1
Sum(x*y, (x, b + 1, a - 1), (y, d + 1, c - 1))

Of course we can mix both notations:

>>> Sum(x*y, (x, a, b), (y, 2, 5)).reverse_order(x, 1)
Sum(x*y, (x, b + 1, a - 1), (y, 6, 1))
>>> Sum(x*y, (x, a, b), (y, 2, 5)).reverse_order(y, x)
Sum(x*y, (x, b + 1, a - 1), (y, 6, 1))

See Also
========

sympy.concrete.expr_with_intlimits.ExprWithIntLimits.index,
reorder_limit,
sympy.concrete.expr_with_intlimits.ExprWithIntLimits.reorder

References
==========

.. [1] Michael Karr, "Summation in Finite Terms", Journal of the ACM,
       Volume 28 Issue 2, April 1981, Pages 305-350
       https://dl.acm.org/doi/10.1145/322248.322255

r   r   rz   )	rµ   rY   rV   Úintrj   r   rŠ   r   r   )	ÚexprÚindicesÚ	l_indicesrh   ÚindxÚer   rk   Úls	            r#   Úreverse_orderÚProduct.reverse_orderÜ  sµ   € ôJ ˜“Mˆ	ä  Ö+‰GˆAÜ˜d¤C×(Ó(Ø#Ÿz™z¨$Ó/�	“ñ ,ð ˆØˆÜ! $§+¡+Ö.‰HˆAØˆAØ‹~Ø�B�Ø˜1‘X˜u Q™x¨!™|¨U°1©X¸©\Ð:�Ø�M‰M˜!Öñ /ô �t—}‘}¨Ñ)Ð3¨FÒ3Ð3r%   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__Ú__annotations__r   r*   Úpropertyr/   r   r6   r;   r?   rC   rG   rJ   rN   rU   rs   r\   r§   r¬   r�   r¹   r¼   rÍ   Ú__static_attributes__r   r%   r#   r   r      s�   ‡ ñlð\ €Ià,Ó,òò:ð ñó ðà€Hò	ò.òòòòòò#òJBò_;òB3ò
ò
Eòò:õxT4r%   r   c                 ód   • [        U 0 UD6n[        U[         5      (       a  UR                  SS9$ U$ )a(  
Compute the product.

Explanation
===========

The notation for symbols is similar to the notation used in Sum or
Integral. product(f, (i, a, b)) computes the product of f with
respect to i from a to b, i.e.,

::

                                 b
                               _____
    product(f(n), (i, a, b)) = |   | f(n)
                               |   |
                               i = a

If it cannot compute the product, it returns an unevaluated Product object.
Repeated products can be computed by introducing additional symbols tuples::

Examples
========

>>> from sympy import product, symbols
>>> i, n, m, k = symbols('i n m k', integer=True)

>>> product(i, (i, 1, k))
factorial(k)
>>> product(m, (i, 1, k))
m**k
>>> product(i, (i, 1, k), (k, 1, n))
Product(factorial(k), (k, 1, n))

F)rR   )r   rV   rU   )r(   r)   Úprods      r#   ÚproductrÚ   3  s7   € ôJ �DÐ#˜FÑ#€Dä�$œ× Ñ Ø�y‰y˜eˆyÐ$Ð$àˆr%   N)!Ú
__future__r   Úexpr_with_intlimitsr   Ú
summationsr   r   r   Úsympy.core.exprr	   Úsympy.core.exprtoolsr
   Úsympy.core.functionr   Úsympy.core.mulr   Úsympy.core.singletonr   Úsympy.core.symbolr   r   Ú(sympy.functions.combinatorial.factorialsr   Ú&sympy.functions.elementary.exponentialr   r   Ú(sympy.functions.special.tensor_functionsr   Úsympy.polysr   r   r   rÚ   r   r%   r#   Ú<module>rè      sD   ðÝ "å 2ß QÑ QÝ  Ý -Ý *Ý Ý "ß +Ý Dß ;Ý Cß "ô_4Ðô _4óD*r%   