U
    	-e                     @   s  d Z ddlmZmZ 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 ddlmZ dd	lmZmZmZmZ dd
lmZmZ ddlmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% ddl&m'Z' ed\Z(Z)Z*Z+Z,Z-Z.Z/ed\Z0Z1Z2Z3dd Z4dd Z5dd Z6dS )zTests for cartesian.py    )Ipi)S)symbols)exp)sqrt)
DiracDelta)Interval)qapply	representL2Dagger)
Commutatorhbar)XOpYOpZOpPxOpXYZPxXKetXBraPxKetPxBraPositionKet3DPositionBra3D)DifferentialOperatorzx,y,z,x_1,x_2,x_3,y_1,z_1zpx py px_1 px_2c                  C   s  t jtttjtjksttt t	
 tt ks6ttt tt ttt ksVttt tksjttt tks~tttttt 
 ttt ksttttt 
 tt t t t tdt t  ksttttttt kstttttt t ks"tttjtks6ttt t  tttt  ks\ttt t  td tttt  ttt  kstttdt  ttt ksttt t  ttt ttt  ksttt t d} | tt tt!t"  t#t! kst| tt t  dks6t| tt t$dksNt| tt t$ dkshttt t$  t$dtt ttt"  t#t kstd S )N   yZbasis)%r   hilbert_spacer   r	   r   NegativeInfinityInfinityAssertionErrorr   r   doitr   r   r
   r   x
dual_classr   r   r    r   r   pxr   r   r   r   x_1positionr   x_2x_3r   px_1px_2r   r   )Zrep_p r0   k/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/physics/quantum/tests/test_cartesian.pytest_x   s<     ($ &
$

&r2   c                  C   s  t jtttjtjksttt t	t
 t
t	t
 ks<tt	t
 tksPttt t	ksdttt	tt	t
  tt
t kstttt	t
  ttt t
 t tdt t  ksttt	t
tt
t ksttt td} | t t ttt  tt kst| tt t dks4t| tt tdksLt| tt t dksfttt t  tdt t ttt  tt kstttdt  t  tdt t ttt   tt kstd S )Nr   r!   r    )!r   r"   r   r	   r   r#   r$   r%   r
   r   r)   r(   r   r'   r   pyr&   r   r   r   r   r   r   r   r   r.   r   r   r*   r,   r   r   r    )Zrep_xr0   r0   r1   test_p4   s(     ("(
r4   c                  C   s  t jtttjtjksttjtttjtjks8tt	t
tt} tt|  t
|  ks\ttt |  t|  kstttt|  t|  kstttt  |  t
t |  kstttt  t |  t
t t |  ksttt t |  tt |  kstt	 | kstt t kstt tks$tt	 tks6tt t	ksHtt	ttt}t||   tt
t ttt  ttt  kst| jt
kst| jtkst| jtkst|jtkst|jtkst|jtkstd S )N)r   r"   r   r	   r   r#   r$   r%   r   r   r'   r    zr
   r   r   r   r(   r   r*   y_1z_1r   r&   r   Z
position_xZ
position_yZ
position_z)Ztest_ketZ	other_ketr0   r0   r1   
test_3dposJ   s0     ( "
r8   N)7__doc__Zsympy.core.numbersr   r   Zsympy.core.singletonr   Zsympy.core.symbolr   Z&sympy.functions.elementary.exponentialr   Z(sympy.functions.elementary.miscellaneousr   Z'sympy.functions.special.delta_functionsr   Zsympy.sets.setsr	   Zsympy.physics.quantumr
   r   r   r   r   r   Zsympy.physics.quantum.cartesianr   r   r   r   r   r   r   r   r   r   r   r   r   r   Zsympy.physics.quantum.operatorr   r'   r    r5   r*   r,   r-   r6   r7   r)   r3   r.   r/   r2   r4   r8   r0   r0   r0   r1   <module>   s    @