summaryrefslogtreecommitdiff
path: root/Modern_Physics/Chapter8.ipynb
blob: a12d49fc8b18377b12564d59a69bd3a881d49c10 (plain)
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{
 "metadata": {
  "name": "",
  "signature": "sha256:8315bc6aae714998ec5db8a7cf2faf25a033ca960fbcf8e976cdfc44e47b09f3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Quantum Mechanics in Three Dimensions"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4, page no. 270"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "\n",
      "R = 1.0             #radius(m)\n",
      "T = 1.0             #period of revolution(s)\n",
      "m = 1.0             #mass of stone(kg)\n",
      "h = 1.055 * 10**-34 #planks constant (kg.m^2/s)\n",
      "\n",
      "#Calculation\n",
      "\n",
      "v = 2*math.pi*R/T\n",
      "L = m * v * R\n",
      "l = L / h\n",
      "\n",
      "#Results\n",
      "\n",
      "print \"The orbital quantum number l is\",round(l/10**34,2),\"X 10^34.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The orbital quantum number l is 5.96 X 10^34.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6, page no. 272"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "\n",
      "l = 3           #orbital quantum number\n",
      "\n",
      "#Calculation and results\n",
      "\n",
      "L = math.sqrt(l*(l+1))\n",
      "print \"The allowed values of Lz are\"\n",
      "for i in range(-l,l+1):\n",
      "    print i,\"h\"\n",
      "print \"The allowed values of theta are\"\n",
      "for i in range(-l,l+1):\n",
      "    theta = round(math.acos(i/L)*180/math.pi,1)\n",
      "    if theta > 90:\n",
      "        print theta-180\n",
      "    else:\n",
      "        print theta"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The allowed values of Lz are\n",
        "-3 h\n",
        "-2 h\n",
        "-1 h\n",
        "0 h\n",
        "1 h\n",
        "2 h\n",
        "3 h\n",
        "The allowed values of theta are\n",
        "-30.0\n",
        "-54.7\n",
        "-73.2\n",
        "90.0\n",
        "73.2\n",
        "54.7\n",
        "30.0\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7, page no. 281"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#Variable declaration\n",
      "\n",
      "n = 2\n",
      "Z = 1\n",
      "\n",
      "#Calculation and results\n",
      " \n",
      "print \"The states of hydrogen atom are\"\n",
      "for i in range(n):\n",
      "    for j in range(-i,i+1):\n",
      "        print \"n = \",n,\"l = \",i,\"ml = \",j\n",
      "\n",
      "E2 = -13.6 * Z**2/n**2\n",
      "print \"All states have same energy of \",E2,\"eV.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The states of hydrogen atom are\n",
        "n =  2 l =  0 ml =  0\n",
        "n =  2 l =  1 ml =  -1\n",
        "n =  2 l =  1 ml =  0\n",
        "n =  2 l =  1 ml =  1\n",
        "All states have same energy of  -3.4 eV.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8, page no. 284"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import scipy\n",
      "from scipy import integrate\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "\n",
      "z2 = lambda z: z**2 * math.e ** -z\n",
      "\n",
      "#Calculation\n",
      "inf = float('inf')\n",
      "integ,err = scipy.integrate.quad(z2,2.0,inf)\n",
      "P = integ * 0.5\n",
      "\n",
      "#result\n",
      "\n",
      "print \"The probability is\",round(P,3)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The probability is 0.677\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}