Skip to content

Commit

Permalink
Enhance readability of the atom grid notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-2023 committed Nov 12, 2023
1 parent f5af7ac commit eda7eee
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions doc/notebooks/Atom_Grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -135,9 +135,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 1. Calculate the radial electron density\n",
"#### 1. Calculate the radial electron density distribution\n",
"\n",
"The radial electron density describes how the electron density in an atom or molecule varies as a function of the distance from the nucleus. It provides insights into the probability distribution of electrons around the nucleus and can help us understand the electron distribution in different electron orbitals (e.g., s, p, d) of atoms and molecules\n",
"The radial distribution of the electron density is the projection of the electron density in the radial coordinate. It describes the probability of finding an electron of the system in the spherical shell between $r$ and $r + dr$. \n",
"\n",
"This is calculated by integrating the electron density over the angular coordinates. Please note the factor $r^{2} sin(\\phi)$ in the integral. This is due to the fact that the electron density is defined in spherical coordinates and the volume element is given by $dV = r^{2} sin(\\phi) dr d\\theta d\\phi$.\n",
"\n",
Expand All @@ -149,12 +149,12 @@
"\n",
"where $r_i$ is a radial grid point. \n",
"\n",
"In the following example we calculate the radial electron density for the He atom in the triplet ($1s^2 2s^1$) state."
"In the following example we calculate the radial electron density distribution for the He atom in the triplet ($1s^2 2s^1$) state using the previously defined atomic grid and the electron density values calculated on the grid points.\n"
]
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -171,14 +171,16 @@
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"# find the radial electron density using atomgrid angular integration\n",
"radial_rho= radial_grid.points**2 * atomgrid.integrate_angular_coordinates(electron_density)\n",
"radial_rho_from_average = atomgrid.spherical_average(electron_density)\n",
"# find the radial electron density distribution using atomgrid angular\n",
"# integration\n",
"radial_rho = atomgrid.integrate_angular_coordinates(electron_density)\n",
"radial_rho *= radial_grid.points**2\n",
"\n",
"# plot the radial electron density\n",
"y_axis = radial_rho\n",
"x_axis = radial_grid.points\n",
"\n",
"plt.plot(x_axis, y_axis, label='He(1s\u00b92s\u00b9)', color='black')\n",
"plt.plot(x_axis, y_axis, label='He(1s¹2s¹)', color='black')\n",
"plt.scatter(x_axis, y_axis, color='red', marker='o')\n",
"plt.xlabel(\"r (bohr)\")\n",
"plt.ylabel(r\"Radial $\\rho(r)$\")\n",
Expand All @@ -193,12 +195,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The radial electron density integrates to the total number of electrons in the system over the radial grid. In this case we have two electrons and the integral should be close to 2.0."
"The maximum values of the radial electron density distribution corresponds to the radial position with maximum probability of finding an electron. In this case there are two maximum values corresponding to the two electrons. The first one (left to right) corresponds to the $1s$ orbital and the second one to the $2s$ orbital.\n",
"\n",
"The radial electron density distribution integrates to the total number of electrons in the system over the radial grid. In this case we have two electrons and the integral should be close to 2.0.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -236,7 +241,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit eda7eee

Please sign in to comment.