Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions examples/atomic_density.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Specify a radial grid."
"## Specify Numerical Grid"
]
},
{
Expand All @@ -62,16 +62,15 @@
"import numpy as np\n",
"from bfit.grid import ClenshawRadialGrid\n",
"\n",
"atomic_numb = 4\n",
"grid = ClenshawRadialGrid(atomic_numb, num_core_pts=400, num_diffuse_pts=500, \n",
" extra_pts=[25, 50, 75])"
"atnum = 4\n",
"grid = ClenshawRadialGrid(atnum, num_core_pts=400, num_diffuse_pts=500, extra_pts=[25, 50, 75])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. Get Slater density."
"## Compute Slater Density"
]
},
{
Expand Down Expand Up @@ -113,13 +112,13 @@
"source": [
"from bfit.density import AtomicDensity\n",
"\n",
"# Grab information about potassium.\n",
"# Load Slater wave-function of Beryllium\n",
"be = AtomicDensity(\"be\")\n",
"\n",
"# Get the total electronic density.\n",
"# Compute total electronic density of Beryllium\n",
"density = be.atomic_density(grid.points, \"total\")\n",
"\n",
"print(\"The integral of potassium is: \", grid.integrate(density))\n",
"print(\"The integral of Beryllium density gives \", grid.integrate(density))\n",
"\n",
"# Plot only the first 500 points.\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -142,7 +141,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Specify the Gaussian model."
"## Specify Gaussian Basis"
]
},
{
Expand All @@ -162,16 +161,16 @@
},
"outputs": [],
"source": [
"from fitting.model import AtomicGaussianDensity\n",
"from bfit.model import AtomicGaussianDensity\n",
"\n",
"model = AtomicGaussianDensity(grid.points, num_s=5, num_p=3, normalize=True)\n"
"model = AtomicGaussianDensity(grid.points, num_s=5, num_p=3, normalize=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Specify the Kullback-Leibler Self-Consistent Field Method."
"## Specify Deviation Measure"
]
},
{
Expand All @@ -191,7 +190,7 @@
},
"outputs": [],
"source": [
"from fitting.fit import KLDivergenceSCF\n",
"from bfit.fit import KLDivergenceSCF\n",
"\n",
"fit = KLDivergenceSCF(grid, density, model)"
]
Expand Down Expand Up @@ -244,6 +243,13 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fit Electron Density"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down