예제 #1
0
def test_states():
    assert PIABKet(n).dual_class() == PIABBra
    assert PIABKet(n).hilbert_space ==\
        L2(Interval(S.NegativeInfinity,S.Infinity))
    assert represent(PIABKet(n)) == sqrt(2 / L) * sin(n * pi * x / L)
    assert (PIABBra(i) * PIABKet(j)).doit() == KroneckerDelta(i, j)
    assert PIABBra(n).dual_class() == PIABKet
예제 #2
0
파일: test_piab.py 프로젝트: msgoff/sympy
def test_H():
    assert PIABHamiltonian("H").hilbert_space == L2(
        Interval(S.NegativeInfinity, S.Infinity)
    )
    assert qapply(PIABHamiltonian("H") * PIABKet(n)) == (
        n ** 2 * pi ** 2 * hbar ** 2
    ) / (2 * m * L ** 2) * PIABKet(n)
예제 #3
0
파일: test_args.py 프로젝트: Visheshk/sympy
def test_sympy__physics__quantum__piab__PIABKet():
    from sympy.physics.quantum.piab import PIABKet
    assert _test_args(PIABKet('K'))
예제 #4
0
def test_H():
    assert PIABHamiltonian('H').hilbert_space ==\
        L2(Interval(S.NegativeInfinity,S.Infinity))
    assert apply_operators(PIABHamiltonian('H')*PIABKet(n)) ==\
        (n**2*pi**2*hbar**2)/(2*m*L**2)*PIABKet(n)