From 10c42666194722b61ab46b87ac21efa4d02b2fe2 Mon Sep 17 00:00:00 2001 From: Mark Dewing Date: Tue, 5 Jul 2016 17:10:51 -0500 Subject: [PATCH] Example of variational principle with hydrogen. Use an inexact wavefunction with an adjustable parameter. --- Variational/Variational_Hydrogen.ipynb | 414 +++++++++++++++++++++++++ 1 file changed, 414 insertions(+) create mode 100644 Variational/Variational_Hydrogen.ipynb diff --git a/Variational/Variational_Hydrogen.ipynb b/Variational/Variational_Hydrogen.ipynb new file mode 100644 index 0000000..12c98a7 --- /dev/null +++ b/Variational/Variational_Hydrogen.ipynb @@ -0,0 +1,414 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from sympy import *\n", + "from sympy.abc import r,x,y,z\n", + "from scipy.integrate import quad, nquad\n", + "import matplotlib.pyplot as plt\n", + "%matplotlib inline\n", + "init_printing()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Energy of the Hydrogen Atom\n", + "The variational principle states a trial wavefunction will have an energy greater than or equal to the ground state energy.\n", + "$$\\frac{\\int \\psi H \\psi}{ \\int \\psi^2} \\ge E_0$$\n", + "\n", + "First consider the hydogen atom. Let us use a trial wavefunction that is not the exact ground state." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEMAAAAbCAYAAAAnFzLpAAAABHNCSVQICAgIfAhkiAAAAfBJREFU\nWIXt10+ITWEYx/GPa65JkjJI/oVbFpKIpoRZTWHhbygmZaUYykpKiaUp9krYWYiFsrBQIoWS2Cg1\nGwurqamx8idZvO81Z7j3Duc67xm53zqd55zzvuf3O2/v+7zPocMPppVtoAkVDGJmvB4q0Uvp7MTS\nGN/BhhSilRQiOajhUIyHjQ/Mf0k3Zsf4ARalEO1KIRLZjvn4jI04F+NGfIrHVjzChwT+krHDxKl+\nD+sn6TMH5wtzVBIrTUyAq/EU1Un6DcY2VfQXYy09B+L5LK5gBMuxBKfxBLdxEaPCdnoYY7HtKNb8\nJS+tNJNQH4wjQp54icvYJuxmrzAQ4xUFe2mpmafoOiVsfc14jlsxXohleJF5fhJ9OIi5eIcF+Fag\njyztaLbFfr/WMtdxLPP8bkpDrTSLLrq2CDOjzlph3V6L1/14WLCHn2mq2ajOWIcTQmKpYp6Q2T/m\nEH6GfbFvBT3YZXx6rpL+v+O3NY/iNRZn7p3B7hyiNfTm6Dcl2IQv2Jy514v7QrL5UwakrXDbJmv2\ngrA09mAvpuOt8MM0luPd3fjapr9SqArGr5ZtpEzqu0mPMBOGS/RSOvXBGBGWQqM1XsPxZI6mCEN4\nbGJV2oebmFWGodRkP7wLl4Si6D1m4A1uSFy2dujQoUOHf4zv2otPzxZAFD8AAAAASUVORK5CYII=\n", + "text/latex": [ + "$$e^{- \\beta r^{2} - r}$$" + ], + "text/plain": [ + " 2 \n", + " - β⋅r - r\n", + "ℯ " + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "beta = Symbol('beta')\n", + "R_T = exp(-r - beta*r*r)\n", + "R_T" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The Hamiltonian for this system is\n", + "$$-\\frac{1}{2} \\nabla^2 - \\frac{1}{r}$$\n", + "The first term is the kinetic energy of the electron, and the second term is the Coulomb attraction between the electron and proton.\n", + "\n", + "The first step is to compute the derivative of the trial wavefunction in spherical coordinates" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def del_spherical(e, r):\n", + " \"\"\"Compute Laplacian for expression e with respect to symbol r.\n", + " Currently works only with radial dependence\"\"\"\n", + " t1 = r*r*diff(e, r)\n", + " t2 = diff(t1, r)/(r*r)\n", + " return simplify(t2)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "del1 = del_spherical(R_T, r)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Construct $\\psi H \\psi$" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "H = -1/S(2) * R_T * del1 - R_T*R_T/r" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUMAAAAcCAYAAAD7nN2RAAAABHNCSVQICAgIfAhkiAAACRRJREFU\neJztnHuwVVUdxz9X7hVUBEcEgcJAyJRRQAhCFAuGEh9RGSBImFL2VDM1LaHmFFiW5sTUqDnJHKNC\nw/H9fpuVSFOmWc2USYWVaXpVRMRS+uO795x19tlrv85+3Mtdn5k75+611/7t9d6/9fv99gaHw9HX\nGVN1ASLYF9i9jBvtUsZNHA5Hj2U0MKPqQkTwPHB21YUAWAEcUnUh2uRdwOeBGnA3cGTFchw7LyOB\nS4HOCu6ddXx+E+iwnJsLLAVOAC4Cdm2viLHsCVwL7BdIn+aVozK+AHykygLkwEDgQuN4IfAq8JaK\n5Dh2fuYB3y/5nlnH5wTgDMu5o4FRxvFNwKEZynZawnwfRwv5DqStBrkq5X2PT5nfyqHAHXkJq5AJ\nwJvAWO94EGrshRXJcfQN1gLzS7xf1vFp2/ntD0wxjscDvwC6MpStljK/bTG8BBiXUMaBwA0p72tV\n579N+krkyTmo4b8Rk28/4FSgH7AHehJ+BnjWO/874DDgKe/Yf9L9OWV58pKTJ3m1UdUcgMbaNmC7\n91sDtkRcU3Wddgc2oEUojIvRZLweeKOE8kSNz7eihfnDwDPAH5A2OBKYSvj4mQKsB74IDANOAt6J\nnBk2WdtyrlOQx70yPJkg74nAukDaNFSf3VCbbAS+AvwjStDEhDcsircBW4lfjGcC5wP9jbTLgZ9G\nXLMWLfTtkpecrBTZRmUyHvg7DQP+cGAT0fWquk5TgV8hDSaKnwEfKr44oZjj8y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l5ovBjPsP+VkZcByju6P3tlTF3Lqq6AL2AqtqoTnGv\nJvbGfh+DYjfdAlc8Z6Lg9baxddZZ3k16CnuRLTK/L1FlG71MIyA6T3prv9fQx5HDnD6OfFlACV8s\nOoecVtwcmIe8hg47O2Mb9cY6zUaf/ncUzzgUrJ4LUWr8xcgmMzGvm7XBVGQbc9jZGduot9VpBLLf\n2j6l78iXsI+4OhwOR5/jZlo/TuFwOBwOh8PhcDgcDofD4XA4HLnwfzLyQErtnCoHAAAAAElFTkSu\nQmCC\n", + "text/latex": [ + "$$\\frac{1}{2} \\left(- 4 \\beta^{2} r^{2} - 4 \\beta r + 6 \\beta - 1\\right) e^{- 2 r \\left(\\beta r + 1\\right)}$$" + ], + "text/plain": [ + "⎛ 2 2 ⎞ -2⋅r⋅(β⋅r + 1)\n", + "⎝- 4⋅β ⋅r - 4⋅β⋅r + 6⋅β - 1⎠⋅ℯ \n", + "─────────────────────────────────────────────\n", + " 2 " + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "simplify(H)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Construct the integral in spherical coordinates (There should be an additional factor of $4 \\pi$, but it will cancel since it occurs in the numerator and denominator)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "h1 = simplify(r*r*H)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Substitute a concrete value for $\\beta$." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "h2 = h1.subs(beta, 0.1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Perform the integral" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMQAAAASCAYAAAAEwXFZAAAABHNCSVQICAgIf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P4KUWnzvhB6ZWYtr6uBi3i7z5jyZX\n2Y9nnD3wW5GaECvkanHDbRdVni68Og4SN8vqzNZVl2HPo6945GjSZTa8eViPn4vy9XtwuNh4PF/4\nuit9b6n2CT2Q2hbPMLgKg/q6F99v8XkuPl2zNfVxgahYVFgkKhPbvLdOvbuoy98ghN8PvxSbzbEB\neBUWiPTkhpq9iy47wjz6iEeONl0G5VVYkfr+WSG/CIuE2Dc1tD2O1+fY13yxIqxpaFuCWxrs9QCM\nJd+HNXDPSfyPtQ064RU8NgNnOt6Y2Ahf2dBWqsuOMI8+4pFjOl268D5qsqhQYSL1vc1kxakX/Eps\n7ur4i+k3Nn34Wi4mdUFD2yrxWFyXvR5K/JfT9UpRsmvbsI+JKs6yaca8R/r+OdNwZuKtFiXKHGdk\nn0t02RHm0Uc8csykSwlvQjzN3jW5kScWmurgcNcGnwPjSnFMnj8+D0wdfanGPVgc7PThC85MbaUH\ngPtrfkJsxLEN/MWiolLdZF8R5cZ9Ms6FiZOfgpby4AuaV7a8SlOiy7DnQT/xqFCiSwlvZ3E+8jtT\niwBHpr6fqQxtJbOuWCt29qtEVYM4LX1JbO4qrMCTYpX47Cx9VagOZJoqME2YX3snRDkf3xUb0T8l\n+wTuFDfFlmQbFwc51QHZMnE6/Hlx+KUj7wRcj4dFebTCvDSuCiW6DHMeFfqIB+W6lPA2J85rpqbd\n54v0ruu/KYpwhHj83ShKWfeJo/wch4ra7209+KpwijiVPHIGnxMitfibEGoznk7fr7BCPLbvFtWb\ne3B8zc9CIe5dYjO2Hsc09FfKe137/3+uqnFLdRnGPCr0FY9SXbrodxZ+IhaU9UKfQ2YY5wgjjDDC\nCCOMMMIIU/E/53G1N9/WAb8AAAAASUVORK5CYII=\n", + "text/latex": [ + "$$-0.0748992089974223$$" + ], + "text/plain": [ + "-0.0748992089974223" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "num = integrate(h2, (r, 0, oo)).evalf()\n", + "num" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Also construct and integrate the denominator (the normalization)." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "norm1 = r*r*R_T*R_T\n", + "norm2 = norm1.subs(beta, 0.1)\n", + "norm3 = simplify(norm2)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKsAAAASCAYAAAAkLS6kAAAABHNCSVQICAgIfAhkiAAABjJJREFU\naIHt2muMXVUVB/DftB1LoS1QWjo2kBYL4iPRlhTQoo1vQ8IH0w+KseLrA6IxEoT4COjgABJMwBCw\npjE6FCNFEEmQRMQIqQlUfKFWCajRGlSwxipapRYcP6x9nX337HPn3NvbD8b5Jzf3nrX3Wf+119l7\n7bXXucxhDv8jGCmuT8WnsAdTWI5L8OQhcByJXXhJjz7Pxzj+iQPpexx/69O2s/E5/DjT9e+s/Xu4\nMf1+Hj6Bp/EsjsKH8URh26OYwH3Yjw34CD6ARwbgfRnOT/0WCf9cle4dxC9nJHsW4QQ8hI/jdxV9\nOS7GqPBpjmHrazvevniPxuPYksk+ht14ziyGNuF08aCmevR5EX6Ljel6DL8WD6Vf2z6UuJo+Z6d+\nJ+FP2Jzdu0U4cEFhX6njX3h/0act73p8HUdk927FU1hX6Gzjl9PwTRyTrhdjJ/6INZqxWiy88UI+\nbH1tx9s375WpMX9Yy3AQF/QwtIYX4m5MiqjaNFkXiMh1YSY7EXvxwQFs25ruH8W8TH4Wbsiu78Sf\niz6LRJR9Z2HjHmzD13BNGluJtrzXCV+8JZOdk2TXZ7K2frkbJxe2rE/6dlTs7GBb6jNeyIetr+14\n++Z9DHdV5D/Ft3sYOhsmNU/Wd4tIdUxDewdtbbuh0mcxviG2HyISHxTbTIlHRSTIcf8strXlhfPw\nV7w+k50r/HN1Jmvrl7+L6Ht8Id8ndo4aNmec44d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PZZ/Az3Yn0JnFqvqeH8Tk6h6AjK23z8KCYKB28WUSO\nNQPY1sElifM9DTZdit+YPtGvF+lGefI8XeRWHdtHxCp/QD1vnI33KvGfgnzR3SzSmNMyWVu/vEZE\n8S8Vnx24pcEGIthM6d5FDoe+tuMdiHedePV1nSj23mHm9nuqeLCf7WH88WIy7zb9fnyvyHPeVvRd\nJqLvbfhyMm7tgLZ18CYxuTc0tC/Cp0V+dLs4ob68oe8rk23bxdY3oV6jbcNLvM69RTy0e3Gr+MNK\niTZ+2af5/wgTZmKpeAa/N11xeDDZfTj0tR1vv7xzmMMc5jCHOczh/wv/AdXUUbu5/Mk5AAAAAElF\nTkSuQmCC\n", + "text/latex": [ + "$$0.160795736242432$$" + ], + "text/plain": [ + "0.160795736242432" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "denom = integrate(norm3, (r, 0, oo)).evalf()\n", + "simplify(denom).evalf()" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAALsAAAASCAYAAAADg69MAAAABHNCSVQICAgIfAhkiAAABtdJREFU\naIHt2m2MXkUVB/Bf2y19ZYWWQiEQWrBgTZAWC1Wxje+KEsFGRWIVE18aUSNGqoCgVSy+JYBErYoJ\nazEWrKn9oB9ME00wEdREC6KAoAhUpCwpAlZaylI/nLns7N377DP32f1i3H/y5Oaec+658585c+bM\n3IdJTOL/BFMm0NfJ+BIewEEcgfXYPQG+L8b05L+Ok7ABT2N/um7AU5nNPbgSv8RerMAl+BjuyuyO\nxaWp/TMwG1/GH2vvLOX6MqxLbZqV/F2F23vkW8qjwmzchpd0eM8J+Bz2YQhz8Gk80iOPXmNgrPHt\nZncWvp3aUsXAc5n+d/hmF7+t8ALswtpMdhnuxCHj9H28GNgNDboX40G8It0vxP0Ntgdrv2fwkZrN\nfGzH0ZlssQiwJZmslOty/BQzM9kmPI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n5CvFuXCFEr4VSniUYjC1ZSGuFkF0fXrHPiM3pDmaeLTpl1K+bfqlwoViEjYiL2Nu\nF2eqbbFbzLjDG3RzxAayNNgXirJkUxe7A6KDH2/Q7RfZYJ7IyreIpXpVzW6a4cw0BZ+t2ewVE+Ce\n1J6lYgNWyvVFqR13ZDY703WN2GPMVcZXIY+2eFzscXIchV8bXhFKeJTGQOn4ltrlmC7Kz/pJ3POY\niJp9r1gRjmvQvdBwx5TgdaJzt2ey6tjvXaKG24xtYgYvMRrVRqjKNsvFClDHEeKYjVjSD8O9DXbf\nEefsM5Vz7U9208VXxarmHErXKSJI2/At4TFeLBBfkTem+1IeTyjrl1K+swvttmX6M8TEeqwry3Hi\nC/iHkX8/OFHM9voXviVG19ljYZHmWu18Ua/mvqaILPKjTLbV6PpzefJ5RfbcI+KEp45DRWlUlUUl\nXGeK1edescJUWJHsRp0UZFikmW8JjzoGdK7ZLxIb0GMz2cWCa3VK04ZHmxjIsUjZR6Vudhck/Xg/\nYnbF0SLI3pPJrhUnIvkGY7WoCX/ewvcSQWJjTT4Vt4oBqvBOkdEXZbLT8WORLYjB2CyW6ryuPy+1\nN3+2XwRZvrsv5XqV+CKbD/6NYjk/TWd04lvKI0e1OZzdoLscfxclAzFxdhv+60VbHqX9Ukcnvm3t\n1if9+7v4mRAsExu7a8Sx1Dajl7WTRYd+q8Bfv/jD08OGT15uFR9+KswT2Wur+Bi0RWSTOlYlm81i\nabxS8xnz6qS/WQTKVnGcWUcJV+Ir5hYRHDuS35Ma7CjjW8LjSJFM7jT8/5DB5Pvdmd0s8fHlBjGJ\nduDlHdpWyqO0X0r5trE7V0y2FR3eN4lJTGISk5jEJCbxv4r/AmY6RtXOL3TYAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$-0.465803451930447$$" + ], + "text/plain": [ + "-0.465803451930447" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "E = num/denom\n", + "E" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And, as expected, energy is greater than the exact ground state energy of -0.5 Hartree.\n", + "\n", + "## Find the minimum energy\n", + "Collect all the steps for computing the energy into a single function. Even though this particular integral could be done symbolically, use numerical integration instead." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def compute_energy(R_T, beta_val):\n", + " \"\"\"Energy given a value for beta\"\"\"\n", + " \n", + " # Normalization integrand (denominator)\n", + " norm1 = r*r*R_T*R_T\n", + " norm2 = norm1.subs(beta, beta_val)\n", + " norm3 = simplify(norm2)\n", + "\n", + " # Integrand for the numerator\n", + " del1 = del_spherical(R_T, r)\n", + " # Construct psi * H * psi\n", + " H = -1/S(2) * R_T * del1 - R_T*R_T/r\n", + " h1 = simplify(r*r*H)\n", + " h2 = h1.subs(beta, beta_val)\n", + " \n", + " lim = 20.0\n", + " \n", + " denom_func = lambdify([r], norm3)\n", + " denom_res = quad(denom_func, 0.0, lim)\n", + " \n", + " num_func = lambdify([r], h2)\n", + " num_res = quad(num_func, 0.0, lim)\n", + "\n", + " e = num_res[0]/denom_res[0]\n", + "\n", + " return e\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now the energy can be computed vs. $\\beta$, and we can find the minimum energy. In this case, the minimum occurs at $\\beta = 0$, which we know is the exact wavefunction for the hydrogen atom." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEACAYAAAByG0uxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYFNW5x/Hvi0ZFRcQoiI6guAUTNSJucaEVcUEFtyAm\ncc01GJeQXMVAghdMclUQxSUuj0B0XCISBB0BZRFacc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y2gxMDDa1w/4WUabP0Zv2FtAl9qOzYOa/kyY\nPPs/wljoZQnVdFi071hCV3UeodtaDpyW5PsEHBzVMTfaf32+/ExlPJ6zEIn5Xu2T8W/3dh79nB8K\n/DWqbQLRfwoSrml74FOgVb78PBHm1/5GOBuqFPhWntT1EmFuZC5hWapaX0sXG4qISIPl85yIiIjk\nOYWIiIg0mEJEREQaTCEiIiINphAREZEGU4iIiEiDKURERKTBFCIiItJg/w/5hdnjarXo7AAAAABJ\nRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "energies = []\n", + "betas = []\n", + "for i in range(10):\n", + " beta_val = i*.01\n", + " e = compute_energy(R_T, beta_val)\n", + " betas.append(beta_val)\n", + " energies.append(e)\n", + "\n", + "plt.plot(betas, energies)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}