QM Lab Animesh PDF

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

QUANTUM

MECHANICS
LAB

SUBMITTED BY-
ANIMESH SAH
ROLL NO-6320
BSc(Hons)Physics V-sem

ANIMESH
//Aim1- A particle is represented by the wave function:-

Write a scilab code to determine the following of a wavefunction


a) Normalization constant A
b) Expectation value of position x
c) Expectation value of momentum p
d) Expectation value of x2
e) Expectation value of p2
f) Uncertainty in x
g) Uncertainty in p
h) Verify that the results are consistent with uncertainty principle.

PROGRAM-
clc
a=input("Enter the lower limit:- ")
b=input("Enter the upper limit:- ")
//calculating normalization constant A
hbar=1.05678971*(10^(-34))
A1=integrate('(4-x^2)*(4-x^2)','x',a,b)
A=1/(sqrt(A1))
mprintf("\n Normalization constant is :-")
disp(A)
//calculating expectation value of position x

x1=(integrate('(4-x^2)*x*(4-x^2)','x',a,b))*(A^2)
mprintf("\nExpectation value of position is :-")
disp(x1)

//calculating expectation value of momentum P


mprintf("\nExpectation value of momentum is :-")
p=(integrate('(4-x^2)*x','x',a,b))*(A^2)*2*hbar*%i
disp(p)
//calculating expectation value of position square X^2
x2=(integrate('(4-x^2)*x*x*(4-x^2)','x',a,b,[10^-4],[10^-4]))*(A^2)
mprintf("\nExpectation value of position squared is :-")
disp(x2)

ANIMESH
//calculating expectation value of momentum squared P^2
p1=(integrate('(4-x^2)','x',a,b,[10^-4],[10^-4]))*(A^2)*2*(hbar^2)
mprintf("\nExpectation value of momentum squared is :-")
disp(p1)

//calculating uncertainity in position


d=x2-x1^2
mprintf("\n Uncertainity in position is :-")
dx=sqrt(d)
disp(dx)

//calculating uncertainity in position


l=sqrt(p1)
mprintf("\n Uncertainity in momentum is :-")
disp(l)
//verifying uncertainity principle
hnew=l*dx //multiplying uncertainity in position and momentum
mprintf("\n Product of Uncertainity in momentum and Uncertainity in position is :-")
disp(hnew)
h=hbar/2
if hnew>=h then
mprintf("The result is consistent with uncertainity principle")
else
mprintf("Inconsitent")
end
//plotting
x=[-10:0.1:10]
y=A*(4-x^2)
plot(x,y)
ylabel("Wavefunction------->")
xlabel("Position----------->")
xtitle("The plot between position and wavefunction ")
xgrid(3,1,2)

OUTPUT-
Enter the lower limit:- -2
Enter the upper limit:- 2
Normalization constant is :-
0.1711633
Expectation value of position is :-
0.
ANIMESH
Expectation value of momentum is :-
0.
Expectation value of position squared is :-
0.5714286
Expectation value of momentum squared is :-
6.980D-69
Uncertainty in position is :-
0.7559289
Uncertainty in momentum is :-
8.355D-35
Product of uncertainty in momentum and uncertainty in position is :-
6.316D-35
The result is consistent with uncertainty principle

GRAPH-

ANIMESH
//Aim2- A particle is represented by a wave function at t=0

Write a scilab code to determine the following:


a) Normalization constant A
b) Probability of finding the particle at 0<=x<=2
c) Plot of (x,0) vs x.

PROGRAM-
clc
A1=integrate('(x/2)*(x/2)','x',0,2)+integrate('(3-x)*(3-x)','x',2,3)
A=1/sqrt(A1)
mprintf("\n Normalization constant is :-")
disp(A)

//calculating probability of finding particle in region 1


x1=(integrate('(x/2)*(x/2)','x',0,2))*A^2
mprintf("\nProbability of finding particle in region 1 (0≤x≤2) :-")
disp(x1)
//calculating probability of finding particle in region 2
x2=integrate('(3-x)*(3-x)','x',2,3)*A^2
mprintf("\nProbability of finding particle in region 2 (2≤x≤3) :-")
disp(x2)

x=[0:0.1:2]
//plotting the curve
y=A*x/2
plot(x,y)
x=[2:0.1:3]
y=A*(3-x)
plot(x,y)
ylabel("Wavefunction------->")
xlabel("Position----------->")
xtitle("The plot between position and wavefunction ")
xgrid(3,1,2)

ANIMESH
OUTPUT-
Normalization constant is :-
1.

Probability of finding particle in region 1 (0≤x≤2) :-


0.6666667

Probability of finding particle in region 2 (2≤x≤3) :-


0.3333333

GRAPH-

ANIMESH
//Aim3- Write a scilab code for the following :
Solve the s-wave Schrodinger equation for the ground state
and the first excited state of the hydrogen atom:

Here, m is the reduced mass of the electron. Obtain the


energy eigenvalues and plot the corresponding
wavefunctions. Remember that the ground state energy
of the hydrogen atom is ≈ -13.6 eV. Take e = 3.795
(eVÅ)1/2, ħc = 1973 (eVÅ) and m = 0.511x106 eV/c2.

PROGRAM-
//constants
clc
clf
// Aim- SSOLVING SCHRODINGER EQUATION FOR S WAVE HYDROGEN ATOM

