From 8865183bbf84a41f9e5d1a7d6672e5fe023dbb87 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Mon, 16 Nov 2026 20:14:59 -0800 Subject: [PATCH 01/18] SOF-8128: nanowire notebook also saves the one-period cell; both materials named Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon.ipynb | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 8fae46707..54f372c2b 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -46,7 +46,10 @@ "PASSIVANT = \"H\" # Chemical symbol of the passivant\n", "COORDINATION_SEARCH_RADIUS = 2.5 # in Angstroms (sphere in which to search for neighbors)\n", "COORDINATION_THRESHOLD = 3 # Coordination number below which to passivate\n", - "MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate" + "MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate\n", + "\n", + "PASSIVATED_NANOWIRE_NAME = \"Si nanowire 110 H-passivated\"\n", + "ONE_PERIOD_NANOWIRE_NAME = \"Si nanowire 110 H-passivated one period\"" ] }, { @@ -250,7 +253,8 @@ "id": "19", "metadata": {}, "source": [ - "## 5. Download the Material" + "## 5. Create the one-period cell\n", + "The manuscript computes the bands on one period of the wire, a√2/2 along ⟨110⟩ (Sec. II): the lower half of the two-period cell." ] }, { @@ -259,12 +263,34 @@ "id": "20", "metadata": {}, "outputs": [], + "source": [ + "lattice_vectors = passivated_nanowire.lattice.vector_arrays\n", + "period = passivated_nanowire.lattice.c / 2\n", + "one_period_nanowire = filter_by_box(passivated_nanowire, [0, 0, 0], [1, 1, 0.5])\n", + "one_period_nanowire.set_lattice_vectors(lattice_vectors[0], lattice_vectors[1], [0.0, 0.0, period])" + ] + }, + { + "cell_type": "markdown", + "id": "21", + "metadata": {}, + "source": [ + "## 6. Download the Material" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.notebooks_utils.io import download_content_to_file\n", "from mat3ra.notebooks_utils.material import set_materials\n", "\n", - "passivated_nanowire.name = \"H-Passivated Silicon Nanowire\"\n", - "set_materials(passivated_nanowire)\n", + "passivated_nanowire.name = PASSIVATED_NANOWIRE_NAME\n", + "one_period_nanowire.name = ONE_PERIOD_NANOWIRE_NAME\n", + "set_materials([passivated_nanowire, one_period_nanowire])\n", "download_content_to_file(passivated_nanowire.to_json(), \"passivated_nanowire.json\")" ] } From 406e624a55b1b78ff0124a3344774cc03eb15e59 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Mon, 16 Nov 2026 21:32:54 -0800 Subject: [PATCH 02/18] SOF-8128: Si nanowire simulation notebook: PBE relaxation of the period, HSE06 bands along the wire and DOS, bulk Si gap Relaxes the one-period H-passivated <110> wire (cell_dofree z), computes its HSE06 band structure along Gamma-Z (explicit path, q-grid 1x1x4) and HSE06 DOS, and the HSE06 gap of bulk Si, then prints both gaps beside Aradi et al. 2007 Table II and shows Fig. 8 (left) beside the same layout of ours. Jobs are reused by material, workflow name and k-grid. Introduction row X-1D-PAS links it. Not yet run end to end on the platform: cluster-003 cannot start MPI and cluster-001's OR node cannot load QE. Co-Authored-By: Claude Opus 5.5 --- .../specific_examples/Introduction.ipynb | 2 +- ...ion_edge_nanowire_silicon_SIMULATION.ipynb | 725 ++++++++++++++++++ 2 files changed, 726 insertions(+), 1 deletion(-) create mode 100644 other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb diff --git a/other/materials_designer/specific_examples/Introduction.ipynb b/other/materials_designer/specific_examples/Introduction.ipynb index 7082fa0a7..1dae0b514 100644 --- a/other/materials_designer/specific_examples/Introduction.ipynb +++ b/other/materials_designer/specific_examples/Introduction.ipynb @@ -49,7 +49,7 @@ "| `X-3D-ANL` | Annealed Crystal | *To be added* | — | — |\n", "| `X-2D-PER` | Perturbation | [Ripple Perturbation in Graphene](perturbation_ripple_graphene.ipynb) | *To be added* | [[20]](#ref20) |\n", "| `X-2D-PAS` | Passivated Surface | [Silicon Surface Passivation](passivation_surface_silicon.ipynb) | *To be added* | [[21]](#ref21) |\n", - "| `X-1D-PAS` | Passivated Edge | [Si Nanowire Edge Passivation](passivation_edge_nanowire_silicon.ipynb) | *To be added* | [[22]](#ref22) |\n", + "| `X-1D-PAS` | Passivated Edge | [Si Nanowire Edge Passivation](passivation_edge_nanowire_silicon.ipynb) | [Si Nanowire Band Gap and DOS](passivation_edge_nanowire_silicon_SIMULATION.ipynb) | [[22]](#ref22) |\n", "| `X-0D-PAS` | Passivated Edge | *To be added* | — | — |\n", "| `X-0D-CUT` | Slab Cutout | [Custom Cutout in Etched Silicon](custom_cutout_etched_silicon.ipynb) | *To be added* | [[25]](#ref25) |\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb new file mode 100644 index 000000000..cd352f573 --- /dev/null +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -0,0 +1,725 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0", + "metadata": {}, + "source": [ + "# Band Gap and Density of States of an H-Passivated Si Nanowire\n", + "\n", + "> **B. Aradi, L. E. Ramos, P. Deák, Th. Köhler, F. Bechstedt, R. Q. Zhang, and Th. Frauenheim**\n", + "> \"Theoretical study of the chemical gap tuning in silicon nanowires\"\n", + "> Phys. Rev. B 76, 035305 (2007)\n", + "> [DOI: 10.1103/PhysRevB.76.035305](https://doi.org/10.1103/PhysRevB.76.035305)\n", + "\n", + "Computes the band gap, the bands along the wire and the density of states of the H-passivated ⟨110⟩ silicon nanowire\n", + "of radius 0.51 nm, one period Si₁₈H₁₂ as created in the [structure notebook](passivation_edge_nanowire_silicon.ipynb),\n", + "and the band gap of bulk silicon, with the HSE06 hybrid functional, and compares them with Aradi et al.'s Table II and\n", + "Fig. 8 (left). The manuscript optimizes the wire with DFTB and computes its gaps with CRYSTAL and a one-parameter global\n", + "hybrid fitted to bulk silicon (1.16 eV); here the atoms and the period of the wire are relaxed with PBE and the gaps are\n", + "computed with HSE06.\n", + "\n", + "

Usage

