{
 "metadata": {
  "name": "Chapter7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7:The Hydrogen Atom in Wave Mechanics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Example 7.2 Page 213"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "from math import exp\n",
      "import math\n",
      "from scipy import integrate\n",
      "# calculating radial probability  P= (4/ao^3)*integral(r^2 * e^(-2r/ao)) between the limits 0 and ao for r\n",
      "\n",
      "#calculation\n",
      "def integrand(x):\n",
      "    return ((x**2)*exp(-x))/2.0\n",
      "Pr=integrate.quad(integrand,0,2,args=());#simplifying where as x=2*r/a0; hence the limits change between 0 to 2\n",
      "\n",
      "#result\n",
      "print \"Hence the probability of finding the electron nearer to nucleus is\",round(Pr[0],3);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Hence the probability of finding the electron nearer to nucleus is 0.323\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page 213"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "from math import exp\n",
      "import math\n",
      "from scipy import integrate\n",
      "# employing the formula for probability distribution similarly as done in Exa-7.2 \n",
      "#calculation\n",
      "def integrand(x):\n",
      "    return (1.0/8)*((4.0*x**2)-(4.0*x**3)+(x**4))*exp(-x)\n",
      "Pr1= integrate.quad(integrand,0,1,args=())             #x=r/ao; similrly limits between 0 and 1.\n",
      "\n",
      "#result\n",
      "print\"The probability for l=0 electron is\",round(Pr1[0],5)\n",
      "\n",
      "#part2\n",
      "def integrand(x):\n",
      "    return (1.0/24)*(x**4)*(exp(-x))\n",
      "Pr2=integrate.quad(integrand,0,1);                            #x=r/ao; similarly limits between 0 and 1.\n",
      "\n",
      "#result\n",
      "print\"The probability for l=1 electron is\",round(Pr2[0],5)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The probability for l=0 electron is 0.03432\n",
        "The probability for l=1 electron is 0.00366\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page 215"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "from math import exp, sqrt\n",
      "import math\n",
      "from scipy import integrate\n",
      "l=1.0;         #given value of l\n",
      "\n",
      "#calculation\n",
      "am1=sqrt(l*(l+1));      #angular momentum==sqrt(l(l+1)) h\n",
      "l=2.0                     #given l\n",
      "am2=sqrt(l*(l+1));\n",
      "\n",
      "#result\n",
      "print\"The angular momenta are found out to be\", round(am1,3),\" h and\",round(am2,3),\" h respectively for l=1 and l=2.\";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angular momenta are found out to be 1.414  h and 2.449  h respectively for l=1 and l=2.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page 216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "from math import sqrt\n",
      "print \"The possible values for m are [+2,-2] and hence any of the 5 components [-2h,2h] are possible for the L vector.\";\n",
      "print \"Length of the vector as found out previously is %.2f*h.\",round(sqrt(6),4);#angular momentum==sqrt(l(l+1)) h"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The possible values for m are [+2,-2] and hence any of the 5 components [-2h,2h] are possible for the L vector.\n",
        "Length of the vector as found out previously is %.2f*h. 2.4495\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6 Page 223"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "uz=9.27*10**-24; t=1.4*10**3; x=3.5*10**-2;    #various constants and given values\n",
      "m=1.8*10**-25;v=750;                        # mass and velocity of the particle\n",
      "\n",
      "#calculation\n",
      "d=(uz*t*(x**2))/(m*(v**2));                  #net separtion \n",
      "\n",
      "#result\n",
      "print\"The distance of separation in mm is\",round(d*10**3,3);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance of separation in mm is 0.157\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7 Page 227"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initiation of variable\n",
      "n1=1.0;n2=2.0;hc=1240.0;    #hc=1240 eV.nm\n",
      "E=(-13.6)*((1/n2**2)-(1/n1**2));   #Energy calculation\n",
      "\n",
      "#calculation\n",
      "w=hc/E;                   #wavelength\n",
      "u=9.27*10**-24; B=2;          #constants\n",
      "delE= u*B/(1.6*10**-19);     #change in energy\n",
      "delw=((w**2/hc))*delE;             #change in wavelength\n",
      "\n",
      "#result\n",
      "print\"The change in wavelength in nm. is\",round(delw,4);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in wavelength in nm. is 0.0014\n"
       ]
      }
     ],
     "prompt_number": 12
    }
   ],
   "metadata": {}
  }
 ]
}