Skip to content

Commit

Permalink
update the example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Dou Du committed Jul 17, 2024
1 parent 4c579f1 commit b896934
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions example/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" This is a Jupyter widget, which plots the bandstructure and density of states from given json files.\n",
"</p>\n",
"\n",
"## **Input json files**\n",
"\n",
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" On the left, it plots the bandstructures. One can input several bandstructure json files as a list.\n",
" The figure on the right shows the density of states, which can only show one DOS plot. The json files\n",
" for the bandstructures can be generated from AiiDA with the verdi command:\n",
Expand All @@ -29,7 +29,7 @@
"verdi data bands export --format json <IDENTIFIER>\n",
"```\n",
"\n",
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" The json format for the DOS can be checked in the github repository.\n",
"</p>\n",
"\n",
Expand All @@ -41,7 +41,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"paramsparams<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" Here, one needs to use the json package to load the json file and pass it to the widget.\n",
"</p>\n",
"\n",
Expand All @@ -55,27 +55,35 @@
"\n",
"## **Fermi energy**\n",
"\n",
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" The Fermi energy is reading from the bands and DOS json files. And bandstructure and density \n",
" of states plots are aligned to the Fermi energy (shift the Fermi energy to zero).\n",
"</p>\n",
"\n",
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" In the default plot for the DOS, there is a horizontal line to highlight the Fermi level. One \n",
" can turn it off by setting plot_fermilevel = False. The legend of the DOS can be turned off\n",
" by set show_legend = False.\n",
" can turn it off by setting showFermi = False. The legend of the DOS can be turned off\n",
" by set showLegend = False.\n",
"</p>\n",
"\n",
"## **Usage of the widget**\n",
"\n",
"<p style=\"text-align: justify;font-size:15px\">\n",
"<p style=\"text-align: justify;font-size:20px\">\n",
" Remeber to pass the bandstructure data as a list of json objects. \"energy_range\" sets the \n",
" energy range for the plots.\n",
"</p>\n",
"\n",
"### **Plot both bandstructure and DOS**\n",
"```python\n",
"w1 = BandsPlotWidget(bands=[band_Si], dos=dos_Si, plot_fermilevel = True, energy_range = {\"ymin\": -10.0, \"ymax\": 10.0})\n",
"w1 = BandsPlotWidget(\n",
" bands = [si_bands],\n",
" dos = si_dos,\n",
" energy_range = [-10.0, 10.0],\n",
" format_settings = {\n",
" \"showFermi\": True,\n",
" \"showLegend\": True,\n",
" }\n",
")\n",
"display(w1)\n",
"```"
]
Expand Down

0 comments on commit b896934

Please sign in to comment.