1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
{
"metadata": {
"name": "",
"signature": "sha256:cbd11433a31785853e9886e91140f1df1e44a2e02ec46a10cd5dc4781d714654"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 8: Atomic Physics"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.3, Page 285"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"delta_E = 0.0021; # Energy difference for the 3p subshell of sodium, eV\n",
"h = 6.62e-034; # Planck's constant, Js\n",
"h_bar = h/(2*math.pi); # Reduced Planck's constant, Js\n",
"e = 1.602e-019; # Energy equivalent of 1 eV, J\n",
"m = 9.11e-031; # Rest of an an electron, kg\n",
"g_s = 2; # Gyromagnetic ratio due to spin splitting\n",
"\n",
"#Calculations\n",
"# As delta_E = g_s*e*h_bar/(2*m)*B, solving for B\n",
"B = m*delta_E/h_bar; # Internal magnetic field causing the LS splitting, T\n",
"\n",
"#Result\n",
"print \"The internal magnetic field causing the LS splitting = %2d T\"%B"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The internal magnetic field causing the LS splitting = 18 T\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.5, Page 289"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy\n",
"\n",
"l1 = 1; # Orbital angular momentum quantum number for first electron\n",
"l2 = 2; # Orbital angular momentum quantum number for second electron\n",
"s1 = 1./2; # Spin angular momentum quantum number for first electron\n",
"s2 = 1./2; # Spin angular momentum quantum number for second electron\n",
"temp_j = numpy.zeros(15);\n",
"cnt = 0;\n",
"print (\"\\nThe all possibe values of the total angular momentum quantum number of J are:\");\n",
"for L in range(int(abs(l1 - l2)),int(abs(l1 + l2))+1):\n",
" for S in range(int(abs(s1 - s2)),int(abs(s1 + s2))+1):\n",
" for j in range(abs(L - S),abs(L + S)+1):\n",
" temp_j[cnt] = j;\n",
" cnt = cnt + 1;\n",
"\n",
"\n",
"J = -1;\n",
"temp_J = sorted(temp_j)\n",
"for i in range(len(temp_J)):\n",
" if temp_J[i] > J:\n",
" J = temp_J[i];\n",
" print \"%d \"%temp_J[i],;\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"The all possibe values of the total angular momentum quantum number of J are:\n",
"0 1 2 3 4 \n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.8, Page 291"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"delta_E = 0.0021; # Energy difference for the 3p subshell of sodium, eV\n",
"h = 6.62e-034; # Planck's constant, Js\n",
"h_bar = h/(2*math.pi); # Reduced Planck's constant, Js\n",
"e = 1.602e-019; # Energy equivalent of 1 eV, J\n",
"m = 9.11e-031; # Rest of an an electron, kg\n",
"g_s = 2; # Gyromagnetic ratio due to spin splitting\n",
"\n",
"#Calculations\n",
"# As delta_E = g_s*e*h_bar/(2*m)*B, solving for B\n",
"B = m*delta_E/h_bar; # Internal magnetic field causing the LS splitting, T\n",
"\n",
"#Result\n",
"print \"The internal magnetic field causing the LS splitting = %2d T\"%B"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The internal magnetic field causing the LS splitting = 18 T\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}
|