# 6: Quantum mechanics of simple systems¶

## Example number 6.1, Page number 90¶

In [6]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=2*10**-10;    #length of square well(m)

#Calculation
def intg(x):
return (2/a)*(math.sin(math.pi*x/a))**2

S=quad(intg,0,0.25*10**-10)[0]     #probability of finding the electron

#Result
print "probability of finding the electron is",round(S,4)

probability of finding the electron is 0.0125


## Example number 6.2, Page number 96¶

In [9]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=6.626*10**-34;    #planck's constant(Js)
new0=6.43*10**13;   #frequency(Hz)
e=1.6*10**-19;   #conversion factor from J to eV
mew=1.1385*10**-26;     #reduced mass(kg)

#Calculation
E0=h*new0/2;   #zero point energy(J)
E0=E0/e;   #zero point energy(eV)
k=4*math.pi**2*new0**2*mew;   #force constane(N/m)

#Result
print "zero point energy is",round(E0,3),"eV"
print "force constane is",round(k),"N/m"
print "answer varies due to rounding off errors"

zero point energy is 0.133 eV
force constane is 1858.0 N/m
answer varies due to rounding off errors


## Example number 6.6, Page number 104¶

In [21]:
#importing modules
import math
from __future__ import division

#Variable declaration
m1=19.9217*10**-27;    #mass of carbon atom(kg)
m2=26.5614*10**-27;    #mass of oxygen atom(kg)
r=1.131*10**-10;   #separation(m)
hbar=1.054*10**-34;
e=1.6*10**-19;   #conversion factor from J to eV

#Calculation
mew=(m1*m2)/(m1+m2);    #reduced mass(kg)
I=mew*r**2;
deltaE=hbar**2/I;    #energy difference(J)
deltaE=deltaE/e;     #energy difference(eV)

#Result
print "energy difference is",round(deltaE*10**4,2),"*10**-4 eV"

energy difference is 4.77 *10**-4 eV


## Example number 6.7, Page number 105¶

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
m1=1;
m2=0;
m3=-1;     #m-components
l=1;

#Calculation
L=math.sqrt(l*(l+1));    #length of vector
theta1=theta1*180/math.pi;   #orientation for m=1(degrees)

orientation for m=1 is 45.0 degrees