
    \h	                     ^    S r SSKJrJr  SSKJr  S/r " S S\5      rS\l        S \l	        g)zHermitian conjugation.    )Exprsympify)adjointDaggerc                   2    \ rS rSrSr\S 5       rSS jrSrg)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                 4    U R                   S   R                  $ )zHFind the kind of a dagger of something (just the kind of the something).r   )argskind)selfs    T/var/www/auris/envauris/lib/python3.13/site-packages/sympy/physics/quantum/dagger.pyr   Dagger.kindR   s     yy|       c                     [        US5      (       a  U(       a  UR                  5       $ [        US5      (       a6  [        US5      (       a%  U(       a  UR                  5       R                  5       $ [        R
                  " U [        U5      5      $ )Nr   	conjugate	transpose)hasattrr   r   r   r   __new__r   )clsargevaluates      r   r   Dagger.__new__W   sb    3	""x;;= S+&&73+D+D==?,,..||C..r    N)T)	__name__
__module____qualname____firstlineno____doc__propertyr   r   __static_attributes__r   r   r   r   r      s"    DL ! !/r   c                 D    SUR                  U R                  S   5      -  $ )Nz
Dagger(%s)r   )_printr
   )abs     r   <lambda>r%   _   s    ,!&&)1D"Dr   N)
r   
sympy.corer   r   $sympy.functions.elementary.complexesr   __all__r   r   
_sympyreprr   r   r   <module>r*      s;     $ 8 
Q/W Q/f  D r   