Skip to content

Commit

Permalink
Minor modifications to text and widget layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor-96 committed Oct 10, 2023
1 parent 710f40c commit b7146f2
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions notebook/band-theory/density_of_states.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
" <details>\n",
" <summary style=\"color: red\">Solution</summary>\n",
" In the free electron model, the energy isosurface is a sphere shown in \n",
" the left panel. The kpoints grid must be larger than the energy \n",
" the left panel. The k-points grid must be larger than the energy \n",
" isosurface to obtain the correct DOS at the energy level. Here, we \n",
" have a fixed length of the kpoints grid. When the energy is larger than \n",
" about 0.31, the kpoints grid cannot include the whole sphere (check it by \n",
" have a fixed length of the k-points grid. When the energy is larger than \n",
" about 0.31, the k-points grid cannot include the whole sphere (check it by \n",
" clicking on the right panel to move the isovalue above and below 0.31). \n",
" </details>\n",
" \n",
Expand All @@ -96,17 +96,9 @@
},
{
"cell_type": "code",
"execution_count": 170,
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"DEBUG:matplotlib.pyplot:Loaded backend module://ipympl.backend_nbagg version unknown.\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"import seekpath\n",
Expand All @@ -131,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 171,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -149,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count": 172,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -170,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 173,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -227,7 +219,7 @@
},
{
"cell_type": "code",
"execution_count": 174,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -245,7 +237,7 @@
},
{
"cell_type": "code",
"execution_count": 175,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -257,7 +249,7 @@
"cell_type = RadioButtons(options=['Simple cubic', 'FCC', 'BCC'], value='Simple cubic', description=\"Cell type:\")\n",
"\n",
"line1 = Label(\n",
" value=r'Number of kpoints per dimension, $N_k$'\n",
" value=r'Number of k-points per dimension, $N_k$'\n",
")\n",
"\n",
"line2 = Label(\n",
Expand All @@ -266,7 +258,7 @@
"nkpt = IntSlider(value=4, min=4, max=15, description=\"\", style={'description_width': 'initial'}, continuous_update=False)\n",
"nkpt_box = HBox([VBox([line1, line2]), nkpt])\n",
"\n",
"# nkpt = IntSlider(value=4, min=4, max=15,description=\"Number of kpoints per dimension\\n, $N_k$\" , display='flex',\n",
"# nkpt = IntSlider(value=4, min=4, max=15,description=\"Number of kpoik-pointsnts per dimension\\n, $N_k$\" , display='flex',\n",
"# flex_flow='row', continuous_update=False)\n",
"grange = IntSlider(value=0, min=0, max=3, description=\"G-vector range:\", style=style)\n",
"grange_hint =HTML(value=f\"<b>Note that there may be a delay while the DOS is computed for G-vectors > 0.</b>\")\n",
Expand Down Expand Up @@ -460,7 +452,7 @@
},
{
"cell_type": "code",
"execution_count": 176,
"execution_count": 25,
"metadata": {
"tags": []
},
Expand All @@ -478,7 +470,7 @@
")\n",
"nkpt = IntSlider(value=4, min=4, max=15, description=\"\", style={'description_width': 'initial'}, continuous_update=False)\n",
"nkpt_box = HBox([VBox([line1, line2]), nkpt])\n",
"nbin = IntSlider(value=30, min=30, max=500, description=\"Number of bins/eV (rounded):\", layout=Layout(width=\"300px\"), style={'description_width': 'initial'})\n",
"nbin = IntSlider(value=30, min=30, max=500, description=\"Number of bins:\", layout=Layout(width=\"400px\"), style={'description_width': 'initial'})\n",
"gstd = FloatSlider(value=0.01, min=0.01, max=0.1, step=0.01, description=\"Gaussian $\\sigma$ (eV):\", layout=Layout(width=\"300px\"), style={'description_width': 'initial'})\n",
"\n",
"#All buttons\n",
Expand Down Expand Up @@ -728,7 +720,7 @@
},
{
"cell_type": "code",
"execution_count": 177,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -764,7 +756,7 @@
"\n",
"\n",
"def update_kpts_fig(c):\n",
" \"\"\"Update the kpoints plot when tuning the kpoints slider.\n",
" \"\"\"Update the k-points plot when tuning the k-points slider.\n",
" \"\"\"\n",
" kpts = _compute_total_kpts(G)\n",
" \n",
Expand Down Expand Up @@ -794,13 +786,13 @@
},
{
"cell_type": "code",
"execution_count": 178,
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "28af17027813409fbbffbc57dd9a625c",
"model_id": "8aff3533264641ada75d55a7b3735e85",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -836,13 +828,13 @@
"\n",
"## **Interactive figures**\n",
"\n",
"The left panel shows the electronic bandstructure of a free electron gas in 3 dimensions while the right panel displays the corresponding density of states. You can choose the number of kpoints used in the computation of the DOS by manipulating the kpoints slider. \n",
"The left panel shows the electronic bandstructure of a free electron gas in 3 dimensions while the right panel displays the corresponding density of states. You can choose the number of k-points used in the computation of the DOS by manipulating the k-points slider. \n",
"\n",
"## **Controls**\n",
"\n",
"Three buttons allow one to compute the DOS with the three methods discussed \n",
"earlier. The calculated DOS will appear in the figure on the right, superimposed on the analytic curve.\n",
"Computing the DOS with a large number of kpoints may take several seconds.\n",
"Computing the DOS with a large number of k-points may take several seconds.\n",
"When using the simple histogramming method, you can adjust the number of bins employed by varying the \"Number of bins\" slider.\n",
"For the Gaussian smearing method, you can also tune the standard \n",
"deviation, $\\sigma$, of the Gaussian functions by adjusting the \"Gaussian $\\sigma$\" slider."
Expand Down

0 comments on commit b7146f2

Please sign in to comment.