Unit 5 SCHRODINGER EQUATION

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Schrodinger Equation

Notes for II sm.M.Sc,2020- AVAH Arts & Sc.College


prepared by Prof.V.Kuttoosa

Time Independent SchrodingerEquation The time independent Schrodinger equation


for harmonic oscillator in one dimension is of the form
~2 d2 Ψ
− + V (x)Ψ = EΨ(x) (1)
2m dx2
where V(x) is the potential energy and E represents the system energy. We are attempting to
determine numerically the eigen energies of the quantum system. given in equation(1).

Energy Eigenvalues To obtain specic values for energy, we have to operate on the wave-
function with the quantum mechanical operator associated with energy, which is called the
Hamiltonian. The operation of the Hamiltonian on the wavefunction is the Schrodinger equa-
tion. Solutions exist for the time-independent Schrodinger equation only for certain values of
energy, and these values are called "eigenvalues" of energy.
The Runge-Kutta 4 method is used a rst order dierential equatin of the form
dy(x)
= f (x, y), y(0) = y0 (2)
dx
The solution is
h
y(x1 ) = y(x0 ) + (K1 + 2K2 + 2K3 + K4) (3)
6
where the K values are:
K1 = f (x, y) (4a)
h K1
K2 = f (x + , y + ) (4b)
2 2
h K2
K3 = f (x + , y + ) (4c)
2 2
K4 = f (x + h, y + K3) (4d)
Since equation (1) is a second order dierential equation we cannot solve it directly with RK4
method. Therefore, we need to split it into an equation system of coupled rst order dierential
equations, Let

= g(x, ψ) (5)
dx
dg(x, ψ) d2 ψ
= (6)
dx dx2
Substituiting equation (6) into equation (1), we get
dg 2m
= 2 [V (x) − E]ψ (7)
dx ~

1
Now by equations (5) and 7) we have two rst order dierential equations which are dependent
on each other and we have to apply the RungeKutta method for each one.
Since the ground state should be symmetric about x=0 , we have to have ψ 0 = 0 . We also
have to choose a value for ψ0 , e.g.ψ0 = 0. . The particular choice of the value of will not
aect the energy eigenvalue because its actual value will be determined by normalization of the
wave function. Using these two initial values, we can now compute the ground state energy as
follows. First, we choose an upper and a lower bound for the estimated ground state energy.
Subsequently, we use RK4 method , starting at , with an estimated eigen energy E0 that is
determined iteratively: if the value of the wave function grows to innity as x → ∞ , we need
to raise the value of E0 ; if the value of the wave function goes to negative innity, we need
to lower E0 . We truncate the method when a desired accuracy acc is achieved and plot the
analytical solution versus the numerical solution of the wave function. As a normalization, we
have taken
m 1
2
= 1 and V (x) = x2
~ 2
print('Solution of Time-independent Schrodinger equation-RK4 method')
import matplotlib.pyplot as plt
import numpy as np
def V(x):return 0.5*x**2 # retrns potental energy
def rk4(f,g,x,h,E): # Runge-Kutta method defined
''' f is the psi function, g the derivatve, x the position, h the step size, the en

k1=g
p1=2*(V(x)-E)*f
k2=g+p1*h/2
p2=2*(V(x+h/2)-E)*(f+k1*h/2)
k3=g+p2*h/2
p3=2*(V(x+h/2)-E)*(f+k2*h/2)
k4=g+p3*h
p4=2*(V(x+h)-E)*(f+k3*h)
f=f + (k1+2*k2+2*k3+k4)*h/6
g=g+(p1+2*p2+2*p3+p4)*h/6
return(f,g)

### initialisation
p = 10 # the number units on the x-axis
n = 1000 # number of points per unit on the x-axis.
dx = 1/n # step length
f0= np.zeros(p*n) # array for function values of f0
f0[0] = 1 # initial value for f0 at x = 0
df0=np.zeros(p*n)
df0[0]=0 # initial value for df0/dx at x = 0
x = np.linspace(0,p,p*n)
acc = 1e-15 # Accuracy of eigen energy
e1 = 0.0 # Lower bound, must be positive since the potential is positive for all x
e2 = 4.0 # Upper bound
E0 = e1
deltaE0 = 1

''' Implementation of rk4 method. If the function value is out of bounds,

2
a new value for the energy is chosen. When the difference between the upper
and lower bound for the energy is smaller than the given accuracy,
the while loop stops, yielding a result for E1.'''

while deltaE0 > acc:


for i, x_ in enumerate(x[0:-1]):
if i == 0:
f0[i+1] = f0[i]+dx*df0[i]
else:
f,g=rk4(f0[i], df0[i],x_,dx,E0)
f0[i+1] =f
df0[i+1]=g
# Implementation of rk4 method. If the function value is out of bounds,
# a new value for the energy is chosen. When the difference between the upper
# and lower bound for the energy is smaller than the given accuracy,
# the while loop stops, yielding a result for E1.
if f0[i] > 5:
e1 = E0
E0 = e1 + (e2-e1)/2
break
elif f0[i] < -5:
e2 = E0
E0 = e2 - (e2-e1)/2
break
deltaE0 = e2-e1
print(r'The energy E0 is: {:f}'.format( E0))
#Plot:
plt.plot(x, np.exp(-x**2/2), 'g:') # analytical eigenfunction
plt.plot(x, f0, 'b') # computed eigenfunction
plt.plot(x, 0.5*x**2, 'r') # potential
plt.legend(['Analytical','Computed','Potential'])
plt.show()
When the program is run, we got the following results:
The energy E0 is: 0.500615
The plot shows that the computed value is in good agreement with the analytical value. Fig.1

3
Figure 1: Groundstate of Harmonic Oscillator

You might also like