§
    OŠtj]  ã                   ó^   — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	  G d„ de	¦  «        Z
dS )	é    )ÚIndexed)ÚTuple)ÚDummy)Úsympify)ÚIntegralc                   ó>   ‡ — e Zd ZdZd„ Zˆ fd„Zed„ ¦   «         Zˆ xZS )ÚIndexedIntegrala/  
    Experimental class to test integration by indexed variables.

    Usage is analogue to ``Integral``, it simply adds awareness of
    integration over indices.

    Contraction of non-identical index symbols referring to the same
    ``IndexedBase`` is not yet supported.

    Examples
    ========

    >>> from sympy.sandbox.indexed_integrals import IndexedIntegral
    >>> from sympy import IndexedBase, symbols
    >>> A = IndexedBase('A')
    >>> i, j = symbols('i j', integer=True)
    >>> ii = IndexedIntegral(A[i], A[i])
    >>> ii
    Integral(_A[i], _A[i])
    >>> ii.doit()
    A[i]**2/2

    If the indices are different, indexed objects are considered to be
    different variables:

    >>> i2 = IndexedIntegral(A[j], A[i])
    >>> i2
    Integral(A[j], _A[i])
    >>> i2.doit()
    A[i]*A[j]
    c                 ó  — t                                |¦  «        \  }}t          |¦  «        }|                     |¦  «        }t	          j        | |g|¢R i |¤Ž}||_        d„ |                     ¦   «         D ¦   «         |_        |S )Nc                 ó   — i | ]\  }}||“Œ	S © r   )Ú.0ÚkeyÚvals      ú]/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/sandbox/indexed_integrals.pyú
<dictcomp>z+IndexedIntegral.__new__.<locals>.<dictcomp>/   s   € Ð$KÐ$KÐ$K±(°#°s S¨#Ð$KÐ$KÐ$Kó    )	r	   Ú_indexed_process_limitsr   Úxreplacer   Ú__new__Ú_indexed_replÚitemsÚ_indexed_reverse_repl)ÚclsÚfunctionÚlimitsÚassumptionsÚreplÚobjs         r   r   zIndexedIntegral.__new__)   s†   € Ý&×>Ò>¸vÑFÔF‰ˆˆfÝ˜8Ñ$Ô$ˆØ×$Ò$ TÑ*Ô*ˆÝÔ˜s HÐE¨vÐEÐEÐE¸ÐEÐEˆØ ˆÔØ$KÐ$K¸d¿jºj¹l¼lÐ$KÑ$KÔ$KˆÔ!Øˆ
r   c                 óx   •— t          ¦   «                              ¦   «         }|                     | j        ¦  «        S )N)ÚsuperÚdoitr   r   )ÚselfÚresÚ	__class__s     €r   r!   zIndexedIntegral.doit2   s)   ø€ Ý‰gŒg�lŠl‰nŒnˆØ�|Š|˜DÔ6Ñ7Ô7Ð7r   c                 ó`  — i }g }| D ]¤}t          |t          t          t          f¦  «        r|d         }|dd …         }n|}d}t          |t          ¦  «        r?||vr!t          t          |¦  «        ¦  «        }|||<   |                     |f|z   ¦  «         Œ�|                     |¦  «         Œ¥||fS )Nr   é   r   )Ú
isinstanceÚtupleÚlistr   r   r   ÚstrÚappend)r   r   Ú	newlimitsÚiÚvÚvrestÚrs          r   r   z'IndexedIntegral._indexed_process_limits6   sÉ   € àˆØˆ	Øð 	$ð 	$ˆAÝ˜!�e¥T­5Ð1Ñ2Ô2ð Ø�a”D�Ø˜!˜"˜"œ��à�Ø�Ý˜!�WÑ%Ô%ð $Ø˜D�=�=Ý�c !™fœf™œ�AØ�D˜‘GØ× Ò  !  e¡Ñ,Ô,Ð,Ð,à× Ò  Ñ#Ô#Ð#Ð#Ø�YˆÐr   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r!   Ústaticmethodr   Ú__classcell__)r$   s   @r   r	   r	      sm   ø€ € € € € ðð ð@ð ð ð8ð 8ð 8ð 8ð 8ð ðð ñ „\ðð ð ð ð r   r	   N)Úsympy.tensorr   Úsympy.core.containersr   Úsympy.core.symbolr   Úsympy.core.sympifyr   Úsympy.integrals.integralsr   r	   r   r   r   ú<module>r<      s�   ðØ  Ð  Ð  Ð  Ð  Ð  Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø #Ð #Ð #Ð #Ð #Ð #Ø &Ð &Ð &Ð &Ð &Ð &Ø .Ð .Ð .Ð .Ð .Ð .ð@ð @ð @ð @ð @�hñ @ô @ð @ð @ð @r   