+
    i                        ^ RI Ht ^ RIHtHt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 ^ R
IHtHtHt ^ RIHtHt ^ RIHt ^ RIHtHtH t H!t!H"t"H#t#H$t$ ^ RI%H&t& ^ RI'H(t( ^ RI)H*t* ^ RI+H,t,H-t- ^ RI.H/t/H0t0H1t1 ^ RI2H3t3 ]	! R4      w  t4t5t6t7]$! ^^ 4      t8]$! ^^4      t9]$! ^R&4      t:]! R4      t; ! R R]4      t<R t=R t>R t?R t@R tAR tBR tCR tDR  tER! tFR" tGR# tHR$ tIR%# )'    )Mul)IIntegerRational)S)symbols)sqrt)AntiCommutator)
Commutator)hbar)Dagger)HXGateIdentityGate)OperatorIdentityOperator)qapply)JxJyJzJplusJminusJ2JzKet)TensorProduct)Ket)Density)QubitQubitBra)BosonOpBosonFockKetBosonFockBra)warns_deprecated_sympyz	j j' m m'Ac                   &   a  ] tR t^ t o R tRtV tR# )Fooc                    V# )N )selfketoptionss   &&,e/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/physics/quantum/tests/test_qapply.py_apply_operator_JzKetFoo._apply_operator_JzKet!   s    
    r(   N)__name__
__module____qualname____firstlineno__r-   __static_attributes____classdictcell__)__classdict__s   @r,   r&   r&       s      r/   r&   c                     \        \        \        ,          4      \        \        ,          8X  g   Q h\        \        \
        ,          4      \        \        ,          \        ^4      ,          \        \        ,          \        ^4      ,          ,           8X  g   Q h\        \        \        ,           \
        ,          \        ^4      ,          4      \        \        ,          \        \        ,          ,           8X  g   Q h\        \        \        \        ,           ,          4      \        \        ,          \        \        ,          ,
          8X  g   Q h\        \        \        ,          \        \        ,          ,           4      \        \        ,          \        \        ,          ,
          8X  g   Q h\        \        \        ,          \        ,          4      ^\        ^,          ,          \        ,          8X  g   Q h\        \        ^,          \        ,          4      ^\        ^,          ,          \        ,          8X  g   Q h\        \        ^,          \        ^,          ,          \        ,          4      ^\        ^,          ,          \        ,          8X  g   Q hR#    N)
