{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2: Quantum Mechanics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable Declaration\n",
      "V = 50;   # Given potential difference, V\n",
      "\n",
      "#Calculations\n",
      "lamda = 12.24/sqrt(V);   # Wavelength of the light, angstrom\n",
      "\n",
      "#Result\n",
      "print \"The de-broglie wavelength of electron = %4.2f angstrom\"%lamda\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de-broglie wavelength of electron = 1.73 angstrom\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2, Page 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable Declaration\n",
      "h = 6.62e-34;   # Planck's constant, J-s\n",
      "m0 = 1.6e-27;   # Rest mass of proton, kg\n",
      "c = 3.0e+8;   # Speed of light, in m/s\n",
      "v = c/20;    # Velocity of the proton, in m/s\n",
      "\n",
      "#Calculations\n",
      "lamda = (h*sqrt(1-v**2/c**2))/(m0*v);\n",
      "\n",
      "#Result\n",
      "print \"The de broglie wavelength associated with the proton = %4.2e m\"%lamda\n",
      "#answer differs due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de broglie wavelength associated with the proton = 2.75e-14 m\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3, Page 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "c = 3.0e+8;   # Speed of light, m/s\n",
      "v = 2.0e+8;   # Velocity of the proton, m/s\n",
      "m0 = 1.6e-27;   # Rest mass of proton, kg\n",
      "h = 6.62e-34;   # Plancks constant,J-s\n",
      "\n",
      "#Calculations\n",
      "lamda = (h*sqrt(1-(v**2/c**2)))/(m0*v);\n",
      "\n",
      "#Result\n",
      "print \"The wavelength of matter wave associated with the proton = %5.3e m\"%lamda\n",
      "\n",
      "#answer differs due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength of matter wave associated with the proton = 1.542e-15 m\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5, Page 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "a = 0.003;    # Accuracy of the electron,in percent\n",
      "s = 5e+03;    # Speed of the electron,in m/s\n",
      "del_v = (a/100)*s;    # Change in velocity,in m/s\n",
      "m0 = 9.1e-31;    # Rest mass of the electron,in kg\n",
      "hcut = 1.054e-34;    # Plancks constant,J-s\n",
      "\n",
      "#Calculations\n",
      "del_x = hcut/(2*del_v*m0);\n",
      "\n",
      "#Result\n",
      "print \"The uncertainity in the position of the electron = %4.2e m\"%del_x\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainity in the position of the electron = 3.86e-04 m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6, Page 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "del_t = 2.5e-14;    # Lifetime of the hydrogen atom in excited state\n",
      "hcut = 1.054e-34;    # Planck's constant,in J-s\n",
      "e = 1.6e-19;    # Charge on electron,in C\n",
      "\n",
      "#Calculations\n",
      "del_E = hcut/(2*del_t*e);    # Energy of the state, in eV\n",
      "\n",
      "#Result\n",
      "print \"The minimum error in measurement of lifetime of excited state of hydrogen atom = %6.4f eV\"%del_E\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum error in measurement of lifetime of excited state of hydrogen atom = 0.0132 eV\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7, Page 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "del_x = 1e-09;      # Uncertainty in position of the electron, m\n",
      "m0 = 9.1e-031;    # Rest mass of an electron, kg\n",
      "hcut = 1.054e-034;    # Planck's constant,in J-s\n",
      "\n",
      "#Calculations\n",
      "del_v = hcut/(2*del_x*m0);    # Uncertainity in velocity of the electron\n",
      "\n",
      "#Result\n",
      "print \"The uncertainity in the velocity of an electron = %4.2e m/s\"%del_v\n",
      "#Incorrect answer in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainity in the velocity of an electron = 5.79e+04 m/s\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8, Page 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "hcut = 1.054e-34;    # Reduced Planck's constant, Js\n",
      "v = 3e+07;    # Velocity of the electron, m/s\n",
      "c = 3e+08;    # Speed of light in vacuum, m/s\n",
      "m0 = 9.1e-31;    # Rest mass of an electron, kg\n",
      "del_v = 3e+08;    # Uncertainty in velocity of the electron, m/s\n",
      "\n",
      "#Calculations\n",
      "del_x = (hcut*sqrt(1-v**2/c**2))/(2*m0*del_v);\n",
      "\n",
      "#Result\n",
      "print \"The smallest possible uncertainity in position of the electron = %6.4f angstrom\"%(del_x/1e-010)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The smallest possible uncertainity in position of the electron = 0.0019 angstrom\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9, Page 82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "n = 1;\n",
      "m0 = 9.1e-031;    # Mass of the electron, kg\n",
      "a = 1e-10;    # Width of the box, m\n",
      "h = 6.63e-034;    # Planck's constant, J-s\n",
      "\n",
      "#Calculations\n",
      "E = n**2*h**2/(8*m0*a**2);\n",
      "\n",
      "#Result\n",
      "print \"The energy of the electron moving in 1D infinetly high potential box = %5.2e J\"%E\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy of the electron moving in 1D infinetly high potential box = 6.04e-18 J\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.10, Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "#n = [1,2];    # Shell numbers for two lowest permitted energy of the electron \n",
      "m0 = 9.1e-31;    # Mass of the electron, kg\n",
      "a = 2.5e-10;    # Width of the box, m\n",
      "h = 6.63e-34;    # Planck's constant, J-s\n",
      "e = 1.6e-19;    # Charge on electron, C\n",
      "\n",
      "#Calculations&Results\n",
      "E = round((h**2)/(8*m0*a**2*e));\n",
      "for n in range(1,3):\n",
      "    print \"The lowest two permitted energy values of an electron are\"\n",
      "    print E*n**2,\"eV\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lowest two permitted energy values of an electron are\n",
        "6.0 eV\n",
        "The lowest two permitted energy values of an electron are\n",
        "24.0 eV\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.11, Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "m0 = 1.67e-27;    # Rest mass,in kg\n",
      "a = 1e-14;    #  Size of the box\n",
      "h = 6.63e-34;    # Planck's constant,in J-s\n",
      "n = 1;   # Quantum number for lowest energy state\n",
      "\n",
      "#Calculations\n",
      "E_n = n**2*h**2/(8*m0*a**2);\n",
      "\n",
      "#Result\n",
      "print \"The lowest energy of the neutron confined to the nucleus = %4.2e J\"%E_n\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lowest energy of the neutron confined to the nucleus = 3.29e-13 J\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.12, Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "m0 = 9.1e-31;    # Rest mass, kg\n",
      "a = 1e-10;    # Length of the box, m\n",
      "h = 6.62e-34;    # Planck's constat, J-s\n",
      "n1 = 1;    # Ground state\n",
      "n2 = 2;    # First excited state\n",
      "e = 1.6e-19;    # Charge on electron, C\n",
      "\n",
      "#Calculations\n",
      "E1 = (n1**2*h**2)/(8*m0*a**2*e);\n",
      "E2 = (n2**2*h**2)/(8*m0*a**2*e);\n",
      "del_E = E2-E1; \n",
      "\n",
      "#Result\n",
      "print \"The energy difference between the ground state and the first excited state = %5.1f eV\"%del_E\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy difference between the ground state and the first excited state = 112.9 eV\n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}