§
    OŠtj´	  ã                   óf   — d Z ddlmZmZ ddlmZ dgZ G d„ de¦  «        Zde_        d„ e_	        dS )zHermitian conjugation.é    )ÚExprÚsympify)ÚadjointÚDaggerc                   ó0   — e Zd ZdZed„ ¦   «         Zdd„ZdS )r   aÍ  General Hermitian conjugate operation.

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

    Take the Hermetian conjugate of an argument [1]_. For matrices this
    operation is equivalent to transpose and complex conjugate [2]_.

    Parameters
    ==========

    arg : Expr
        The SymPy expression that we want to take the dagger of.
    evaluate : bool
        Whether the resulting expression should be directly evaluated.

    Examples
    ========

    Daggering various quantum objects:

        >>> from sympy.physics.quantum.dagger import Dagger
        >>> from sympy.physics.quantum.state import Ket, Bra
        >>> from sympy.physics.quantum.operator import Operator
        >>> Dagger(Ket('psi'))
        <psi|
        >>> Dagger(Bra('phi'))
        |phi>
        >>> Dagger(Operator('A'))
        Dagger(A)

    Inner and outer products::

        >>> from sympy.physics.quantum import InnerProduct, OuterProduct
        >>> Dagger(InnerProduct(Bra('a'), Ket('b')))
        <b|a>
        >>> Dagger(OuterProduct(Ket('a'), Bra('b')))
        |b><a|

    Powers, sums and products::

        >>> A = Operator('A')
        >>> B = Operator('B')
        >>> Dagger(A*B)
        Dagger(B)*Dagger(A)
        >>> Dagger(A+B)
        Dagger(A) + Dagger(B)
        >>> Dagger(A**2)
        Dagger(A)**2

    Dagger also seamlessly handles complex numbers and matrices::

        >>> from sympy import Matrix, I
        >>> m = Matrix([[1,I],[2,I]])
        >>> m
        Matrix([
        [1, I],
        [2, I]])
        >>> Dagger(m)
        Matrix([
        [ 1,  2],
        [-I, -I]])

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Hermitian_adjoint
    .. [2] https://en.wikipedia.org/wiki/Hermitian_transpose
    c                 ó&   — | j         d         j        S )zHFind the kind of a dagger of something (just the kind of the something).r   )ÚargsÚkind)Úselfs    úZ/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/physics/quantum/dagger.pyr
   zDagger.kindR   s   € ð Œy˜Œ|Ô Ð ó    Tc                 ó"  — t          |d¦  «        r|r|                     ¦   «         S t          |d¦  «        r8t          |d¦  «        r(|r&|                     ¦   «                              ¦   «         S t	          j        | t          |¦  «        ¦  «        S )Nr   Ú	conjugateÚ	transpose)Úhasattrr   r   r   r   Ú__new__r   )ÚclsÚargÚevaluates      r   r   zDagger.__new__W   s…   € Ý�3˜	Ñ"Ô"ð 	/ xð 	/Ø—;’;‘=”=Ð Ý�S˜+Ñ&Ô&ð 	/­7°3¸Ñ+DÔ+Dð 	/Èð 	/Ø—=’=‘?”?×,Ò,Ñ.Ô.Ð.ÝŒ|˜C¥¨¡¤Ñ.Ô.Ð.r   N)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr
   r   © r   r   r   r      sP   € € € € € ðDð DðL ð!ð !ñ „Xð!ð/ð /ð /ð /ð /ð /r   c                 óH   — d|                      | j        d         ¦  «        z  S )Nz
Dagger(%s)r   )Ú_printr	   )ÚaÚbs     r   ú<lambda>r    _   s   €  ,°·²¸!¼&À¼)Ñ1DÔ1DÑ"D€ r   N)
r   Ú
sympy.corer   r   Ú$sympy.functions.elementary.complexesr   Ú__all__r   r   Ú
_sympyreprr   r   r   ú<module>r%      s�   ðØ Ð à $Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8ð ð€ð
Q/ð Q/ð Q/ð Q/ð Q/ˆWñ Q/ô Q/ð Q/ðf €Ô ØDÐD€Ô Ð Ð r   