diff --git a/ch05/hydrogen_wavefunctions.ipynb b/ch05/hydrogen_wavefunctions.ipynb index a6cd5cd4..eb73730f 100644 --- a/ch05/hydrogen_wavefunctions.ipynb +++ b/ch05/hydrogen_wavefunctions.ipynb @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "id": "66432757", "metadata": { "id": "66432757" @@ -41,7 +41,6 @@ "import seaborn as sns\n", "import numpy as np\n", "\n", - "from scipy.special import sph_harm, genlaguerre\n", "from scipy.constants import physical_constants\n", "from matplotlib import cm, colors\n", "import plotly.graph_objects as go\n", @@ -78,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "id": "64b5614e", "metadata": { "id": "64b5614e" @@ -93,7 +92,9 @@ " n: principal quantum number Int (1,2,3... inf)\n", " l: angular quantum number Int (0,1,2,... n-1)\n", " '''\n", - "\n", + " from scipy.special import genlaguerre\n", + " \n", + " \n", " a0 = 1 # Bohr radius equal to 5.29e-11 m\n", "\n", " prefactor = np.sqrt( ((2 / n * a0) ** 3 * (np.math.factorial(n - l - 1))) / (2 * n * (np.math.factorial(n + l))) )\n", @@ -108,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "id": "1d3fa3c2", "metadata": {}, "outputs": [ @@ -116,7 +117,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_14968/1718118984.py:12: DeprecationWarning: `np.math` is a deprecated alias for the standard library `math` module (Deprecated Numpy 1.25). Replace usages of `np.math` with `math`\n", + "/tmp/ipykernel_15473/1039204017.py:14: DeprecationWarning: `np.math` is a deprecated alias for the standard library `math` module (Deprecated Numpy 1.25). Replace usages of `np.math` with `math`\n", " prefactor = np.sqrt( ((2 / n * a0) ** 3 * (np.math.factorial(n - l - 1))) / (2 * n * (np.math.factorial(n + l))) )\n" ] }, @@ -126,7 +127,7 @@ "Text(0, 0.5, '$R_nl(r) r^2$')" ] }, - "execution_count": 6, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, @@ -199,8 +200,7 @@ }, { "cell_type": "code", - "execution_count": 7, - "id": "1fc901f3", + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -209,18 +209,20 @@ "(0.28209479177387814+0j)" ] }, - "execution_count": 7, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "from scipy.special import sph_harm\n", + "\n", "sph_harm(0, 0, np.pi, np.pi) # test a few spherical harmonics" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "id": "00641d96", "metadata": {}, "outputs": [], @@ -241,9 +243,9 @@ " R=abs(Ylm)\n", " \n", " # Let's normalize color scale\n", - " fcolors = Ylm.real\n", + " fcolors = Ylm.real\n", " fmax, fmin = fcolors.max(), fcolors.min()\n", - " fcolors = (fcolors - fmin)/(fmax - fmin)\n", + " fcolors = (fcolors - fmin)/(fmax - fmin)\n", "\n", " # Since we want to plot on cartesian reference frame we will use cartesian coordiniates x, y, z using R as the absolute value of Yml\n", " # Try a plot without R part. \n", @@ -263,10 +265,39 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "id": "5ba0e196", "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "application/vnd.plotly.v1+json": { @@ -41968,9 +41999,9 @@ } }, "text/html": [ - "