Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(18)  |  Call(13)  |  Derive(0)  |  Import(5)
1D cartesian momentum operator.

src/s/y/sympy-HEAD/sympy/physics/quantum/operatorset.py   sympy(Download)
from __future__ import print_function, division
 
from sympy.physics.quantum.cartesian import (XOp, YOp, ZOp, XKet, PxOp, PxKet,
                                             PositionKet3D)
from sympy.physics.quantum.operator import Operator

src/s/y/sympy-HEAD/sympy/core/tests/test_args.py   sympy(Download)
def test_sympy__physics__quantum__cartesian__PxOp():
    from sympy.physics.quantum.cartesian import PxOp
    assert _test_args(PxOp(x, y, z))
 
 

src/s/y/sympy-HEAD/sympy/physics/quantum/tests/test_cartesian.py   sympy(Download)
from sympy.physics.quantum import qapply, represent, L2, Dagger
from sympy.physics.quantum import Commutator, hbar
from sympy.physics.quantum.cartesian import (
    XOp, YOp, ZOp, PxOp, X, Y, Z, Px, XKet, XBra, PxKet, PxBra,
    PositionKet3D, PositionBra3D
    rep_p = represent(XOp(), basis=PxOp)
    assert rep_p == hbar*I*DiracDelta(px_1 - px_2)*DifferentialOperator(px_1)
    assert rep_p == represent(XOp(), basis=PxOp())
    assert rep_p == represent(XOp(), basis=PxKet)
    assert rep_p == represent(XOp(), basis=PxKet())
    assert represent(PxKet(px)) == DiracDelta(px - px_1)
 
    rep_x = represent(PxOp(), basis=XOp)
    assert rep_x == -hbar*I*DiracDelta(x_1 - x_2)*DifferentialOperator(x_1)
    assert rep_x == represent(PxOp(), basis=XOp())
    assert rep_x == represent(PxOp(), basis=XKet)

src/s/y/sympy-HEAD/sympy/physics/quantum/tests/test_operatorset.py   sympy(Download)
from sympy.physics.quantum.operatorset import (
    operators_to_state, state_to_operators
)
 
from sympy.physics.quantum.cartesian import (
def test_state_to_op():
    assert state_to_operators(XKet) == XOp()
    assert state_to_operators(PxKet) == PxOp()
    assert state_to_operators(XBra) == XOp()
    assert state_to_operators(PxBra) == PxOp()

src/s/y/sympy-HEAD/sympy/physics/quantum/tests/test_density.py   sympy(Download)
from sympy.physics.quantum.represent import represent
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.cartesian import XKet, PxKet, PxOp, XOp
from sympy.physics.quantum.spin import JzKet, Jz
from sympy.physics.quantum.operator import OuterProduct
 
    # check when given explicit basis
    assert (represent(0.5*(XKet()*Dagger(XKet())), basis=PxOp()) +
            represent(0.5*(PxKet()*Dagger(PxKet())), basis=PxOp())) == \
        represent(d, basis=PxOp())