r   r   por   r   zr	   mor   r   r(   r/   r,   
test_basicr=   %   sU   "R%=DG###"Q$<4747?T"WT!W_<<<<56>1$T!W,-b471BBBB"b2g,47T"W#4444"R%"R%- DGd2g$5555&-"#qqy|333%(2+!D!G)B,...%(619$R'(AdAgIbL888r/   c                  |   \         P                  \        ,          \         ,          p \        \        \
        ,          V ,          4      \        \
        ,          V ,          8X  g   Q h\        \        \         ,          V ,          4      \        \
        ,          \        ^4      ,          \        \        ,          \        ^4      ,          ,           V ,          8X  g   Q h\        \        \        ,           \         ,          \        ^4      ,          V ,          4      \        \
        ,          V ,          \        \        ,          V ,          ,           8X  g   Q h\        \        \
        \        ,           ,          V ,          4      \        \
        ,          V ,          \        \        ,          V ,          ,
          8X  g   Q h\        \        \
        ,          V ,          \        \        ,          V ,          ,           4      \        \
        ,          V ,          \        \        ,          V ,          ,
          8X  g   Q h\        \        \        ,          \
        ,          V ,          4      ^\        ^,          ,          \        ,          V ,          8X  g   Q h\        \        ^,          \        ,          V ,          4      ^\        ^,          ,          \
        ,          V ,          8X  g   Q h\        \        ^,          \        ^,          ,          \
        ,          V ,          4      ^\        ^,          ,          \
        ,          V ,          8X  g   Q hR# r8   )r;   dualr$   r   r   r:   r   r   r	   r<   r   r   )extras    r,   
test_extrarA   0   s   FF1HQJE"R%+$r'%-///"Q$u*$r'$q'/DGDGO"CU!JJJJ	47"5(*-1"WU]T"WU]-JK K K"b2g,u$%bb)FFFF"R%+2e+,RR0MMMM&-"5()QtQwYr\%-????%(2+e#$$'	"U(::::%(619$R'-.!D!G)B,u2DDDDr/   c                  2   \        \        P                  \        ,          \        ,          R R7      \        \        P                  \        ,          ,          8X  g   Q h\        \        P                  \        ,          \        ,          4      \        8X  g   Q hR# )Fip_doitN)r   r:   r?   r   r   r(   r/   r,   test_innerproductrE   =   sO    "''"*R-/43DDDD"''"*R- D(((r/   c                  `    \        ^ 4      ^ 8X  g   Q h\        \        ^ 4      4      ^ 8X  g   Q hR# )r   N)r   r   r(   r/   r,   	test_zerorG   B   s)    !9>>'!*"""r/   c                      \        \        \        \        4      \        ,          \
        ,          4      \        \        ^,          ,          \
        ,          8X  g   Q h\        \        \        \        4      \        ,          \
        ,          4      ^ 8X  g   Q h\        \        \        \        R4      4      \
        ,          4      ^ 8X  g   Q h\        \        \        R4      \        4      \
        ,          4      ^ 8X  g   Q hR# )   FN)
r   r   r   r   r   r:   r   r   r   r&   r(   r/   r,   test_commutatorrK   G   s    *R$R'*+qqy|;;;*R$R'*+q000*RS*2-.!333*SXr*2-.!333r/   c                  .   \        \        \        \        R 4      4      \        ,          4      ^\
        ,          \        ,          8X  g   Q h\        \        \        R 4      \        4      \        ,          4      ^\
        ,          \        ,          8X  g   Q hR# )rJ   N)r   r
   r   r&   r:   r   r(   r/   r,   test_anticommutatorrM   N   sX    .SX.r12afRi???.S2.r12afRi???r/   c                     \         \        \        P                  ,          ,          \         ,          \        ,          p \	        V 4      \
        ^,          ) \        ,          8X  g   Q h\	        V RR7      \
        ^,          ) \        P                  \        ,          ,          \        ,          8X  g   Q h\	        V 4      P                  4       \
        ^,          ) \        ,          8X  g   Q hR# )r9   FrC   N)r   r<   r:   r?   r   r   doit)es    r,   test_outerproductrQ   S   s    
BrwwJ2A!9q###!U#ax'<R'????!9>>ax{***r/   c            	      .   \        R 4      p \        R4      p\        \        ^4      \        ^4      4      p\        \        ^ 4      \        ^ 4      4      p\        \        ^ 4      \        ^4      4      p\        \        ^ 4      \        ^ 4      4      p\        \        ^4      \        ^4      4      p\	        \        W^,          4      V,          4      \        ^4      V,          8X  g   Q h\	        \        V \        V4      V,          4      V,          4      ^V,          8X  g   Q h\	        V\        WV,          4      ,          RR7      \        ^4      V,          8X  g   Q h\	        Wb,          4      P                  4       \        P                  8X  g   Q h\	        \        WV,          4      V,          4      \        ^4      V,          8X  g   Q h\	        \        \        WV,          4      V,          4      RR7      \        ^4      \        V4      ,          8X  g   Q hR# )abTdaggerN)
r    r   r!   r"   r   r	   r   rO   r   One)rS   rT   ket1ket2ket3bra1bra2s          r,   test_tensorproductr]   Z   s   AAa,q/:Da,q/:Da,q/:Da,q/:Da,q/:D-6*T12d1gnDDD-6!9q=1D89QXEEE$qa%00"&q'D.1 1 1$+##%...-q5)D01T!Wt^CCC&qa%0478"&q'F4L"89 9 9r/   c                  "   \        \        ^ 4      4      \        \        ^ 4      4      ,          p \        \        ^4      4      \        ^4      ,          \        \        ^ 4      4      \        ^4      ,          ,           p\	        V RR7      V8X  g   Q hR# )r   TrU   N)r   r   r   r	   r   )lhsrhss     r,   test_daggerra   l   s`    
q
6!A$<
'C
q
47
"VE!H%5d1g%=
=C#d#s***r/   c                      \        R RR7      w  r\        W4      p\        R4      p\        V4      V8X  g   Q h\        VP                  V,          4      VP                  V,          8X  g   Q hR# )zx yF)commutativeBN)r   r   r   r   r?   )xyr$   rd   s       r,   test_issue_6073rg   r   sU    5e,DAA	AA!9>>!&&(qvvax'''r/   c                      \        \        \        ,          R .\        \        ,          R .4      p \	        V 4      \        \
        ) \        ,          R .\
        \        ,          R .4      8X  g   Q hR# )g      ?N)r   r   r<   r:   r   r   )ds    r,   test_densityrj   z   sI    Br"ucl+A!9$r3$r'3@@@@r/   c                  .   \        \        \        \        ^4      \        P                  4      ,          \        ^4      ,          \        \        \        P                  \        P                  4      ,          4      p \        \        P                  \        ^^4      ^\        P                  ,          \        ^,          4      pV\        \        ^R4      \        \        P                  \        P                  4      4      ,          p\        V 4      V8X  g   Q hR# )r9   N)r   r   r   r   NegativeOner	   Halfr   r   r   r   )expr1results     r,   test_issue3044rq      s    "U1Q466tAw>5PQPVPVCW@WXEA166	47CF
mE!BKqvvaff)=>>F%=F"""r/   c            	         \        ^ 4      \        R4      ,          p \        V 4      V 8X  g   Q h\        ^4      \	        ^ 4      ,          p \        V 4      V 8X  g   Q h\        \        ^ 4      \        \        ^ 4      \        ^ 4      4      \	        ^ 4      4      p\        V4      \        ^ 4      \	        ^ 4      ,          8X  g   Q h\        VRR7      p\        VRR7      \        ^4      8X  g   Q h\        ^ 4      \        ^ 4      \        ^ 4      ,          ,          \	        ^ 4      ,          p\        VRR7      pV\        ^4      8X  g   Q h\        4       ;_uu_ 4        \        \        ^4      \        4       ,          4      \        ^4      8X  g   Q h\        \        ^ 4      \        ^ 4      \        ^4      ,           ,          4      \        ^ 4      \        ^4      ,           8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r   rS   TrU   N)
r!   r    r   r   r   r   r   r#   r   r   )PP1P2s      r,   test_issue24158_ket_times_oprv      sd   Q'#,&A!9>>a58A!9>>	Xa[#hqk584eAh	?B":!uQx////	T	"B"t$333	!eAh.	/%(	:B	T	"B!		!	!hqk"2"445!DDDl1ouQx%(':;<a5QR8@SSSS 
"	!	!	!s   BG**G;	Nrl   )Jsympy.core.mulr   sympy.core.numbersr   r   r   sympy.core.singletonr   sympy.core.symbolr   (sympy.functions.elementary.miscellaneousr	   $sympy.physics.quantum.anticommutatorr
    sympy.physics.quantum.commutatorr   sympy.physics.quantum.constantsr   sympy.physics.quantum.daggerr   sympy.physics.quantum.gater   r   r   sympy.physics.quantum.operatorr   r   sympy.physics.quantum.qapplyr   sympy.physics.quantum.spinr   r   r   r   r   r   r   #sympy.physics.quantum.tensorproductr   sympy.physics.quantum.stater   sympy.physics.quantum.densityr   sympy.physics.quantum.qubitr   r   sympy.physics.quantum.bosonr    r!   r"   sympy.testing.pytestr#   jjpmmpr;   r:   r<   r$   r&   r=   rA   rE   rG   rK   rM   rQ   r]   ra   rg   rj   rq   rv   r(   r/   r,   <module>r      s     5 5 " % 9 ? 7 0 / = = E / K K K = + 1 7 K K 7 {#2q"	!QK
1a[
1b\SM( 
9
E)
#
4@
+9$+(A
#Tr/   