+
    i                         R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHtHt R	.t ! R
 R	]4      t]P(                  P+                  ]]4      R 4       tR# )z+The anti-commutator: ``{A,B} = A*B + B*A``.)Expr)KindDispatcher)Mul)Integer)S)
prettyForm)Dagger)_OperatorKindOperatorKindAntiCommutatorc                      a  ] tR t^t o RtRt]! RRR7      t]R 4       t	R t
]R 4       tR	 tR
 tR tR tR tR tRtV tR# )r   ar  The standard anticommutator, in an unevaluated state.

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

Evaluating an anticommutator is defined [1]_ as: ``{A, B} = A*B + B*A``.
This class returns the anticommutator in an unevaluated form.  To evaluate
the anticommutator, use the ``.doit()`` method.

Canonical ordering of an anticommutator is ``{A, B}`` for ``A < B``. The
arguments of the anticommutator are put into canonical order using
``__cmp__``. If ``B < A``, then ``{A, B}`` is returned as ``{B, A}``.

Parameters
==========

A : Expr
    The first argument of the anticommutator {A,B}.
B : Expr
    The second argument of the anticommutator {A,B}.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.quantum import AntiCommutator
>>> from sympy.physics.quantum import Operator, Dagger
>>> x, y = symbols('x,y')
>>> A = Operator('A')
>>> B = Operator('B')

Create an anticommutator and use ``doit()`` to multiply them out.

>>> ac = AntiCommutator(A,B); ac
{A,B}
>>> ac.doit()
A*B + B*A

The commutator orders it arguments in canonical order:

>>> ac = AntiCommutator(B,A); ac
{A,B}

Commutative constants are factored out:

>>> AntiCommutator(3*x*A,x*y*B)
3*x**2*y*{A,B}

Adjoint operations applied to the anticommutator are properly applied to
the arguments:

>>> Dagger(AntiCommutator(A,B))
{Dagger(A),Dagger(B)}

References
==========

.. [1] https://en.wikipedia.org/wiki/Commutator
FAntiCommutator_kind_dispatcherT)commutativec                H    R  V P                    4       pV P                  ! V!  # )c              3   8   "   T F  qP                   x  K  	  R # 5iN)kind).0as   & b/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/physics/quantum/anticommutator.py	<genexpr>&AntiCommutator.kind.<locals>.<genexpr>X   s     /YVVYs   )args_kind_dispatcher)self	arg_kindss   & r   r   AntiCommutator.kindV   s!    /TYY/	$$i00    c                b    V P                  W4      pVe   V# \        P                  ! WV4      pV# r   )evalr   __new__)clsABrobjs   &&&  r   r    AntiCommutator.__new__[   s.    HHQN=Hll31%
r   c           	     &   V'       d	   V'       g   \         P                  # W8X  d   \        ^4      V^,          ,          # VP                  '       g   VP                  '       d   \        ^4      V,          V,          # VP	                  4       w  r4VP	                  4       w  rVW5,           pV'       dC   \        \        V!  V ! \
        P                  ! V4      \
        P                  ! V4      4      4      # VP                  V4      ^8X  d	   V ! W!4      # R# )   N)r   Zeror   is_commutativeargs_cncr   
_from_argscompare)r!   r   bcancacbncbc_parts   &&&     r   r   AntiCommutator.evalb   s    a66M61:ad?"q///1:a<>! **,**,sF|S)<cnnS>Q%RSS 99Q<1q9 r   c                   ^ RI Hp V P                  ^ ,          pV P                  ^,          p\        W24      '       d<   \        WB4      '       d+    VP                  ! V3/ VB pTe   TP                  ! R/ TB # W4,          WC,          ,           P                  ! R/ VB #   \
         d,     TP                  ! T3/ TB p L\  \
         d    Rp  Lli ; ii ; i)zEvaluate anticommutator )OperatorN )sympy.physics.quantum.operatorr6   r   
isinstance_eval_anticommutatorNotImplementedErrordoit)r   hintsr6   r"   r#   comms   &,    r   r<   AntiCommutator.doitw   s     	<IIaLIIaLa""z!'>'> --a959 yy)5))ac	(%(( '   11!=u=D*  D  s*   B C*B??CCCCc                    \        \        V P                  ^ ,          4      \        V P                  ^,          4      4      # )    )r   r   r   )r   s   &r   _eval_adjointAntiCommutator._eval_adjoint   s)    fTYYq\2F499Q<4HIIr   c                    V P                   P                  : R VP                  V P                  ^ ,          4      : RVP                  V P                  ^,          4      : R2# )(,))	__class____name___printr   r   printerr   s   &&*r   
_sympyreprAntiCommutator._sympyrepr   sC    NN##W^^		!&&~~diil;
 	
r   c                    R VP                  V P                  ^ ,          4      : RVP                  V P                  ^,          4      : R2# ){rF   })rJ   r   rK   s   &&*r   	_sympystrAntiCommutator._sympystr   s5    NN499Q<('..1*FH 	Hr   c                <   VP                   ! V P                  ^ ,          .VO5!  p\        VP                  \        R4      4      !  p\        VP                  VP                   ! V P                  ^,          .VO5!  4      !  p\        VP	                  RRR7      !  pV# )rA   rF   rP   rQ   )leftright)rJ   r   r   rV   parens)r   rL   r   pforms   &&* r   _prettyAntiCommutator._pretty   sy    tyy|3d3EKK
389EKKtyy|(Kd(KLMELLcL=>r   c           
         R \        V P                   Uu. uF  q1P                  ! V.VO5!  NK  	  up4      ,          # u upi )z\left\{%s,%s\right\})tupler   rJ   )r   rL   r   args   &&* r   _latexAntiCommutator._latex   sB    )E26))3=2;3NN3&&)3= -> > 	> 3=s   >
r7   N)rI   
__module____qualname____firstlineno____doc__r*   r   r   propertyr   r    classmethodr   r<   rB   rM   rR   rY   r^   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sq     :v N%&FTXY1 1  ()&J
H> >r   c                    \         # )z8Find the kind of an anticommutator of two OperatorKinds.)r
   )e1e2s   &&r   find_op_kindrl      s
     r   N)rc   sympy.core.exprr   sympy.core.kindr   sympy.core.mulr   sympy.core.numbersr   sympy.core.singletonr    sympy.printing.pretty.stringpictr   sympy.physics.quantum.daggerr   sympy.physics.quantum.kindr	   r
   __all__r   r   registerrl   r7   r   r   <module>rw      sc    1   *  & " 7 / B J>T J>Z   ))-G Hr   