\n", + "\n", + "1. Create the material in the [structure notebook](passivation_edge_nanowire_silicon.ipynb), which saves `Si nanowire 110 H-passivated one period` to the `uploads` folder.\n", + "1. Set the parameters in cells 1.2 and 1.3 (or use the defaults).\n", + "1. Click \"Run\" > \"Run All\" to run all cells.\n", + "1. Wait for the jobs to complete.\n", + "1. Scroll down to view the results.\n", + "\n", + "## Summary\n", + "\n", + "1. Set up the environment and parameters: install packages (JupyterLite only) and configure the material names, compute, DFT and plot parameters.\n", + "1. Authenticate and initialize API client: authenticate via browser, initialize the client, then select account and project.\n", + "1. Load the wire by name and bulk silicon from Standata, print provenance and save both to the platform.\n", + "1. Configure the workflows: variable-cell relaxation of the wire, HSE06 band structure of the wire, HSE06 band gap and density of states of the wire and of bulk silicon.\n", + "1. Configure compute: get the list of clusters and create a compute configuration.\n", + "1. Run the jobs: bulk silicon and the relaxation of the wire, then the band structure and the density of states of the relaxed wire.\n", + "1. Retrieve the results: the period of the relaxed wire and the band gaps.\n", + "1. Compare with Aradi et al. (2007): the band gaps, then the bands and the density of states beside Fig. 8 (left)." + ] + }, + { + "cell_type": "markdown", + "id": "1", + "metadata": {}, + "source": [ + "## 1. Set up the environment and parameters\n", + "### 1.1. Install packages (JupyterLite)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.packages import install_packages\n", + "\n", + "await install_packages(\"made|api_examples\")" + ] + }, + { + "cell_type": "markdown", + "id": "3", + "metadata": {}, + "source": [ + "### 1.2. Set parameters and configurations for the workflows and jobs" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "from datetime import datetime\n", + "from mat3ra.ide.compute import QueueName\n", + "\n", + "ORGANIZATION_NAME = None # set to your organization name (full or partial); otherwise, your default one is used\n", + "FOLDER = \"./uploads\"\n", + "WIRE_NAME = \"Si nanowire 110 H-passivated one period\" # saved by the structure notebook\n", + "BULK_NAME = \"Silicon\" # Standata\n", + "\n", + "APPLICATION_NAME = \"espresso\"\n", + "RELAX_WORKFLOW_SEARCH_TERM = \"variable_cell_relaxation.json\"\n", + "BANDS_WORKFLOW_SEARCH_TERM = \"band_structure_hse.json\"\n", + "DOS_WORKFLOW_SEARCH_TERM = \"band_gap_dos_hse.json\"\n", + "\n", + "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", + "QUEUE_NAME = QueueName.OR\n", + "PPN = 16 # OR allows 16 cores per job\n", + "TIME_LIMIT = \"04:00:00\"\n", + "\n", + "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", + "POLL_INTERVAL = 60 # seconds\n", + "\n", + "ENERGY_WINDOW = (-4.0, 6.0) # eV, the energy range of Fig. 8" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### 1.3. Set the DFT parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], + "source": [ + "# manuscript: geometry with DFTB, gaps with CRYSTAL and a one-parameter global hybrid fitted to bulk Si;\n", + "# ours: geometry with PBE, gaps with HSE06, GBRV ultrasoft pseudopotentials at their tested cutoffs\n", + "ECUTWFC = 40 # Ry\n", + "ECUTRHO = 200 # Ry\n", + "\n", + "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", + "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", + "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", + "BANDS_KGRID = [1, 1, 8]\n", + "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", + "KPATH_STEPS = 20 # even, so every k − q of the path stays on the path for the 1x1x4 q-grid\n", + "DOS_KGRID = [1, 1, 8] # the workflow runs odd dimensions as the next even, so 2x2x8\n", + "BULK_KGRID = [8, 8, 8]\n", + "\n", + "RELAX_UNIT = \"pw_vc-relax\"\n", + "PRELIMINARY_SCF_UNIT = \"pw_scf\"\n", + "BANDS_HSE_UNIT = \"pw_scf_bands_hse\"\n", + "BANDS_UNIT = \"bands\"\n", + "DOS_HSE_UNIT = \"pw_scf_hse\"" + ] + }, + { + "cell_type": "markdown", + "id": "7", + "metadata": {}, + "source": [ + "## 2. Authenticate and initialize API client\n", + "### 2.1. Authenticate\n", + "Authenticate in the browser and have credentials stored in environment variable \"OIDC_ACCESS_TOKEN\"." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.auth import authenticate\n", + "\n", + "await authenticate()" + ] + }, + { + "cell_type": "markdown", + "id": "9", + "metadata": {}, + "source": [ + "### 2.2. Initialize API client" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.api_client import APIClient\n", + "\n", + "client = APIClient.authenticate()\n", + "client" + ] + }, + { + "cell_type": "markdown", + "id": "11", + "metadata": {}, + "source": [ + "### 2.3. Select account" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "client.list_accounts()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], + "source": [ + "selected_account = client.my_account\n", + "\n", + "if ORGANIZATION_NAME:\n", + " selected_account = client.get_account(name=ORGANIZATION_NAME)\n", + "\n", + "ACCOUNT_ID = selected_account.id\n", + "print(f\"✅ Selected account ID: {ACCOUNT_ID}, name: {selected_account.name}\")" + ] + }, + { + "cell_type": "markdown", + "id": "14", + "metadata": {}, + "source": [ + "### 2.4. Select project" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], + "source": [ + "projects = client.projects.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})\n", + "project_id = projects[0][\"_id\"]\n", + "print(f\"✅ Using project: {projects[0]['name']} ({project_id})\")" + ] + }, + { + "cell_type": "markdown", + "id": "16", + "metadata": {}, + "source": [ + "## 3. Load the materials\n", + "### 3.1. Load the wire from the uploads folder or the platform, bulk silicon from Standata, and print provenance" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], + "source": [ + "from collections import Counter\n", + "from mat3ra.made.material import Material\n", + "from mat3ra.notebooks_utils.core.entity.material.api import load_material\n", + "from mat3ra.standata.materials import Materials\n", + "\n", + "materials = {\n", + " WIRE_NAME: load_material(client, FOLDER, WIRE_NAME, ACCOUNT_ID),\n", + " BULK_NAME: Material.create(Materials.get_by_name_first_match(BULK_NAME)),\n", + "}\n", + "for name, material in materials.items():\n", + " print(f\"{name}: {dict(Counter(material.basis.elements.values))}, {material.basis.number_of_atoms} atoms, \"\n", + " f\"cell {material.lattice.a:.3f} x {material.lattice.b:.3f} x {material.lattice.c:.3f} Å\")" + ] + }, + { + "cell_type": "markdown", + "id": "18", + "metadata": {}, + "source": [ + "### 3.2. Save the materials to the platform" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "19", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.core.entity.material.api import get_or_create_material\n", + "\n", + "saved_materials = {name: get_or_create_material(client, material, ACCOUNT_ID) for name, material in materials.items()}" + ] + }, + { + "cell_type": "markdown", + "id": "20", + "metadata": {}, + "source": [ + "## 4. Configure the workflows\n", + "\n", + "The Standata workflows carry their models: PBE for the relaxation and for the preliminary SCF of the band structure,\n", + "HSE06 for the band structure and for the band gap and density of states, all with GBRV ultrasoft pseudopotentials.\n", + "### 4.1. Variable-cell relaxation of the wire" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.standata.workflows import WorkflowStandata\n", + "from mat3ra.wode.workflows import Workflow\n", + "from mat3ra.notebooks_utils.workflow import apply_planewave_cutoffs, apply_scf_kgrid, patch_workflow_qe_input\n", + "\n", + "workflow_configs = WorkflowStandata.filter_by_application(APPLICATION_NAME)\n", + "wire = materials[WIRE_NAME]\n", + "\n", + "relax_workflow = Workflow.create(workflow_configs.get_by_name_first_match(RELAX_WORKFLOW_SEARCH_TERM))\n", + "relax_workflow.name = \"Variable-cell Relaxation Si nanowire\"\n", + "apply_planewave_cutoffs(relax_workflow, ECUTWFC, ECUTRHO, unit_name=RELAX_UNIT)\n", + "apply_scf_kgrid(relax_workflow, RELAX_KGRID, material=wire, unit_name=RELAX_UNIT)\n", + "patch_workflow_qe_input(relax_workflow, RELAXATION_SETTINGS, [RELAX_UNIT])" + ] + }, + { + "cell_type": "markdown", + "id": "22", + "metadata": {}, + "source": [ + "### 4.2. HSE06 band structure of the wire\n", + "\n", + "The PBE SCF on `BANDS_KGRID` gives the k-points of the HSE06 run, which adds the path along the wire (6.2) and\n", + "evaluates the exchange on `QGRID`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "23", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.wode.context.providers import PointsGridDataProvider\n", + "\n", + "bands_workflow = Workflow.create(workflow_configs.get_by_name_first_match(BANDS_WORKFLOW_SEARCH_TERM))\n", + "bands_workflow.name = \"Band Structure HSE06 Si nanowire\"\n", + "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", + "for unit_name in (PRELIMINARY_SCF_UNIT, BANDS_HSE_UNIT):\n", + " apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", + "main_hse_subworkflow = next(\n", + " subworkflow for subworkflow in bands_workflow.subworkflows if subworkflow.name == \"Main HSE Run\"\n", + ")\n", + "bands_hse_unit = main_hse_subworkflow.get_unit_by_name(name=BANDS_HSE_UNIT)\n", + "bands_hse_unit.add_context(\n", + " PointsGridDataProvider(name=\"qgrid\", material=wire, dimensions=QGRID, isEdited=True).get_context_item_data()\n", + ")\n", + "main_hse_subworkflow.set_unit(bands_hse_unit)\n", + "bands_unit = main_hse_subworkflow.get_unit_by_name(name=BANDS_UNIT)\n", + "bands_unit.results = [{\"name\": \"band_structure\"}, {\"name\": \"band_gaps\"}]\n", + "main_hse_subworkflow.set_unit(bands_unit)" + ] + }, + { + "cell_type": "markdown", + "id": "24", + "metadata": {}, + "source": [ + "### 4.3. HSE06 band gap and density of states of the wire and of bulk silicon" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25", + "metadata": {}, + "outputs": [], + "source": [ + "dos_workflows = {}\n", + "for name, kgrid, workflow_name in ((WIRE_NAME, DOS_KGRID, \"Band Gap + DOS HSE06 Si nanowire\"),\n", + " (BULK_NAME, BULK_KGRID, \"Band Gap + DOS HSE06 Si bulk\")):\n", + " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", + " workflow.name = workflow_name\n", + " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=DOS_HSE_UNIT)\n", + " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", + " dos_workflows[name] = workflow" + ] + }, + { + "cell_type": "markdown", + "id": "26", + "metadata": {}, + "source": [ + "## 5. Create the compute configuration\n", + "### 5.1. Get list of clusters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27", + "metadata": {}, + "outputs": [], + "source": [ + "clusters = client.clusters.list()\n", + "print(f\"Available clusters: {[c['hostname'] for c in clusters]}\")" + ] + }, + { + "cell_type": "markdown", + "id": "28", + "metadata": {}, + "source": [ + "### 5.2. Create the compute configuration for the jobs" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "29", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.ide.compute import Compute\n", + "\n", + "if CLUSTER_NAME:\n", + " cluster = next((c for c in clusters if CLUSTER_NAME in c[\"hostname\"]), None)\n", + " if cluster is None:\n", + " raise ValueError(f\"Cluster '{CLUSTER_NAME}' not found. Available: {[c['hostname'] for c in clusters]}\")\n", + "else:\n", + " cluster = clusters[0]\n", + "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=PPN, timeLimit=TIME_LIMIT)\n", + "print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}, \"\n", + " f\"time limit: {TIME_LIMIT}\")" + ] + }, + { + "cell_type": "markdown", + "id": "30", + "metadata": {}, + "source": [ + "## 6. Run the jobs\n", + "\n", + "A finished or running job for the same material, workflow name and k-grid is reused.\n", + "### 6.1. Bulk silicon and the relaxation of the wire" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.core.entity.job.api import find_job_for_material\n", + "from mat3ra.notebooks_utils.job import create_job\n", + "from mat3ra.notebooks_utils.api.job import submit_jobs, wait_for_jobs_to_finish_async\n", + "\n", + "job_ids = {}\n", + "for workflow, saved_material, kgrid, unit_name in (\n", + " (dos_workflows[BULK_NAME], saved_materials[BULK_NAME], BULK_KGRID, DOS_HSE_UNIT),\n", + " (relax_workflow, saved_materials[WIRE_NAME], RELAX_KGRID, RELAX_UNIT),\n", + "):\n", + " job = find_job_for_material(client, saved_material[\"_id\"], workflow.name, ACCOUNT_ID,\n", + " statuses=(\"submitted\", \"queued\", \"active\", \"finished\"),\n", + " kgrid=kgrid, unit_name=unit_name)\n", + " if job is None:\n", + " job = create_job(api_client=client, materials=[saved_material], workflow=workflow, project_id=project_id,\n", + " owner_id=ACCOUNT_ID, compute=compute.to_dict(), prefix=f\"{workflow.name} {timestamp}\")\n", + " submit_jobs(client.jobs, [job[\"_id\"]])\n", + " print(f\"✅ {workflow.name}: submitted job {job['_id']}\")\n", + " else:\n", + " print(f\"♻️ {workflow.name}: reusing job {job['_id']}\")\n", + " job_ids[workflow.name] = job[\"_id\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "32", + "metadata": {}, + "outputs": [], + "source": [ + "await wait_for_jobs_to_finish_async(client.jobs, list(job_ids.values()), poll_interval=POLL_INTERVAL)" + ] + }, + { + "cell_type": "markdown", + "id": "33", + "metadata": {}, + "source": [ + "### 6.2. Relaxed wire and the path along it\n", + "\n", + "The end of the Brillouin zone along the wire, (0, 0, 1/2), is Z in the manuscript; its name in the k-path depends on\n", + "the lattice type of the relaxed cell, so it is looked up by its coordinates." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.reciprocal.symmetry_points import get_symmetry_points\n", + "from mat3ra.notebooks_utils.core.entity.material.api import get_final_structure_for_job\n", + "from mat3ra.wode.context.providers import PointsPathDataProvider\n", + "\n", + "relaxed_wire = get_final_structure_for_job(client, job_ids[relax_workflow.name])\n", + "wire_axis_point = next(\n", + " point[\"point\"] for point in get_symmetry_points(relaxed_wire.lattice) if point[\"coordinates\"] == [0, 0, 0.5]\n", + ")\n", + "bands_hse_unit.add_context(\n", + " PointsPathDataProvider(\n", + " name=\"explicitKPath\",\n", + " path=[{\"point\": \"Γ\", \"steps\": KPATH_STEPS}, {\"point\": wire_axis_point, \"steps\": 1}],\n", + " isEdited=True,\n", + " ).get_context_item_data()\n", + ")\n", + "main_hse_subworkflow.set_unit(bands_hse_unit)" + ] + }, + { + "cell_type": "markdown", + "id": "35", + "metadata": {}, + "source": [ + "### 6.3. Band structure and density of states of the relaxed wire" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "36", + "metadata": {}, + "outputs": [], + "source": [ + "for workflow, saved_material, kgrid, unit_name in (\n", + " (bands_workflow, relaxed_wire.to_dict(), BANDS_KGRID, PRELIMINARY_SCF_UNIT),\n", + " (dos_workflows[WIRE_NAME], relaxed_wire.to_dict(), DOS_KGRID, DOS_HSE_UNIT),\n", + "):\n", + " job = find_job_for_material(client, saved_material[\"_id\"], workflow.name, ACCOUNT_ID,\n", + " statuses=(\"submitted\", \"queued\", \"active\", \"finished\"),\n", + " kgrid=kgrid, unit_name=unit_name)\n", + " if job is None:\n", + " job = create_job(api_client=client, materials=[saved_material], workflow=workflow, project_id=project_id,\n", + " owner_id=ACCOUNT_ID, compute=compute.to_dict(), prefix=f\"{workflow.name} {timestamp}\")\n", + " submit_jobs(client.jobs, [job[\"_id\"]])\n", + " print(f\"✅ {workflow.name}: submitted job {job['_id']}\")\n", + " else:\n", + " print(f\"♻️ {workflow.name}: reusing job {job['_id']}\")\n", + " job_ids[workflow.name] = job[\"_id\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "37", + "metadata": {}, + "outputs": [], + "source": [ + "await wait_for_jobs_to_finish_async(client.jobs, list(job_ids.values()), poll_interval=POLL_INTERVAL)" + ] + }, + { + "cell_type": "markdown", + "id": "38", + "metadata": {}, + "source": [ + "## 7. Retrieve the results\n", + "### 7.1. Period of the relaxed wire" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "39", + "metadata": {}, + "outputs": [], + "source": [ + "print(f\"Period along the wire, {WIRE_NAME}:\")\n", + "print(f\"start: {wire.lattice.c:.4f} Å\")\n", + "print(f\"relaxed (PBE): {relaxed_wire.lattice.c:.4f} Å\")" + ] + }, + { + "cell_type": "markdown", + "id": "40", + "metadata": {}, + "source": [ + "### 7.2. Band gaps\n", + "\n", + "The fundamental gap is the `indirect` entry of a job's band gaps: from the valence-band maximum to the conduction-band\n", + "minimum wherever they fall, direct when both are at the same k-point. The gap of the wire comes from the band structure\n", + "job, whose k-points include the path along the wire." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.prode import PropertyName\n", + "\n", + "fundamental_gaps = {}\n", + "for workflow in (bands_workflow, dos_workflows[WIRE_NAME], dos_workflows[BULK_NAME]):\n", + " band_gaps = client.properties.get_for_job(job_ids[workflow.name], PropertyName.non_scalar.band_gaps.value)[0]\n", + " fundamental_gaps[workflow.name] = next(value for value in band_gaps[\"values\"] if value[\"type\"] == \"indirect\")" + ] + }, + { + "cell_type": "markdown", + "id": "42", + "metadata": {}, + "source": [ + "## 8. Compare with Aradi et al. (2007)\n", + "### 8.1. Band gaps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43", + "metadata": {}, + "outputs": [], + "source": [ + "# Aradi et al. 2007: Table II (p. 5) for the wire; bulk Si with the same hybrid, p. 6\n", + "MANUSCRIPT_BAND_GAPS = {WIRE_NAME: (2.21, \"direct\"), \"Si bulk\": (1.16, \"indirect\")} # eV\n", + "\n", + "print(\"Band gap (HSE06):\")\n", + "for label, gap in ((WIRE_NAME, fundamental_gaps[bands_workflow.name]),\n", + " (\"Si bulk\", fundamental_gaps[dos_workflows[BULK_NAME].name])):\n", + " if gap[\"kpointValence\"] == gap[\"kpointConduction\"]:\n", + " band_edges = f\"direct, VBM and CBM at k = {tuple(gap['kpointValence'])}\"\n", + " else:\n", + " band_edges = f\"indirect, VBM at k = {tuple(gap['kpointValence'])}, CBM at k = {tuple(gap['kpointConduction'])}\"\n", + " print(f\"{label}: {gap['value']:.2f} eV, {band_edges}\")\n", + "\n", + "print(\"\\nBand gap from the manuscript:\")\n", + "for label, (value, character) in MANUSCRIPT_BAND_GAPS.items():\n", + " print(f\"{label}: {value:.2f} eV, {character}\")" + ] + }, + { + "cell_type": "markdown", + "id": "44", + "metadata": {}, + "source": [ + "### 8.2. Bands and density of states (Fig. 8 of the manuscript, left)\n", + "\n", + "The manuscript's Fig. 8 (left): density of states (solid), its projection on the H atoms (dotted) and bands along Γ–Z,\n", + "the valence-band maximum at 0:\n", + "\n", + "\"Aradi" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from matplotlib import pyplot as plt\n", + "from mat3ra.notebooks_utils.core.entity.property.api import get_properties_for_job\n", + "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", + "\n", + "band_structure = get_properties_for_job(client, job_ids[bands_workflow.name], \"band_structure\")[0]\n", + "density_of_states = get_properties_for_job(client, job_ids[dos_workflows[WIRE_NAME].name], \"density_of_states\")[0]\n", + "path_bands = np.array(band_structure[\"yDataSeries\"])[:, -(KPATH_STEPS + 1):]\n", + "path_bands -= fundamental_gaps[bands_workflow.name][\"eigenvalueValence\"]\n", + "dos_energies = np.array(density_of_states[\"xDataArray\"][0])\n", + "dos_energies -= fundamental_gaps[dos_workflows[WIRE_NAME].name][\"eigenvalueValence\"]\n", + "hydrogen_dos = np.sum([series for series, legend in zip(density_of_states[\"yDataSeries\"], density_of_states[\"legend\"])\n", + " if legend.get(\"element\") == \"H\"], axis=0)\n", + "\n", + "figure, (dos_axes, bands_axes) = plt.subplots(1, 2, sharey=True, gridspec_kw={\"width_ratios\": [1, 2], \"wspace\": 0})\n", + "dos_axes.plot(density_of_states[\"yDataSeries\"][0], dos_energies, color=\"black\", label=\"total\")\n", + "dos_axes.plot(hydrogen_dos, dos_energies, color=\"black\", linestyle=\":\", label=\"H\")\n", + "dos_axes.invert_xaxis()\n", + "dos_axes.set_xticks([])\n", + "dos_axes.set_ylabel(\"Energy (eV)\")\n", + "dos_axes.legend()\n", + "bands_axes.plot(path_bands.T, color=\"black\", linewidth=0.8)\n", + "bands_axes.set_xlim(0, KPATH_STEPS)\n", + "bands_axes.set_xticks([0, KPATH_STEPS], [\"Γ\", \"Z\"])\n", + "bands_axes.set_ylim(*ENERGY_WINDOW)\n", + "figure.suptitle(f\"{WIRE_NAME}, HSE06\")\n", + "display_matplotlib_figure(figure)" + ] + }, + { + "cell_type": "markdown", + "id": "46", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "[1] B. Aradi, L. E. Ramos, P. Deák, Th. Köhler, F. Bechstedt, R. Q. Zhang and Th. Frauenheim, \"Theoretical study of the chemical gap tuning in silicon nanowires\", Phys. Rev. B 76, 035305 (2007). https://doi.org/10.1103/PhysRevB.76.035305\n", + "\n", + "[2] J. Heyd, G. E. Scuseria and M. Ernzerhof, \"Hybrid functionals based on a screened Coulomb potential\", J. Chem. Phys. 118, 8207 (2003). https://doi.org/10.1063/1.1564060\n", + "\n", + "[3] A. V. Krukau, O. A. Vydrov, A. F. Izmaylov and G. E. Scuseria, \"Influence of the exchange screening parameter on the performance of screened hybrid functionals\", J. Chem. Phys. 125, 224106 (2006). https://doi.org/10.1063/1.2404663\n", + "\n", + "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 63a045b0c119467b84e10a6b12847c76048bb4bd Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 09:14:31 -0800 Subject: [PATCH 03/18] SOF-8128: run Quantum ESPRESSO 7.5, as the Pt-step notebook does: cluster-001 can no longer load 6.3 Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index cd352f573..c5021cf82 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -84,6 +84,7 @@ "BULK_NAME = \"Silicon\" # Standata\n", "\n", "APPLICATION_NAME = \"espresso\"\n", + "APPLICATION_VERSION = \"7.5\"\n", "RELAX_WORKFLOW_SEARCH_TERM = \"variable_cell_relaxation.json\"\n", "BANDS_WORKFLOW_SEARCH_TERM = \"band_structure_hse.json\"\n", "DOS_WORKFLOW_SEARCH_TERM = \"band_gap_dos_hse.json\"\n", @@ -310,6 +311,9 @@ "\n", "relax_workflow = Workflow.create(workflow_configs.get_by_name_first_match(RELAX_WORKFLOW_SEARCH_TERM))\n", "relax_workflow.name = \"Variable-cell Relaxation Si nanowire\"\n", + "for subworkflow in relax_workflow.subworkflows:\n", + " for application in (subworkflow.application, *(unit.application for unit in subworkflow.units)):\n", + " application.version = APPLICATION_VERSION\n", "apply_planewave_cutoffs(relax_workflow, ECUTWFC, ECUTRHO, unit_name=RELAX_UNIT)\n", "apply_scf_kgrid(relax_workflow, RELAX_KGRID, material=wire, unit_name=RELAX_UNIT)\n", "patch_workflow_qe_input(relax_workflow, RELAXATION_SETTINGS, [RELAX_UNIT])" @@ -373,6 +377,9 @@ " (BULK_NAME, BULK_KGRID, \"Band Gap + DOS HSE06 Si bulk\")):\n", " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", " workflow.name = workflow_name\n", + " for subworkflow in workflow.subworkflows:\n", + " for application in (subworkflow.application, *(unit.application for unit in subworkflow.units)):\n", + " application.version = APPLICATION_VERSION\n", " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", " dos_workflows[name] = workflow" From 139f79734bc19b607ade9e419788c006cc7f9ab5 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 11:53:47 -0800 Subject: [PATCH 04/18] SOF-8128: back to the workflows' Quantum ESPRESSO version: the jobs run on cluster-002, where it runs This reverts commit 63a045b0. Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index c5021cf82..cd352f573 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -84,7 +84,6 @@ "BULK_NAME = \"Silicon\" # Standata\n", "\n", "APPLICATION_NAME = \"espresso\"\n", - "APPLICATION_VERSION = \"7.5\"\n", "RELAX_WORKFLOW_SEARCH_TERM = \"variable_cell_relaxation.json\"\n", "BANDS_WORKFLOW_SEARCH_TERM = \"band_structure_hse.json\"\n", "DOS_WORKFLOW_SEARCH_TERM = \"band_gap_dos_hse.json\"\n", @@ -311,9 +310,6 @@ "\n", "relax_workflow = Workflow.create(workflow_configs.get_by_name_first_match(RELAX_WORKFLOW_SEARCH_TERM))\n", "relax_workflow.name = \"Variable-cell Relaxation Si nanowire\"\n", - "for subworkflow in relax_workflow.subworkflows:\n", - " for application in (subworkflow.application, *(unit.application for unit in subworkflow.units)):\n", - " application.version = APPLICATION_VERSION\n", "apply_planewave_cutoffs(relax_workflow, ECUTWFC, ECUTRHO, unit_name=RELAX_UNIT)\n", "apply_scf_kgrid(relax_workflow, RELAX_KGRID, material=wire, unit_name=RELAX_UNIT)\n", "patch_workflow_qe_input(relax_workflow, RELAXATION_SETTINGS, [RELAX_UNIT])" @@ -377,9 +373,6 @@ " (BULK_NAME, BULK_KGRID, \"Band Gap + DOS HSE06 Si bulk\")):\n", " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", " workflow.name = workflow_name\n", - " for subworkflow in workflow.subworkflows:\n", - " for application in (subworkflow.application, *(unit.application for unit in subworkflow.units)):\n", - " application.version = APPLICATION_VERSION\n", " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", " dos_workflows[name] = workflow" From fab48f9ac1b12de93d729ae2ce8faec25cd1a67b Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 17:38:54 -0800 Subject: [PATCH 05/18] SOF-8128: review: the band plot spans the bands job's own path, the gap line has one shape for direct and indirect, the relaxed wire is named as in the defect siblings Co-Authored-By: Claude Opus 5.5 --- ...ion_edge_nanowire_silicon_SIMULATION.ipynb | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index cd352f573..5f3498f76 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -433,7 +433,7 @@ "source": [ "## 6. Run the jobs\n", "\n", - "A finished or running job for the same material, workflow name and k-grid is reused.\n", + "A submitted, queued, running or finished job for the same material, workflow name and k-grid is reused.\n", "### 6.1. Bulk silicon and the relaxation of the wire" ] }, @@ -473,7 +473,7 @@ "metadata": {}, "outputs": [], "source": [ - "await wait_for_jobs_to_finish_async(client.jobs, list(job_ids.values()), poll_interval=POLL_INTERVAL)" + "await wait_for_jobs_to_finish_async(client.jobs, [job_ids[relax_workflow.name]], poll_interval=POLL_INTERVAL)" ] }, { @@ -499,6 +499,7 @@ "from mat3ra.wode.context.providers import PointsPathDataProvider\n", "\n", "relaxed_wire = get_final_structure_for_job(client, job_ids[relax_workflow.name])\n", + "client.materials.update(relaxed_wire.id, {\"name\": \"Si nanowire 110 H-passivated relaxed one period\"})\n", "wire_axis_point = next(\n", " point[\"point\"] for point in get_symmetry_points(relaxed_wire.lattice) if point[\"coordinates\"] == [0, 0, 0.5]\n", ")\n", @@ -594,12 +595,12 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.prode import PropertyName\n", + "from mat3ra.notebooks_utils.core.entity.property.api import get_properties_for_job\n", "\n", "fundamental_gaps = {}\n", "for workflow in (bands_workflow, dos_workflows[WIRE_NAME], dos_workflows[BULK_NAME]):\n", - " band_gaps = client.properties.get_for_job(job_ids[workflow.name], PropertyName.non_scalar.band_gaps.value)[0]\n", - " fundamental_gaps[workflow.name] = next(value for value in band_gaps[\"values\"] if value[\"type\"] == \"indirect\")" + " band_gaps = get_properties_for_job(client, job_ids[workflow.name], \"band_gaps\")[0]\n", + " fundamental_gaps[workflow.name] = next(gap for gap in band_gaps[\"values\"] if gap[\"type\"] == \"indirect\")" ] }, { @@ -619,16 +620,14 @@ "outputs": [], "source": [ "# Aradi et al. 2007: Table II (p. 5) for the wire; bulk Si with the same hybrid, p. 6\n", - "MANUSCRIPT_BAND_GAPS = {WIRE_NAME: (2.21, \"direct\"), \"Si bulk\": (1.16, \"indirect\")} # eV\n", + "MANUSCRIPT_BAND_GAPS = {WIRE_NAME: (2.21, \"direct\"), BULK_NAME: (1.16, \"indirect\")} # eV\n", "\n", "print(\"Band gap (HSE06):\")\n", "for label, gap in ((WIRE_NAME, fundamental_gaps[bands_workflow.name]),\n", - " (\"Si bulk\", fundamental_gaps[dos_workflows[BULK_NAME].name])):\n", - " if gap[\"kpointValence\"] == gap[\"kpointConduction\"]:\n", - " band_edges = f\"direct, VBM and CBM at k = {tuple(gap['kpointValence'])}\"\n", - " else:\n", - " band_edges = f\"indirect, VBM at k = {tuple(gap['kpointValence'])}, CBM at k = {tuple(gap['kpointConduction'])}\"\n", - " print(f\"{label}: {gap['value']:.2f} eV, {band_edges}\")\n", + " (BULK_NAME, fundamental_gaps[dos_workflows[BULK_NAME].name])):\n", + " character = \"direct\" if gap[\"kpointValence\"] == gap[\"kpointConduction\"] else \"indirect\"\n", + " print(f\"{label}: {gap['value']:.2f} eV, {character}, VBM at k = {tuple(gap['kpointValence'])}, \"\n", + " f\"CBM at k = {tuple(gap['kpointConduction'])}\")\n", "\n", "print(\"\\nBand gap from the manuscript:\")\n", "for label, (value, character) in MANUSCRIPT_BAND_GAPS.items():\n", @@ -657,13 +656,12 @@ "source": [ "import numpy as np\n", "from matplotlib import pyplot as plt\n", - "from mat3ra.notebooks_utils.core.entity.property.api import get_properties_for_job\n", "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", "\n", "band_structure = get_properties_for_job(client, job_ids[bands_workflow.name], \"band_structure\")[0]\n", "density_of_states = get_properties_for_job(client, job_ids[dos_workflows[WIRE_NAME].name], \"density_of_states\")[0]\n", - "path_bands = np.array(band_structure[\"yDataSeries\"])[:, -(KPATH_STEPS + 1):]\n", - "path_bands -= fundamental_gaps[bands_workflow.name][\"eigenvalueValence\"]\n", + "path_bands = np.array(band_structure[\"yDataSeries\"]) - fundamental_gaps[bands_workflow.name][\"eigenvalueValence\"]\n", + "last_path_index = len(band_structure[\"xDataArray\"]) - 1\n", "dos_energies = np.array(density_of_states[\"xDataArray\"][0])\n", "dos_energies -= fundamental_gaps[dos_workflows[WIRE_NAME].name][\"eigenvalueValence\"]\n", "hydrogen_dos = np.sum([series for series, legend in zip(density_of_states[\"yDataSeries\"], density_of_states[\"legend\"])\n", @@ -677,8 +675,8 @@ "dos_axes.set_ylabel(\"Energy (eV)\")\n", "dos_axes.legend()\n", "bands_axes.plot(path_bands.T, color=\"black\", linewidth=0.8)\n", - "bands_axes.set_xlim(0, KPATH_STEPS)\n", - "bands_axes.set_xticks([0, KPATH_STEPS], [\"Γ\", \"Z\"])\n", + "bands_axes.set_xlim(0, last_path_index)\n", + "bands_axes.set_xticks([0, last_path_index], [\"Γ\", \"Z\"])\n", "bands_axes.set_ylim(*ENERGY_WINDOW)\n", "figure.suptitle(f\"{WIRE_NAME}, HSE06\")\n", "display_matplotlib_figure(figure)" From 3217017931fd05d60803490cb6b6b92cca5464b3 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 17:44:48 -0800 Subject: [PATCH 06/18] SOF-8128: the band structure workflow name sits in 1.3 beside QGRID and KPATH_STEPS, whose change needs a new name for a new job; the relaxed wire's name sits in 1.2 beside WIRE_NAME (review round 2) Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 5f3498f76..4e2ba18d7 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -81,6 +81,7 @@ "ORGANIZATION_NAME = None # set to your organization name (full or partial); otherwise, your default one is used\n", "FOLDER = \"./uploads\"\n", "WIRE_NAME = \"Si nanowire 110 H-passivated one period\" # saved by the structure notebook\n", + "RELAXED_WIRE_NAME = \"Si nanowire 110 H-passivated relaxed one period\"\n", "BULK_NAME = \"Silicon\" # Standata\n", "\n", "APPLICATION_NAME = \"espresso\"\n", @@ -125,6 +126,8 @@ "BANDS_KGRID = [1, 1, 8]\n", "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", "KPATH_STEPS = 20 # even, so every k − q of the path stays on the path for the 1x1x4 q-grid\n", + "# a job is reused by material, this name and BANDS_KGRID, so rename it after changing QGRID or KPATH_STEPS\n", + "BANDS_WORKFLOW_NAME = \"Band Structure HSE06 Si nanowire\"\n", "DOS_KGRID = [1, 1, 8] # the workflow runs odd dimensions as the next even, so 2x2x8\n", "BULK_KGRID = [8, 8, 8]\n", "\n", @@ -336,7 +339,7 @@ "from mat3ra.wode.context.providers import PointsGridDataProvider\n", "\n", "bands_workflow = Workflow.create(workflow_configs.get_by_name_first_match(BANDS_WORKFLOW_SEARCH_TERM))\n", - "bands_workflow.name = \"Band Structure HSE06 Si nanowire\"\n", + "bands_workflow.name = BANDS_WORKFLOW_NAME\n", "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", "for unit_name in (PRELIMINARY_SCF_UNIT, BANDS_HSE_UNIT):\n", " apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", @@ -499,7 +502,7 @@ "from mat3ra.wode.context.providers import PointsPathDataProvider\n", "\n", "relaxed_wire = get_final_structure_for_job(client, job_ids[relax_workflow.name])\n", - "client.materials.update(relaxed_wire.id, {\"name\": \"Si nanowire 110 H-passivated relaxed one period\"})\n", + "client.materials.update(relaxed_wire.id, {\"name\": RELAXED_WIRE_NAME})\n", "wire_axis_point = next(\n", " point[\"point\"] for point in get_symmetry_points(relaxed_wire.lattice) if point[\"coordinates\"] == [0, 0, 0.5]\n", ")\n", From 9be9b32b840a8ee5198164629a6b4807a269a253 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 19:14:13 -0800 Subject: [PATCH 07/18] SOF-8128: VB: every job on OF at the cluster's maximum cores; OR queues jobs one at a time Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 4e2ba18d7..85dd597ee 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -90,8 +90,8 @@ "DOS_WORKFLOW_SEARCH_TERM = \"band_gap_dos_hse.json\"\n", "\n", "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", - "QUEUE_NAME = QueueName.OR\n", - "PPN = 16 # OR allows 16 cores per job\n", + "QUEUE_NAME = QueueName.OF\n", + "PPN = 36 # OF allows up to the cluster's maximum cores per job: 60 on cluster-001, 36 on cluster-002, 44 on cluster-003\n", "TIME_LIMIT = \"04:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", From 7893f53d8b191f833381ee70db7f75bf31278d23 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 19:23:49 -0800 Subject: [PATCH 08/18] SOF-8128: the default cores follow the selected cluster's queue maximum, as CodeRabbit noted Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 85dd597ee..04ad127f6 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -91,7 +91,7 @@ "\n", "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", - "PPN = 36 # OF allows up to the cluster's maximum cores per job: 60 on cluster-001, 36 on cluster-002, 44 on cluster-003\n", + "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", "TIME_LIMIT = \"04:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", @@ -424,8 +424,9 @@ " raise ValueError(f\"Cluster '{CLUSTER_NAME}' not found. Available: {[c['hostname'] for c in clusters]}\")\n", "else:\n", " cluster = clusters[0]\n", - "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=PPN, timeLimit=TIME_LIMIT)\n", - "print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}, \"\n", + "ppn = PPN or next(queue[\"maxPPN\"] for queue in cluster[\"queues\"] if queue[\"name\"] == QUEUE_NAME.value)\n", + "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=TIME_LIMIT)\n", + "print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {ppn}, \"\n", " f\"time limit: {TIME_LIMIT}\")" ] }, From 5b0e92247ee6614aac9044e82c62ffba81c38326 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 22:47:48 -0800 Subject: [PATCH 09/18] SOF-8128: HSE jobs use k-point pools and band groups, 24 h limit Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 04ad127f6..5b5599936 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -92,7 +92,9 @@ "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", - "TIME_LIMIT = \"04:00:00\"\n", + "NPOOLS = 2 # pw.x k-point pools; NPOOLS × NBAND must divide the cores per job\n", + "NBAND = 2 # pw.x band groups, which split the HSE exact-exchange work\n", + "TIME_LIMIT = \"24:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", "POLL_INTERVAL = 60 # seconds\n", @@ -425,7 +427,8 @@ "else:\n", " cluster = clusters[0]\n", "ppn = PPN or next(queue[\"maxPPN\"] for queue in cluster[\"queues\"] if queue[\"name\"] == QUEUE_NAME.value)\n", - "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=TIME_LIMIT)\n", + "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=TIME_LIMIT,\n", + " arguments={\"npools\": NPOOLS, \"nband\": NBAND})\n", "print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {ppn}, \"\n", " f\"time limit: {TIME_LIMIT}\")" ] From 58bda06bddcb4cd81bf867aaa5e3fbf241d9f6f8 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 23:07:16 -0800 Subject: [PATCH 10/18] SOF-8128: HSE jobs: k-point pools without stress, k-points extracted at high verbosity Co-Authored-By: Claude Opus 5.5 --- ...passivation_edge_nanowire_silicon_SIMULATION.ipynb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 5b5599936..afdf48e59 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -92,8 +92,7 @@ "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", - "NPOOLS = 2 # pw.x k-point pools; NPOOLS × NBAND must divide the cores per job\n", - "NBAND = 2 # pw.x band groups, which split the HSE exact-exchange work\n", + "NPOOLS = 4 # Quantum ESPRESSO k-point pools; must divide the cores per job\n", "TIME_LIMIT = \"24:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", @@ -124,6 +123,8 @@ "\n", "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", + "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the HSE run uses\n", + "HSE_SETTINGS = {\"control\": {\"tstress\": False}} # QE 6.3 computes no hybrid-functional stress with k-point pools\n", "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", "BANDS_KGRID = [1, 1, 8]\n", "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", @@ -345,6 +346,8 @@ "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", "for unit_name in (PRELIMINARY_SCF_UNIT, BANDS_HSE_UNIT):\n", " apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", + "patch_workflow_qe_input(bands_workflow, PRELIMINARY_SCF_SETTINGS, [PRELIMINARY_SCF_UNIT])\n", + "patch_workflow_qe_input(bands_workflow, HSE_SETTINGS, [BANDS_HSE_UNIT])\n", "main_hse_subworkflow = next(\n", " subworkflow for subworkflow in bands_workflow.subworkflows if subworkflow.name == \"Main HSE Run\"\n", ")\n", @@ -380,6 +383,7 @@ " workflow.name = workflow_name\n", " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", + " patch_workflow_qe_input(workflow, HSE_SETTINGS, [DOS_HSE_UNIT])\n", " dos_workflows[name] = workflow" ] }, @@ -427,8 +431,7 @@ "else:\n", " cluster = clusters[0]\n", "ppn = PPN or next(queue[\"maxPPN\"] for queue in cluster[\"queues\"] if queue[\"name\"] == QUEUE_NAME.value)\n", - "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=TIME_LIMIT,\n", - " arguments={\"npools\": NPOOLS, \"nband\": NBAND})\n", + "compute = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=TIME_LIMIT, arguments={\"npools\": NPOOLS})\n", "print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {ppn}, \"\n", " f\"time limit: {TIME_LIMIT}\")" ] From cf50ddd65b2a6857debb115ffba6915667a910f0 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 17 Nov 2026 23:18:47 -0800 Subject: [PATCH 11/18] SOF-8128: NPOOLS comment states both pool rules Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index afdf48e59..b3cfe7671 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -92,7 +92,7 @@ "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", - "NPOOLS = 4 # Quantum ESPRESSO k-point pools; must divide the cores per job\n", + "NPOOLS = 4 # Quantum ESPRESSO k-point pools; must divide the cores per job and not exceed any job's k-points\n", "TIME_LIMIT = \"24:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", @@ -124,7 +124,7 @@ "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the HSE run uses\n", - "HSE_SETTINGS = {\"control\": {\"tstress\": False}} # QE 6.3 computes no hybrid-functional stress with k-point pools\n", + "HSE_SETTINGS = {\"control\": {\"tstress\": False}} # Quantum ESPRESSO computes no hybrid-functional stress with pools\n", "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", "BANDS_KGRID = [1, 1, 8]\n", "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", From cb73246faf01ea03fbd36bf90d79bbd46af2461f Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 18 Nov 2026 01:25:15 -0800 Subject: [PATCH 12/18] SOF-8128: use 2 k-point pools so the HSE06 band structure fits one node Each pool keeps its own copy of the exchange data; with 4 pools on a 60-core, 247 GB node pw.x estimated more than 209 GB and stopped at the first exchange step. Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index b3cfe7671..bfde0d352 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -92,7 +92,7 @@ "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", - "NPOOLS = 4 # Quantum ESPRESSO k-point pools; must divide the cores per job and not exceed any job's k-points\n", + "NPOOLS = 2 # k-point pools: must divide the cores and not exceed any job's k-points; each adds HSE06 exchange memory\n", "TIME_LIMIT = \"24:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", From 1014398d66df58fde5fe70638857d833a1d94d35 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 19 Nov 2026 19:23:00 -0800 Subject: [PATCH 13/18] SOF-8128: run HSE06 on PseudoDojo norm-conserving pseudopotentials With GBRV ultrasoft pseudopotentials, QE 6.3 augments every exchange band pair over the whole G-sphere: one exchange step took 15 h (DOS) and over 24 h (bands) on a 60-core node. The HSE06 runs now use PseudoDojo ONCV 0.4 (searchText, since hybrid + nc otherwise selects a user file) at 72/288 Ry with ecutfock 100; the relaxation and the preliminary PBE SCF stay on GBRV 40/200. Workflow names move to cell 1.3 and the HSE06 ones change, so reuse cannot attach the ultrasoft jobs. Co-Authored-By: Claude Opus 5.5 --- ...ion_edge_nanowire_silicon_SIMULATION.ipynb | 49 ++++++++++++++----- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index bfde0d352..4a2eee186 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -117,20 +117,30 @@ "outputs": [], "source": [ "# manuscript: geometry with DFTB, gaps with CRYSTAL and a one-parameter global hybrid fitted to bulk Si;\n", - "# ours: geometry with PBE, gaps with HSE06, GBRV ultrasoft pseudopotentials at their tested cutoffs\n", + "# ours: geometry with PBE, GBRV ultrasoft pseudopotentials at their tested cutoffs; gaps with HSE06, PseudoDojo\n", + "# norm-conserving ones, as the ultrasoft augmentation of every band pair dominates the cost of the exact exchange\n", "ECUTWFC = 40 # Ry\n", "ECUTRHO = 200 # Ry\n", + "HSE_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", + "HSE_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files for HSE06\n", + "HSE_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", + "HSE_ECUTRHO = 4 * HSE_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", "\n", "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the HSE run uses\n", - "HSE_SETTINGS = {\"control\": {\"tstress\": False}} # Quantum ESPRESSO computes no hybrid-functional stress with pools\n", + "# Quantum ESPRESSO computes no hybrid-functional stress with pools; ecutfock (Ry) as in the DOS workflow, since\n", + "# its default, 4 x HSE_ECUTWFC, would multiply each pool's exchange memory\n", + "HSE_SETTINGS = {\"control\": {\"tstress\": False}, \"system\": {\"ecutfock\": 100}}\n", "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", "BANDS_KGRID = [1, 1, 8]\n", "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", "KPATH_STEPS = 20 # even, so every k − q of the path stays on the path for the 1x1x4 q-grid\n", - "# a job is reused by material, this name and BANDS_KGRID, so rename it after changing QGRID or KPATH_STEPS\n", - "BANDS_WORKFLOW_NAME = \"Band Structure HSE06 Si nanowire\"\n", + "# a job is reused by material, workflow name and k-grid, so rename a workflow after changing any other setting it uses\n", + "RELAX_WORKFLOW_NAME = \"Variable-cell Relaxation Si nanowire\"\n", + "BANDS_WORKFLOW_NAME = \"Band Structure HSE06 Si nanowire PseudoDojo\"\n", + "WIRE_DOS_WORKFLOW_NAME = \"Band Gap + DOS HSE06 Si nanowire PseudoDojo\"\n", + "BULK_DOS_WORKFLOW_NAME = \"Band Gap + DOS HSE06 Si bulk PseudoDojo\"\n", "DOS_KGRID = [1, 1, 8] # the workflow runs odd dimensions as the next even, so 2x2x8\n", "BULK_KGRID = [8, 8, 8]\n", "\n", @@ -296,7 +306,8 @@ "## 4. Configure the workflows\n", "\n", "The Standata workflows carry their models: PBE for the relaxation and for the preliminary SCF of the band structure,\n", - "HSE06 for the band structure and for the band gap and density of states, all with GBRV ultrasoft pseudopotentials.\n", + "HSE06 for the band structure and for the band gap and density of states, all with GBRV ultrasoft pseudopotentials;\n", + "4.2 and 4.3 switch the HSE06 runs to norm-conserving ones.\n", "### 4.1. Variable-cell relaxation of the wire" ] }, @@ -315,7 +326,7 @@ "wire = materials[WIRE_NAME]\n", "\n", "relax_workflow = Workflow.create(workflow_configs.get_by_name_first_match(RELAX_WORKFLOW_SEARCH_TERM))\n", - "relax_workflow.name = \"Variable-cell Relaxation Si nanowire\"\n", + "relax_workflow.name = RELAX_WORKFLOW_NAME\n", "apply_planewave_cutoffs(relax_workflow, ECUTWFC, ECUTRHO, unit_name=RELAX_UNIT)\n", "apply_scf_kgrid(relax_workflow, RELAX_KGRID, material=wire, unit_name=RELAX_UNIT)\n", "patch_workflow_qe_input(relax_workflow, RELAXATION_SETTINGS, [RELAX_UNIT])" @@ -339,18 +350,29 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.mode import ModelFactory\n", + "from mat3ra.standata.model_tree import ModelTreeStandata\n", "from mat3ra.wode.context.providers import PointsGridDataProvider\n", "\n", "bands_workflow = Workflow.create(workflow_configs.get_by_name_first_match(BANDS_WORKFLOW_SEARCH_TERM))\n", "bands_workflow.name = BANDS_WORKFLOW_NAME\n", "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", - "for unit_name in (PRELIMINARY_SCF_UNIT, BANDS_HSE_UNIT):\n", - " apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", + "apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=PRELIMINARY_SCF_UNIT)\n", + "apply_planewave_cutoffs(bands_workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=BANDS_HSE_UNIT)\n", "patch_workflow_qe_input(bands_workflow, PRELIMINARY_SCF_SETTINGS, [PRELIMINARY_SCF_UNIT])\n", "patch_workflow_qe_input(bands_workflow, HSE_SETTINGS, [BANDS_HSE_UNIT])\n", "main_hse_subworkflow = next(\n", " subworkflow for subworkflow in bands_workflow.subworkflows if subworkflow.name == \"Main HSE Run\"\n", ")\n", + "hse_model_config = ModelTreeStandata.get_model_by_parameters(\n", + " type=\"dft\", subtype=main_hse_subworkflow.model.subtype, functional=main_hse_subworkflow.model.functional\n", + ")\n", + "hse_model_config[\"method\"] = {\n", + " \"type\": \"pseudopotential\",\n", + " \"subtype\": HSE_PSEUDOPOTENTIAL_TYPE,\n", + " \"data\": {\"searchText\": HSE_PSEUDOPOTENTIAL_SEARCH_TEXT},\n", + "}\n", + "main_hse_subworkflow.model = ModelFactory.create(hse_model_config)\n", "bands_hse_unit = main_hse_subworkflow.get_unit_by_name(name=BANDS_HSE_UNIT)\n", "bands_hse_unit.add_context(\n", " PointsGridDataProvider(name=\"qgrid\", material=wire, dimensions=QGRID, isEdited=True).get_context_item_data()\n", @@ -377,13 +399,14 @@ "outputs": [], "source": [ "dos_workflows = {}\n", - "for name, kgrid, workflow_name in ((WIRE_NAME, DOS_KGRID, \"Band Gap + DOS HSE06 Si nanowire\"),\n", - " (BULK_NAME, BULK_KGRID, \"Band Gap + DOS HSE06 Si bulk\")):\n", + "for name, kgrid, workflow_name in ((WIRE_NAME, DOS_KGRID, WIRE_DOS_WORKFLOW_NAME),\n", + " (BULK_NAME, BULK_KGRID, BULK_DOS_WORKFLOW_NAME)):\n", " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", " workflow.name = workflow_name\n", - " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=DOS_HSE_UNIT)\n", + " apply_planewave_cutoffs(workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", " patch_workflow_qe_input(workflow, HSE_SETTINGS, [DOS_HSE_UNIT])\n", + " workflow.subworkflows[0].model = ModelFactory.create(hse_model_config)\n", " dos_workflows[name] = workflow" ] }, @@ -705,7 +728,9 @@ "\n", "[3] A. V. Krukau, O. A. Vydrov, A. F. Izmaylov and G. E. Scuseria, \"Influence of the exchange screening parameter on the performance of screened hybrid functionals\", J. Chem. Phys. 125, 224106 (2006). https://doi.org/10.1063/1.2404663\n", "\n", - "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053" + "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053\n", + "\n", + "[5] M. J. van Setten, M. Giantomassi, E. Bousquet, M. J. Verstraete, D. R. Hamann, X. Gonze and G.-M. Rignanese, \"The PseudoDojo: Training and grading a 85 element optimized norm-conserving pseudopotential table\", Comput. Phys. Commun. 226, 39 (2018). https://doi.org/10.1016/j.cpc.2018.01.012" ] } ], From 62203a083b408fda315f7a0e55ce60350891e083 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 20 Nov 2026 15:40:42 -0800 Subject: [PATCH 14/18] SOF-8128: gaps, bands and DOS with the manuscript's global hybrid (PBE0 form, EXX_FRACTION) in place of HSE06 The manuscript computes its gaps with a one-parameter global hybrid fitted so bulk Si gives 1.16 eV. The three hybrid units now run input_dft = 'pbe0' with exx_fraction = EXX_FRACTION (cell 1.3; 0.25 until the bulk fit replaces it), set through patch_workflow_qe_input: the model tree's hybrids are b3lyp and hse06 only, so the jobs keep the hse06 model and with it the PseudoDojo selection. The workflow names carry the fraction, so reuse cannot pick a job at another fraction. The HSE_* constants that configure those runs are HYBRID_*; the HSE06 references give way to the PBE0 ones. Co-Authored-By: Claude Opus 5.5 --- ...ion_edge_nanowire_silicon_SIMULATION.ipynb | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 4a2eee186..e5aa39996 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -14,10 +14,10 @@ "\n", "Computes the band gap, the bands along the wire and the density of states of the H-passivated ⟨110⟩ silicon nanowire\n", "of radius 0.51 nm, one period Si₁₈H₁₂ as created in the [structure notebook](passivation_edge_nanowire_silicon.ipynb),\n", - "and the band gap of bulk silicon, with the HSE06 hybrid functional, and compares them with Aradi et al.'s Table II and\n", + "and the band gap of bulk silicon, and compares them with Aradi et al.'s Table II and\n", "Fig. 8 (left). The manuscript optimizes the wire with DFTB and computes its gaps with CRYSTAL and a one-parameter global\n", "hybrid fitted to bulk silicon (1.16 eV); here the atoms and the period of the wire are relaxed with PBE and the gaps are\n", - "computed with HSE06.\n", + "computed with a global hybrid in the PBE0 form, its fraction of exact exchange set in cell 1.3.\n", "\n", "

Usage

\n", "\n", @@ -32,7 +32,7 @@ "1. Set up the environment and parameters: install packages (JupyterLite only) and configure the material names, compute, DFT and plot parameters.\n", "1. Authenticate and initialize API client: authenticate via browser, initialize the client, then select account and project.\n", "1. Load the wire by name and bulk silicon from Standata, print provenance and save both to the platform.\n", - "1. Configure the workflows: variable-cell relaxation of the wire, HSE06 band structure of the wire, HSE06 band gap and density of states of the wire and of bulk silicon.\n", + "1. Configure the workflows: variable-cell relaxation of the wire, then, with the global hybrid, band structure of the wire, band gap and density of states of the wire and of bulk silicon.\n", "1. Configure compute: get the list of clusters and create a compute configuration.\n", "1. Run the jobs: bulk silicon and the relaxation of the wire, then the band structure and the density of states of the relaxed wire.\n", "1. Retrieve the results: the period of the relaxed wire and the band gaps.\n", @@ -92,7 +92,7 @@ "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", - "NPOOLS = 2 # k-point pools: must divide the cores and not exceed any job's k-points; each adds HSE06 exchange memory\n", + "NPOOLS = 2 # k-point pools: must divide the cores and not exceed any job's k-points; each adds exact-exchange memory\n", "TIME_LIMIT = \"24:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", @@ -117,30 +117,33 @@ "outputs": [], "source": [ "# manuscript: geometry with DFTB, gaps with CRYSTAL and a one-parameter global hybrid fitted to bulk Si;\n", - "# ours: geometry with PBE, GBRV ultrasoft pseudopotentials at their tested cutoffs; gaps with HSE06, PseudoDojo\n", - "# norm-conserving ones, as the ultrasoft augmentation of every band pair dominates the cost of the exact exchange\n", + "# ours: geometry with PBE, GBRV ultrasoft pseudopotentials at their tested cutoffs; gaps with that hybrid in the\n", + "# PBE0 form and PseudoDojo norm-conserving ones, as ultrasoft augmentation of every band pair dominates its cost\n", "ECUTWFC = 40 # Ry\n", "ECUTRHO = 200 # Ry\n", - "HSE_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", - "HSE_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files for HSE06\n", - "HSE_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", - "HSE_ECUTRHO = 4 * HSE_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", + "HYBRID_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", + "HYBRID_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files\n", + "HYBRID_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", + "HYBRID_ECUTRHO = 4 * HYBRID_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", + "# fraction of exact exchange; the manuscript fits it so bulk Si gives 1.16 eV, which section 8.1 prints\n", + "EXX_FRACTION = 0.25\n", "\n", "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", - "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the HSE run uses\n", + "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the hybrid run uses\n", "# Quantum ESPRESSO computes no hybrid-functional stress with pools; ecutfock (Ry) as in the DOS workflow, since\n", - "# its default, 4 x HSE_ECUTWFC, would multiply each pool's exchange memory\n", - "HSE_SETTINGS = {\"control\": {\"tstress\": False}, \"system\": {\"ecutfock\": 100}}\n", + "# its default, 4 x HYBRID_ECUTWFC, would multiply each pool's exchange memory\n", + "HYBRID_SETTINGS = {\"control\": {\"tstress\": False},\n", + " \"system\": {\"input_dft\": \"pbe0\", \"exx_fraction\": EXX_FRACTION, \"ecutfock\": 100}}\n", "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", "BANDS_KGRID = [1, 1, 8]\n", - "QGRID = [1, 1, 4] # HSE exchange q-grid; each dimension divides the one of BANDS_KGRID\n", + "QGRID = [1, 1, 4] # exact-exchange q-grid; each dimension divides the one of BANDS_KGRID\n", "KPATH_STEPS = 20 # even, so every k − q of the path stays on the path for the 1x1x4 q-grid\n", "# a job is reused by material, workflow name and k-grid, so rename a workflow after changing any other setting it uses\n", "RELAX_WORKFLOW_NAME = \"Variable-cell Relaxation Si nanowire\"\n", - "BANDS_WORKFLOW_NAME = \"Band Structure HSE06 Si nanowire PseudoDojo\"\n", - "WIRE_DOS_WORKFLOW_NAME = \"Band Gap + DOS HSE06 Si nanowire PseudoDojo\"\n", - "BULK_DOS_WORKFLOW_NAME = \"Band Gap + DOS HSE06 Si bulk PseudoDojo\"\n", + "BANDS_WORKFLOW_NAME = f\"Band Structure global hybrid {EXX_FRACTION} Si nanowire\"\n", + "WIRE_DOS_WORKFLOW_NAME = f\"Band Gap + DOS global hybrid {EXX_FRACTION} Si nanowire\"\n", + "BULK_DOS_WORKFLOW_NAME = f\"Band Gap + DOS global hybrid {EXX_FRACTION} Si bulk\"\n", "DOS_KGRID = [1, 1, 8] # the workflow runs odd dimensions as the next even, so 2x2x8\n", "BULK_KGRID = [8, 8, 8]\n", "\n", @@ -307,7 +310,7 @@ "\n", "The Standata workflows carry their models: PBE for the relaxation and for the preliminary SCF of the band structure,\n", "HSE06 for the band structure and for the band gap and density of states, all with GBRV ultrasoft pseudopotentials;\n", - "4.2 and 4.3 switch the HSE06 runs to norm-conserving ones.\n", + "4.2 and 4.3 switch those runs to norm-conserving ones and set the global hybrid in their input files.\n", "### 4.1. Variable-cell relaxation of the wire" ] }, @@ -337,9 +340,9 @@ "id": "22", "metadata": {}, "source": [ - "### 4.2. HSE06 band structure of the wire\n", + "### 4.2. Global-hybrid band structure of the wire\n", "\n", - "The PBE SCF on `BANDS_KGRID` gives the k-points of the HSE06 run, which adds the path along the wire (6.2) and\n", + "The PBE SCF on `BANDS_KGRID` gives the k-points of the hybrid run, which adds the path along the wire (6.2) and\n", "evaluates the exchange on `QGRID`." ] }, @@ -358,9 +361,9 @@ "bands_workflow.name = BANDS_WORKFLOW_NAME\n", "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", "apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=PRELIMINARY_SCF_UNIT)\n", - "apply_planewave_cutoffs(bands_workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=BANDS_HSE_UNIT)\n", + "apply_planewave_cutoffs(bands_workflow, HYBRID_ECUTWFC, HYBRID_ECUTRHO, unit_name=BANDS_HSE_UNIT)\n", "patch_workflow_qe_input(bands_workflow, PRELIMINARY_SCF_SETTINGS, [PRELIMINARY_SCF_UNIT])\n", - "patch_workflow_qe_input(bands_workflow, HSE_SETTINGS, [BANDS_HSE_UNIT])\n", + "patch_workflow_qe_input(bands_workflow, HYBRID_SETTINGS, [BANDS_HSE_UNIT])\n", "main_hse_subworkflow = next(\n", " subworkflow for subworkflow in bands_workflow.subworkflows if subworkflow.name == \"Main HSE Run\"\n", ")\n", @@ -369,8 +372,8 @@ ")\n", "hse_model_config[\"method\"] = {\n", " \"type\": \"pseudopotential\",\n", - " \"subtype\": HSE_PSEUDOPOTENTIAL_TYPE,\n", - " \"data\": {\"searchText\": HSE_PSEUDOPOTENTIAL_SEARCH_TEXT},\n", + " \"subtype\": HYBRID_PSEUDOPOTENTIAL_TYPE,\n", + " \"data\": {\"searchText\": HYBRID_PSEUDOPOTENTIAL_SEARCH_TEXT},\n", "}\n", "main_hse_subworkflow.model = ModelFactory.create(hse_model_config)\n", "bands_hse_unit = main_hse_subworkflow.get_unit_by_name(name=BANDS_HSE_UNIT)\n", @@ -388,7 +391,7 @@ "id": "24", "metadata": {}, "source": [ - "### 4.3. HSE06 band gap and density of states of the wire and of bulk silicon" + "### 4.3. Global-hybrid band gap and density of states of the wire and of bulk silicon" ] }, { @@ -403,9 +406,9 @@ " (BULK_NAME, BULK_KGRID, BULK_DOS_WORKFLOW_NAME)):\n", " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", " workflow.name = workflow_name\n", - " apply_planewave_cutoffs(workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=DOS_HSE_UNIT)\n", + " apply_planewave_cutoffs(workflow, HYBRID_ECUTWFC, HYBRID_ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", - " patch_workflow_qe_input(workflow, HSE_SETTINGS, [DOS_HSE_UNIT])\n", + " patch_workflow_qe_input(workflow, HYBRID_SETTINGS, [DOS_HSE_UNIT])\n", " workflow.subworkflows[0].model = ModelFactory.create(hse_model_config)\n", " dos_workflows[name] = workflow" ] @@ -655,7 +658,7 @@ "# Aradi et al. 2007: Table II (p. 5) for the wire; bulk Si with the same hybrid, p. 6\n", "MANUSCRIPT_BAND_GAPS = {WIRE_NAME: (2.21, \"direct\"), BULK_NAME: (1.16, \"indirect\")} # eV\n", "\n", - "print(\"Band gap (HSE06):\")\n", + "print(f\"Band gap (global hybrid, exact-exchange fraction {EXX_FRACTION}):\")\n", "for label, gap in ((WIRE_NAME, fundamental_gaps[bands_workflow.name]),\n", " (BULK_NAME, fundamental_gaps[dos_workflows[BULK_NAME].name])):\n", " character = \"direct\" if gap[\"kpointValence\"] == gap[\"kpointConduction\"] else \"indirect\"\n", @@ -711,7 +714,7 @@ "bands_axes.set_xlim(0, last_path_index)\n", "bands_axes.set_xticks([0, last_path_index], [\"Γ\", \"Z\"])\n", "bands_axes.set_ylim(*ENERGY_WINDOW)\n", - "figure.suptitle(f\"{WIRE_NAME}, HSE06\")\n", + "figure.suptitle(f\"{WIRE_NAME}\\nglobal hybrid, exact-exchange fraction {EXX_FRACTION}\")\n", "display_matplotlib_figure(figure)" ] }, @@ -724,9 +727,9 @@ "\n", "[1] B. Aradi, L. E. Ramos, P. Deák, Th. Köhler, F. Bechstedt, R. Q. Zhang and Th. Frauenheim, \"Theoretical study of the chemical gap tuning in silicon nanowires\", Phys. Rev. B 76, 035305 (2007). https://doi.org/10.1103/PhysRevB.76.035305\n", "\n", - "[2] J. Heyd, G. E. Scuseria and M. Ernzerhof, \"Hybrid functionals based on a screened Coulomb potential\", J. Chem. Phys. 118, 8207 (2003). https://doi.org/10.1063/1.1564060\n", + "[2] J. P. Perdew, M. Ernzerhof and K. Burke, \"Rationale for mixing exact exchange with density functional approximations\", J. Chem. Phys. 105, 9982 (1996). https://doi.org/10.1063/1.472933\n", "\n", - "[3] A. V. Krukau, O. A. Vydrov, A. F. Izmaylov and G. E. Scuseria, \"Influence of the exchange screening parameter on the performance of screened hybrid functionals\", J. Chem. Phys. 125, 224106 (2006). https://doi.org/10.1063/1.2404663\n", + "[3] C. Adamo and V. Barone, \"Toward reliable density functional methods without adjustable parameters: The PBE0 model\", J. Chem. Phys. 110, 6158 (1999). https://doi.org/10.1063/1.478522\n", "\n", "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053\n", "\n", From 9115205674516ce6b3a6ae72a1c5737e5382330a Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 20 Nov 2026 15:53:24 -0800 Subject: [PATCH 15/18] SOF-8128: keep the HSE_* names; they configure the hse06 model and the *_hse units Design review (smaller, finding 1): the rename named still-true constants and made one call name the same run two ways. input_dft and exx_fraction stay in HSE_SETTINGS; EXX_FRACTION, the names carrying it, prose, labels and references are unchanged. Co-Authored-By: Claude Opus 5.5 --- ...ion_edge_nanowire_silicon_SIMULATION.ipynb | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index e5aa39996..936e796cb 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -121,10 +121,10 @@ "# PBE0 form and PseudoDojo norm-conserving ones, as ultrasoft augmentation of every band pair dominates its cost\n", "ECUTWFC = 40 # Ry\n", "ECUTRHO = 200 # Ry\n", - "HYBRID_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", - "HYBRID_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files\n", - "HYBRID_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", - "HYBRID_ECUTRHO = 4 * HYBRID_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", + "HSE_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", + "HSE_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files for HSE06\n", + "HSE_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", + "HSE_ECUTRHO = 4 * HSE_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", "# fraction of exact exchange; the manuscript fits it so bulk Si gives 1.16 eV, which section 8.1 prints\n", "EXX_FRACTION = 0.25\n", "\n", @@ -132,9 +132,9 @@ "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", "PRELIMINARY_SCF_SETTINGS = {\"control\": {\"verbosity\": \"high\"}} # so pw.x prints the crystal k-points the hybrid run uses\n", "# Quantum ESPRESSO computes no hybrid-functional stress with pools; ecutfock (Ry) as in the DOS workflow, since\n", - "# its default, 4 x HYBRID_ECUTWFC, would multiply each pool's exchange memory\n", - "HYBRID_SETTINGS = {\"control\": {\"tstress\": False},\n", - " \"system\": {\"input_dft\": \"pbe0\", \"exx_fraction\": EXX_FRACTION, \"ecutfock\": 100}}\n", + "# its default, 4 x HSE_ECUTWFC, would multiply each pool's exchange memory\n", + "HSE_SETTINGS = {\"control\": {\"tstress\": False},\n", + " \"system\": {\"input_dft\": \"pbe0\", \"exx_fraction\": EXX_FRACTION, \"ecutfock\": 100}}\n", "RELAX_KGRID = [1, 1, 8] # manuscript: 1x1x4 on two periods\n", "BANDS_KGRID = [1, 1, 8]\n", "QGRID = [1, 1, 4] # exact-exchange q-grid; each dimension divides the one of BANDS_KGRID\n", @@ -361,9 +361,9 @@ "bands_workflow.name = BANDS_WORKFLOW_NAME\n", "apply_scf_kgrid(bands_workflow, BANDS_KGRID, material=wire, unit_name=PRELIMINARY_SCF_UNIT)\n", "apply_planewave_cutoffs(bands_workflow, ECUTWFC, ECUTRHO, unit_name=PRELIMINARY_SCF_UNIT)\n", - "apply_planewave_cutoffs(bands_workflow, HYBRID_ECUTWFC, HYBRID_ECUTRHO, unit_name=BANDS_HSE_UNIT)\n", + "apply_planewave_cutoffs(bands_workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=BANDS_HSE_UNIT)\n", "patch_workflow_qe_input(bands_workflow, PRELIMINARY_SCF_SETTINGS, [PRELIMINARY_SCF_UNIT])\n", - "patch_workflow_qe_input(bands_workflow, HYBRID_SETTINGS, [BANDS_HSE_UNIT])\n", + "patch_workflow_qe_input(bands_workflow, HSE_SETTINGS, [BANDS_HSE_UNIT])\n", "main_hse_subworkflow = next(\n", " subworkflow for subworkflow in bands_workflow.subworkflows if subworkflow.name == \"Main HSE Run\"\n", ")\n", @@ -372,8 +372,8 @@ ")\n", "hse_model_config[\"method\"] = {\n", " \"type\": \"pseudopotential\",\n", - " \"subtype\": HYBRID_PSEUDOPOTENTIAL_TYPE,\n", - " \"data\": {\"searchText\": HYBRID_PSEUDOPOTENTIAL_SEARCH_TEXT},\n", + " \"subtype\": HSE_PSEUDOPOTENTIAL_TYPE,\n", + " \"data\": {\"searchText\": HSE_PSEUDOPOTENTIAL_SEARCH_TEXT},\n", "}\n", "main_hse_subworkflow.model = ModelFactory.create(hse_model_config)\n", "bands_hse_unit = main_hse_subworkflow.get_unit_by_name(name=BANDS_HSE_UNIT)\n", @@ -406,9 +406,9 @@ " (BULK_NAME, BULK_KGRID, BULK_DOS_WORKFLOW_NAME)):\n", " workflow = Workflow.create(workflow_configs.get_by_name_first_match(DOS_WORKFLOW_SEARCH_TERM))\n", " workflow.name = workflow_name\n", - " apply_planewave_cutoffs(workflow, HYBRID_ECUTWFC, HYBRID_ECUTRHO, unit_name=DOS_HSE_UNIT)\n", + " apply_planewave_cutoffs(workflow, HSE_ECUTWFC, HSE_ECUTRHO, unit_name=DOS_HSE_UNIT)\n", " apply_scf_kgrid(workflow, kgrid, material=materials[name], unit_name=DOS_HSE_UNIT)\n", - " patch_workflow_qe_input(workflow, HYBRID_SETTINGS, [DOS_HSE_UNIT])\n", + " patch_workflow_qe_input(workflow, HSE_SETTINGS, [DOS_HSE_UNIT])\n", " workflow.subworkflows[0].model = ModelFactory.create(hse_model_config)\n", " dos_workflows[name] = workflow" ] From c96863dd61a1c0fa5cc388db54b030e00a064664 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 20 Nov 2026 16:15:49 -0800 Subject: [PATCH 16/18] SOF-8128: EXX_FRACTION = 0.10, fitted so bulk Si gives the manuscript's 1.16 eV Bulk Si on 8x8x8: 1.1477 eV indirect at 0.10, 1.4050 eV at 0.15; linear interpolation puts 1.16 eV at 0.1024. 0.10 reuses the 0.10 fit job under the same workflow name. tb-review B1: the comment and cell 0 say the value is fitted; N1: the search-text comment no longer reads as if HSE06 were the functional. Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 936e796cb..0a0e5b8e9 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -17,7 +17,7 @@ "and the band gap of bulk silicon, and compares them with Aradi et al.'s Table II and\n", "Fig. 8 (left). The manuscript optimizes the wire with DFTB and computes its gaps with CRYSTAL and a one-parameter global\n", "hybrid fitted to bulk silicon (1.16 eV); here the atoms and the period of the wire are relaxed with PBE and the gaps are\n", - "computed with a global hybrid in the PBE0 form, its fraction of exact exchange set in cell 1.3.\n", + "computed with a global hybrid in the PBE0 form, its fraction of exact exchange (cell 1.3) fitted the same way.\n", "\n", "

Usage

\n", "\n", @@ -122,11 +122,11 @@ "ECUTWFC = 40 # Ry\n", "ECUTRHO = 200 # Ry\n", "HSE_PSEUDOPOTENTIAL_TYPE = \"nc\"\n", - "HSE_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among the platform's norm-conserving files for HSE06\n", + "HSE_PSEUDOPOTENTIAL_SEARCH_TEXT = \"dojo-oncv/0.4\" # PseudoDojo 0.4 among norm-conserving files for hybrid functionals\n", "HSE_ECUTWFC = 72 # Ry, PseudoDojo \"normal\" hint: H 36 Ha, Si 18 Ha\n", "HSE_ECUTRHO = 4 * HSE_ECUTWFC # Ry, enough for norm-conserving pseudopotentials\n", - "# fraction of exact exchange; the manuscript fits it so bulk Si gives 1.16 eV, which section 8.1 prints\n", - "EXX_FRACTION = 0.25\n", + "# fraction of exact exchange, fitted (to two decimals) so bulk Si gives the manuscript's 1.16 eV; section 8.1 prints it\n", + "EXX_FRACTION = 0.10\n", "\n", "# forces below 1e-4 Ha/Bohr as in the manuscript, in QE's Ry/Bohr; the atoms and the period along the wire relax\n", "RELAXATION_SETTINGS = {\"control\": {\"forc_conv_thr\": 2e-4, \"nstep\": 100}, \"cell\": {\"cell_dofree\": \"z\"}}\n", From 79e1d0f6c9a213f2591c6e3d47d3829483fbf14c Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Sat, 21 Nov 2026 22:06:09 -0800 Subject: [PATCH 17/18] =?UTF-8?q?SOF-8128:=20plot=20only=20the=20=CE=93?= =?UTF-8?q?=E2=80=93Z=20path=20of=20the=20hybrid=20band=20structure;=20gap?= =?UTF-8?q?=20lines=20in=20the=20manuscript's=20shape;=204=20h=20time=20li?= =?UTF-8?q?mit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- ...ssivation_edge_nanowire_silicon_SIMULATION.ipynb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 0a0e5b8e9..9fd86c676 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -93,7 +93,7 @@ "QUEUE_NAME = QueueName.OF\n", "PPN = None # None uses the selected queue's maximum cores per job on the selected cluster\n", "NPOOLS = 2 # k-point pools: must divide the cores and not exceed any job's k-points; each adds exact-exchange memory\n", - "TIME_LIMIT = \"24:00:00\"\n", + "TIME_LIMIT = \"04:00:00\"\n", "\n", "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", "POLL_INTERVAL = 60 # seconds\n", @@ -662,8 +662,7 @@ "for label, gap in ((WIRE_NAME, fundamental_gaps[bands_workflow.name]),\n", " (BULK_NAME, fundamental_gaps[dos_workflows[BULK_NAME].name])):\n", " character = \"direct\" if gap[\"kpointValence\"] == gap[\"kpointConduction\"] else \"indirect\"\n", - " print(f\"{label}: {gap['value']:.2f} eV, {character}, VBM at k = {tuple(gap['kpointValence'])}, \"\n", - " f\"CBM at k = {tuple(gap['kpointConduction'])}\")\n", + " print(f\"{label}: {gap['value']:.2f} eV, {character}\")\n", "\n", "print(\"\\nBand gap from the manuscript:\")\n", "for label, (value, character) in MANUSCRIPT_BAND_GAPS.items():\n", @@ -696,8 +695,8 @@ "\n", "band_structure = get_properties_for_job(client, job_ids[bands_workflow.name], \"band_structure\")[0]\n", "density_of_states = get_properties_for_job(client, job_ids[dos_workflows[WIRE_NAME].name], \"density_of_states\")[0]\n", - "path_bands = np.array(band_structure[\"yDataSeries\"]) - fundamental_gaps[bands_workflow.name][\"eigenvalueValence\"]\n", - "last_path_index = len(band_structure[\"xDataArray\"]) - 1\n", + "path_bands = np.array(band_structure[\"yDataSeries\"])[:, -(KPATH_STEPS + 1):]\n", + "path_bands -= fundamental_gaps[bands_workflow.name][\"eigenvalueValence\"]\n", "dos_energies = np.array(density_of_states[\"xDataArray\"][0])\n", "dos_energies -= fundamental_gaps[dos_workflows[WIRE_NAME].name][\"eigenvalueValence\"]\n", "hydrogen_dos = np.sum([series for series, legend in zip(density_of_states[\"yDataSeries\"], density_of_states[\"legend\"])\n", @@ -711,8 +710,8 @@ "dos_axes.set_ylabel(\"Energy (eV)\")\n", "dos_axes.legend()\n", "bands_axes.plot(path_bands.T, color=\"black\", linewidth=0.8)\n", - "bands_axes.set_xlim(0, last_path_index)\n", - "bands_axes.set_xticks([0, last_path_index], [\"Γ\", \"Z\"])\n", + "bands_axes.set_xlim(0, KPATH_STEPS)\n", + "bands_axes.set_xticks([0, KPATH_STEPS], [\"Γ\", \"Z\"])\n", "bands_axes.set_ylim(*ENERGY_WINDOW)\n", "figure.suptitle(f\"{WIRE_NAME}\\nglobal hybrid, exact-exchange fraction {EXX_FRACTION}\")\n", "display_matplotlib_figure(figure)" From a69009945946f862fc218d790b69a5e2a2c9cd8d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 25 Nov 2026 22:16:17 -0800 Subject: [PATCH 18/18] SOF-8128: cell 0 names the manuscript's exact-exchange fraction 0.12 and says ours is fitted to its bulk gap Co-Authored-By: Claude Opus 5.5 --- .../passivation_edge_nanowire_silicon_SIMULATION.ipynb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb index 9fd86c676..034d5cb81 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon_SIMULATION.ipynb @@ -16,8 +16,9 @@ "of radius 0.51 nm, one period Si₁₈H₁₂ as created in the [structure notebook](passivation_edge_nanowire_silicon.ipynb),\n", "and the band gap of bulk silicon, and compares them with Aradi et al.'s Table II and\n", "Fig. 8 (left). The manuscript optimizes the wire with DFTB and computes its gaps with CRYSTAL and a one-parameter global\n", - "hybrid fitted to bulk silicon (1.16 eV); here the atoms and the period of the wire are relaxed with PBE and the gaps are\n", - "computed with a global hybrid in the PBE0 form, its fraction of exact exchange (cell 1.3) fitted the same way.\n", + "hybrid, PBE with an exact-exchange fraction of 0.12, chosen in its ref. 31 (Deák et al. 2005) as the best match to bulk\n", + "silicon (gap 1.16 eV); here the atoms and the period of the wire are relaxed with PBE and the gaps are computed with a\n", + "global hybrid in the PBE0 form, its fraction of exact exchange (cell 1.3) fitted to that bulk gap.\n", "\n", "

Usage

\n", "\n",