h=1973
m=.511*10^(6)
e=3.795
k=((h)^2)/(2*m)
//inputs
H=[]
xlow=input("Enter the lower value of position :- ")
xhigh=input("Enter the upper value of position :- ")
n=input("Enter the number of intervals :- ")
a=(xhigh-xlow)/(n)
mprintf(" \n\n CALCULATING ENERGY EIGEN VALUES AND FUNCTIONS \n\n ")

for i=1:n-1

for j=1:n-1
if i==j then

ANIMESH
H(i,j)=((2*k)/(a)^2)-((e^2)/(xlow+a*i))
elseif i==j+1 | j==i+1
H(i,j)=-k/(a^2)
else //if i>j+1 | j>i+1
H(i,j)=0
end
end

end
[ef,ev]=spec(H)
D=spec(H)
E1=D(1)
E2=D(2)

mprintf("The ground state energy is %4.2f\n\n",E1)


mprintf("The first excited state energy is %4.2f\n\n",E2)
// AIM 2: NORMALISATION AND ORHTOGONALITY OF EIGEN FUNCTIONS
mprintf(" NORMALISATION AND ORHTOGONALITY OF EIGEN FUNCTIONS \n\n ")
X1=ef(:,1)
X2=ef(:,2)
X3=ef(:,3)
L1=X1.*X1
L2=X2.*X2
O1=X1.*X2

norm1=inttrap(L1)
mprintf("The normalisation of wave function X1 ∫(X1*X1)is %4.4f eV\n ",norm1)
norm2=inttrap(L2)
mprintf("The normalisation of wave function X2 ∫(X2*X2)is %4.4f eV\n ",norm2)
orth1=inttrap(O1)
mprintf("The ∫(X1*.X2) is %4.4f\n\n",orth1)
if abs(norm1-1)<0.02 & abs(norm2-1)<0.02 then
mprintf("The wave function is normalised\n")
else
mprintf("The wave function is not normalised\n")
end

if abs(orth1)<0.02 then
mprintf("The wave function is orhtogonal\n")
else
mprintf("The wave function is not orthogonal\n")
end

//AIM 3:EXPECTATION VALUES OF THE GROUND STATE: <x>,<x^2>


mprintf(" \n\n EXPECTATION VALUES OF THE GROUND STATE: <x>,<x^2> \n\n ")
for i=1:n-1
x(i)=xlow+a*i
end
exg=(inttrap(X1.*x.*X1))
exf=(inttrap(X2.*x.*X2))
mprintf("The expectation value of x for ground state is %4.2f\n",exg)
exg1=(inttrap(X1.*x.*x.*X1))
exf1=(inttrap(X2.*x.*x.*X2))

ANIMESH
mprintf("The expectation value of x^2 for ground state is %4.2f\n",exg1)
xrec=1./(x)
exg2=(inttrap(X1.*xrec.*X1))
exf2=(inttrap(X2.*xrec.*X2))
mprintf("The expectation value of 1/x for ground state is %4.2f\n",exg2)

//AIM 4: Expectation values of the first excited sate :<x>,<x^2>,<1/x>


mprintf(" \n\n Expectation values of the first excited sate :<x>,<x^2>,<1/x> \n\n ")
mprintf("The expectation value of x for first excited state state is %4.2f\n",exf)
mprintf("The expectation value of x^2 for first excited state state is %4.2f\n",exf1)
mprintf("The expectation value of 1/x for first excited state state is %f\n",exf2)
//AIM 5: PLOT WAVE FUNCTIONS : GROUND STATE , FRIST EXCITED STATE AND SECOND
EXCITED STATE
scf(1)

title("PLOT OF WAVE FUNCTION VS POSITION ")


plot(x,X1,'.r','linewidth',3)
plot(x,X2,'.-g')
plot(x,X3,'b')
xgrid(2,1,2)
y=legend("Ground state","First Excited state","Second State")
ylabel("-------->",'fontsize',3)
xlabel("X-------->",'fontsize',3)

//AIM 6: TO PLOT THE GIVEN POTENTIAL


scf(2)
title("PLOT OF POTENTIAL VS POSITION ")
for i=1:n-1
pot(i)=-((e^2)/(xlow+a*i))
v(i)=xlow+a*i
end
plot(v,pot,'g','linewidth',2)
xgrid(2,1,2)
ylabel("Potential-------->",'fontsize',3)
xlabel("X-------->",'fontsize',3)

ANIMESH
OUTPUT-
Enter the lower value of position :- 0

Enter the upper value of position :- 10

Enter the number of intervals :- 100

CALCULATING ENERGY EIGEN VALUES AND FUNCTIONS

The ground state energy is -13.49 eV

The first excited state energy is -3.40 eV

NORMALISATION AND ORHTOGONALITY OF EIGEN FUNCTIONS

The normalisation of wave function X1 ∫(X1*X1)is 0.9909


The normalisation of wave function X2 ∫(X2*X2)is 0.9988
The ∫(X1*.X2) is 0.0032

The wave function is normalised


The wave function is orhtogonal

EXPECTATION VALUES OF THE GROUND STATE: <x>,<x^2>

The expectation value of x for ground state is 0.80


The expectation value of x^2 for ground state is 0.85
The expectation value of 1/x for ground state is 1.77

Expectation values of the first excited sate :<x>,<x^2>,<1/x>

The expectation value of x for first excited state state is 3.17


The expectation value of x^2 for first excited state state is 11.71
The expectation value of 1/x for first excited state state is 0.459688

ANIMESH
GRAPH-

1.

2.

ANIMESH

You might also like