Special Function Hermite Polinomial 1
Special Function Hermite Polinomial 1
Special Function Hermite Polinomial 1
15/04/2024
1 Hermite Polinomial
Hermite Differntial equation is given as :
d2 y dy
− 2x + 2ny = 0 (1)
dx2 dx
The solution that sattisfies the above equation is known as Hermite Polinomial.The Rodrigue’s
formula is given as :
2 dn −x2
Hn (x) = (−1)n ex e (2)
dxn
The Orthogonality Condition for Hermite Polinomial is given as:
Z +∞
2
e−x Hm (x).Hn (x)dx = 0 f or n ̸= m (3)
−∞
Z +∞
2
e−x Hm (x).Hn (x)dx = 2n n!
p
(π) f or n=m (4)
−∞
1.1 Program:
1.1.1 Question1.
Verify the Orthogonality relation for Hermite Polinomial.
Source Code:
import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.special import hermite as H
from scipy.integrate import quad
15
LHS = quad(f,-np.inf,np.inf)
if m == n:
RHS = (2**n)*(math.factorial(n)*np.sqrt(np.pi))
else:
RHS = 0
print('LHS = ',LHS[0],'RHS = ',RHS)
if abs(LHS[0] - RHS)<0.01:
print('The Orthogonality relation of Legendre plinomial is verified')
else:
print('Not Verified')
1.1.2 Question 2.
Verify the following recurrence relation for Hermite Polinomial.
′
Hn+1 (x) = 2xHn (x) − 2nHn−1 (x)
Source Code:
[22]: #Recurrence relation for Hermite Polinomial 2nd
plot()
16
1.1.3 Question 3.
Consider the wavefunction of 1D Harmonic Oscillator:
1/4 2
1 1 −x
ψn (x) = p exp Hn (x)
(2n n!) π 2
mω
Where Hn (x) is the Hermite polinomial and we consider = 1.Plot the wavefunction for n = 0,
ℏ
1 and 2 in a single graph.
Source Code:
[23]: import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.special import hermite as H
from scipy.integrate import quad
def psi(n,x):
return 1/np.sqrt((2**n)*math.factorial(n))*(1/np.pi)**(1/4)*np.exp(-x**2/
,→2)*H(n)(x)
x = np.linspace(-5,5,100)
n = np.array([0,1,2])
for i in n:
plt.plot(x,psi(i,x),linestyle=(0,(2,i*i)), label =r'$\psi_n(x) \;
,→at\quadn=%f$'%i, color = 'black')
plt.legend(bbox_to_anchor=(1.00, 1),ncol=1)
plt.grid()
plt.title(r'Plot of $\psi_n(x)$ for n = 0,1,2')
17
plt.ylabel(r'$\psi_n(x)$')
plt.xlabel('Position(x)')
plt.axhline(y=0, linestyle='-')
plt.show()
18