{
 "metadata": {
  "name": "",
  "signature": "sha256:cd8528b1343f720ba16c3255f8c2f531a0d8db6500634023001bba60d12d390a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5:Principles of Quantum Mechanics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, Page number 5.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "c = 3*10**8        #velocity of air(m/s)\n",
      "m = 1.67*10**-27   #mass of proton(kg)\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "\n",
      "#Calculation\n",
      "v = c/10.   #velocity of proton(m/s)\n",
      "lamda = h/(m*v)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",round((lamda/1E-14),3),\"*10^-14 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 1.323 *10^-14 m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, Page number 5.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "V = 400  #potential(V)\n",
      "\n",
      "#Calculation\n",
      "lamda = 12.26/math.sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",lamda,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 0.613 A\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, Page number 5.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "E = 0.025          #kinetic energy of neutron(eV)\n",
      "m = 1.674*10**-27  #mass of neutron(kg)\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "\n",
      "#Calculations\n",
      "E_j = E*1.6*10**-19 #converting eV to joules\n",
      "lamda = h/math.sqrt(2*m*E_j)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",round((lamda/1E-11),3),\"*10^-11 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 18.106 *10^-11 m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, Page number 5.13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "V = 1600  #potential(V)\n",
      "\n",
      "#Calculation\n",
      "lamda = 12.26/math.sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",lamda,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 0.3065 A\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5, Page number 5.21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31    #mass of electron(kg)\n",
      "L = 0.1*10**-9     #length of each side of box(m)\n",
      "#For lowest energy level,\n",
      "nx = 1\n",
      "ny = 1\n",
      "nz = 1\n",
      "\n",
      "#Calculations\n",
      "E1 = (((h**2)*(nx**2+ny**2+nz**2))/(8*m*L**2))/(1.6*10**-19)\n",
      "\n",
      "#Result\n",
      "print \"The lowest energy of electron is\",round(E1,2),\"eV\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lowest energy of electron is 113.08 eV\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6, Page number 5.22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31    #mass of electron(kg)\n",
      "L = 0.1*10**-9     #length of each side of box(m)\n",
      "#For level next to lowest energy level,\n",
      "nx = 1\n",
      "ny = 1\n",
      "nz = 2\n",
      "\n",
      "#Calculations\n",
      "E1 = (((h**2)*(nx**2+ny**2+nz**2))/(8*m*L**2))/(1.6*10**-19)\n",
      "\n",
      "#Result\n",
      "print \"The lowest energy of electron is\",round(E1,2),\"eV\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lowest energy of electron is 226.15 eV\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, Page number 5.23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31    #mass of electron(kg)\n",
      "E = 2000.          #energy of electron(eV)\n",
      "\n",
      "#Calculations\n",
      "Ej = E*1.6*10**-19 #converting eV to joules\n",
      "lamda = h/math.sqrt(2*m*Ej)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",round((lamda/1E-9),4),\"nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 0.0275 nm\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8, Page number 5.23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31    #mass of electron(kg)\n",
      "L = 4*10**-10      #length of each side of box(m)\n",
      "#For minimum energy \n",
      "n = 1\n",
      "\n",
      "#Calculations\n",
      "E1 = ((h**2)*(n**2))/(8*m*L**2)\n",
      "\n",
      "#Result\n",
      "print \"Minimum energy =\",round((E1/1E-18),3),\"*10^-18 J\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum energy = 0.377 *10^-18 J\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9, Page number 5.24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "h = 6.626*10**-34  #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31    #mass of electron(kg)\n",
      "L = 1*10**-10      #length of each side of box(m)\n",
      "n1 = 10            #For energy in ground state\n",
      "n2 = 2             #For energy in first excited state\n",
      "n3 = 3             #For energy in second excited state\n",
      "\n",
      "#Calculations\n",
      "E1 = ((h**2)*(n1**2))/(8*m*L**2)\n",
      "E2 = ((h**2)*(n2**2))/(8*m*L**2)\n",
      "E3 = ((h**2)*(n3**2))/(8*m*L**2)\n",
      "\n",
      "#Results\n",
      "print \"Energy in ground state =\",round((E1/1E-17),4),\"*10^17 J (Calculation mistake in textbook)\"\n",
      "print \"Energy in first excited state =\",round((E2/1E-17),4),\"*10^17 J\"\n",
      "print \"Energy in second excited state =\",round((E3/1E-17),4),\"*10^17 J\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy in ground state = 60.3075 *10^17 J (Calculation mistake in textbook)\n",
        "Energy in first excited state = 2.4123 *10^17 J\n",
        "Energy in second excited state = 5.4277 *10^17 J\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10, Page number 5.24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "h = 6.626*10**-34    #Planck's constant(J x sec)\n",
      "m = 9.1*10**-31      #mass of electron(kg)\n",
      "lamda = 1.66*10**-10 #wavelength(m)\n",
      "\n",
      "#Calculations\n",
      "v = h/(m*lamda)\n",
      "KE = (m*v**2)/(2*1.6*10**-19) #in joules\n",
      "\n",
      "#Result\n",
      "print \"Velocity of electron =\",round((v/1E+7),4),\"*10^7 m\"\n",
      "print \"Kinetic energy of electron =\",round(KE,2),\"eV\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of electron = 0.4386 *10^7 m\n",
        "Kinetic energy of electron = 54.71 eV\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11, Page number 5.25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "V = 15*10**3  #potential(V)\n",
      "\n",
      "#Calculation\n",
      "lamda = 12.26/math.sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"The de Brogile wavelength is\",round(lamda,2),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de Brogile wavelength is 0.1 A\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12, Page number 5.25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "V = 344    #potential(V)\n",
      "theta = 60 #glancing angle(degrees)\n",
      "\n",
      "#Calculation\n",
      "lamda = 12.26/math.sqrt(V)\n",
      "#For first reflection \n",
      "n = 1\n",
      "d = (n*lamda)/(2*math.sin(math.radians(theta)))\n",
      "\n",
      "#Result\n",
      "print \"The interatomic spacing of the crystal is\",round(d,4),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interatomic spacing of the crystal is 0.3816 A\n"
       ]
      }
     ],
     "prompt_number": 24
    }
   ],
   "metadata": {}
  }
 ]
}