Skip to content

Commit

Permalink
Update tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
kavanase committed Aug 13, 2024
1 parent bdbdebb commit b04b9bf
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions examples/fermisolver_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-11T16:35:19.573318Z",
"start_time": "2024-08-11T16:35:00.021051Z"
"end_time": "2024-08-12T20:08:34.735725Z",
"start_time": "2024-08-12T20:07:56.127239Z"
}
},
"source": [
Expand Down Expand Up @@ -58,12 +58,10 @@
"# defect thermodynamics and the electronic structure of the bulk material. The\n",
"# chempots argument can be supplied to overwrite any chempots associated with\n",
"# the defect thermodynamics object, but regardless chempots must be supplied\n",
"fs = FermiSolver(defect_thermodynamics=defect_thermo,\n",
" bulk_dos=vasprun_path,\n",
" chempots=chempots, backend=\"doped\")\n",
"py_fs = FermiSolver(defect_thermodynamics=defect_thermo,\n",
" bulk_dos=vasprun_path,\n",
" chempots=chempots, backend=\"py-sc-fermi\")\n",
"fs = FermiSolver(defect_thermodynamics=defect_thermo, bulk_dos=vasprun_path,\n",
" chempots=chempots, backend=\"doped\") # default backend\n",
"py_fs = FermiSolver(defect_thermodynamics=defect_thermo, bulk_dos=vasprun_path,\n",
" chempots=chempots, backend=\"py-sc-fermi\")\n",
"\n",
"print(chempots)"
],
Expand All @@ -89,8 +87,8 @@
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-11T16:35:21.589410Z",
"start_time": "2024-08-11T16:35:19.574526Z"
"end_time": "2024-08-12T20:08:50.414395Z",
"start_time": "2024-08-12T20:08:42.207113Z"
}
},
"source": [
Expand Down Expand Up @@ -186,19 +184,19 @@
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-11T16:35:34.843558Z",
"start_time": "2024-08-11T16:35:21.590392Z"
"end_time": "2024-08-13T02:32:58.939074Z",
"start_time": "2024-08-13T02:32:43.860988Z"
}
},
"source": [
"# scan between the Cd and Te rich limits to see how the defect concentrations\n",
"# change as a function of chemical potential\n",
"mu_df = py_fs.interpolate_chempots(limits = [\"Cd-rich\", \"Te-rich\"], \n",
" n_points=20, annealing_temperature=1000, quenching_temperature = 300,\n",
" processes=4)\n",
" n_points=20, annealing_temperature=1000, \n",
" quenching_temperature = 300)\n",
"mu_df_doped = fs.interpolate_chempots(limits = [\"Cd-rich\", \"Te-rich\"],\n",
" n_points=20, annealing_temperature=1000, quenching_temperature=300,\n",
" processes=4)\n",
" n_points=20, annealing_temperature=1000,\n",
" quenching_temperature=300)\n",
"\n",
"# we'll keep the py-sc-fermi and doped comparison going\n",
"mu_df[\"backend\"] = \"py-sc-fermi\"\n",
Expand All @@ -212,19 +210,19 @@
" for defect in unique_defects:\n",
" defect_df = mu_df.loc[defect]\n",
" defect_df_backend = defect_df[defect_df[\"backend\"] == backend]\n",
" ax.plot(defect_df_backend[\"Cd\"], \n",
" ax.plot(defect_df_backend[\"μ_Cd\"], \n",
" defect_df_backend[\"Concentration (cm^-3)\"], \n",
" label=format_defect_name(defect, include_site_info_in_name=True, wout_charge=True), \n",
" color=defect_colors[defect], \n",
" marker=\"o\" if backend == \"doped\" else \"x\",\n",
" alpha = 0.1)\n",
" ax.plot(defect_df_backend[\"Cd\"], \n",
" ax.plot(defect_df_backend[\"μ_Cd\"], \n",
" defect_df_backend[\"Holes (cm^-3)\"], \n",
" marker=\"o\" if backend == \"doped\" else \"x\", \n",
" linestyle=\"--\", \n",
" alpha = 0.75,\n",
" color = \"#999999\")\n",
" ax.plot(defect_df_backend[\"Cd\"], \n",
" ax.plot(defect_df_backend[\"μ_Cd\"], \n",
" defect_df_backend[\"Electrons (cm^-3)\"], \n",
" marker=\"o\" if backend == \"doped\" else \"x\", \n",
" linestyle=\"--\",\n",
Expand Down Expand Up @@ -259,7 +257,7 @@
"output_type": "display_data"
}
],
"execution_count": 3
"execution_count": 5
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -631,7 +629,7 @@
" n_points=50, # n_points in each dimension when scanning over the chemical potential grid\n",
" annealing_temperature=1000, # the temperature at which to anneal the system\n",
" quenching_temperature=300, # the temperature at which to quench the system\n",
" processes=4) # the number of processes to use when scanning over the chemical potential grid"
")"
]
},
{
Expand Down

0 comments on commit b04b9bf

Please sign in to comment.