In [1]:
from sympy import *
from sympy.physics.quantum.constants import hbar
from xv.util import listAttr
In [2]:
E, KE, PE, v, p, psi, x, t = symbols('E, KE, PE, v, p, psi, x, t')
m, u, k, omega, lamda, h, f = symbols('m, u, k, omega, lamda, h, f', constant = True)
In [3]:
valOfE = Eq(E, KE + PE)
display(valOfE)
In [4]:
valOfE = Eq(E, m*v**2/2 + u)
display(valOfE)
In [5]:
valOfP = Eq(p, m*v)
display(valOfP)
In [6]:
valOfKE = Eq(m*v**2/2, p**2/(2*m))
display(valOfKE)
In [7]:
valOfE = Eq(E, p**2/(2*m) + u)
display(valOfE)
In [8]:
valOfPsi = Eq(psi, exp(I*(k*x - omega*t)))
display(valOfPsi)
In [9]:
Eq(exp(I*(k*x - omega*t)), cos(k*x - omega*t) + I*sin(k*x - omega*t))
Out[9]:
In [10]:
diffOfPsi_WRO_X = Eq(Eq(Derivative(psi, x), Derivative(exp(I*(k*x - omega*t)), x).doit()), I*k*psi, evaluate = False)
display(diffOfPsi_WRO_X)
In [11]:
diff2OfPsi_WRO_X = Eq(Eq(Derivative(psi, x, 2), Derivative(exp(I*(k*x - omega*t)), x, 2).doit()), (I*k)**2*psi, evaluate = False)
display(diff2OfPsi_WRO_X)
In [12]:
valOfK = Eq(k, p/hbar)
display(valOfK)
In [13]:
valOfK = Eq(k, 2*pi/lamda)
display(valOfK)
In [14]:
valOfP = Eq(p, h/lamda)
display(valOfP)
In [15]:
valOfP = Eq(p, h/(2*pi)*k)
display(valOfP)
In [16]:
diff2OfPsi_WRO_X = Eq(Derivative(psi, x, 2), (I*p/hbar)**2*psi)
display(diff2OfPsi_WRO_X)
In [17]:
valOfP2_Psi = Eq(-hbar**2 * Derivative(psi, x, 2), p**2*psi)
display(valOfP2_Psi)
In [18]:
valOfE_Psi = Eq(E*psi, p**2/(2*m)*psi + u*psi)
display(valOfE_Psi)
In [19]:
timeIndependentSchrodingerEquation = Eq(E*psi, -hbar**2 * Derivative(psi, x, 2)/(2*m) + u*psi)
display(timeIndependentSchrodingerEquation)
In [20]:
valOfE = Eq(Eq(E, hbar*omega), h*f, evaluate = False)
display(valOfE)
In [21]:
valOfPsi = Eq(psi, exp(I*(k*x - omega*t)))
display(valOfPsi)
In [22]:
diffOfPsi_WRO_T = Eq(Eq(Derivative(psi, t), Derivative(exp(I*(k*x - omega*t)), t).doit()), -I*omega*psi, evaluate = False)
display(diffOfPsi_WRO_T)
In [23]:
valOfE = Eq(E, hbar*omega)
display(valOfE)
In [24]:
valOfE_Psi = Eq(E*psi, hbar*omega*psi)
display(valOfE_Psi)
In [25]:
valOfE_Psi = Eq(Eq(-I*E*psi/hbar, -I*omega*psi), Derivative(psi, t), evaluate = False)
display(valOfE_Psi)
In [26]:
valOfE_Psi = Eq(E*psi, I*hbar*Derivative(psi, t), evaluate = False)
display(valOfE_Psi)
In [27]:
timeDependentSchrodingerEquation = Eq(I*hbar*Derivative(psi, t), -hbar**2 * Derivative(psi, x, 2)/(2*m) + u*psi)
display(timeDependentSchrodingerEquation)
In [28]:
display(timeDependentSchrodingerEquation, timeIndependentSchrodingerEquation)
In [ ]: