#NEWLINE# def test_3dpos( ) : #NEWLINE# #INDENT# assert ( Y . hilbert_space == L2 ( Interval ( S . NegativeInfinity , S . Infinity ) ) ) #NEWLINE# assert ( Z . hilbert_space == L2 ( Interval ( S . NegativeInfinity , S . Infinity ) ) ) #NEWLINE# test_ket = PositionKet3D ( x , y , z ) #NEWLINE# assert ( qapply ( ( X * test_ket ) ) == ( x * test_ket ) ) #NEWLINE# assert ( qapply ( ( Y * test_ket ) ) == ( y * test_ket ) ) #NEWLINE# assert ( qapply ( ( Z * test_ket ) ) == ( z * test_ket ) ) #NEWLINE# assert ( qapply ( ( ( X * Y ) * test_ket ) ) == ( ( x * y ) * test_ket ) ) #NEWLINE# assert ( qapply ( ( ( ( X * Y ) * Z ) * test_ket ) ) == ( ( ( x * y ) * z ) * test_ket ) ) #NEWLINE# assert ( qapply ( ( ( Y * Z ) * test_ket ) ) == ( ( y * z ) * test_ket ) ) #NEWLINE# assert ( PositionKet3D ( ) == test_ket ) #NEWLINE# assert ( YOp ( ) == Y ) #NEWLINE# assert ( ZOp ( ) == Z ) #NEWLINE# assert ( PositionKet3D . dual_class ( ) == PositionBra3D ) #NEWLINE# assert ( PositionBra3D . dual_class ( ) == PositionKet3D ) #NEWLINE# other_ket = PositionKet3D ( x_1 , y_1 , z_1 ) #NEWLINE# assert ( ( Dagger ( other_ket ) * test_ket ) . doit ( ) == ( ( DiracDelta ( ( x - x_1 ) ) * DiracDelta ( ( y - y_1 ) ) ) * DiracDelta ( ( z - z_1 ) ) ) ) #NEWLINE# assert ( test_ket . position_x == x ) #NEWLINE# assert ( test_ket . position_y == y ) #NEWLINE# assert ( test_ket . position_z == z ) #NEWLINE# assert ( other_ket . position_x == x_1 ) #NEWLINE# assert ( other_ket . position_y == y_1 ) #NEWLINE# assert ( other_ket . position_z == z_1 )