Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 18 additions & 7 deletions other/materials_designer/workflows/band_structure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,19 @@
"\n",
"# K-grids and k-path\n",
"RELAXATION_KGRID = None # e.g. [4, 4, 4]\n",
"SCF_KGRID = None # e.g. [8, 8, 8]\n",
"NSCF_KGRID = None # e.g. [12, 12, 12] — used for band_structure_dos\n",
"KPATH = [{\"point\": \"Г\", \"steps\": 10}, {\"point\": \"M\", \"steps\": 10}, {\"point\": \"K\", \"steps\": 10}, {\"point\": \"Г\", \"steps\": 10}] # e.g. [{\"point\": \"Г\", \"steps\": 10}, {\"point\": \"M\", \"steps\": 10}, {\"point\": \"K\", \"steps\": 10}, {\"point\": \"Г\", \"steps\": 10}]\n",
"SCF_KGRID = None # e.g. [8, 8, 8]\n",
"NSCF_KGRID = None # e.g. [12, 12, 12] — used for band_structure_dos\n",
"KPATH = None # [{\"point\": \"Г\", \"steps\": 10}, {\"point\": \"M\", \"steps\": 10}, {\"point\": \"K\", \"steps\": 10}, {\"point\": \"Г\", \"steps\": 10}]\n",
"\n",
"# Energy cutoffs\n",
"ECUTWFC = 40\n",
"ECUTRHO = 200"
"ECUTRHO = 200\n",
"\n",
"# Additional QE input parameters per unit\n",
"# Format: {\"unit_name\": {\"namelist\": {\"parameter\": value}}}\n",
"ADDITIONAL_PARAMETERS = {\n",
" # \"pw_nscf\": {\"system\": {\"occupations\": \"tetrahedra_opt\"}},\n",
"}"
]
},
{
Expand Down Expand Up @@ -390,6 +396,8 @@
"source": [
"from mat3ra.wode.context.providers import PlanewaveCutoffsContextProvider, PointsGridDataProvider, \\\n",
" PointsPathDataProvider\n",
"from mat3ra.notebooks_utils.workflow import patch_workflow_qe_input\n",
"\n",
"\n",
"bs_subworkflow = workflow.subworkflows[1 if ADD_RELAXATION else 0]\n",
"\n",
Expand Down Expand Up @@ -423,7 +431,11 @@
" unit = swf.get_unit_by_name(name=unit_name)\n",
" if unit:\n",
" unit.add_context(cutoffs_context)\n",
" swf.set_unit(unit)"
" swf.set_unit(unit)\n",
"\n",
"if ADDITIONAL_PARAMETERS:\n",
" for unit_name, parameters in ADDITIONAL_PARAMETERS.items():\n",
" patch_workflow_qe_input(workflow, parameters, unit_names=[unit_name])"
]
},
{
Expand Down Expand Up @@ -513,8 +525,7 @@
" queue=QUEUE_NAME,\n",
" ppn=PPN\n",
")\n",
"print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}\")\n",
"compute.cluster"
"print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}\")"
]
},
{
Expand Down
26 changes: 22 additions & 4 deletions other/materials_designer/workflows/band_structure_hse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
"# K-grids and k-path\n",
"RELAXATION_KGRID = None # e.g. [4, 4, 4]\n",
"# Required: uniform Gamma-centered grid — sets both k-mesh and exchange q-grid (nqx1/2/3)\n",
"SCF_KGRID = [1, 1, 1]\n",
"KPATH = None # e.g. [{\"point\": \"Г\", \"steps\": 20}, {\"point\": \"X\", \"steps\": 20}]\n",
"\n",
"SCF_KGRID = None # [1, 1, 1]\n",
"KPATH = None # e.g. [{\"point\": \"Г\", \"steps\": 10},{\"point\": \"M\", \"steps\": 10}, {\"point\": \"K\", \"steps\": 10}, {\"point\": \"Г\", \"steps\": 10}]\n",
"QGRID = None # [1, 1, 1]\n",
"# Energy cutoffs\n",
"ECUTWFC = 40\n",
"ECUTRHO = 200"
Expand Down Expand Up @@ -436,7 +436,25 @@
" unit = swf.get_unit_by_name(name=unit_name)\n",
" if unit:\n",
" unit.add_context(cutoffs_context)\n",
" swf.set_unit(unit)"
" swf.set_unit(unit)\n",
"\n",
"if QGRID is not None:\n",
" unit = main_hse_subworkflow.get_unit_by_name(name=\"pw_scf_bands_hse\")\n",
" if unit:\n",
" unit.add_context({\n",
" \"qgrid\": {\n",
" \"dimensions\": QGRID,\n",
" \"shifts\": [0, 0, 0],\n",
" \"preferGridMetric\": False,\n",
" },\n",
" \"isQgridEdited\": True,\n",
" })\n",
" main_hse_subworkflow.set_unit(unit)\n",
"\n",
"bands_unit = main_hse_subworkflow.get_unit_by_name(name=\"bands\")\n",
"if bands_unit:\n",
" bands_unit.results = [{\"name\": \"band_structure\"},{\"name\": \"band_gaps\"}]\n",
" main_hse_subworkflow.set_unit(bands_unit)"
]
},
{
Expand Down
Loading
Loading