import math
#variable declaration
h = 6.63*10**-34; # plancks constant in J.s
m = 9.1*10**-31; # mass of electron in kg
a = 2.5*10**-10; # width of infinite square well
e = 1.6*10**-19; # charge of electron coulombs
n2 = 2; #number of permiissable quantum
n3 = 3; #number of permiissable quantum
# Calculations
E1 = (h**2)/float(8*m*a**2*e); # first lowest permissable quantum energy in eV
E2 = n2**2 *E1; # second lowest permissable quantum energy in eV
E3 = n3**2 *E1; # second lowest permissable quantum energy in eV
# Result
print'Lowest three permissable quantum energies are E1 = %d'%E1,'eV';
print' E2 = %d'%E2,'eV';
print' E3 = %d'%E3,'eV';
import math
#variable declaration
h = 6.63*10**-34; # plancks constant in J.s
m = 9.1*10**-31; # mass of electron in kg
a = 10**-10; # width of infinite square well in m
e = 1.6*10**-19; # charge of electron in coulombs
n1 = 1; #energy level constant
n2 = 2; #energy level constant
# calculations
E1 = ((n1**2)*(h**2))/float(8*m*(a**2)*e); # ground state energy in eV
E2 = ((n2**2)*(h**2))/float(8*m*(a**2)*e); # first excited state in energy in eV
dE = E2-E1 # difference between first excited and ground state(E2 - E1)
#Result
print'Energy Difference = %3.2f '%dE,'eV';
import math
# Variable declaration
h = 6.63*10**-34; # plancks constant in J.s
m = 9.1*10**-31; # mass of electron in kg
a = 5*10**-10; # width of infinite potential well in m
e = 1.6*10**-19; # charge of electron in coulombs
n1 = 1; # energy level constant
n2 = 2; # energy level constant
n3 = 3; # energy level constant
#Calculations
E1 = ((n1**2)*(h**2))/(8*m*(a**2)*e); # first energy level in eV
E2 = ((n2**2)*(h**2))/(8*m*(a**2)*e); # second energy level in eV
E3 = ((n3**2)*(h**2))/(8*m*(a**2)*e); # third energy level in eV
# Result
print'First Three Energy levels are \n E1 = %3.2f'%E1,'eV';
print' E2 = %d'%E2,'eV';
print' E3 = %3.2f'%E3,'eV';
print'\n Above calculation shows that the energy of the bound electron cannot be continuous';
import math
#variable declaration
h = 1.054*10**-34; #plancks constant in J.s
m = 9.1*10**-31; #mass of electron in kg
a = 5*10**-10; #width of infinite potential well in m
e = 1.6*10**-19; # charge of electron coulombs
# Calculations
#cos(ka) = ((Psin(alpha*a))/(alpha*a)) + cos(alpha*a)
#to find the lowest allowed energy bandwidth,we have to find the difference in αa values, as ka changes from 0 to π
# for ka = 0 in above eq becomes
# 1 = 10*sin(αa))/(αa)) + cos(αa)
# This gives αa = 2.628 rad
# ka = π , αa = π
# sqrt((2*m*E2)/h**2)*a = π
E2 = ((math.pi*math.pi)*h**2)/(2*m*a**2*e); #energy in eV
E1 = ((2.628**2)*h**2)/(2*m*a**2*e); #for αa = 2.628 rad energy in eV
dE = E2 - E1; #lowest energy bandwidth in eV
# Result
print'Lowest energy bandwidth = %3.3f'%dE,'eV';
import math
# Variable declaration
a = 3*10**-10; # side of 2d square lattice in m
h = 6.63*10**-34; # plancks constant in J.s
e = 1.6*10**-19 # charge of electron in coulombs
m = 9.1*10**-31; # mass of electron in kg
# calculations
#p = h*k # momentum of the electron
k = math.pi/float(a); # first Brillouin zone
p = (h/float(2*math.pi))*(math.pi/float(a)); # momentum of electron
E = (p**2)/float(2*m*e) # Energyin eV
#Result
print'Electron Momentum for first Brillouin zone appearance = %g'%p,'eV';
print'\n Energy of free electron with this momentum = %4.1f'%E,'eV';
print'\n Note: in Textbook Momentum value is wrongly printed as 1.1*10**-10';