#Variable declaration
e=1.6*10**-19 #charge of electron (Coulomb)
B=0.5 #magnetic field (Tesla)
lembda=6438*10**-10 #wavelength of the line (m)
m=9.1*10**-31 #mass of electron (kg)
c=3*10**8 #speed of light (m/s)
#calculation
import math
dlembda=(e*B*lembda**2*10**10)/(4*math.pi*m*c) #normal Zeeman splitting (Å)
#Result
print"Zeeman shift =",round(dlembda,3),"Å"
#Variable declaration
e=1.6*10**-19 #charge of electron (Coulomb)
B=1 #magnetic field (Tesla)
lembda=612*10**-9 #wavelength of the line (m)
m=9.1*10**-31 #mass of electron (kg)
c=3*10**8 #speed of light (m/s)
#calculation
import math
dlembda1=(e*B*lembda**2*10**10)/(4*math.pi*m*c) #normal Zeeman splitting (Å)
dlembda2=2*dlembda1 #Separation of outer lines (Å)
#Result
print"Separation of outer lines =",round(dlembda2,2),"Å"
#Variable declaration
mu=9.27*10**-24 #(J/T)
B=1*10**-1 #external magnetic field (T)
h=1.054*10**-34 #Plank's constant (Js)
J=3/2.0
L=1.0
S=1/2.0
#calculation
g=1+(((J*(J+1))+(S*(S+1))-(L*(L+1)))/(2*J*(J+1))) #Lande g-factor
omega=(g*mu*B)/h #angular velocity of precession (rad/s)
#Result
print"ω =%.1e"%omega,"rad/s"
#Variable declaration
J=5/2.0
#Calculation
sub=2*J+1
#Result
print"\n(i) Energy level does not split"
print"\n(ii) number of sub-shells =",sub
print"\n(iii) Energy level does not split"
#Variable declaration
S1=0.0
L1=2.0
J1=2.0
g1=1.0
S2=1.0
L2=3.0
J2=4.0
g2=5/4.0
B=0.25 #magnetic field (T)
mu=5.79*10**-5 #mass (eV/T)
#Calculation
#(i)
E1=4*g1*mu*B #total splitting (eV)
#(ii)
E2=8*g2*mu*B #total splitting (eV)
#Result
print"\n(i) total splitting =",E1,"eV\n(ii) total splitting =%.4e"%E2,"eV"
#Variable declaration
mu=9.27*10**-24 #(J/T)
B=0.45 #magnetic field (μb/m**2)
h=1.054*10**-34 #Plank's constant (Js)
k=[5/3.0,1.0,1/3.0,-1/3.0,-1.0,-5/3.0] #value of g'Mj'-gMj
#calculation
c=(mu*B)/h #constant (rad/s)
deltaomega1=c*k[0] #displacement of Zeeman component (rad/s)
deltaomega2=c*k[1] #displacement of Zeeman component (rad/s)
deltaomega3=c*k[2] #displacement of Zeeman component (rad/s)
#Result
print"Displcement of Zeeman component =","+-%.3e"%deltaomega1,",+-%.2e"%deltaomega2,",+-%.2e"%deltaomega3,"rad/s"
#Variable declaration
m=9.1*10**-31 #mass of electron (Kg)
h=1.054*10**-34 #Plank's constant (Js)
B=1.2 #magnetic field (mu*b/m**2)
gs=2 #for a pure spin system
J=0.5 #for a pure spin system
#calculation
mub=h/(2*m) #(eV/T)
deltaE=2*gs*mub*B*J #energy difference b/w electrons(eV)
#Result
print"\n ΔE =%.2e"%deltaE,"eV"
#Variable declaration
m=9.1*10**-31 #mass of electron (Kg)
h=1.054*10**-34 #Plank's constant (Js)
B=5 #magnetic field (T)
lembda=1210 #wavelength of spectral line (Å)
M=[1,0,-1,1,0,-1] #value of Ml+2*Ms
ch=12400 #product of speed of light and Plank's constant (eV*Å)
#calculation
import numpy as np
M=np.array(M)
dE=(h/(2*m))*B*M #value of dE(upper)-dE(lower) (eV)
dlembda=(lembda**2/ch)*dE #wavelengths of the spectral lines in the pattern (Å)
#Result
print"Wavelengths of the line =",round(lembda+dlembda[1],3),",",round(lembda+dlembda[0],3),",",round(lembda+dlembda[2],3),"Å"