From e69e8f73f50ef277d1d052dc504e05b5844511f6 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 30 Oct 2026 19:40:14 -0700 Subject: [PATCH 01/11] SOF-8097: SiO2/HfO2 (001) superlattices, monoclinic and cubic HfO2, structure notebook Two superlattices on the 5.23 A face of beta-cristobalite (standata mp-8352, cut as primitive (110)): Prodhomme et al. 2011 (m-HfO2 mp-352, 10 SiO2 + 7 HfO2 layers, Hf14Si10O48, three O at each interface) and the Robertson & Wallace / Sharia et al. c-332 model (c-HfO2 mp-550893, 12 + 6 layers, quarter-cell film shift, one O moved between the interfaces, Hf12Si12O48). Interface separations put the closest cation-O pair at the bulk Si-O / Hf-O bond length. Three bulk references with the superlattice in-plane cell; five materials saved by name. Co-Authored-By: Claude Opus 5.5 --- ...d_3d_silicon_dioxide_hafnium_dioxide.ipynb | 413 ++++++++++++++++++ 1 file changed, 413 insertions(+) create mode 100644 other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb new file mode 100644 index 000000000..f1a09df5f --- /dev/null +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb @@ -0,0 +1,413 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0", + "metadata": {}, + "source": [ + "# SiO2/HfO2 (001) Superlattices with Monoclinic and Cubic HfO2\n", + "\n", + "## 0. Introduction\n", + "\n", + "This tutorial builds two SiO₂/HfO₂ (001) superlattices and their bulk reference cells after the publications:\n", + "\n", + "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", + "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", + "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", + "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "SiO₂ is ideal β-cristobalite (C9) and is the in-plane reference: its (001) face is the 5.23 × 5.23 Ų square cell,\n", + "turned 45° from the cubic cell, and HfO₂ is strained onto it. Both superlattices are periodic along [001] without\n", + "vacuum, so each has two SiO₂/HfO₂ interfaces.\n", + "\n", + "- **Monoclinic HfO₂** (P2₁/c), as in the first publication: ten SiO₂ layers (one Si each) and seven HfO₂ layers (two\n", + " Hf each), Hf₁₄Si₁₀O₄₈. Each interface carries three O between the last Si and the first Hf. The publication\n", + " stretches HfO₂ by 3.7 % along [100] and 2.1 % along [010] from its own lattice; here the strain follows from the\n", + " Standata lattices.\n", + "- **Cubic HfO₂** (Fm-3m), the model of the second publication, built after Sharia et al. [3]: twelve SiO₂ and six\n", + " HfO₂ layers, Hf₁₂Si₁₂O₄₈. Each interface plane carries three O: two bridge Si and Hf, one is bonded to Hf only, so\n", + " no Si–O bond is broken.\n", + "\n", + "At each interface the two blocks are separated so that the closest cation–O pair across it is at the bulk bond length\n", + "of the cation's own oxide; both publications relax the atomic positions afterwards.\n", + "\n", + "The valence band offsets are computed from the superlattices and from bulk cells with the same in-plane lattice, so\n", + "all five materials are saved:\n", + "[the simulation notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb) loads them by name." + ] + }, + { + "cell_type": "markdown", + "id": "1", + "metadata": {}, + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up the parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], + "source": [ + "SUBSTRATE_NAME = \"mp-8352\" # SiO2, beta-cristobalite (C9), Standata\n", + "MONOCLINIC_FILM_NAME = \"mp-352\" # HfO2, monoclinic, Standata\n", + "CUBIC_FILM_NAME = \"mp-550893\" # HfO2, cubic, Standata\n", + "\n", + "SUBSTRATE_MILLER_INDICES = (1, 1, 0) # in the primitive cell: the (001) face, 5.23 Å square\n", + "FILM_MILLER_INDICES = (0, 0, 1)\n", + "VACUUM = 0.0 # in Angstrom: periodic along the stacking axis\n", + "\n", + "MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS = 5 # two SiO2 layers each: 10\n", + "MONOCLINIC_FILM_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8, of which one is removed\n", + "MONOCLINIC_FILM_ATOMS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", + "MONOCLINIC_FILM_ATOMS_REMOVED_FROM_TOP = 5 # with the lowest O, one HfO2 layer; three O stay at each interface\n", + "\n", + "CUBIC_SUBSTRATE_NUMBER_OF_LAYERS = 6 # two SiO2 layers each: 12\n", + "CUBIC_FILM_NUMBER_OF_LAYERS = 3 # two HfO2 layers each: 6\n", + "CUBIC_FILM_XY_SHIFT = (0, 0.25) # fractions of the in-plane cell: SiO2 interface O on HfO2 O sites\n", + "\n", + "SUBSTRATE_BULK_NUMBER_OF_LAYERS = 2 # one beta-cristobalite period along [001]\n", + "\n", + "MAX_LENGTH_TOLERANCE = 0.05 # admits the 4 % mismatch of cubic HfO2\n", + "\n", + "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", + "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", + "SUBSTRATE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", + "MONOCLINIC_FILM_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", + "CUBIC_FILM_BULK_NAME = \"HfO2 cubic (001) bulk strained\"" + ] + }, + { + "cell_type": "markdown", + "id": "3", + "metadata": {}, + "source": [ + "### 1.2. Install Packages\n", + "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install` (see [README](../../README.ipynb))." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.packages import install_packages\n", + "\n", + "await install_packages(\"made|specific_examples\")" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### 1.3. Load the materials and define the helper functions\n", + "\n", + "The SiO₂ slab is cut from the primitive cell, where the Miller indices (1, 1, 0) select the cubic (001) face in the\n", + "45° cell. The interface builder re-creates its slabs from the bulk, so layer counts and atoms are changed on the built\n", + "superlattice. At each interface the film is moved along the normal, and the cell length is set, so that the closest\n", + "cation–O pair across the interface is at the bulk bond length: Si–O of SiO₂, Hf–O of the HfO₂ phase." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from ase.geometry import get_distances\n", + "from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema\n", + "from mat3ra.made.material import Material\n", + "from mat3ra.made.tools.convert import to_ase\n", + "from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n", + "from mat3ra.made.tools.helpers import (create_interface_zsl_between_slabs, create_slab,\n", + " get_material_with_conventional_lattice)\n", + "from mat3ra.made.tools.modify import interface_displace_part, interface_get_part\n", + "from mat3ra.made.tools.operations.core.unary import strain\n", + "from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction\n", + "from mat3ra.standata.materials import Materials\n", + "\n", + "\n", + "def get_conventional_cell(name):\n", + " return get_material_with_conventional_lattice(Material.create(Materials.get_by_name_first_match(name)))\n", + "\n", + "\n", + "def get_bond_length(material, cation):\n", + " atoms = to_ase(material)\n", + " symbols = np.array(atoms.get_chemical_symbols())\n", + " return atoms.get_all_distances(mic=True)[np.ix_(symbols == cation, symbols == \"O\")].min()\n", + "\n", + "\n", + "def get_vertical_shift(lower, upper, bond_length_by_pair, upper_offset=0.0):\n", + " \"\"\"Shift along z of `upper` that puts the closest cation–O pair across the interface at its bond length.\"\"\"\n", + " lower_atoms, upper_atoms = to_ase(lower), to_ase(upper)\n", + " vectors, _ = get_distances(lower_atoms.positions, upper_atoms.positions + [0, 0, upper_offset],\n", + " cell=lower_atoms.cell, pbc=[True, True, False])\n", + " bond_length = np.array([[bond_length_by_pair.get(frozenset((lower_symbol, upper_symbol)), 0.0)\n", + " for upper_symbol in upper_atoms.symbols] for lower_symbol in lower_atoms.symbols])\n", + " in_plane_distance = np.linalg.norm(vectors[..., :2], axis=-1)\n", + " paired = bond_length > in_plane_distance\n", + " return (np.sqrt(bond_length[paired] ** 2 - in_plane_distance[paired] ** 2) - vectors[..., 2][paired]).max()\n", + "\n", + "\n", + "def set_interface_separations(interface, film):\n", + " bond_length_by_pair = {frozenset((\"Si\", \"O\")): get_bond_length(substrate, \"Si\"),\n", + " frozenset((\"Hf\", \"O\")): get_bond_length(film, \"Hf\")}\n", + " substrate_part = interface_get_part(interface, InterfacePartsEnum.SUBSTRATE)\n", + " film_part = interface_get_part(interface, InterfacePartsEnum.FILM)\n", + " film_shift = get_vertical_shift(substrate_part, film_part, bond_length_by_pair)\n", + " wrap_shift = get_vertical_shift(film_part, substrate_part, bond_length_by_pair, interface.lattice.c)\n", + " top = to_ase(interface).positions[:, 2].max()\n", + " interface = adjust_material_cell_to_set_gap_along_direction(interface,\n", + " interface.lattice.c + film_shift + wrap_shift - top)\n", + " return interface_displace_part(interface, [0, 0, film_shift])\n", + "\n", + "\n", + "def strain_in_plane(material, lattice):\n", + " vectors = np.array(material.lattice.vector_arrays)\n", + " a_direction, b_direction = vectors[:2] / np.linalg.norm(vectors[:2], axis=1)[:, None]\n", + " normal = np.cross(a_direction, b_direction)\n", + " deformation = (lattice.a / material.lattice.a * np.outer(a_direction, a_direction)\n", + " + lattice.b / material.lattice.b * np.outer(b_direction, b_direction) + np.outer(normal, normal))\n", + " return strain(material, Matrix3x3Schema(root=deformation.tolist()))\n", + "\n", + "\n", + "def create_superlattice(film, substrate_number_of_layers, film_number_of_layers, xy_shift=(0, 0)):\n", + " substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=substrate_number_of_layers, vacuum=VACUUM)\n", + " film_slab = create_slab(film, FILM_MILLER_INDICES, number_of_layers=film_number_of_layers, vacuum=VACUUM)\n", + " return create_interface_zsl_between_slabs(\n", + " substrate_slab=substrate_slab, film_slab=film_slab, vacuum=VACUUM, max_length_tol=MAX_LENGTH_TOLERANCE,\n", + " xy_shift=(np.array(xy_shift) * [substrate_slab.lattice.a, substrate_slab.lattice.b]).tolist())\n", + "\n", + "\n", + "substrate = Material.create(Materials.get_by_name_first_match(SUBSTRATE_NAME))\n", + "monoclinic_film = get_conventional_cell(MONOCLINIC_FILM_NAME)\n", + "cubic_film = get_conventional_cell(CUBIC_FILM_NAME)" + ] + }, + { + "cell_type": "markdown", + "id": "7", + "metadata": {}, + "source": [ + "## 2. Create the Superlattice with Monoclinic HfO₂\n", + "\n", + "The slab builder counts monoclinic (001) layers in pairs, so eight HfO₂ layers are built and one is removed. The\n", + "HfO₂ block as built ends in two O on each side; the block kept is one O higher, so it ends in one O against the\n", + "SiO₂ O plane and in three O against the SiO₂ Si. Each interface then carries three O, and the cell stays\n", + "stoichiometric. The in-plane registry of the two blocks is not given in the publication; the builder's default is\n", + "kept." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.modify import filter_by_ids\n", + "\n", + "monoclinic_superlattice = create_superlattice(monoclinic_film, MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS,\n", + " MONOCLINIC_FILM_NUMBER_OF_LAYERS)\n", + "heights = to_ase(monoclinic_superlattice).positions[:, 2]\n", + "film_ids = np.flatnonzero(np.array(monoclinic_superlattice.basis.labels.values) == InterfacePartsEnum.FILM.value)\n", + "film_ids_by_height = film_ids[np.argsort(heights[film_ids])]\n", + "removed_ids = np.concatenate([film_ids_by_height[:MONOCLINIC_FILM_ATOMS_REMOVED_FROM_BOTTOM],\n", + " film_ids_by_height[-MONOCLINIC_FILM_ATOMS_REMOVED_FROM_TOP:]])\n", + "monoclinic_superlattice = filter_by_ids(monoclinic_superlattice, removed_ids.tolist(), invert=True, reset_ids=True)\n", + "monoclinic_superlattice = set_interface_separations(monoclinic_superlattice, monoclinic_film)" + ] + }, + { + "cell_type": "markdown", + "id": "9", + "metadata": {}, + "source": [ + "## 3. Create the Superlattice with Cubic HfO₂\n", + "### 3.1. Stack the slabs\n", + "\n", + "The HfO₂ film is shifted in plane by a quarter of the cell, so that the O of SiO₂ at the interface sit on O sites of\n", + "HfO₂. As built, one interface plane is an HfO₂ O plane with four O, two of them bonded to the Si above, and the other\n", + "is the SiO₂ O plane with two O." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], + "source": [ + "cubic_superlattice = create_superlattice(cubic_film, CUBIC_SUBSTRATE_NUMBER_OF_LAYERS, CUBIC_FILM_NUMBER_OF_LAYERS,\n", + " CUBIC_FILM_XY_SHIFT)\n", + "cubic_superlattice = set_interface_separations(cubic_superlattice, cubic_film)" + ] + }, + { + "cell_type": "markdown", + "id": "11", + "metadata": {}, + "source": [ + "### 3.2. Move one O to the other interface\n", + "\n", + "The first O of the four-O plane that is not bonded to Si is removed, and an O is added at the same in-plane position\n", + "in the two-O plane. Each interface plane then carries three O, two bonded to Si and Hf and one to Hf only: the\n", + "structure of Sharia et al., who remove a different O from each of two four-O interface planes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.helpers import create_defect_point_interstitial, create_defect_point_vacancy\n", + "\n", + "atoms = to_ase(cubic_superlattice)\n", + "symbols = np.array(atoms.get_chemical_symbols())\n", + "labels = np.array(cubic_superlattice.basis.labels.values)\n", + "heights = atoms.positions[:, 2]\n", + "film_oxygen_ids = np.flatnonzero((symbols == \"O\") & (labels == InterfacePartsEnum.FILM.value))\n", + "substrate_oxygen_ids = np.flatnonzero((symbols == \"O\") & (labels == InterfacePartsEnum.SUBSTRATE.value))\n", + "four_oxygen_plane_ids = film_oxygen_ids[np.isclose(heights[film_oxygen_ids], heights[film_oxygen_ids].max())]\n", + "distance_to_silicon = [atoms.get_distances(index, np.flatnonzero(symbols == \"Si\"), mic=True).min()\n", + " for index in four_oxygen_plane_ids]\n", + "removed_position = atoms.positions[four_oxygen_plane_ids[np.isclose(distance_to_silicon, max(distance_to_silicon))][0]]\n", + "added_position = [*removed_position[:2], heights[substrate_oxygen_ids].max()]\n", + "\n", + "cubic_superlattice = create_defect_point_vacancy(cubic_superlattice, removed_position.tolist(), \"closest_site\",\n", + " use_cartesian_coordinates=True)\n", + "cubic_superlattice = create_defect_point_interstitial(cubic_superlattice, added_position, \"O\", \"exact_coordinate\",\n", + " use_cartesian_coordinates=True)" + ] + }, + { + "cell_type": "markdown", + "id": "13", + "metadata": {}, + "source": [ + "## 4. Create the Bulk Reference Cells\n", + "\n", + "SiO₂ is used as is, one β-cristobalite period along [001] in the 45° cell. Each HfO₂ is strained in plane to the cell\n", + "of its superlattice, with the (001) layer spacing kept. Atom labels are removed from all five materials: labels break\n", + "the Quantum ESPRESSO input." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], + "source": [ + "substrate_bulk = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=SUBSTRATE_BULK_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", + "monoclinic_film_bulk = strain_in_plane(monoclinic_film, monoclinic_superlattice.lattice)\n", + "cubic_film_bulk = strain_in_plane(cubic_film, cubic_superlattice.lattice)\n", + "\n", + "materials = [monoclinic_superlattice, cubic_superlattice, substrate_bulk, monoclinic_film_bulk, cubic_film_bulk]\n", + "names = [MONOCLINIC_SUPERLATTICE_NAME, CUBIC_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME, MONOCLINIC_FILM_BULK_NAME,\n", + " CUBIC_FILM_BULK_NAME]\n", + "for material, name in zip(materials, names):\n", + " material.name = name\n", + " material.set_labels_from_list([])" + ] + }, + { + "cell_type": "markdown", + "id": "15", + "metadata": {}, + "source": [ + "## 5. Visualize the Result(s)\n", + "\n", + "In each superlattice the SiO₂ block is at the bottom of the cell and the HfO₂ block on top; the second interface is\n", + "across the periodic boundary." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.ipython.entity.material.visualize import visualize_materials\n", + "\n", + "visualize_materials([{\"material\": material, \"title\": material.name, \"rotation\": \"-90x\"} for material in materials],\n", + " repetitions=[2, 2, 1])" + ] + }, + { + "cell_type": "markdown", + "id": "17", + "metadata": {}, + "source": [ + "## 6. Pass data to the outside runtime" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "18", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.material import set_materials\n", + "\n", + "set_materials(materials)" + ] + }, + { + "cell_type": "markdown", + "id": "19", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", + "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", + "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", + "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", + "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", + "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)" + ] + } + ], + "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 4e0863701369daa53e7696e030c8543d78f85ef6 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 4 Nov 2026 01:09:37 -0800 Subject: [PATCH 02/11] SOF-8097: SiO2/HfO2 valence band offset simulation notebook, monoclinic and cubic HfO2 LDA (GBRV us) offset of both superlattices against Prodhomme 2011 and Robertson and Wallace 2015: MACE anneal (monoclinic) and relaxation of the interface region only, block interiors held at the bulk crystals; superlattice k-grid 4x4x1 as Sharia et al.; Average Electrostatic Potential replaces the unused superlattice band structure; starting_charge on Hf and a 20-step mixing history so the 72-atom SCF converges. Co-Authored-By: Claude Opus 5.5 --- ...n_dioxide_hafnium_dioxide_SIMULATION.ipynb | 926 ++++++++++++++++++ 1 file changed, 926 insertions(+) create mode 100644 other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb new file mode 100644 index 000000000..c768a72de --- /dev/null +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb @@ -0,0 +1,926 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0", + "metadata": {}, + "source": [ + "# Valence Band Offset of SiO₂/HfO₂ (001) Superlattices with Monoclinic and Cubic HfO₂\n", + "\n", + "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", + "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", + "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", + "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "Computes the valence band offset of the two SiO₂/HfO₂ (001) superlattices created in the\n", + "[structure notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb), with the platform's\n", + "[Valence Band Offset](../workflows/valence_band_offset.ipynb) workflow on each relaxed superlattice and its two bulk\n", + "cells, and compares each offset with its publication. Each bulk's valence band maximum is measured from its own average\n", + "electrostatic potential V̄, and the superlattice gives the step in V̄ between the two materials:\n", + "\n", + "ΔE_v = (E_VBM − V̄)_SiO₂ − (E_VBM − V̄)_HfO₂ + (V̄_SiO₂ − V̄_HfO₂)_superlattice\n", + "\n", + "ΔE_v is positive when the valence band maximum of SiO₂ lies above that of HfO₂, the sign convention of both\n", + "publications. Both publications use LDA, as this notebook does; the publications' values compared here are LDA\n", + "values, and their G0W0 corrections to the band edges are not computed.\n", + "\n", + "- **Monoclinic HfO₂**, after Prodhomme et al.: the atomic positions are annealed from 1000 K to 100 K in 1 ps, then\n", + " relaxed, as in the publication.\n", + "- **Cubic HfO₂**, the model of Robertson and Wallace, built after Sharia et al.: the atomic positions are relaxed.\n", + "\n", + "Both publications relax with DFT in LDA, Prodhomme et al. with SIESTA and Sharia et al. with VASP; here the anneal and\n", + "the relaxation use the MACE-MP-0 machine-learned force field, trained on PBE data. Both move only the cation layer on\n", + "each side of an interface and the atoms between them; the block interiors are held at the bulk crystals.\n", + "\n", + "

Usage

\n", + "\n", + "1. Create the materials in the [structure notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb), which saves the two superlattices and their three bulk cells to the `uploads` folder.\n", + "1. Set the material names and parameters in cells 1.2-1.5, 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; the last section prints the comparison with the manuscripts.\n", + "\n", + "## Summary\n", + "\n", + "1. Set up the environment and parameters: install packages (JupyterLite only) and configure the material names, model, anneal, relaxation and compute parameters.\n", + "1. Authenticate and initialize API client: authenticate via browser, initialize the client, then select account and project.\n", + "1. Load the two superlattices and the three bulks by name from the `uploads` folder or the platform, print their composition and geometry.\n", + "1. Configure the DFT model and a k-grid per material.\n", + "1. Configure compute: get the list of clusters and create a compute configuration.\n", + "1. Anneal the monoclinic superlattice with molecular dynamics on the MACE force field.\n", + "1. Relax the atomic positions of both superlattices on the same force field.\n", + "1. Configure the Valence Band Offset workflow for each superlattice: the model, a k-grid per material and the band structures the valence band maxima are read from.\n", + "1. Run the jobs, or reuse ones that already ran on the same materials.\n", + "1. Retrieve the valence band maxima and the potential profiles, compute the offsets, and plot the potentials with the bulk potentials overlaid.\n", + "1. Compare with the manuscripts." + ] + }, + { + "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.calculators.mlff import get_mlff_install_profiles\n", + "from mat3ra.notebooks_utils.packages import install_packages\n", + "\n", + "await install_packages(get_mlff_install_profiles(\"mace\"))\n", + "\n", + "from mat3ra.notebooks_utils.pyodide.packages.patches import apply_all_patches\n", + "\n", + "apply_all_patches(\"mace\")" + ] + }, + { + "cell_type": "markdown", + "id": "3", + "metadata": {}, + "source": [ + "### 1.2. Material names" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "# Names saved by interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb.\n", + "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", + "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", + "SUBSTRATE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", + "MONOCLINIC_FILM_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", + "CUBIC_FILM_BULK_NAME = \"HfO2 cubic (001) bulk strained\"\n", + "\n", + "FILM_BULK_NAME_BY_SUPERLATTICE_NAME = {\n", + " MONOCLINIC_SUPERLATTICE_NAME: MONOCLINIC_FILM_BULK_NAME,\n", + " CUBIC_SUPERLATTICE_NAME: CUBIC_FILM_BULK_NAME,\n", + "}\n", + "ANNEALED_SUPERLATTICE_NAMES = [MONOCLINIC_SUPERLATTICE_NAME] # annealed before the relaxation, as Prodhomme et al." + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### 1.3. Parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6", + "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", + "\n", + "VBO_WORKFLOW_SEARCH_TERM = \"valence_band_offset.json\"\n", + "POTENTIAL_WORKFLOW_SEARCH_TERM = \"average_electrostatic_potential.json\"\n", + "MY_WORKFLOW_NAME = \"Valence Band Offset\"\n", + "APPLICATION_NAME = \"espresso\"\n", + "\n", + "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", + "QUEUE_NAME = QueueName.OR\n", + "PPN = 16 # the OR queue allows at most 16 cores per node\n", + "TIME_LIMIT = \"04:00:00\"\n", + "\n", + "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", + "POLL_INTERVAL = 60 # seconds" + ] + }, + { + "cell_type": "markdown", + "id": "7", + "metadata": {}, + "source": [ + "### 1.4. DFT model parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], + "source": [ + "MODEL_SUBTYPE = \"lda\"\n", + "FUNCTIONAL = \"pz\" # both publications use LDA\n", + "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Hf, Si and O\n", + "VALENCE_ELECTRONS_PER_ATOM = {\"Hf\": 12, \"Si\": 4, \"O\": 6} # GBRV LDA pseudopotentials, Hf with its 5s and 5p shells\n", + "BLOCK_LABEL = {SUBSTRATE_BULK_NAME: \"SiO₂\", MONOCLINIC_FILM_BULK_NAME: \"monoclinic HfO₂\", CUBIC_FILM_BULK_NAME: \"cubic HfO₂\"}\n", + "BLOCK_CATION = {SUBSTRATE_BULK_NAME: \"Si\", MONOCLINIC_FILM_BULK_NAME: \"Hf\", CUBIC_FILM_BULK_NAME: \"Hf\"} # marks each block\n", + "CATIONS_PER_LAYER = {\"Si\": 1, \"Hf\": 2} # per (001) layer of the 5.23 Å cell, one period of the planar-averaged potential\n", + "ECUTWFC = 40 # Ry, GBRV's recommended wavefunction cutoff\n", + "ECUTRHO = 200 # Ry, GBRV's recommended charge-density cutoff\n", + "ADDITIONAL_PARAMETERS = {\n", + " # Hf, the third species of the superlattices: its GBRV atomic density holds 10 of its 12 valence electrons;\n", + " # scaled by (12 + 2.4) / 12, the starting density is neutral in both blocks\n", + " \"system\": {\"starting_charge(3)\": -2.4},\n", + " \"electrons\": {\"mixing_mode\": \"local-TF\", \"mixing_beta\": 0.2, \"mixing_ndim\": 20, \"electron_maxstep\": 200}, # the long cells need local-TF mixing with a long history to converge\n", + "}\n", + "KPOINT_DENSITY = 3.5 # points per Å⁻¹, for the bulks\n", + "SUPERLATTICE_KGRID = [4, 4, 1] # Sharia et al.\n", + "\n", + "SCF_UNIT = \"pw_scf\"\n", + "BANDS_UNIT = \"pw_bands\"\n", + "AVERAGE_UNIT = \"average ESP\"" + ] + }, + { + "cell_type": "markdown", + "id": "9", + "metadata": {}, + "source": [ + "### 1.5. Anneal and relaxation parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], + "source": [ + "MACE_MODEL_FAMILY = \"MACE-MP-0\"\n", + "MACE_MODEL = \"large\"\n", + "MACE_DISPERSION = False\n", + "MACE_DEFAULT_DTYPE = \"float32\"\n", + "MACE_DEVICE = \"cpu\"\n", + "\n", + "ANNEAL_START_TEMPERATURE = 1000 # K\n", + "ANNEAL_END_TEMPERATURE = 100 # K\n", + "ANNEAL_DURATION = 1000 # fs\n", + "ANNEAL_TIMESTEP = 1 # fs\n", + "ANNEAL_FRICTION = 0.01 # 1/fs, Langevin thermostat\n", + "ANNEAL_SEED = 42 # initial velocities and thermostat noise\n", + "ANNEAL_LOG_INTERVAL = 100 # steps\n", + "RELAXATION_FORCE_THRESHOLD = 0.07 # eV/Å, the force threshold of Prodhomme et al.\n", + "INTERFACE_CATION_LAYERS = 1 # on each side of an interface; these and the atoms between them move, all others are fixed" + ] + }, + { + "cell_type": "markdown", + "id": "11", + "metadata": {}, + "source": [ + "## 2. Authenticate and initialize API client\n", + "### 2.1. Authenticate" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.auth import authenticate\n", + "\n", + "await authenticate()" + ] + }, + { + "cell_type": "markdown", + "id": "13", + "metadata": {}, + "source": [ + "### 2.2. Initialize API client" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.api_client import APIClient\n", + "\n", + "client = APIClient.authenticate()\n", + "client" + ] + }, + { + "cell_type": "markdown", + "id": "15", + "metadata": {}, + "source": [ + "### 2.3. Select account" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], + "source": [ + "client.list_accounts()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "17", + "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": "18", + "metadata": {}, + "source": [ + "### 2.4. Select project" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "19", + "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": "20", + "metadata": {}, + "source": [ + "## 3. Load the materials\n", + "### 3.1. Load from the uploads folder and print composition and geometry\n", + "\n", + "Both superlattices are periodic along [001], with two SiO₂/HfO₂ interfaces each; HfO₂ is strained in plane to the\n", + "5.23 Å cell of SiO₂, and each HfO₂ bulk cell carries the same strain." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from collections import Counter\n", + "from mat3ra.notebooks_utils.core.entity.material.api import load_material\n", + "\n", + "MATERIAL_NAMES = [*FILM_BULK_NAME_BY_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME, *FILM_BULK_NAME_BY_SUPERLATTICE_NAME.values()]\n", + "materials_by_name = {name: load_material(client, FOLDER, name, ACCOUNT_ID) for name in MATERIAL_NAMES}\n", + "\n", + "\n", + "def get_layer_spacing(bulk, bulk_name):\n", + " vectors = np.array(bulk.lattice.vector_arrays)\n", + " normal_length = abs(np.linalg.det(vectors)) / np.linalg.norm(np.cross(vectors[0], vectors[1]))\n", + " cation = BLOCK_CATION[bulk_name]\n", + " return normal_length * CATIONS_PER_LAYER[cation] / bulk.basis.elements.values.count(cation)\n", + "\n", + "\n", + "valence_electrons = {}\n", + "for name, material in materials_by_name.items():\n", + " composition = Counter(material.basis.elements.values)\n", + " electron_count = sum(VALENCE_ELECTRONS_PER_ATOM[element] * count for element, count in composition.items())\n", + " lattice = material.lattice\n", + " valence_electrons[name] = electron_count\n", + " print(f\"{name}: {dict(composition)}, {material.basis.number_of_atoms} atoms, \"\n", + " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å, {electron_count} valence electrons\")\n", + " if name in BLOCK_CATION:\n", + " print(f\" (001) layer spacing: {get_layer_spacing(material, name):.4f} Å\")" + ] + }, + { + "cell_type": "markdown", + "id": "22", + "metadata": {}, + "source": [ + "## 4. Configure the DFT model and k-grid\n", + "### 4.1. DFT model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "23", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.standata.applications import ApplicationStandata\n", + "from mat3ra.standata.model_tree import ModelTreeStandata\n", + "from mat3ra.ade.application import Application\n", + "from mat3ra.mode import ModelFactory\n", + "\n", + "app_config = ApplicationStandata.get_by_name_first_match(APPLICATION_NAME)\n", + "app = Application(**app_config)\n", + "\n", + "model_config = ModelTreeStandata.get_model_by_parameters(type=\"dft\", subtype=MODEL_SUBTYPE, functional=FUNCTIONAL)\n", + "model_config[\"method\"] = {\"type\": \"pseudopotential\", \"subtype\": PSEUDOPOTENTIAL_TYPE}\n", + "model = ModelFactory.create(model_config)\n", + "print(f\"Using application: {app.name}, model: {MODEL_SUBTYPE} {FUNCTIONAL}, {PSEUDOPOTENTIAL_TYPE} pseudopotentials\")" + ] + }, + { + "cell_type": "markdown", + "id": "24", + "metadata": {}, + "source": [ + "### 4.2. k-grid per material" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.workflow import kgrid_from_density\n", + "\n", + "kgrid = {name: kgrid_from_density(material, KPOINT_DENSITY) for name, material in materials_by_name.items()}\n", + "kgrid.update({name: SUPERLATTICE_KGRID for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME})\n", + "for name, grid in kgrid.items():\n", + " print(f\"{name}: k-grid {grid}\")" + ] + }, + { + "cell_type": "markdown", + "id": "26", + "metadata": {}, + "source": [ + "## 5. Create the compute configuration\n", + "### 5.1. Select cluster" + ] + }, + { + "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. Anneal the monoclinic superlattice\n", + "\n", + "Molecular dynamics at fixed cell: velocities are drawn at the start temperature, and the thermostat temperature is\n", + "lowered at every step, linearly to the end temperature. The annealed structure is the starting point of the relaxation." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31", + "metadata": {}, + "outputs": [], + "source": [ + "from ase import units\n", + "from ase.constraints import FixAtoms\n", + "from ase.md import MDLogger\n", + "from ase.md.langevin import Langevin\n", + "from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n", + "from mat3ra.made.material import Material\n", + "from mat3ra.made.tools.convert import from_ase, to_ase\n", + "from mat3ra.notebooks_utils.calculators.mlff import create_mlff_calculator\n", + "\n", + "calculator = create_mlff_calculator(\n", + " \"mace\",\n", + " {\n", + " \"family\": MACE_MODEL_FAMILY,\n", + " \"model\": MACE_MODEL,\n", + " \"dispersion\": MACE_DISPERSION,\n", + " \"default_dtype\": MACE_DEFAULT_DTYPE,\n", + " \"device\": MACE_DEVICE,\n", + " },\n", + ")\n", + "temperatures = np.linspace(ANNEAL_START_TEMPERATURE, ANNEAL_END_TEMPERATURE, round(ANNEAL_DURATION / ANNEAL_TIMESTEP))\n", + "\n", + "\n", + "def get_interior_indices(superlattice, film_cation, substrate_cation):\n", + " atoms = to_ase(superlattice)\n", + " heights, period = atoms.positions[:, 2], atoms.cell[2, 2]\n", + " elements = np.array(atoms.get_chemical_symbols())\n", + " film_center = np.angle(np.exp(2j * np.pi * heights[elements == film_cation] / period).mean()) * period / (2 * np.pi)\n", + " offsets = (heights - film_center + period / 2) % period - period / 2\n", + " in_interface = np.zeros(len(atoms), dtype=bool)\n", + " for side_offsets in (offsets, -offsets): # the interface above the film block, then the one below\n", + " film_cations = np.sort(side_offsets[(elements == film_cation) & (side_offsets > 0)])\n", + " substrate_cations = np.sort(side_offsets[(elements == substrate_cation) & (side_offsets > 0)])\n", + " film_edge = film_cations[-INTERFACE_CATION_LAYERS * CATIONS_PER_LAYER[film_cation]]\n", + " substrate_edge = substrate_cations[INTERFACE_CATION_LAYERS * CATIONS_PER_LAYER[substrate_cation] - 1]\n", + " in_interface |= (side_offsets >= film_edge) & (side_offsets <= substrate_edge)\n", + " return np.flatnonzero(~in_interface)\n", + "\n", + "\n", + "interior_indices = {\n", + " name: get_interior_indices(materials_by_name[name], BLOCK_CATION[film_bulk_name], BLOCK_CATION[SUBSTRATE_BULK_NAME])\n", + " for name, film_bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items()\n", + "}\n", + "\n", + "unrelaxed_superlattices = {name: materials_by_name[name] for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME}\n", + "for name in ANNEALED_SUPERLATTICE_NAMES:\n", + " atoms = to_ase(materials_by_name[name])\n", + " atoms.set_constraint(FixAtoms(indices=interior_indices[name]))\n", + " atoms.calc = calculator\n", + " random_generator = np.random.default_rng(ANNEAL_SEED)\n", + " MaxwellBoltzmannDistribution(atoms, temperature_K=ANNEAL_START_TEMPERATURE, rng=random_generator)\n", + " dynamics = Langevin(atoms, ANNEAL_TIMESTEP * units.fs, temperature_K=ANNEAL_START_TEMPERATURE,\n", + " friction=ANNEAL_FRICTION / units.fs, rng=random_generator)\n", + " dynamics.attach(MDLogger(dynamics, atoms, \"-\", peratom=False), interval=ANNEAL_LOG_INTERVAL)\n", + " for temperature in temperatures:\n", + " dynamics.set_temperature(temperature_K=temperature)\n", + " dynamics.run(1)\n", + " annealed = Material.create(from_ase(atoms))\n", + " annealed.name = f\"{name} annealed\"\n", + " unrelaxed_superlattices[name] = annealed" + ] + }, + { + "cell_type": "markdown", + "id": "32", + "metadata": {}, + "source": [ + "## 7. Relax the superlattices\n", + "\n", + "Fixed-cell relaxation of the atomic positions on the same force field, to the force threshold of Prodhomme et al.; the\n", + "monoclinic superlattice starts from its annealed structure. Each relaxed superlattice is named ` relaxed`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "33", + "metadata": {}, + "outputs": [], + "source": [ + "from ase.optimize import BFGS\n", + "\n", + "relaxed_superlattices = {}\n", + "for name, superlattice in unrelaxed_superlattices.items():\n", + " atoms = to_ase(superlattice)\n", + " atoms.set_constraint(FixAtoms(indices=interior_indices[name]))\n", + " atoms.calc = calculator\n", + " BFGS(atoms).run(fmax=RELAXATION_FORCE_THRESHOLD)\n", + " relaxed = Material.create(from_ase(atoms))\n", + " relaxed.name = f\"{name} relaxed\"\n", + " relaxed_superlattices[name] = relaxed" + ] + }, + { + "cell_type": "markdown", + "id": "34", + "metadata": {}, + "source": [ + "## 8. Configure the Valence Band Offset workflow\n", + "\n", + "The workflow runs the band structure and electrostatic potential calculation on the two bulks, each with its own\n", + "k-grid, and stores the band structures. The superlattice needs only its electrostatic potential, so its band structure\n", + "calculation is replaced by the platform's Average Electrostatic Potential workflow. Section 10 computes the offset\n", + "from the band structures and the planar-averaged potentials, so the workflow's own lineup step is left out. One workflow is configured per\n", + "superlattice." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.standata.workflows import WorkflowStandata\n", + "from mat3ra.wode.context.providers import PointsGridDataProvider\n", + "from mat3ra.wode.workflows import Workflow\n", + "from mat3ra.notebooks_utils.ipython.entity.workflow.visualize import visualize_workflow\n", + "from mat3ra.notebooks_utils.workflow import apply_planewave_cutoffs, patch_workflow_qe_input\n", + "\n", + "job_material_names, job_materials, workflows = {}, {}, {}\n", + "for name, film_bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items():\n", + " job_material_names[name] = [name, SUBSTRATE_BULK_NAME, film_bulk_name]\n", + " job_materials[name] = [relaxed_superlattices[name], materials_by_name[SUBSTRATE_BULK_NAME],\n", + " materials_by_name[film_bulk_name]]\n", + " workflow = Workflow.create(\n", + " WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(VBO_WORKFLOW_SEARCH_TERM)\n", + " )\n", + " workflow.name = MY_WORKFLOW_NAME\n", + " superlattice_band_structure = workflow.subworkflows[0]\n", + " for subworkflow in list(workflow.subworkflows):\n", + " if subworkflow.application.name != APPLICATION_NAME or subworkflow.id == superlattice_band_structure.id:\n", + " workflow.remove_unit(workflow.get_unit_by_name(name=subworkflow.name).flowchartId)\n", + " workflow.remove_subworkflow_by_id(subworkflow.id)\n", + " potential_workflow = Workflow.create(\n", + " WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(POTENTIAL_WORKFLOW_SEARCH_TERM)\n", + " )\n", + " workflow.add_subworkflow(potential_workflow.subworkflows[0], head=True)\n", + " for unit_name in [SCF_UNIT, BANDS_UNIT]:\n", + " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", + " for subworkflow in workflow.subworkflows:\n", + " subworkflow.model = model\n", + " material_index = int(next((unit.value for unit in subworkflow.units if unit.name.startswith(\"Set Material Index\")), 0))\n", + " material_name = job_material_names[name][material_index]\n", + "\n", + " if bands_unit := subworkflow.get_unit_by_name(name=BANDS_UNIT):\n", + " bands_unit.results.append({\"name\": \"band_structure\"})\n", + " subworkflow.set_unit(bands_unit)\n", + "\n", + " scf_unit = subworkflow.get_unit_by_name(name=SCF_UNIT)\n", + " scf_unit.add_context(PointsGridDataProvider(material=job_materials[name][material_index],\n", + " dimensions=kgrid[material_name], isEdited=True).get_context_item_data())\n", + " subworkflow.set_unit(scf_unit)\n", + "\n", + " patch_workflow_qe_input(workflow, ADDITIONAL_PARAMETERS, unit_names=[SCF_UNIT])\n", + " workflows[name] = workflow\n", + "visualize_workflow(workflow)" + ] + }, + { + "cell_type": "markdown", + "id": "36", + "metadata": {}, + "source": [ + "## 9. Save the materials and run the jobs\n", + "\n", + "For each superlattice, a job that already ran on the same three materials is reused; otherwise a new one is created\n", + "and submitted. One job runs at a time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "37", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.core.entity.job.api import get_kgrid_query\n", + "from mat3ra.notebooks_utils.core.entity.material.api import get_or_create_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 name, workflow in workflows.items():\n", + " saved_materials = [get_or_create_material(client, material, ACCOUNT_ID) for material in job_materials[name]]\n", + " material_ids = [material[\"_id\"] for material in saved_materials]\n", + " candidates = client.jobs.list({\n", + " \"_material._id\": material_ids[0], \"owner._id\": ACCOUNT_ID, \"workflow.name\": workflow.name,\n", + " \"status\": {\"$in\": [\"submitted\", \"queued\", \"active\", \"finished\"]}, **get_kgrid_query(kgrid[name], SCF_UNIT),\n", + " })\n", + " job = next((candidate for candidate in candidates\n", + " if [material[\"_id\"] for material in candidate[\"_materials\"]] == material_ids), None)\n", + " if job is None:\n", + " job = create_job(api_client=client, materials=saved_materials, workflow=workflow, project_id=project_id,\n", + " owner_id=ACCOUNT_ID, compute=compute.to_dict(), prefix=f\"{workflow.name} {name} {timestamp}\")\n", + " submit_jobs(client.jobs, [job[\"_id\"]])\n", + " print(f\"✅ Submitted job {job['_id']}\")\n", + " else:\n", + " print(f\"♻️ Reusing job {job['_id']}\")\n", + " await wait_for_jobs_to_finish_async(client.jobs, [job[\"_id\"]], poll_interval=POLL_INTERVAL)\n", + " job_ids[name] = job[\"_id\"]" + ] + }, + { + "cell_type": "markdown", + "id": "38", + "metadata": {}, + "source": [ + "## 10. Retrieve the results\n", + "### 10.1. Valence band maxima and average potentials\n", + "\n", + "E_VBM is the top of the highest valence band, band N_electrons / 2, along each bulk's k-path, and the gap is the\n", + "bottom of the next band minus E_VBM. V̄ is the planar average of the electrostatic potential, averaged over the whole\n", + "cell for a bulk, and over one (001) layer, one period of the potential, at the centre of each block for a\n", + "superlattice, the bulk-like region far from both interfaces." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "39", + "metadata": {}, + "outputs": [], + "source": [ + "band_structures, profiles = {}, {}\n", + "for name, job_id in job_ids.items():\n", + " for subworkflow in client.jobs.get(job_id)[\"workflow\"][\"subworkflows\"]:\n", + " units = {unit[\"name\"]: unit for unit in subworkflow[\"units\"]}\n", + " material_name = job_material_names[name][int(next((unit[\"value\"] for unit in subworkflow[\"units\"]\n", + " if unit[\"name\"].startswith(\"Set Material Index\")), 0))]\n", + " profiles[name, material_name] = client.properties.get_for_job(\n", + " job_id, property_name=\"average_potential_profile\", unit_id=units[AVERAGE_UNIT][\"flowchartId\"])[0]\n", + " if BANDS_UNIT in units:\n", + " band_structures[name, material_name] = np.array(client.properties.get_for_job(\n", + " job_id, property_name=\"band_structure\", unit_id=units[BANDS_UNIT][\"flowchartId\"])[0][\"yDataSeries\"])\n", + "\n", + "block_windows, superlattice_potential, bulk_potential, valence_band_maximum, bulk_gap = {}, {}, {}, {}, {}\n", + "for name, (_, *bulk_names) in job_material_names.items():\n", + " superlattice = relaxed_superlattices[name]\n", + " superlattice_in_cartesian = superlattice.clone()\n", + " superlattice_in_cartesian.to_cartesian()\n", + " heights = np.array(superlattice_in_cartesian.basis.coordinates.values)[:, 2]\n", + " elements = np.array(superlattice.basis.elements.values)\n", + " period = superlattice.lattice.c\n", + " positions = np.array(profiles[name, name][\"xDataArray\"])\n", + " planar_average = np.array(profiles[name, name][\"yDataSeries\"][0])\n", + " print(f\"{name}:\")\n", + " for bulk_name in bulk_names:\n", + " key = (name, bulk_name)\n", + " number_of_valence_bands = valence_electrons[bulk_name] // 2\n", + " cation_heights = heights[elements == BLOCK_CATION[bulk_name]]\n", + " # centre of the block's layers, also when the block wraps around the cell boundary\n", + " center = np.angle(np.exp(2j * np.pi * cation_heights / period).mean()) * period / (2 * np.pi) % period\n", + " spacing = get_layer_spacing(materials_by_name[bulk_name], bulk_name)\n", + " block_windows[key] = (center, spacing)\n", + " distances = (positions - center + period / 2) % period - period / 2\n", + " superlattice_potential[key] = planar_average[np.abs(distances) <= spacing / 2].mean()\n", + " bulk_potential[key] = np.mean(profiles[key][\"yDataSeries\"][0])\n", + " valence_band_maximum[key] = band_structures[key][number_of_valence_bands - 1].max()\n", + " bulk_gap[key] = band_structures[key][number_of_valence_bands].min() - valence_band_maximum[key]\n", + " print(f\" {bulk_name}: E_VBM = {valence_band_maximum[key]:.4f} eV, V̄ = {bulk_potential[key]:.4f} eV, \"\n", + " f\"E_VBM - V̄ = {valence_band_maximum[key] - bulk_potential[key]:.4f} eV, gap {bulk_gap[key]:+.3f} eV\")\n", + " print(f\" in the superlattice: V̄ = {superlattice_potential[key]:.4f} eV, averaged over \"\n", + " f\"{spacing:.4f} Å centred at z = {center:.4f} Å\")" + ] + }, + { + "cell_type": "markdown", + "id": "40", + "metadata": {}, + "source": [ + "### 10.2. Valence band offsets" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41", + "metadata": {}, + "outputs": [], + "source": [ + "potential_lineup, valence_band_offset = {}, {}\n", + "for name, (_, substrate_bulk_name, film_bulk_name) in job_material_names.items():\n", + " substrate, film = (name, substrate_bulk_name), (name, film_bulk_name)\n", + " bulk_term = ((valence_band_maximum[substrate] - bulk_potential[substrate])\n", + " - (valence_band_maximum[film] - bulk_potential[film]))\n", + " potential_lineup[name] = superlattice_potential[substrate] - superlattice_potential[film]\n", + " valence_band_offset[name] = bulk_term + potential_lineup[name]\n", + " film_label = BLOCK_LABEL[film_bulk_name]\n", + " print(f\"{name}:\")\n", + " print(f\" (E_VBM - V̄)_SiO₂ - (E_VBM - V̄)_{film_label} = {bulk_term:+.4f} eV\")\n", + " print(f\" (V̄_SiO₂ - V̄_{film_label})_superlattice = {potential_lineup[name]:+.4f} eV\")\n", + " print(f\" ΔE_v = E_VBM(SiO₂) - E_VBM({film_label}) = {valence_band_offset[name]:+.4f} eV\")" + ] + }, + { + "cell_type": "markdown", + "id": "42", + "metadata": {}, + "source": [ + "### 10.3. Potential across the superlattices\n", + "\n", + "One period from the HfO₂→SiO₂ interface, SiO₂ on the left. Each bulk's own potential (dotted) is overlaid on its\n", + "block, shifted to the block's average; where they coincide the block is bulk-like, and the two averages (dashed\n", + "horizontal lines) are shifted with respect to each other by the lineup." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", + "\n", + "figure, axes = plt.subplots(len(job_ids), 1, figsize=(10, 5 * len(job_ids)), squeeze=False)\n", + "for axis, (name, (_, substrate_bulk_name, film_bulk_name)) in zip(axes[:, 0], job_material_names.items()):\n", + " superlattice = relaxed_superlattices[name]\n", + " superlattice_in_cartesian = superlattice.clone()\n", + " superlattice_in_cartesian.to_cartesian()\n", + " heights = np.array(superlattice_in_cartesian.basis.coordinates.values)[:, 2]\n", + " elements = np.array(superlattice.basis.elements.values)\n", + " period = superlattice.lattice.c\n", + " positions = np.array(profiles[name, name][\"xDataArray\"])\n", + " planar_average = np.array(profiles[name, name][\"yDataSeries\"][0])\n", + "\n", + " substrate_center, substrate_spacing = block_windows[name, substrate_bulk_name]\n", + " substrate_cation = BLOCK_CATION[substrate_bulk_name]\n", + " substrate_layers = np.sum(elements == substrate_cation) / CATIONS_PER_LAYER[substrate_cation]\n", + " plot_origin = substrate_center - substrate_layers * substrate_spacing / 2 # the middle of the HfO2->SiO2 interface\n", + " order = np.argsort((positions - plot_origin) % period)\n", + " axis.plot(((positions - plot_origin) % period)[order], planar_average[order], color=\"black\", label=\"superlattice\")\n", + " for bulk_name, color in ((substrate_bulk_name, \"tab:blue\"), (film_bulk_name, \"tab:red\")):\n", + " key = (name, bulk_name)\n", + " bulk = materials_by_name[bulk_name]\n", + " cation = BLOCK_CATION[bulk_name]\n", + " center, spacing = block_windows[key]\n", + " half_width = np.sum(elements == cation) / CATIONS_PER_LAYER[cation] * spacing / 2\n", + " offsets = np.linspace(-half_width, half_width, 400) # from the block's centre\n", + " cation_offsets = (heights[elements == cation] - center + period / 2) % period - period / 2\n", + " layer_offsets = np.sort(cation_offsets).reshape(-1, CATIONS_PER_LAYER[cation]).mean(axis=1)\n", + " plane_offset = layer_offsets[np.abs(layer_offsets).argmin()] # the layer nearest the block centre\n", + " bulk_profile = profiles[key]\n", + " profile_length = len(bulk_profile[\"xDataArray\"]) * bulk_profile[\"xDataArray\"][1] # one bulk cell\n", + " bulk_cation_fractions = np.array(bulk.basis.coordinates.values)[np.array(bulk.basis.elements.values) == cation][:, 2]\n", + " bulk_layer_fraction = np.sort(bulk_cation_fractions)[:CATIONS_PER_LAYER[cation]].mean()\n", + " bulk_normal_length = spacing * bulk.basis.elements.values.count(cation) / CATIONS_PER_LAYER[cation]\n", + " bulk_values = np.interp((((offsets - plane_offset) / bulk_normal_length + bulk_layer_fraction) * profile_length),\n", + " bulk_profile[\"xDataArray\"], bulk_profile[\"yDataSeries\"][0], period=profile_length)\n", + " region = offsets + (center - plot_origin) % period\n", + " shift = superlattice_potential[key] - bulk_potential[key]\n", + " axis.plot(region, bulk_values + shift, color=color, linestyle=\":\", linewidth=2,\n", + " label=f\"bulk {BLOCK_LABEL[bulk_name]}, shifted\")\n", + " axis.hlines(superlattice_potential[key], region[0], region[-1], color=color, linestyle=\"--\",\n", + " label=f\"V̄_{BLOCK_LABEL[bulk_name]} = {superlattice_potential[key]:.3f} eV\")\n", + " axis.text((center - plot_origin) % period, 0.02, BLOCK_LABEL[bulk_name], transform=axis.get_xaxis_transform(),\n", + " ha=\"center\")\n", + " axis.set_xlim(0, period)\n", + " axis.set_xlabel(\"position along (001) (Å)\")\n", + " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", + " axis.set_title(f\"{name}: ΔV̄ = {potential_lineup[name]:.3f} eV, ΔE_v = {valence_band_offset[name]:.3f} eV\")\n", + " axis.legend(loc=\"lower right\", bbox_to_anchor=(1, 0.07), fontsize=8)\n", + "figure.tight_layout()\n", + "display_matplotlib_figure(figure)" + ] + }, + { + "cell_type": "markdown", + "id": "44", + "metadata": {}, + "source": [ + "## 11. Compare with the manuscripts\n", + "\n", + "Both publications define the offset as E_VBM(SiO₂) − E_VBM(HfO₂). Robertson and Wallace read it from the densities of\n", + "states of layers away from the interfaces; here both offsets come from the potential line-up, as in Prodhomme et al.\n", + "Settings that differ from the manuscripts: GBRV ultrasoft LDA pseudopotentials in plane waves at 40/200 Ry, against\n", + "the localized orbitals and Troullier–Martins pseudopotentials of Prodhomme et al.; the lattice constants of the platform's SiO₂ and HfO₂ structures, against the publications' LDA\n", + "lattices, so the in-plane strain of monoclinic HfO₂ is smaller than the 3.7 % and 2.1 % of Prodhomme et al.; and\n", + "the k-points of the bulks, which Prodhomme et al. do not give and Sharia et al. set to 8 × 8 × 8. The value of Robertson and Wallace is read from their Fig. 57a." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45", + "metadata": {}, + "outputs": [], + "source": [ + "MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME = {\n", + " MONOCLINIC_SUPERLATTICE_NAME: (\"Prodhomme 2011\", 0.4), # eV, LDA, Table I\n", + " CUBIC_SUPERLATTICE_NAME: (\"Robertson and Wallace 2015\", -0.67), # eV, LDA, Fig. 57a\n", + "}\n", + "\n", + "for name, (source, manuscript_offset) in MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME.items():\n", + " film_label = BLOCK_LABEL[FILM_BULK_NAME_BY_SUPERLATTICE_NAME[name]]\n", + " print(f\"VBO, SiO₂/HfO₂ ({film_label}): {source} {manuscript_offset:+} eV | ours {valence_band_offset[name]:+.2f} eV\")" + ] + }, + { + "cell_type": "markdown", + "id": "46", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", + "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", + "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", + "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", + "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", + "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)\n", + "\n", + "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT\n", + "calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053\n", + "\n", + "[5] MACE-MP-0 foundation models: https://github.com/ACEsuit/mace" + ] + } + ], + "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 6d454fba0cdc75a13b050278ec246f7a4871bc0f Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 4 Nov 2026 07:27:12 -0800 Subject: [PATCH 03/11] SOF-8097: SiO2/HfO2 simulation notebook runs Valence Band Offset (Bulk Method), offsets from the job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow computes the offset (bulk V̄ means, double-convolution line-up at the block centres) and stores valence_band_offset; the notebook drops its own composition and arithmetic and keeps the V̄(z) plot. Co-Authored-By: Claude Opus 5.5 --- ...n_dioxide_hafnium_dioxide_SIMULATION.ipynb | 165 +++++++----------- 1 file changed, 60 insertions(+), 105 deletions(-) diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb index c768a72de..e22407de6 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb @@ -16,7 +16,7 @@ "\n", "Computes the valence band offset of the two SiO₂/HfO₂ (001) superlattices created in the\n", "[structure notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb), with the platform's\n", - "[Valence Band Offset](../workflows/valence_band_offset.ipynb) workflow on each relaxed superlattice and its two bulk\n", + "Valence Band Offset (Bulk Method) workflow on each relaxed superlattice and its two bulk\n", "cells, and compares each offset with its publication. Each bulk's valence band maximum is measured from its own average\n", "electrostatic potential V̄, and the superlattice gives the step in V̄ between the two materials:\n", "\n", @@ -51,9 +51,9 @@ "1. Configure compute: get the list of clusters and create a compute configuration.\n", "1. Anneal the monoclinic superlattice with molecular dynamics on the MACE force field.\n", "1. Relax the atomic positions of both superlattices on the same force field.\n", - "1. Configure the Valence Band Offset workflow for each superlattice: the model, a k-grid per material and the band structures the valence band maxima are read from.\n", + "1. Configure the Valence Band Offset (Bulk Method) workflow for each superlattice: the model and a k-grid per material.\n", "1. Run the jobs, or reuse ones that already ran on the same materials.\n", - "1. Retrieve the valence band maxima and the potential profiles, compute the offsets, and plot the potentials with the bulk potentials overlaid.\n", + "1. Retrieve the valence band offsets and the potential profiles, and plot the potentials with the bulk potentials overlaid.\n", "1. Compare with the manuscripts." ] }, @@ -133,9 +133,8 @@ "ORGANIZATION_NAME = None # set to your organization name (full or partial); otherwise, your default one is used\n", "FOLDER = \"./uploads\"\n", "\n", - "VBO_WORKFLOW_SEARCH_TERM = \"valence_band_offset.json\"\n", - "POTENTIAL_WORKFLOW_SEARCH_TERM = \"average_electrostatic_potential.json\"\n", - "MY_WORKFLOW_NAME = \"Valence Band Offset\"\n", + "VBO_WORKFLOW_SEARCH_TERM = \"valence_band_offset_bulk\"\n", + "MY_WORKFLOW_NAME = \"Valence Band Offset (Bulk Method)\"\n", "APPLICATION_NAME = \"espresso\"\n", "\n", "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", @@ -165,7 +164,6 @@ "MODEL_SUBTYPE = \"lda\"\n", "FUNCTIONAL = \"pz\" # both publications use LDA\n", "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Hf, Si and O\n", - "VALENCE_ELECTRONS_PER_ATOM = {\"Hf\": 12, \"Si\": 4, \"O\": 6} # GBRV LDA pseudopotentials, Hf with its 5s and 5p shells\n", "BLOCK_LABEL = {SUBSTRATE_BULK_NAME: \"SiO₂\", MONOCLINIC_FILM_BULK_NAME: \"monoclinic HfO₂\", CUBIC_FILM_BULK_NAME: \"cubic HfO₂\"}\n", "BLOCK_CATION = {SUBSTRATE_BULK_NAME: \"Si\", MONOCLINIC_FILM_BULK_NAME: \"Hf\", CUBIC_FILM_BULK_NAME: \"Hf\"} # marks each block\n", "CATIONS_PER_LAYER = {\"Si\": 1, \"Hf\": 2} # per (001) layer of the 5.23 Å cell, one period of the planar-averaged potential\n", @@ -182,7 +180,9 @@ "\n", "SCF_UNIT = \"pw_scf\"\n", "BANDS_UNIT = \"pw_bands\"\n", - "AVERAGE_UNIT = \"average ESP\"" + "AVERAGE_FLOWCHART_IDS = [ # the workflow's average ESP units: superlattice, SiO₂ bulk, HfO₂ bulk\n", + " \"average-electrostatic-potential\", \"average-electrostatic-potential-left\", \"average-electrostatic-potential-right\"\n", + "]" ] }, { @@ -347,14 +347,10 @@ " return normal_length * CATIONS_PER_LAYER[cation] / bulk.basis.elements.values.count(cation)\n", "\n", "\n", - "valence_electrons = {}\n", "for name, material in materials_by_name.items():\n", - " composition = Counter(material.basis.elements.values)\n", - " electron_count = sum(VALENCE_ELECTRONS_PER_ATOM[element] * count for element, count in composition.items())\n", " lattice = material.lattice\n", - " valence_electrons[name] = electron_count\n", - " print(f\"{name}: {dict(composition)}, {material.basis.number_of_atoms} atoms, \"\n", - " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å, {electron_count} valence electrons\")\n", + " print(f\"{name}: {dict(Counter(material.basis.elements.values))}, {material.basis.number_of_atoms} atoms, \"\n", + " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å\")\n", " if name in BLOCK_CATION:\n", " print(f\" (001) layer spacing: {get_layer_spacing(material, name):.4f} Å\")" ] @@ -575,12 +571,10 @@ "id": "34", "metadata": {}, "source": [ - "## 8. Configure the Valence Band Offset workflow\n", + "## 8. Configure the Valence Band Offset (Bulk Method) workflow\n", "\n", - "The workflow runs the band structure and electrostatic potential calculation on the two bulks, each with its own\n", - "k-grid, and stores the band structures. The superlattice needs only its electrostatic potential, so its band structure\n", - "calculation is replaced by the platform's Average Electrostatic Potential workflow. Section 10 computes the offset\n", - "from the band structures and the planar-averaged potentials, so the workflow's own lineup step is left out. One workflow is configured per\n", + "The workflow computes the electrostatic potential of the superlattice, the band structure and electrostatic potential\n", + "of the two bulks, each material on its own k-grid, and from these the offset. One workflow is configured per\n", "superlattice." ] }, @@ -606,26 +600,14 @@ " WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(VBO_WORKFLOW_SEARCH_TERM)\n", " )\n", " workflow.name = MY_WORKFLOW_NAME\n", - " superlattice_band_structure = workflow.subworkflows[0]\n", - " for subworkflow in list(workflow.subworkflows):\n", - " if subworkflow.application.name != APPLICATION_NAME or subworkflow.id == superlattice_band_structure.id:\n", - " workflow.remove_unit(workflow.get_unit_by_name(name=subworkflow.name).flowchartId)\n", - " workflow.remove_subworkflow_by_id(subworkflow.id)\n", - " potential_workflow = Workflow.create(\n", - " WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(POTENTIAL_WORKFLOW_SEARCH_TERM)\n", - " )\n", - " workflow.add_subworkflow(potential_workflow.subworkflows[0], head=True)\n", " for unit_name in [SCF_UNIT, BANDS_UNIT]:\n", " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", " for subworkflow in workflow.subworkflows:\n", + " if subworkflow.application.name != APPLICATION_NAME:\n", + " continue\n", " subworkflow.model = model\n", " material_index = int(next((unit.value for unit in subworkflow.units if unit.name.startswith(\"Set Material Index\")), 0))\n", " material_name = job_material_names[name][material_index]\n", - "\n", - " if bands_unit := subworkflow.get_unit_by_name(name=BANDS_UNIT):\n", - " bands_unit.results.append({\"name\": \"band_structure\"})\n", - " subworkflow.set_unit(bands_unit)\n", - "\n", " scf_unit = subworkflow.get_unit_by_name(name=SCF_UNIT)\n", " scf_unit.add_context(PointsGridDataProvider(material=job_materials[name][material_index],\n", " dimensions=kgrid[material_name], isEdited=True).get_context_item_data())\n", @@ -686,12 +668,12 @@ "metadata": {}, "source": [ "## 10. Retrieve the results\n", - "### 10.1. Valence band maxima and average potentials\n", + "### 10.1. Valence band offsets\n", "\n", - "E_VBM is the top of the highest valence band, band N_electrons / 2, along each bulk's k-path, and the gap is the\n", - "bottom of the next band minus E_VBM. V̄ is the planar average of the electrostatic potential, averaged over the whole\n", - "cell for a bulk, and over one (001) layer, one period of the potential, at the centre of each block for a\n", - "superlattice, the bulk-like region far from both interfaces." + "The workflow's last step computes ΔE_v with E_VBM from each bulk's band structure and V̄ of a bulk as the mean of its\n", + "planar-averaged electrostatic potential. In the superlattice, V̄ is read at the centre of each block, the bulk-like\n", + "region far from both interfaces, from the planar average smoothed by a double convolution with the two bulks' (001)\n", + "layer spacings, as in Prodhomme et al. The offset is stored with the job as its valence band offset property." ] }, { @@ -701,19 +683,40 @@ "metadata": {}, "outputs": [], "source": [ - "band_structures, profiles = {}, {}\n", - "for name, job_id in job_ids.items():\n", - " for subworkflow in client.jobs.get(job_id)[\"workflow\"][\"subworkflows\"]:\n", - " units = {unit[\"name\"]: unit for unit in subworkflow[\"units\"]}\n", - " material_name = job_material_names[name][int(next((unit[\"value\"] for unit in subworkflow[\"units\"]\n", - " if unit[\"name\"].startswith(\"Set Material Index\")), 0))]\n", - " profiles[name, material_name] = client.properties.get_for_job(\n", - " job_id, property_name=\"average_potential_profile\", unit_id=units[AVERAGE_UNIT][\"flowchartId\"])[0]\n", - " if BANDS_UNIT in units:\n", - " band_structures[name, material_name] = np.array(client.properties.get_for_job(\n", - " job_id, property_name=\"band_structure\", unit_id=units[BANDS_UNIT][\"flowchartId\"])[0][\"yDataSeries\"])\n", - "\n", - "block_windows, superlattice_potential, bulk_potential, valence_band_maximum, bulk_gap = {}, {}, {}, {}, {}\n", + "valence_band_offset = {\n", + " name: client.properties.get_for_job(job_id, property_name=\"valence_band_offset\")[0][\"value\"]\n", + " for name, job_id in job_ids.items()\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "40", + "metadata": {}, + "source": [ + "### 10.2. Potential across the superlattices\n", + "\n", + "One period from the HfO₂→SiO₂ interface, SiO₂ on the left. Each bulk's own potential (dotted) is overlaid on its\n", + "block, shifted to the block's average over one (001) layer, one period of the potential, at the block's centre;\n", + "where they coincide the block is bulk-like, and the two averages (dashed horizontal lines) are shifted with respect\n", + "to each other by the lineup." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41", + "metadata": {}, + "outputs": [], + "source": [ + "profiles = {\n", + " (name, material_name): client.properties.get_for_job(job_id, property_name=\"average_potential_profile\",\n", + " unit_id=flowchart_id)[0]\n", + " for name, job_id in job_ids.items()\n", + " for material_name, flowchart_id in zip(job_material_names[name], AVERAGE_FLOWCHART_IDS)\n", + "}\n", + "\n", + "block_windows, superlattice_potential, bulk_potential = {}, {}, {}\n", "for name, (_, *bulk_names) in job_material_names.items():\n", " superlattice = relaxed_superlattices[name]\n", " superlattice_in_cartesian = superlattice.clone()\n", @@ -723,10 +726,8 @@ " period = superlattice.lattice.c\n", " positions = np.array(profiles[name, name][\"xDataArray\"])\n", " planar_average = np.array(profiles[name, name][\"yDataSeries\"][0])\n", - " print(f\"{name}:\")\n", " for bulk_name in bulk_names:\n", " key = (name, bulk_name)\n", - " number_of_valence_bands = valence_electrons[bulk_name] // 2\n", " cation_heights = heights[elements == BLOCK_CATION[bulk_name]]\n", " # centre of the block's layers, also when the block wraps around the cell boundary\n", " center = np.angle(np.exp(2j * np.pi * cation_heights / period).mean()) * period / (2 * np.pi) % period\n", @@ -734,61 +735,14 @@ " block_windows[key] = (center, spacing)\n", " distances = (positions - center + period / 2) % period - period / 2\n", " superlattice_potential[key] = planar_average[np.abs(distances) <= spacing / 2].mean()\n", - " bulk_potential[key] = np.mean(profiles[key][\"yDataSeries\"][0])\n", - " valence_band_maximum[key] = band_structures[key][number_of_valence_bands - 1].max()\n", - " bulk_gap[key] = band_structures[key][number_of_valence_bands].min() - valence_band_maximum[key]\n", - " print(f\" {bulk_name}: E_VBM = {valence_band_maximum[key]:.4f} eV, V̄ = {bulk_potential[key]:.4f} eV, \"\n", - " f\"E_VBM - V̄ = {valence_band_maximum[key] - bulk_potential[key]:.4f} eV, gap {bulk_gap[key]:+.3f} eV\")\n", - " print(f\" in the superlattice: V̄ = {superlattice_potential[key]:.4f} eV, averaged over \"\n", - " f\"{spacing:.4f} Å centred at z = {center:.4f} Å\")" - ] - }, - { - "cell_type": "markdown", - "id": "40", - "metadata": {}, - "source": [ - "### 10.2. Valence band offsets" + " bulk_potential[key] = np.mean(profiles[key][\"yDataSeries\"][0])" ] }, { "cell_type": "code", "execution_count": null, - "id": "41", - "metadata": {}, - "outputs": [], - "source": [ - "potential_lineup, valence_band_offset = {}, {}\n", - "for name, (_, substrate_bulk_name, film_bulk_name) in job_material_names.items():\n", - " substrate, film = (name, substrate_bulk_name), (name, film_bulk_name)\n", - " bulk_term = ((valence_band_maximum[substrate] - bulk_potential[substrate])\n", - " - (valence_band_maximum[film] - bulk_potential[film]))\n", - " potential_lineup[name] = superlattice_potential[substrate] - superlattice_potential[film]\n", - " valence_band_offset[name] = bulk_term + potential_lineup[name]\n", - " film_label = BLOCK_LABEL[film_bulk_name]\n", - " print(f\"{name}:\")\n", - " print(f\" (E_VBM - V̄)_SiO₂ - (E_VBM - V̄)_{film_label} = {bulk_term:+.4f} eV\")\n", - " print(f\" (V̄_SiO₂ - V̄_{film_label})_superlattice = {potential_lineup[name]:+.4f} eV\")\n", - " print(f\" ΔE_v = E_VBM(SiO₂) - E_VBM({film_label}) = {valence_band_offset[name]:+.4f} eV\")" - ] - }, - { - "cell_type": "markdown", "id": "42", "metadata": {}, - "source": [ - "### 10.3. Potential across the superlattices\n", - "\n", - "One period from the HfO₂→SiO₂ interface, SiO₂ on the left. Each bulk's own potential (dotted) is overlaid on its\n", - "block, shifted to the block's average; where they coincide the block is bulk-like, and the two averages (dashed\n", - "horizontal lines) are shifted with respect to each other by the lineup." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "43", - "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -839,7 +793,8 @@ " axis.set_xlim(0, period)\n", " axis.set_xlabel(\"position along (001) (Å)\")\n", " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", - " axis.set_title(f\"{name}: ΔV̄ = {potential_lineup[name]:.3f} eV, ΔE_v = {valence_band_offset[name]:.3f} eV\")\n", + " potential_lineup = superlattice_potential[name, substrate_bulk_name] - superlattice_potential[name, film_bulk_name]\n", + " axis.set_title(f\"{name}: ΔV̄ = {potential_lineup:.3f} eV, ΔE_v = {valence_band_offset[name]:.3f} eV\")\n", " axis.legend(loc=\"lower right\", bbox_to_anchor=(1, 0.07), fontsize=8)\n", "figure.tight_layout()\n", "display_matplotlib_figure(figure)" @@ -847,7 +802,7 @@ }, { "cell_type": "markdown", - "id": "44", + "id": "43", "metadata": {}, "source": [ "## 11. Compare with the manuscripts\n", @@ -863,7 +818,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -879,7 +834,7 @@ }, { "cell_type": "markdown", - "id": "46", + "id": "45", "metadata": {}, "source": [ "## References\n", From 7b355d96f81c5eeee50dd74838a17a8a0d91e769 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 16:21:08 -0800 Subject: [PATCH 04/11] SOF-8097: WIP stack notebooks and SiO2/HfO2 simulation updates Co-Authored-By: Claude Opus 5.5 --- .../specific_examples/Introduction.ipynb | 7 +- ...ide_hafnium_dioxide_titanium_nitride.ipynb | 509 +++++++++++++++++- ...d_3d_silicon_dioxide_hafnium_dioxide.ipynb | 187 +++---- ...n_dioxide_hafnium_dioxide_SIMULATION.ipynb | 210 +++----- 4 files changed, 668 insertions(+), 245 deletions(-) diff --git a/other/materials_designer/specific_examples/Introduction.ipynb b/other/materials_designer/specific_examples/Introduction.ipynb index 7082fa0a7..810b12f17 100644 --- a/other/materials_designer/specific_examples/Introduction.ipynb +++ b/other/materials_designer/specific_examples/Introduction.ipynb @@ -29,6 +29,7 @@ "| `C-2D-INT-Z` | Interface ZSL | [Graphene/SiO₂ 2D–3D Interface](interface_2d_3d_graphene_silicon_dioxide.ipynb) | *To be added* | [[5]](#ref5) |\n", "| `C-2D-INT-Z` | Interface ZSL | [Cu/Cristobalite 3D–3D Interface](interface_3d_3d_copper_cristobalite.ipynb) | *To be added* | [[6]](#ref6) |\n", "| `C-2D-INT-Z` | Interface ZSL | [Graphene/Ni Interface Film XY Position Optimization](optimization_interface_film_xy_position_graphene_nickel.ipynb) | [Gr/Ni(111) Registry and Work of Adhesion](optimization_interface_film_xy_position_graphene_nickel_SIMULATION.ipynb) | [[7]](#ref7) |\n", + "| `C-2D-INT-Z` | Interface ZSL | [SiO₂/HfO₂ (001) Interfaces](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb) | [SiO₂/HfO₂ (001) Valence Band Offset](interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb) | [[26]](#ref26), [[27]](#ref27) |\n", "| `C-2D-INT-T` | Interface Twisted | *To be added* | — | — |\n", "| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate MoS₂ Bilayer](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb) | [Twisted MoS₂ Bilayer Band Structure](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide_SIMULATION.ipynb) | [[8]](#ref8) |\n", "| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate h-BN Bilayer](interface_bilayer_twisted_commensurate_lattices_boron_nitride.ipynb) | [Twisted h-BN Bilayer Flat Bands](interface_bilayer_twisted_commensurate_lattices_boron_nitride_SIMULATION.ipynb) | [[9]](#ref9) |\n", @@ -103,7 +104,11 @@ "\n", "[24] Hinuma, Y., Grüneis, A., Kresse, G., & Oba, F. (2014). Band alignment of semiconductors from density-functional theory and many-body perturbation theory. *Physical Review B*, 90(15), 155405. https://doi.org/10.1103/PhysRevB.90.155405\n", "\n", - "[25] Chen, Y., Fang, F., & Zhang, N. (2024). Advance in additive manufacturing of 2D materials at the atomic and close-to-atomic scale. *npj 2D Materials and Applications*, 8(1), 17. https://doi.org/10.1038/s41699-024-00456-x\n" + "[25] Chen, Y., Fang, F., & Zhang, N. (2024). Advance in additive manufacturing of 2D materials at the atomic and close-to-atomic scale. *npj 2D Materials and Applications*, 8(1), 17. https://doi.org/10.1038/s41699-024-00456-x\n", + "\n", + "[26] Prodhomme, P.-Y., Fontaine-Vive, F., Van Der Geest, A., Blaise, P., & Even, J. (2011). Ab initio calculation of effective work functions for a TiN/HfO₂/SiO₂/Si transistor stack. *Applied Physics Letters*, 99(2), 022101. https://doi.org/10.1063/1.3609869\n", + "\n", + "[27] Robertson, J., & Wallace, R. M. (2015). High-K materials and metal gates for CMOS applications. *Materials Science and Engineering: R: Reports*, 88, 1-41. https://doi.org/10.1016/j.mser.2014.11.001" ] }, { diff --git a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb index 7b566d711..bb3768f69 100644 --- a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb @@ -90,6 +90,88 @@ "cell_type": "markdown", "id": "3", "metadata": {}, + "source": [ + "Parameters of the interface superlattices and their bulk reference cells, built in sections 5–10." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "SILICON_NAME = \"mp-149\" # Si, diamond, Standata\n", + "SILICON_DIOXIDE_NAME = \"mp-8352\" # SiO2, beta-cristobalite (C9), Standata\n", + "MONOCLINIC_HAFNIUM_DIOXIDE_NAME = \"mp-352\" # HfO2, monoclinic, Standata\n", + "CUBIC_HAFNIUM_DIOXIDE_NAME = \"mp-550893\" # HfO2, cubic, Standata\n", + "TITANIUM_NITRIDE_NAME = \"mp-492\" # TiN, rock salt, Standata\n", + "\n", + "SILICON_DIOXIDE_MILLER_INDICES = (1, 1, 0) # in the primitive cell: the (001) face, 5.23 Å square\n", + "SILICON_MILLER_INDICES = (0, 0, 1)\n", + "HAFNIUM_DIOXIDE_MILLER_INDICES = (0, 0, 1)\n", + "TITANIUM_NITRIDE_MILLER_INDICES = (1, 1, 1) # in the primitive cell: the cubic (111) face\n", + "TITANIUM_NITRIDE_EXPANSION_ALONG_111 = 0.01 # Prodhomme et al.\n", + "\n", + "# in Angstrom, between the facing atomic planes at the interfaces: about the spacing of an anion plane and the next\n", + "# cation plane in the materials (0.92 Å in beta-cristobalite, 1.24 Å in TiN (111), 1.26 Å in cubic HfO2)\n", + "INTERFACE_DISTANCE = 1.0\n", + "SUPERLATTICE_VACUUM = 0.0 # in Angstrom: periodic along the stacking axis\n", + "MAX_LENGTH_TOLERANCE = 0.05 # admits the 4.3 % mismatch of Si and the 4 % of cubic HfO2\n", + "\n", + "# Si/SiO2, oxygen-rich: the SiO2 block ends in an O2 plane at both interfaces\n", + "SILICON_DIOXIDE_NUMBER_OF_LAYERS = 7 # two SiO2 layers each\n", + "SILICON_DIOXIDE_TERMINATION_FORMULA = None # O2 on top\n", + "SILICON_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 3 # Si, O2, Si: twelve SiO2 layers stay\n", + "# Si/SiO2, oxygen-poor: the SiO2 block ends in a Si plane at both interfaces\n", + "# SILICON_DIOXIDE_NUMBER_OF_LAYERS = 6\n", + "# SILICON_DIOXIDE_TERMINATION_FORMULA = \"SiO\" # Si on top\n", + "# SILICON_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # O2\n", + "SILICON_NUMBER_OF_LAYERS = 5 # four Si layers each: 20\n", + "SILICON_ATOMIC_LAYERS_REMOVED_FROM_TOP = 2 # 18 Si layers stay\n", + "\n", + "MONOCLINIC_SILICON_DIOXIDE_NUMBER_OF_LAYERS = 5 # two SiO2 layers each: 10\n", + "MONOCLINIC_HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8, of which one is removed\n", + "MONOCLINIC_HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", + "MONOCLINIC_HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP = 2 # with the lowest O, one HfO2 layer\n", + "\n", + "CUBIC_SILICON_DIOXIDE_NUMBER_OF_LAYERS = 6 # two SiO2 layers each: 12\n", + "CUBIC_HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS = 3 # two HfO2 layers each: 6\n", + "CUBIC_HAFNIUM_DIOXIDE_XY_SHIFT = (0, 0.25) # fractions of the in-plane cell: SiO2 interface O on HfO2 O sites\n", + "SILICON_OXYGEN_BOND_CUTOFF = 2.0 # in Angstrom, between the Si–O bonds (1.6–1.7 Å) and the next Si–O distance (3.1 Å)\n", + "\n", + "HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8\n", + "TITANIUM_NITRIDE_NUMBER_OF_LAYERS = 6 # one Ti and one N plane each\n", + "TITANIUM_NITRIDE_MATCH_ID = 4 # three HfO2 cells along [100], one along [010]\n", + "TITANIUM_NITRIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP = 1 # N: Ti at both ends\n", + "HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # O\n", + "HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP = 1 # O: an Hf2O2 group at both ends\n", + "INTERFACIAL_ELEMENT_BY_ELEMENT = {\"Hf\": \"Ti\", \"O\": \"N\"}\n", + "INTERFACIAL_ATOMIC_LAYERS = 2 # nitridized: at each end, the Hf2O2 group and the O2 plane next to it\n", + "# INTERFACIAL_ATOMIC_LAYERS = 1 # oxidized: the O2 plane facing HfO2 stays O\n", + "\n", + "SILICON_DIOXIDE_BULK_NUMBER_OF_LAYERS = 2 # one beta-cristobalite period along [001]\n", + "HAFNIUM_DIOXIDE_BULK_SUPERCELL_MATRIX = [[0, 1, 0], [3, 0, 0], [0, 0, -1]] # b and 3a in plane, as in HfO2/TiN\n", + "TITANIUM_NITRIDE_BULK_NUMBER_OF_LAYERS = 3 # one period of (111) planes\n", + "\n", + "SILICON_SUPERLATTICE_NAME = \"Si/SiO2 (001) superlattice 18+12 O-rich\"\n", + "# SILICON_SUPERLATTICE_NAME = \"Si/SiO2 (001) superlattice 18+12 O-poor\"\n", + "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", + "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", + "TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 nitridized\"\n", + "# TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 oxidized\"\n", + "SILICON_BULK_NAME = \"Si (001) bulk strained\"\n", + "SILICON_DIOXIDE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", + "MONOCLINIC_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", + "CUBIC_BULK_NAME = \"HfO2 cubic (001) bulk strained\"\n", + "HAFNIUM_DIOXIDE_BULK_NAME = \"HfO2 monoclinic (001) bulk 3x1\"\n", + "TITANIUM_NITRIDE_BULK_NAME = \"TiN (111) bulk strained\"" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, "source": [ "### 1.2. Install Packages\n", "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install` (see [README](../../README.ipynb))." @@ -98,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "7", "metadata": {}, "source": [ "### 1.3. Get input material\n", @@ -119,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "7", + "id": "9", "metadata": {}, "source": [ "## 2. Create the heterostructure\n", @@ -143,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "11", "metadata": {}, "source": [ "### 2.1. Create the heterostructure\n", @@ -169,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "11", + "id": "13", "metadata": {}, "source": [ "## 3. Visualize the material\n" @@ -198,7 +280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "13", + "id": "15", "metadata": {}, "source": [ "## 4. Save the material" @@ -223,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -234,6 +316,411 @@ "set_materials(flipped_heterostructure)\n", "download_content_to_file(flipped_heterostructure.to_json(), \"heterostructure_high_k_metal_gate.json\")" ] + }, + { + "cell_type": "markdown", + "id": "17", + "metadata": {}, + "source": [ + "## 5. Interfaces of the Stack as Superlattices\n", + "\n", + "Prodhomme et al. [1] compute the band alignment of the stack pairwise, at the Si/SiO₂, SiO₂/HfO₂ and HfO₂/TiN\n", + "interfaces, each in a cell periodic along the interface normal without vacuum, so that each cell holds two interfaces.\n", + "Robertson and Wallace [2] give the SiO₂/HfO₂ offset of another model, with cubic HfO₂ after Sharia et al. [3]; it is\n", + "built here as well. The offsets are read against bulk cells with the in-plane lattice of their superlattice, so these\n", + "are built too.\n", + "\n", + "SiO₂ is β-cristobalite, cut along its (001) face, the 5.23 × 5.23 Ų square cell; Si and HfO₂ are strained onto it.\n", + "At the HfO₂/TiN interface, TiN is strained onto HfO₂. The strains follow from the Standata lattices. The publications\n", + "do not give the separation of the blocks: the builder sets the same distance between facing atomic planes at the\n", + "interfaces, and the atomic positions are relaxed in the calculation notebook. The slabs are built longer than the\n", + "blocks and trimmed by atomic layers, because the interface builder re-creates its slabs from the bulk.\n", + "\n", + "### 5.1. Load the materials\n", + "\n", + "TiN is taken in its primitive cell, where the Miller indices (1, 1, 1) select the cubic (111) face with one atom per\n", + "plane, and expanded along [111] as in Prodhomme et al." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "18", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema\n", + "from mat3ra.made.material import Material\n", + "from mat3ra.made.tools.helpers import get_material_with_conventional_lattice, get_material_with_primitive_lattice\n", + "from mat3ra.made.tools.operations.core.unary import strain\n", + "\n", + "silicon = get_material_with_conventional_lattice(Material.create(Materials.get_by_name_first_match(SILICON_NAME)))\n", + "silicon_dioxide = Material.create(Materials.get_by_name_first_match(SILICON_DIOXIDE_NAME))\n", + "monoclinic_hafnium_dioxide = Material.create(Materials.get_by_name_first_match(MONOCLINIC_HAFNIUM_DIOXIDE_NAME))\n", + "cubic_hafnium_dioxide = Material.create(Materials.get_by_name_first_match(CUBIC_HAFNIUM_DIOXIDE_NAME))\n", + "titanium_nitride = get_material_with_primitive_lattice(\n", + " Material.create(Materials.get_by_name_first_match(TITANIUM_NITRIDE_NAME)))\n", + "\n", + "axis_111 = np.sum(titanium_nitride.lattice.vector_arrays, axis=0) # [111]: the sum of the primitive vectors\n", + "titanium_nitride = strain(titanium_nitride, Matrix3x3Schema(root=(\n", + " np.eye(3) + TITANIUM_NITRIDE_EXPANSION_ALONG_111 * np.outer(axis_111, axis_111) / np.dot(axis_111, axis_111)\n", + ").tolist()))" + ] + }, + { + "cell_type": "markdown", + "id": "19", + "metadata": {}, + "source": [ + "## 6. Create the Si/SiO₂ Superlattice\n", + "\n", + "Si (001) on SiO₂, compressed in plane onto the SiO₂ face: Prodhomme et al. compress Si by 3 % on their lattices, the\n", + "Standata lattices give 4.3 %. Twelve SiO₂ layers (22.2 Å, as in the publication) and eighteen Si layers (24.6 Å; the\n", + "publication gives 24.3 Å). The publication computes an oxygen-rich and an oxygen-poor interface without describing\n", + "their bonding. Here the oxygen-rich SiO₂ block ends in an O₂ plane at both interfaces, so that Si–O–Si bridges join the\n", + "blocks; the oxygen-poor block ends in a Si plane, with Si–Si bonds across the interfaces (commented out in the\n", + "parameters). The lowest atom is moved to the bottom of the cell, and the cell is shortened to the interface distance\n", + "across its boundary." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "20", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs, create_slab, get_atom_indices_by_layer\n", + "from mat3ra.made.tools.modify import filter_by_ids, translate_to_z_level\n", + "from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction\n", + "\n", + "silicon_dioxide_slab = create_slab(silicon_dioxide, SILICON_DIOXIDE_MILLER_INDICES, use_conventional_cell=False,\n", + " termination_top_formula=SILICON_DIOXIDE_TERMINATION_FORMULA,\n", + " number_of_layers=SILICON_DIOXIDE_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM)\n", + "silicon_slab = create_slab(silicon, SILICON_MILLER_INDICES, number_of_layers=SILICON_NUMBER_OF_LAYERS,\n", + " vacuum=SUPERLATTICE_VACUUM)\n", + "silicon_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=silicon_dioxide_slab, film_slab=silicon_slab, gap=INTERFACE_DISTANCE, vacuum=SUPERLATTICE_VACUUM,\n", + " max_length_tol=MAX_LENGTH_TOLERANCE)\n", + "\n", + "labels = silicon_superlattice.basis.labels.values\n", + "layers = get_atom_indices_by_layer(silicon_superlattice)\n", + "silicon_dioxide_layers = [layer for layer in layers if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value]\n", + "silicon_layers = [layer for layer in layers if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", + "removed_layers = (silicon_dioxide_layers[:SILICON_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM]\n", + " + silicon_layers[-SILICON_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", + "silicon_superlattice = filter_by_ids(silicon_superlattice, [index for layer in removed_layers for index in layer],\n", + " invert=True, reset_ids=True)\n", + "silicon_superlattice = translate_to_z_level(silicon_superlattice, \"bottom\")\n", + "silicon_superlattice = adjust_material_cell_to_set_gap_along_direction(silicon_superlattice, INTERFACE_DISTANCE)" + ] + }, + { + "cell_type": "markdown", + "id": "21", + "metadata": {}, + "source": [ + "## 7. Create the SiO₂/HfO₂ Superlattice with Monoclinic HfO₂\n", + "\n", + "Ten SiO₂ layers (one Si each) and seven monoclinic HfO₂ layers (two Hf each), Hf₁₄Si₁₀O₄₈, as Prodhomme et al. The\n", + "publication stretches HfO₂ by 3.7 % along [100] and 2.1 % along [010] on its lattices; here the strain follows from the\n", + "Standata lattices. The slab builder counts monoclinic (001) layers in pairs, so eight HfO₂ layers are built and one is\n", + "removed. The HfO₂ block as built ends in two O on each side; the block kept is one O higher, so it ends in one O against\n", + "the SiO₂ O plane and in three O against the SiO₂ Si. Each interface then carries three O, and the cell stays\n", + "stoichiometric. The kept block stays where the builder placed it, and the cell is shortened to the interface distance\n", + "across its boundary. The in-plane registry of the two blocks is not given in the publication; the builder's default is\n", + "kept." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22", + "metadata": {}, + "outputs": [], + "source": [ + "monoclinic_silicon_dioxide_slab = create_slab(silicon_dioxide, SILICON_DIOXIDE_MILLER_INDICES,\n", + " use_conventional_cell=False,\n", + " number_of_layers=MONOCLINIC_SILICON_DIOXIDE_NUMBER_OF_LAYERS,\n", + " vacuum=SUPERLATTICE_VACUUM)\n", + "monoclinic_hafnium_dioxide_slab = create_slab(monoclinic_hafnium_dioxide, HAFNIUM_DIOXIDE_MILLER_INDICES,\n", + " number_of_layers=MONOCLINIC_HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS,\n", + " vacuum=SUPERLATTICE_VACUUM)\n", + "monoclinic_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=monoclinic_silicon_dioxide_slab, film_slab=monoclinic_hafnium_dioxide_slab, gap=INTERFACE_DISTANCE,\n", + " vacuum=SUPERLATTICE_VACUUM, max_length_tol=MAX_LENGTH_TOLERANCE)\n", + "\n", + "labels = monoclinic_superlattice.basis.labels.values\n", + "hafnium_dioxide_layers = [layer for layer in get_atom_indices_by_layer(monoclinic_superlattice)\n", + " if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", + "removed_layers = (hafnium_dioxide_layers[:MONOCLINIC_HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM]\n", + " + hafnium_dioxide_layers[-MONOCLINIC_HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", + "monoclinic_superlattice = filter_by_ids(monoclinic_superlattice, [index for layer in removed_layers for index in layer],\n", + " invert=True, reset_ids=True)\n", + "monoclinic_superlattice = adjust_material_cell_to_set_gap_along_direction(monoclinic_superlattice, INTERFACE_DISTANCE)" + ] + }, + { + "cell_type": "markdown", + "id": "23", + "metadata": {}, + "source": [ + "## 8. Create the SiO₂/HfO₂ Superlattice with Cubic HfO₂\n", + "### 8.1. Stack the slabs\n", + "\n", + "Twelve SiO₂ and six cubic HfO₂ layers, Hf₁₂Si₁₂O₄₈, the model of Robertson and Wallace after Sharia et al. The HfO₂\n", + "film is shifted in plane by a quarter of the cell, so that the O of SiO₂ at the interface sit on O sites of HfO₂. As\n", + "built, one interface plane is an HfO₂ O plane with four O, two of them bonded to the Si above, and the other is the\n", + "SiO₂ O plane with two O." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "24", + "metadata": {}, + "outputs": [], + "source": [ + "cubic_silicon_dioxide_slab = create_slab(silicon_dioxide, SILICON_DIOXIDE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=CUBIC_SILICON_DIOXIDE_NUMBER_OF_LAYERS,\n", + " vacuum=SUPERLATTICE_VACUUM)\n", + "cubic_hafnium_dioxide_slab = create_slab(cubic_hafnium_dioxide, HAFNIUM_DIOXIDE_MILLER_INDICES,\n", + " number_of_layers=CUBIC_HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS,\n", + " vacuum=SUPERLATTICE_VACUUM)\n", + "cubic_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=cubic_silicon_dioxide_slab, film_slab=cubic_hafnium_dioxide_slab, gap=INTERFACE_DISTANCE,\n", + " vacuum=SUPERLATTICE_VACUUM, max_length_tol=MAX_LENGTH_TOLERANCE,\n", + " xy_shift=[CUBIC_HAFNIUM_DIOXIDE_XY_SHIFT[0] * cubic_silicon_dioxide_slab.lattice.a,\n", + " CUBIC_HAFNIUM_DIOXIDE_XY_SHIFT[1] * cubic_silicon_dioxide_slab.lattice.b])" + ] + }, + { + "cell_type": "markdown", + "id": "25", + "metadata": {}, + "source": [ + "### 8.2. Move one O to the other interface\n", + "\n", + "The four-O plane is the top atomic layer of the cell, below the SiO₂ Si across the cell boundary; the two-O plane is\n", + "the top layer of SiO₂. The first O of the four-O plane that is not bonded to that Si is removed, and an O is added at\n", + "the same in-plane position in the two-O plane. Each interface plane then carries three O, two bonded to Si and Hf and\n", + "one to Hf only: the structure of Sharia et al., who remove a different O from each of two four-O interface planes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "26", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.analyze.other import get_atom_indices_within_radius_pbc\n", + "from mat3ra.made.tools.helpers import PointDefectDict, create_multiple_defects\n", + "\n", + "layers = get_atom_indices_by_layer(cubic_superlattice)\n", + "labels = cubic_superlattice.basis.labels.values\n", + "silicon_layer, four_oxygen_plane = layers[0], layers[-1]\n", + "two_oxygen_plane = [layer for layer in layers if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value][-1]\n", + "silicon_neighbor_ids = get_atom_indices_within_radius_pbc(cubic_superlattice, atom_index=silicon_layer[0],\n", + " radius=SILICON_OXYGEN_BOND_CUTOFF)\n", + "coordinates = cubic_superlattice.basis.coordinates.values\n", + "removed_coordinate = coordinates[[index for index in four_oxygen_plane if index not in silicon_neighbor_ids][0]]\n", + "added_coordinate = [*removed_coordinate[:2], coordinates[two_oxygen_plane[0]][2]]\n", + "\n", + "cubic_superlattice = create_multiple_defects(cubic_superlattice, [\n", + " PointDefectDict(type=\"vacancy\", coordinate=removed_coordinate, placement_method=\"closest_site\"),\n", + " PointDefectDict(type=\"interstitial\", coordinate=added_coordinate, element=\"O\", placement_method=\"exact_coordinate\"),\n", + "])" + ] + }, + { + "cell_type": "markdown", + "id": "27", + "metadata": {}, + "source": [ + "## 9. Create the HfO₂/TiN Superlattice\n", + "\n", + "Monoclinic HfO₂ (001), three cells along [100] and one along [010], with TiN (111) on it, as Prodhomme et al. TiN is\n", + "strained in plane onto HfO₂: the publication stretches it by 1.8 % along [1-10] and compresses it by 0.5 % along\n", + "[11-2] on its lattices; the Standata lattices give 2.9 % along [1-10] and 0.0 % along [11-2]. The slab builder counts\n", + "monoclinic (001) layers in pairs: eight are built, and the O at both ends are removed, which leaves an Hf₂O₂ group at\n", + "each end. The publication shows one interface; both interfaces of the cell are built as it. At each end the outermost\n", + "HfO₂ layer becomes the interfacial layer of the publication, with Ti on the Hf sites and N on the O sites (nitridized);\n", + "in the oxidized interface, commented out in the parameters, the six O facing HfO₂ stay. Six HfO₂ layers remain between\n", + "them. TiN has six Ti planes and the five N planes between them, so that Ti faces the interfacial layer on both sides.\n", + "The second interface, across the cell boundary, gets the same distance as the first, and the cell starts at the HfO₂\n", + "block." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "28", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.analyze.interface_material import get_interface_configuration\n", + "from mat3ra.made.tools.modify import translate_by_vector, wrap_to_unit_cell\n", + "\n", + "hafnium_dioxide_slab = create_slab(monoclinic_hafnium_dioxide, HAFNIUM_DIOXIDE_MILLER_INDICES,\n", + " number_of_layers=HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM)\n", + "titanium_nitride_slab = create_slab(titanium_nitride, TITANIUM_NITRIDE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=TITANIUM_NITRIDE_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM)\n", + "titanium_nitride_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=hafnium_dioxide_slab, film_slab=titanium_nitride_slab, gap=INTERFACE_DISTANCE,\n", + " vacuum=SUPERLATTICE_VACUUM, match_id=TITANIUM_NITRIDE_MATCH_ID)\n", + "titanium_nitride_supercell_matrix = get_interface_configuration(\n", + " titanium_nitride_superlattice).film_configuration.xy_supercell_matrix.model_dump()\n", + "\n", + "labels = titanium_nitride_superlattice.basis.labels.values\n", + "titanium_nitride_layers = [layer for layer in get_atom_indices_by_layer(titanium_nitride_superlattice)\n", + " if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", + "titanium_nitride_superlattice = filter_by_ids(\n", + " titanium_nitride_superlattice,\n", + " [index for layer in titanium_nitride_layers[-TITANIUM_NITRIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP:] for index in layer],\n", + " invert=True, reset_ids=True)\n", + "titanium_nitride_superlattice = adjust_material_cell_to_set_gap_along_direction(titanium_nitride_superlattice,\n", + " INTERFACE_DISTANCE)\n", + "\n", + "labels = titanium_nitride_superlattice.basis.labels.values\n", + "hafnium_dioxide_layers = [layer for layer in get_atom_indices_by_layer(titanium_nitride_superlattice)\n", + " if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value]\n", + "removed_layers = (hafnium_dioxide_layers[:HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM]\n", + " + hafnium_dioxide_layers[-HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", + "titanium_nitride_superlattice = filter_by_ids(titanium_nitride_superlattice,\n", + " [index for layer in removed_layers for index in layer],\n", + " invert=True, reset_ids=True)\n", + "\n", + "labels = titanium_nitride_superlattice.basis.labels.values\n", + "hafnium_dioxide_layers = [layer for layer in get_atom_indices_by_layer(titanium_nitride_superlattice)\n", + " if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value]\n", + "interfacial_layers = (hafnium_dioxide_layers[:INTERFACIAL_ATOMIC_LAYERS]\n", + " + hafnium_dioxide_layers[-INTERFACIAL_ATOMIC_LAYERS:])\n", + "elements = titanium_nitride_superlattice.basis.elements.values\n", + "coordinates = titanium_nitride_superlattice.basis.coordinates.values\n", + "titanium_nitride_superlattice = create_multiple_defects(titanium_nitride_superlattice, [\n", + " PointDefectDict(type=\"substitution\", element=INTERFACIAL_ELEMENT_BY_ELEMENT[elements[index]],\n", + " coordinate=coordinates[index])\n", + " for layer in interfacial_layers for index in layer\n", + "])\n", + "titanium_nitride_superlattice = wrap_to_unit_cell(translate_by_vector(\n", + " titanium_nitride_superlattice,\n", + " [0, 0, -min(coordinates[index][2] for index in hafnium_dioxide_layers[INTERFACIAL_ATOMIC_LAYERS])]))" + ] + }, + { + "cell_type": "markdown", + "id": "29", + "metadata": {}, + "source": [ + "## 10. Create the Bulk Reference Cells\n", + "\n", + "SiO₂ is used as is, one β-cristobalite period along [001]; it is the bulk reference of both SiO₂ interfaces. Si and\n", + "the two HfO₂ of the SiO₂/HfO₂ superlattices are strained in plane to the 5.23 Å cell: a and b take the superlattice's\n", + "lengths, c and the cell angles are kept. For HfO₂/TiN, HfO₂ is three bulk cells with a and b in the order of the\n", + "superlattice's, and TiN is one period of its (111) planes in the TiN cell of the superlattice, strained in plane as\n", + "the TiN block. Atom labels are removed from all materials." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "30", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.helpers import create_supercell\n", + "from mat3ra.made.tools.operations.reusable.unary import strain_to_match_lattice\n", + "\n", + "silicon_dioxide_bulk = create_slab(silicon_dioxide, SILICON_DIOXIDE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=SILICON_DIOXIDE_BULK_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM)\n", + "in_plane_lattice = {\"a\": silicon_dioxide_bulk.lattice.a, \"b\": silicon_dioxide_bulk.lattice.b}\n", + "silicon_bulk, monoclinic_bulk, cubic_bulk = [\n", + " strain_to_match_lattice(material, Material.create(\n", + " {**material.to_dict(), \"lattice\": {**material.lattice.to_dict(), **in_plane_lattice}}))\n", + " for material in (silicon, monoclinic_hafnium_dioxide, cubic_hafnium_dioxide)\n", + "]\n", + "hafnium_dioxide_bulk = create_supercell(monoclinic_hafnium_dioxide, HAFNIUM_DIOXIDE_BULK_SUPERCELL_MATRIX)\n", + "titanium_nitride_cell = create_slab(titanium_nitride, TITANIUM_NITRIDE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=TITANIUM_NITRIDE_BULK_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM,\n", + " xy_supercell_matrix=titanium_nitride_supercell_matrix)\n", + "titanium_nitride_in_plane_lattice = {\"a\": titanium_nitride_superlattice.lattice.a,\n", + " \"b\": titanium_nitride_superlattice.lattice.b}\n", + "titanium_nitride_bulk = strain_to_match_lattice(titanium_nitride_cell, Material.create(\n", + " {**titanium_nitride_cell.to_dict(),\n", + " \"lattice\": {**titanium_nitride_cell.lattice.to_dict(), **titanium_nitride_in_plane_lattice}}))\n", + "\n", + "materials = [silicon_superlattice, monoclinic_superlattice, cubic_superlattice, titanium_nitride_superlattice,\n", + " silicon_bulk, silicon_dioxide_bulk, monoclinic_bulk, cubic_bulk, hafnium_dioxide_bulk,\n", + " titanium_nitride_bulk]\n", + "names = [SILICON_SUPERLATTICE_NAME, MONOCLINIC_SUPERLATTICE_NAME, CUBIC_SUPERLATTICE_NAME,\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME, SILICON_BULK_NAME, SILICON_DIOXIDE_BULK_NAME, MONOCLINIC_BULK_NAME,\n", + " CUBIC_BULK_NAME, HAFNIUM_DIOXIDE_BULK_NAME, TITANIUM_NITRIDE_BULK_NAME]\n", + "for material, name in zip(materials, names):\n", + " material.name = name\n", + " material.set_labels_from_list([])" + ] + }, + { + "cell_type": "markdown", + "id": "31", + "metadata": {}, + "source": [ + "## 11. Visualize the Superlattices and Bulk Cells\n", + "\n", + "In each superlattice the lower block of its name is at the bottom of the cell, except Si/SiO₂, where SiO₂ is at the\n", + "bottom; the second interface is across the periodic boundary." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "32", + "metadata": {}, + "outputs": [], + "source": [ + "visualize([{\"material\": material, \"title\": material.name, \"rotation\": \"-90x\"} for material in materials],\n", + " repetitions=[2, 2, 1])" + ] + }, + { + "cell_type": "markdown", + "id": "33", + "metadata": {}, + "source": [ + "## 12. Pass the Superlattices and Bulk Cells to the Outside Runtime" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34", + "metadata": {}, + "outputs": [], + "source": [ + "set_materials(materials)" + ] + }, + { + "cell_type": "markdown", + "id": "35", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", + "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", + "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", + "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", + "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", + "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)" + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb index f1a09df5f..deb75179b 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb @@ -30,8 +30,8 @@ " HfO₂ layers, Hf₁₂Si₁₂O₄₈. Each interface plane carries three O: two bridge Si and Hf, one is bonded to Hf only, so\n", " no Si–O bond is broken.\n", "\n", - "At each interface the two blocks are separated so that the closest cation–O pair across it is at the bulk bond length\n", - "of the cation's own oxide; both publications relax the atomic positions afterwards.\n", + "Neither publication gives the separation of the two blocks: the builder sets the same distance between the facing\n", + "atomic planes at both interfaces, and both publications relax the atomic positions afterwards.\n", "\n", "The valence band offsets are computed from the superlattices and from bulk cells with the same in-plane lattice, so\n", "all five materials are saved:\n", @@ -60,16 +60,21 @@ "\n", "SUBSTRATE_MILLER_INDICES = (1, 1, 0) # in the primitive cell: the (001) face, 5.23 Å square\n", "FILM_MILLER_INDICES = (0, 0, 1)\n", + "# in Angstrom, between the facing atomic planes at both interfaces: about the spacing of an O plane and the next\n", + "# cation plane along [001] in the two oxides (0.92 Å in beta-cristobalite, 1.26 Å in cubic HfO2)\n", + "INTERFACE_DISTANCE = 1.0\n", "VACUUM = 0.0 # in Angstrom: periodic along the stacking axis\n", "\n", "MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS = 5 # two SiO2 layers each: 10\n", "MONOCLINIC_FILM_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8, of which one is removed\n", - "MONOCLINIC_FILM_ATOMS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", - "MONOCLINIC_FILM_ATOMS_REMOVED_FROM_TOP = 5 # with the lowest O, one HfO2 layer; three O stay at each interface\n", + "MONOCLINIC_FILM_TERMINATION_FORMULA = \"Hf_P2/m_1\" # the slab from one O below the first Hf layer to one O above the last\n", + "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", + "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_TOP = 2 # with the lowest O, one HfO2 layer; three O stay at each interface\n", "\n", "CUBIC_SUBSTRATE_NUMBER_OF_LAYERS = 6 # two SiO2 layers each: 12\n", "CUBIC_FILM_NUMBER_OF_LAYERS = 3 # two HfO2 layers each: 6\n", "CUBIC_FILM_XY_SHIFT = (0, 0.25) # fractions of the in-plane cell: SiO2 interface O on HfO2 O sites\n", + "SILICON_OXYGEN_BOND_CUTOFF = 2.0 # in Angstrom, between the Si–O bonds (1.6–1.7 Å) and the next Si–O distance (3.1 Å)\n", "\n", "SUBSTRATE_BULK_NUMBER_OF_LAYERS = 2 # one beta-cristobalite period along [001]\n", "\n", @@ -108,12 +113,11 @@ "id": "5", "metadata": {}, "source": [ - "### 1.3. Load the materials and define the helper functions\n", + "### 1.3. Load the materials\n", "\n", "The SiO₂ slab is cut from the primitive cell, where the Miller indices (1, 1, 0) select the cubic (001) face in the\n", - "45° cell. The interface builder re-creates its slabs from the bulk, so layer counts and atoms are changed on the built\n", - "superlattice. At each interface the film is moved along the normal, and the cell length is set, so that the closest\n", - "cation–O pair across the interface is at the bulk bond length: Si–O of SiO₂, Hf–O of the HfO₂ phase." + "45° cell. The interface builder strains HfO₂ onto it and re-creates its slabs from the bulk, so layer counts and atoms\n", + "are changed on the built superlattice." ] }, { @@ -123,76 +127,15 @@ "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", - "from ase.geometry import get_distances\n", - "from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema\n", "from mat3ra.made.material import Material\n", - "from mat3ra.made.tools.convert import to_ase\n", - "from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n", "from mat3ra.made.tools.helpers import (create_interface_zsl_between_slabs, create_slab,\n", " get_material_with_conventional_lattice)\n", - "from mat3ra.made.tools.modify import interface_displace_part, interface_get_part\n", - "from mat3ra.made.tools.operations.core.unary import strain\n", - "from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction\n", "from mat3ra.standata.materials import Materials\n", "\n", - "\n", - "def get_conventional_cell(name):\n", - " return get_material_with_conventional_lattice(Material.create(Materials.get_by_name_first_match(name)))\n", - "\n", - "\n", - "def get_bond_length(material, cation):\n", - " atoms = to_ase(material)\n", - " symbols = np.array(atoms.get_chemical_symbols())\n", - " return atoms.get_all_distances(mic=True)[np.ix_(symbols == cation, symbols == \"O\")].min()\n", - "\n", - "\n", - "def get_vertical_shift(lower, upper, bond_length_by_pair, upper_offset=0.0):\n", - " \"\"\"Shift along z of `upper` that puts the closest cation–O pair across the interface at its bond length.\"\"\"\n", - " lower_atoms, upper_atoms = to_ase(lower), to_ase(upper)\n", - " vectors, _ = get_distances(lower_atoms.positions, upper_atoms.positions + [0, 0, upper_offset],\n", - " cell=lower_atoms.cell, pbc=[True, True, False])\n", - " bond_length = np.array([[bond_length_by_pair.get(frozenset((lower_symbol, upper_symbol)), 0.0)\n", - " for upper_symbol in upper_atoms.symbols] for lower_symbol in lower_atoms.symbols])\n", - " in_plane_distance = np.linalg.norm(vectors[..., :2], axis=-1)\n", - " paired = bond_length > in_plane_distance\n", - " return (np.sqrt(bond_length[paired] ** 2 - in_plane_distance[paired] ** 2) - vectors[..., 2][paired]).max()\n", - "\n", - "\n", - "def set_interface_separations(interface, film):\n", - " bond_length_by_pair = {frozenset((\"Si\", \"O\")): get_bond_length(substrate, \"Si\"),\n", - " frozenset((\"Hf\", \"O\")): get_bond_length(film, \"Hf\")}\n", - " substrate_part = interface_get_part(interface, InterfacePartsEnum.SUBSTRATE)\n", - " film_part = interface_get_part(interface, InterfacePartsEnum.FILM)\n", - " film_shift = get_vertical_shift(substrate_part, film_part, bond_length_by_pair)\n", - " wrap_shift = get_vertical_shift(film_part, substrate_part, bond_length_by_pair, interface.lattice.c)\n", - " top = to_ase(interface).positions[:, 2].max()\n", - " interface = adjust_material_cell_to_set_gap_along_direction(interface,\n", - " interface.lattice.c + film_shift + wrap_shift - top)\n", - " return interface_displace_part(interface, [0, 0, film_shift])\n", - "\n", - "\n", - "def strain_in_plane(material, lattice):\n", - " vectors = np.array(material.lattice.vector_arrays)\n", - " a_direction, b_direction = vectors[:2] / np.linalg.norm(vectors[:2], axis=1)[:, None]\n", - " normal = np.cross(a_direction, b_direction)\n", - " deformation = (lattice.a / material.lattice.a * np.outer(a_direction, a_direction)\n", - " + lattice.b / material.lattice.b * np.outer(b_direction, b_direction) + np.outer(normal, normal))\n", - " return strain(material, Matrix3x3Schema(root=deformation.tolist()))\n", - "\n", - "\n", - "def create_superlattice(film, substrate_number_of_layers, film_number_of_layers, xy_shift=(0, 0)):\n", - " substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", - " number_of_layers=substrate_number_of_layers, vacuum=VACUUM)\n", - " film_slab = create_slab(film, FILM_MILLER_INDICES, number_of_layers=film_number_of_layers, vacuum=VACUUM)\n", - " return create_interface_zsl_between_slabs(\n", - " substrate_slab=substrate_slab, film_slab=film_slab, vacuum=VACUUM, max_length_tol=MAX_LENGTH_TOLERANCE,\n", - " xy_shift=(np.array(xy_shift) * [substrate_slab.lattice.a, substrate_slab.lattice.b]).tolist())\n", - "\n", - "\n", "substrate = Material.create(Materials.get_by_name_first_match(SUBSTRATE_NAME))\n", - "monoclinic_film = get_conventional_cell(MONOCLINIC_FILM_NAME)\n", - "cubic_film = get_conventional_cell(CUBIC_FILM_NAME)" + "monoclinic_film = get_material_with_conventional_lattice(\n", + " Material.create(Materials.get_by_name_first_match(MONOCLINIC_FILM_NAME)))\n", + "cubic_film = get_material_with_conventional_lattice(Material.create(Materials.get_by_name_first_match(CUBIC_FILM_NAME)))" ] }, { @@ -205,7 +148,8 @@ "The slab builder counts monoclinic (001) layers in pairs, so eight HfO₂ layers are built and one is removed. The\n", "HfO₂ block as built ends in two O on each side; the block kept is one O higher, so it ends in one O against the\n", "SiO₂ O plane and in three O against the SiO₂ Si. Each interface then carries three O, and the cell stays\n", - "stoichiometric. The in-plane registry of the two blocks is not given in the publication; the builder's default is\n", + "stoichiometric. The kept block stays where the builder placed it, and the cell is shortened to the interface distance\n", + "across its boundary. The in-plane registry of the two blocks is not given in the publication; the builder's default is\n", "kept." ] }, @@ -216,17 +160,28 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n", + "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", "from mat3ra.made.tools.modify import filter_by_ids\n", + "from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction\n", "\n", - "monoclinic_superlattice = create_superlattice(monoclinic_film, MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS,\n", - " MONOCLINIC_FILM_NUMBER_OF_LAYERS)\n", - "heights = to_ase(monoclinic_superlattice).positions[:, 2]\n", - "film_ids = np.flatnonzero(np.array(monoclinic_superlattice.basis.labels.values) == InterfacePartsEnum.FILM.value)\n", - "film_ids_by_height = film_ids[np.argsort(heights[film_ids])]\n", - "removed_ids = np.concatenate([film_ids_by_height[:MONOCLINIC_FILM_ATOMS_REMOVED_FROM_BOTTOM],\n", - " film_ids_by_height[-MONOCLINIC_FILM_ATOMS_REMOVED_FROM_TOP:]])\n", - "monoclinic_superlattice = filter_by_ids(monoclinic_superlattice, removed_ids.tolist(), invert=True, reset_ids=True)\n", - "monoclinic_superlattice = set_interface_separations(monoclinic_superlattice, monoclinic_film)" + "monoclinic_substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", + "monoclinic_film_slab = create_slab(monoclinic_film, FILM_MILLER_INDICES,\n", + " termination_top_formula=MONOCLINIC_FILM_TERMINATION_FORMULA,\n", + " number_of_layers=MONOCLINIC_FILM_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", + "monoclinic_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=monoclinic_substrate_slab, film_slab=monoclinic_film_slab, gap=INTERFACE_DISTANCE, vacuum=VACUUM,\n", + " max_length_tol=MAX_LENGTH_TOLERANCE)\n", + "\n", + "labels = monoclinic_superlattice.basis.labels.values\n", + "film_layers = [layer for layer in get_atom_indices_by_layer(monoclinic_superlattice)\n", + " if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", + "removed_layers = (film_layers[:MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM]\n", + " + film_layers[-MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", + "monoclinic_superlattice = filter_by_ids(monoclinic_superlattice, [index for layer in removed_layers for index in layer],\n", + " invert=True, reset_ids=True)\n", + "monoclinic_superlattice = adjust_material_cell_to_set_gap_along_direction(monoclinic_superlattice, INTERFACE_DISTANCE)" ] }, { @@ -249,9 +204,15 @@ "metadata": {}, "outputs": [], "source": [ - "cubic_superlattice = create_superlattice(cubic_film, CUBIC_SUBSTRATE_NUMBER_OF_LAYERS, CUBIC_FILM_NUMBER_OF_LAYERS,\n", - " CUBIC_FILM_XY_SHIFT)\n", - "cubic_superlattice = set_interface_separations(cubic_superlattice, cubic_film)" + "cubic_substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", + " number_of_layers=CUBIC_SUBSTRATE_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", + "cubic_film_slab = create_slab(cubic_film, FILM_MILLER_INDICES, number_of_layers=CUBIC_FILM_NUMBER_OF_LAYERS,\n", + " vacuum=VACUUM)\n", + "cubic_superlattice = create_interface_zsl_between_slabs(\n", + " substrate_slab=cubic_substrate_slab, film_slab=cubic_film_slab, gap=INTERFACE_DISTANCE, vacuum=VACUUM,\n", + " max_length_tol=MAX_LENGTH_TOLERANCE,\n", + " xy_shift=[CUBIC_FILM_XY_SHIFT[0] * cubic_substrate_slab.lattice.a,\n", + " CUBIC_FILM_XY_SHIFT[1] * cubic_substrate_slab.lattice.b])" ] }, { @@ -261,9 +222,10 @@ "source": [ "### 3.2. Move one O to the other interface\n", "\n", - "The first O of the four-O plane that is not bonded to Si is removed, and an O is added at the same in-plane position\n", - "in the two-O plane. Each interface plane then carries three O, two bonded to Si and Hf and one to Hf only: the\n", - "structure of Sharia et al., who remove a different O from each of two four-O interface planes." + "The four-O plane is the top atomic layer of the cell, below the SiO₂ Si across the cell boundary; the two-O plane is\n", + "the top layer of SiO₂. The first O of the four-O plane that is not bonded to that Si is removed, and an O is added at\n", + "the same in-plane position in the two-O plane. Each interface plane then carries three O, two bonded to Si and Hf and\n", + "one to Hf only: the structure of Sharia et al., who remove a different O from each of two four-O interface planes." ] }, { @@ -273,24 +235,24 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import create_defect_point_interstitial, create_defect_point_vacancy\n", - "\n", - "atoms = to_ase(cubic_superlattice)\n", - "symbols = np.array(atoms.get_chemical_symbols())\n", - "labels = np.array(cubic_superlattice.basis.labels.values)\n", - "heights = atoms.positions[:, 2]\n", - "film_oxygen_ids = np.flatnonzero((symbols == \"O\") & (labels == InterfacePartsEnum.FILM.value))\n", - "substrate_oxygen_ids = np.flatnonzero((symbols == \"O\") & (labels == InterfacePartsEnum.SUBSTRATE.value))\n", - "four_oxygen_plane_ids = film_oxygen_ids[np.isclose(heights[film_oxygen_ids], heights[film_oxygen_ids].max())]\n", - "distance_to_silicon = [atoms.get_distances(index, np.flatnonzero(symbols == \"Si\"), mic=True).min()\n", - " for index in four_oxygen_plane_ids]\n", - "removed_position = atoms.positions[four_oxygen_plane_ids[np.isclose(distance_to_silicon, max(distance_to_silicon))][0]]\n", - "added_position = [*removed_position[:2], heights[substrate_oxygen_ids].max()]\n", - "\n", - "cubic_superlattice = create_defect_point_vacancy(cubic_superlattice, removed_position.tolist(), \"closest_site\",\n", - " use_cartesian_coordinates=True)\n", - "cubic_superlattice = create_defect_point_interstitial(cubic_superlattice, added_position, \"O\", \"exact_coordinate\",\n", - " use_cartesian_coordinates=True)" + "from mat3ra.made.tools.analyze.other import get_atom_indices_within_radius_pbc\n", + "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", + "from mat3ra.made.tools.helpers import create_multiple_defects\n", + "\n", + "layers = get_atom_indices_by_layer(cubic_superlattice)\n", + "labels = cubic_superlattice.basis.labels.values\n", + "silicon_layer, four_oxygen_plane = layers[0], layers[-1]\n", + "two_oxygen_plane = [layer for layer in layers if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value][-1]\n", + "silicon_neighbor_ids = get_atom_indices_within_radius_pbc(cubic_superlattice, atom_index=silicon_layer[0],\n", + " radius=SILICON_OXYGEN_BOND_CUTOFF)\n", + "coordinates = cubic_superlattice.basis.coordinates.values\n", + "removed_coordinate = coordinates[[index for index in four_oxygen_plane if index not in silicon_neighbor_ids][0]]\n", + "added_coordinate = [*removed_coordinate[:2], coordinates[two_oxygen_plane[0]][2]]\n", + "\n", + "cubic_superlattice = create_multiple_defects(cubic_superlattice, [\n", + " PointDefectDict(type=\"vacancy\", coordinate=removed_coordinate, placement_method=\"closest_site\"),\n", + " PointDefectDict(type=\"interstitial\", coordinate=added_coordinate, element=\"O\", placement_method=\"exact_coordinate\"),\n", + "])" ] }, { @@ -301,8 +263,8 @@ "## 4. Create the Bulk Reference Cells\n", "\n", "SiO₂ is used as is, one β-cristobalite period along [001] in the 45° cell. Each HfO₂ is strained in plane to the cell\n", - "of its superlattice, with the (001) layer spacing kept. Atom labels are removed from all five materials: labels break\n", - "the Quantum ESPRESSO input." + "of its superlattice: a and b take the superlattice's lengths, c and the cell angles are kept, so the (001) layer\n", + "spacing is kept. Atom labels are removed from all five materials: labels break the Quantum ESPRESSO input." ] }, { @@ -312,10 +274,15 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.made.tools.operations.reusable.unary import strain_to_match_lattice\n", + "\n", "substrate_bulk = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", " number_of_layers=SUBSTRATE_BULK_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", - "monoclinic_film_bulk = strain_in_plane(monoclinic_film, monoclinic_superlattice.lattice)\n", - "cubic_film_bulk = strain_in_plane(cubic_film, cubic_superlattice.lattice)\n", + "in_plane_lattice = {\"a\": substrate_bulk.lattice.a, \"b\": substrate_bulk.lattice.b}\n", + "monoclinic_film_bulk = strain_to_match_lattice(monoclinic_film, Material.create(\n", + " {**monoclinic_film.to_dict(), \"lattice\": {**monoclinic_film.lattice.to_dict(), **in_plane_lattice}}))\n", + "cubic_film_bulk = strain_to_match_lattice(cubic_film, Material.create(\n", + " {**cubic_film.to_dict(), \"lattice\": {**cubic_film.lattice.to_dict(), **in_plane_lattice}}))\n", "\n", "materials = [monoclinic_superlattice, cubic_superlattice, substrate_bulk, monoclinic_film_bulk, cubic_film_bulk]\n", "names = [MONOCLINIC_SUPERLATTICE_NAME, CUBIC_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME, MONOCLINIC_FILM_BULK_NAME,\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb index e22407de6..0e66f5ce8 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb @@ -24,15 +24,16 @@ "\n", "ΔE_v is positive when the valence band maximum of SiO₂ lies above that of HfO₂, the sign convention of both\n", "publications. Both publications use LDA, as this notebook does; the publications' values compared here are LDA\n", - "values, and their G0W0 corrections to the band edges are not computed.\n", + "values, and the G0W0 corrections of Prodhomme et al. to the band edges are not computed.\n", "\n", "- **Monoclinic HfO₂**, after Prodhomme et al.: the atomic positions are annealed from 1000 K to 100 K in 1 ps, then\n", " relaxed, as in the publication.\n", "- **Cubic HfO₂**, the model of Robertson and Wallace, built after Sharia et al.: the atomic positions are relaxed.\n", "\n", - "Both publications relax with DFT in LDA, Prodhomme et al. with SIESTA and Sharia et al. with VASP; here the anneal and\n", - "the relaxation use the MACE-MP-0 machine-learned force field, trained on PBE data. Both move only the cation layer on\n", - "each side of an interface and the atoms between them; the block interiors are held at the bulk crystals.\n", + "Prodhomme et al. relax with SIESTA; Robertson and Wallace relax in LDA, on the model of Sharia et al.; here the anneal\n", + "and the relaxation use the MACE-MP-0 machine-learned force field, trained on PBE data. Both move only the cation layer\n", + "on each side of an interface and the atoms between them; the block interiors are held at the bulk crystals, so that\n", + "each block centre has the structure of its bulk reference.\n", "\n", "

Usage

\n", "\n", @@ -164,23 +165,25 @@ "MODEL_SUBTYPE = \"lda\"\n", "FUNCTIONAL = \"pz\" # both publications use LDA\n", "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Hf, Si and O\n", - "BLOCK_LABEL = {SUBSTRATE_BULK_NAME: \"SiO₂\", MONOCLINIC_FILM_BULK_NAME: \"monoclinic HfO₂\", CUBIC_FILM_BULK_NAME: \"cubic HfO₂\"}\n", - "BLOCK_CATION = {SUBSTRATE_BULK_NAME: \"Si\", MONOCLINIC_FILM_BULK_NAME: \"Hf\", CUBIC_FILM_BULK_NAME: \"Hf\"} # marks each block\n", - "CATIONS_PER_LAYER = {\"Si\": 1, \"Hf\": 2} # per (001) layer of the 5.23 Å cell, one period of the planar-averaged potential\n", + "BLOCK_LABEL = {\n", + " SUBSTRATE_BULK_NAME: \"SiO₂\", MONOCLINIC_FILM_BULK_NAME: \"monoclinic HfO₂\", CUBIC_FILM_BULK_NAME: \"cubic HfO₂\"\n", + "}\n", + "BLOCK_CATION = {SUBSTRATE_BULK_NAME: \"Si\", MONOCLINIC_FILM_BULK_NAME: \"Hf\", CUBIC_FILM_BULK_NAME: \"Hf\"} # marks a block\n", "ECUTWFC = 40 # Ry, GBRV's recommended wavefunction cutoff\n", "ECUTRHO = 200 # Ry, GBRV's recommended charge-density cutoff\n", "ADDITIONAL_PARAMETERS = {\n", " # Hf, the third species of the superlattices: its GBRV atomic density holds 10 of its 12 valence electrons;\n", " # scaled by (12 + 2.4) / 12, the starting density is neutral in both blocks\n", " \"system\": {\"starting_charge(3)\": -2.4},\n", - " \"electrons\": {\"mixing_mode\": \"local-TF\", \"mixing_beta\": 0.2, \"mixing_ndim\": 20, \"electron_maxstep\": 200}, # the long cells need local-TF mixing with a long history to converge\n", + " # the long cells need local-TF mixing with a long history to converge\n", + " \"electrons\": {\"mixing_mode\": \"local-TF\", \"mixing_beta\": 0.2, \"mixing_ndim\": 20, \"electron_maxstep\": 200},\n", "}\n", "KPOINT_DENSITY = 3.5 # points per Å⁻¹, for the bulks\n", "SUPERLATTICE_KGRID = [4, 4, 1] # Sharia et al.\n", "\n", "SCF_UNIT = \"pw_scf\"\n", "BANDS_UNIT = \"pw_bands\"\n", - "AVERAGE_FLOWCHART_IDS = [ # the workflow's average ESP units: superlattice, SiO₂ bulk, HfO₂ bulk\n", + "AVERAGE_FLOWCHART_IDS = [ # average ESP units of the valence_band_offset_bulk workflow: superlattice, SiO₂, HfO₂\n", " \"average-electrostatic-potential\", \"average-electrostatic-potential-left\", \"average-electrostatic-potential-right\"\n", "]" ] @@ -336,23 +339,14 @@ "from collections import Counter\n", "from mat3ra.notebooks_utils.core.entity.material.api import load_material\n", "\n", - "MATERIAL_NAMES = [*FILM_BULK_NAME_BY_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME, *FILM_BULK_NAME_BY_SUPERLATTICE_NAME.values()]\n", + "MATERIAL_NAMES = [*FILM_BULK_NAME_BY_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME,\n", + " *FILM_BULK_NAME_BY_SUPERLATTICE_NAME.values()]\n", "materials_by_name = {name: load_material(client, FOLDER, name, ACCOUNT_ID) for name in MATERIAL_NAMES}\n", "\n", - "\n", - "def get_layer_spacing(bulk, bulk_name):\n", - " vectors = np.array(bulk.lattice.vector_arrays)\n", - " normal_length = abs(np.linalg.det(vectors)) / np.linalg.norm(np.cross(vectors[0], vectors[1]))\n", - " cation = BLOCK_CATION[bulk_name]\n", - " return normal_length * CATIONS_PER_LAYER[cation] / bulk.basis.elements.values.count(cation)\n", - "\n", - "\n", "for name, material in materials_by_name.items():\n", " lattice = material.lattice\n", " print(f\"{name}: {dict(Counter(material.basis.elements.values))}, {material.basis.number_of_atoms} atoms, \"\n", - " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å\")\n", - " if name in BLOCK_CATION:\n", - " print(f\" (001) layer spacing: {get_layer_spacing(material, name):.4f} Å\")" + " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å\")" ] }, { @@ -481,6 +475,7 @@ "from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n", "from mat3ra.made.material import Material\n", "from mat3ra.made.tools.convert import from_ase, to_ase\n", + "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", "from mat3ra.notebooks_utils.calculators.mlff import create_mlff_calculator\n", "\n", "calculator = create_mlff_calculator(\n", @@ -496,25 +491,21 @@ "temperatures = np.linspace(ANNEAL_START_TEMPERATURE, ANNEAL_END_TEMPERATURE, round(ANNEAL_DURATION / ANNEAL_TIMESTEP))\n", "\n", "\n", - "def get_interior_indices(superlattice, film_cation, substrate_cation):\n", - " atoms = to_ase(superlattice)\n", - " heights, period = atoms.positions[:, 2], atoms.cell[2, 2]\n", - " elements = np.array(atoms.get_chemical_symbols())\n", - " film_center = np.angle(np.exp(2j * np.pi * heights[elements == film_cation] / period).mean()) * period / (2 * np.pi)\n", - " offsets = (heights - film_center + period / 2) % period - period / 2\n", - " in_interface = np.zeros(len(atoms), dtype=bool)\n", - " for side_offsets in (offsets, -offsets): # the interface above the film block, then the one below\n", - " film_cations = np.sort(side_offsets[(elements == film_cation) & (side_offsets > 0)])\n", - " substrate_cations = np.sort(side_offsets[(elements == substrate_cation) & (side_offsets > 0)])\n", - " film_edge = film_cations[-INTERFACE_CATION_LAYERS * CATIONS_PER_LAYER[film_cation]]\n", - " substrate_edge = substrate_cations[INTERFACE_CATION_LAYERS * CATIONS_PER_LAYER[substrate_cation] - 1]\n", - " in_interface |= (side_offsets >= film_edge) & (side_offsets <= substrate_edge)\n", - " return np.flatnonzero(~in_interface)\n", + "def get_interior_indices(superlattice, cations):\n", + " \"\"\"Atoms of each block, marked by its cation, between the block's outermost cation layers.\"\"\"\n", + " layers = get_atom_indices_by_layer(superlattice)\n", + " elements = superlattice.basis.elements.values\n", + " interior_indices = []\n", + " for cation in cations:\n", + " cation_layers = [index for index, layer in enumerate(layers) if cation in [elements[atom] for atom in layer]]\n", + " for layer in layers[cation_layers[INTERFACE_CATION_LAYERS - 1] + 1:cation_layers[-INTERFACE_CATION_LAYERS]]:\n", + " interior_indices.extend(layer)\n", + " return interior_indices\n", "\n", "\n", "interior_indices = {\n", - " name: get_interior_indices(materials_by_name[name], BLOCK_CATION[film_bulk_name], BLOCK_CATION[SUBSTRATE_BULK_NAME])\n", - " for name, film_bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items()\n", + " name: get_interior_indices(materials_by_name[name], [BLOCK_CATION[SUBSTRATE_BULK_NAME], BLOCK_CATION[bulk_name]])\n", + " for name, bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items()\n", "}\n", "\n", "unrelaxed_superlattices = {name: materials_by_name[name] for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME}\n", @@ -530,9 +521,7 @@ " for temperature in temperatures:\n", " dynamics.set_temperature(temperature_K=temperature)\n", " dynamics.run(1)\n", - " annealed = Material.create(from_ase(atoms))\n", - " annealed.name = f\"{name} annealed\"\n", - " unrelaxed_superlattices[name] = annealed" + " unrelaxed_superlattices[name] = Material.create(from_ase(atoms))" ] }, { @@ -553,17 +542,13 @@ "metadata": {}, "outputs": [], "source": [ - "from ase.optimize import BFGS\n", + "from mat3ra.notebooks_utils.workflows.relaxation import relax_material\n", "\n", "relaxed_superlattices = {}\n", "for name, superlattice in unrelaxed_superlattices.items():\n", - " atoms = to_ase(superlattice)\n", - " atoms.set_constraint(FixAtoms(indices=interior_indices[name]))\n", - " atoms.calc = calculator\n", - " BFGS(atoms).run(fmax=RELAXATION_FORCE_THRESHOLD)\n", - " relaxed = Material.create(from_ase(atoms))\n", - " relaxed.name = f\"{name} relaxed\"\n", - " relaxed_superlattices[name] = relaxed" + " relaxed_superlattices[name] = relax_material(superlattice, calculator, fmax=RELAXATION_FORCE_THRESHOLD,\n", + " fixed_atom_indices=interior_indices[name])\n", + " relaxed_superlattices[name].name = f\"{name} relaxed\"" ] }, { @@ -606,11 +591,14 @@ " if subworkflow.application.name != APPLICATION_NAME:\n", " continue\n", " subworkflow.model = model\n", - " material_index = int(next((unit.value for unit in subworkflow.units if unit.name.startswith(\"Set Material Index\")), 0))\n", + " # the superlattice subworkflow has no \"Set Material Index\" unit: it runs on material 0\n", + " material_index = int(next((unit.value for unit in subworkflow.units\n", + " if unit.name.startswith(\"Set Material Index\")), 0))\n", " material_name = job_material_names[name][material_index]\n", " scf_unit = subworkflow.get_unit_by_name(name=SCF_UNIT)\n", - " scf_unit.add_context(PointsGridDataProvider(material=job_materials[name][material_index],\n", - " dimensions=kgrid[material_name], isEdited=True).get_context_item_data())\n", + " kgrid_context = PointsGridDataProvider(material=job_materials[name][material_index],\n", + " dimensions=kgrid[material_name], isEdited=True).get_context_item_data()\n", + " scf_unit.add_context(kgrid_context)\n", " subworkflow.set_unit(scf_unit)\n", "\n", " patch_workflow_qe_input(workflow, ADDITIONAL_PARAMETERS, unit_names=[SCF_UNIT])\n", @@ -683,7 +671,7 @@ "metadata": {}, "outputs": [], "source": [ - "valence_band_offset = {\n", + "valence_band_offset_by_superlattice_name = {\n", " name: client.properties.get_for_job(job_id, property_name=\"valence_band_offset\")[0][\"value\"]\n", " for name, job_id in job_ids.items()\n", "}" @@ -696,10 +684,10 @@ "source": [ "### 10.2. Potential across the superlattices\n", "\n", - "One period from the HfO₂→SiO₂ interface, SiO₂ on the left. Each bulk's own potential (dotted) is overlaid on its\n", - "block, shifted to the block's average over one (001) layer, one period of the potential, at the block's centre;\n", - "where they coincide the block is bulk-like, and the two averages (dashed horizontal lines) are shifted with respect\n", - "to each other by the lineup." + "One cell along [001] from its origin, the first SiO₂ layer: SiO₂ on the left, HfO₂ on the right. Each block spans its\n", + "(001) cation layers; each bulk's own potential (dotted) is overlaid on its block, aligned on the first cation layer\n", + "and shifted to the block's average over one (001) layer, one period of the potential, at the block's centre: the\n", + "one-layer average used for the overlay (dashed). Where the curves coincide, the block is bulk-like." ] }, { @@ -710,32 +698,13 @@ "outputs": [], "source": [ "profiles = {\n", - " (name, material_name): client.properties.get_for_job(job_id, property_name=\"average_potential_profile\",\n", - " unit_id=flowchart_id)[0]\n", + " name: {\n", + " material_name: client.properties.get_for_job(job_id, property_name=\"average_potential_profile\",\n", + " unit_id=flowchart_id)[0]\n", + " for material_name, flowchart_id in zip(job_material_names[name], AVERAGE_FLOWCHART_IDS)\n", + " }\n", " for name, job_id in job_ids.items()\n", - " for material_name, flowchart_id in zip(job_material_names[name], AVERAGE_FLOWCHART_IDS)\n", - "}\n", - "\n", - "block_windows, superlattice_potential, bulk_potential = {}, {}, {}\n", - "for name, (_, *bulk_names) in job_material_names.items():\n", - " superlattice = relaxed_superlattices[name]\n", - " superlattice_in_cartesian = superlattice.clone()\n", - " superlattice_in_cartesian.to_cartesian()\n", - " heights = np.array(superlattice_in_cartesian.basis.coordinates.values)[:, 2]\n", - " elements = np.array(superlattice.basis.elements.values)\n", - " period = superlattice.lattice.c\n", - " positions = np.array(profiles[name, name][\"xDataArray\"])\n", - " planar_average = np.array(profiles[name, name][\"yDataSeries\"][0])\n", - " for bulk_name in bulk_names:\n", - " key = (name, bulk_name)\n", - " cation_heights = heights[elements == BLOCK_CATION[bulk_name]]\n", - " # centre of the block's layers, also when the block wraps around the cell boundary\n", - " center = np.angle(np.exp(2j * np.pi * cation_heights / period).mean()) * period / (2 * np.pi) % period\n", - " spacing = get_layer_spacing(materials_by_name[bulk_name], bulk_name)\n", - " block_windows[key] = (center, spacing)\n", - " distances = (positions - center + period / 2) % period - period / 2\n", - " superlattice_potential[key] = planar_average[np.abs(distances) <= spacing / 2].mean()\n", - " bulk_potential[key] = np.mean(profiles[key][\"yDataSeries\"][0])" + "}" ] }, { @@ -748,54 +717,44 @@ "import matplotlib.pyplot as plt\n", "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", "\n", + "\n", + "def get_cation_layer_fractions(material, cation):\n", + " \"\"\"Crystal coordinates along c of the (001) layers that hold the cation, bottom first.\"\"\"\n", + " elements, coordinates = material.basis.elements.values, material.basis.coordinates.values\n", + " return [np.mean([coordinates[index][2] for index in layer if elements[index] == cation])\n", + " for layer in get_atom_indices_by_layer(material) if cation in [elements[index] for index in layer]]\n", + "\n", + "\n", "figure, axes = plt.subplots(len(job_ids), 1, figsize=(10, 5 * len(job_ids)), squeeze=False)\n", "for axis, (name, (_, substrate_bulk_name, film_bulk_name)) in zip(axes[:, 0], job_material_names.items()):\n", - " superlattice = relaxed_superlattices[name]\n", - " superlattice_in_cartesian = superlattice.clone()\n", - " superlattice_in_cartesian.to_cartesian()\n", - " heights = np.array(superlattice_in_cartesian.basis.coordinates.values)[:, 2]\n", - " elements = np.array(superlattice.basis.elements.values)\n", - " period = superlattice.lattice.c\n", - " positions = np.array(profiles[name, name][\"xDataArray\"])\n", - " planar_average = np.array(profiles[name, name][\"yDataSeries\"][0])\n", - "\n", - " substrate_center, substrate_spacing = block_windows[name, substrate_bulk_name]\n", - " substrate_cation = BLOCK_CATION[substrate_bulk_name]\n", - " substrate_layers = np.sum(elements == substrate_cation) / CATIONS_PER_LAYER[substrate_cation]\n", - " plot_origin = substrate_center - substrate_layers * substrate_spacing / 2 # the middle of the HfO2->SiO2 interface\n", - " order = np.argsort((positions - plot_origin) % period)\n", - " axis.plot(((positions - plot_origin) % period)[order], planar_average[order], color=\"black\", label=\"superlattice\")\n", + " period = materials_by_name[name].lattice.c\n", + " positions = np.array(profiles[name][name][\"xDataArray\"])\n", + " planar_average = np.array(profiles[name][name][\"yDataSeries\"][0])\n", + " axis.plot(positions, planar_average, color=\"black\", label=\"superlattice\")\n", " for bulk_name, color in ((substrate_bulk_name, \"tab:blue\"), (film_bulk_name, \"tab:red\")):\n", - " key = (name, bulk_name)\n", - " bulk = materials_by_name[bulk_name]\n", " cation = BLOCK_CATION[bulk_name]\n", - " center, spacing = block_windows[key]\n", - " half_width = np.sum(elements == cation) / CATIONS_PER_LAYER[cation] * spacing / 2\n", - " offsets = np.linspace(-half_width, half_width, 400) # from the block's centre\n", - " cation_offsets = (heights[elements == cation] - center + period / 2) % period - period / 2\n", - " layer_offsets = np.sort(cation_offsets).reshape(-1, CATIONS_PER_LAYER[cation]).mean(axis=1)\n", - " plane_offset = layer_offsets[np.abs(layer_offsets).argmin()] # the layer nearest the block centre\n", - " bulk_profile = profiles[key]\n", + " layer_heights = [fraction * period for fraction in get_cation_layer_fractions(materials_by_name[name], cation)]\n", + " spacing = (layer_heights[-1] - layer_heights[0]) / (len(layer_heights) - 1)\n", + " center = (layer_heights[0] + layer_heights[-1]) / 2\n", + " block_potential = planar_average[np.abs(positions - center) <= spacing / 2].mean()\n", + " region = np.linspace(layer_heights[0] - spacing / 2, layer_heights[-1] + spacing / 2, 400)\n", + " bulk_profile = profiles[name][bulk_name]\n", " profile_length = len(bulk_profile[\"xDataArray\"]) * bulk_profile[\"xDataArray\"][1] # one bulk cell\n", - " bulk_cation_fractions = np.array(bulk.basis.coordinates.values)[np.array(bulk.basis.elements.values) == cation][:, 2]\n", - " bulk_layer_fraction = np.sort(bulk_cation_fractions)[:CATIONS_PER_LAYER[cation]].mean()\n", - " bulk_normal_length = spacing * bulk.basis.elements.values.count(cation) / CATIONS_PER_LAYER[cation]\n", - " bulk_values = np.interp((((offsets - plane_offset) / bulk_normal_length + bulk_layer_fraction) * profile_length),\n", - " bulk_profile[\"xDataArray\"], bulk_profile[\"yDataSeries\"][0], period=profile_length)\n", - " region = offsets + (center - plot_origin) % period\n", - " shift = superlattice_potential[key] - bulk_potential[key]\n", + " bulk_layer_fractions = get_cation_layer_fractions(materials_by_name[bulk_name], cation)\n", + " bulk_fractions = (region - layer_heights[0]) / (spacing * len(bulk_layer_fractions)) + bulk_layer_fractions[0]\n", + " bulk_values = np.interp(bulk_fractions * profile_length, bulk_profile[\"xDataArray\"],\n", + " bulk_profile[\"yDataSeries\"][0], period=profile_length)\n", + " shift = block_potential - np.mean(bulk_profile[\"yDataSeries\"][0])\n", " axis.plot(region, bulk_values + shift, color=color, linestyle=\":\", linewidth=2,\n", " label=f\"bulk {BLOCK_LABEL[bulk_name]}, shifted\")\n", - " axis.hlines(superlattice_potential[key], region[0], region[-1], color=color, linestyle=\"--\",\n", - " label=f\"V̄_{BLOCK_LABEL[bulk_name]} = {superlattice_potential[key]:.3f} eV\")\n", - " axis.text((center - plot_origin) % period, 0.02, BLOCK_LABEL[bulk_name], transform=axis.get_xaxis_transform(),\n", - " ha=\"center\")\n", + " axis.hlines(block_potential, region[0], region[-1], color=color, linestyle=\"--\",\n", + " label=f\"V̄_{BLOCK_LABEL[bulk_name]} = {block_potential:.3f} eV\")\n", + " axis.text(center, 0.02, BLOCK_LABEL[bulk_name], transform=axis.get_xaxis_transform(), ha=\"center\")\n", " axis.set_xlim(0, period)\n", " axis.set_xlabel(\"position along (001) (Å)\")\n", " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", - " potential_lineup = superlattice_potential[name, substrate_bulk_name] - superlattice_potential[name, film_bulk_name]\n", - " axis.set_title(f\"{name}: ΔV̄ = {potential_lineup:.3f} eV, ΔE_v = {valence_band_offset[name]:.3f} eV\")\n", - " axis.legend(loc=\"lower right\", bbox_to_anchor=(1, 0.07), fontsize=8)\n", + " axis.set_title(f\"{name}: ΔE_v = {valence_band_offset_by_superlattice_name[name]:.3f} eV\")\n", + " axis.legend(loc=\"upper right\", fontsize=8)\n", "figure.tight_layout()\n", "display_matplotlib_figure(figure)" ] @@ -810,9 +769,13 @@ "Both publications define the offset as E_VBM(SiO₂) − E_VBM(HfO₂). Robertson and Wallace read it from the densities of\n", "states of layers away from the interfaces; here both offsets come from the potential line-up, as in Prodhomme et al.\n", "Settings that differ from the manuscripts: GBRV ultrasoft LDA pseudopotentials in plane waves at 40/200 Ry, against\n", - "the localized orbitals and Troullier–Martins pseudopotentials of Prodhomme et al.; the lattice constants of the platform's SiO₂ and HfO₂ structures, against the publications' LDA\n", - "lattices, so the in-plane strain of monoclinic HfO₂ is smaller than the 3.7 % and 2.1 % of Prodhomme et al.; and\n", - "the k-points of the bulks, which Prodhomme et al. do not give and Sharia et al. set to 8 × 8 × 8. The value of Robertson and Wallace is read from their Fig. 57a." + "the localized orbitals and Troullier–Martins pseudopotentials of Prodhomme et al.; the lattice constants of the\n", + "platform's SiO₂ and HfO₂ structures, so the in-plane strain of monoclinic HfO₂ is smaller than in Prodhomme et al., who\n", + "stretch HfO₂ by 3.7 % along [100] and 2.1 % along [010] onto the 5.23 Å SiO₂ face; the cell length along [001], which\n", + "Sharia et al. relax and which is kept as built here; and the k-points of the bulks, which Prodhomme et al. do not give\n", + "and Sharia et al. set to 8 × 8 × 8. In the monoclinic superlattice, after relaxation, two O at each interface bond to\n", + "both Si and Hf (twofold at one interface, threefold at the other); Prodhomme et al. report three threefold O. The value\n", + "of Robertson and Wallace is read from their Fig. 57a." ] }, { @@ -829,7 +792,8 @@ "\n", "for name, (source, manuscript_offset) in MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME.items():\n", " film_label = BLOCK_LABEL[FILM_BULK_NAME_BY_SUPERLATTICE_NAME[name]]\n", - " print(f\"VBO, SiO₂/HfO₂ ({film_label}): {source} {manuscript_offset:+} eV | ours {valence_band_offset[name]:+.2f} eV\")" + " offset = valence_band_offset_by_superlattice_name[name]\n", + " print(f\"VBO, SiO₂/HfO₂ ({film_label}): {source} {manuscript_offset:+} eV | ours {offset:+.2f} eV\")" ] }, { From b01ec622e987422744a7e3ae9f580819bef88b5d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 16:26:08 -0800 Subject: [PATCH 05/11] SOF-8097: SiO2/HfO2 simulation holds the interior atoms with atomic_constraints Co-Authored-By: Claude Opus 5.5 --- ...d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb index 0e66f5ce8..e57ab8bb5 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb @@ -469,10 +469,11 @@ "outputs": [], "source": [ "from ase import units\n", - "from ase.constraints import FixAtoms\n", "from ase.md import MDLogger\n", "from ase.md.langevin import Langevin\n", "from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n", + "from mat3ra.code.array_with_ids import ArrayWithIds\n", + "from mat3ra.esse.models.properties_directory.enum_options import ProtoPropertyEnum\n", "from mat3ra.made.material import Material\n", "from mat3ra.made.tools.convert import from_ase, to_ase\n", "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", @@ -509,9 +510,10 @@ "}\n", "\n", "unrelaxed_superlattices = {name: materials_by_name[name] for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME}\n", + "for name, superlattice in unrelaxed_superlattices.items():\n", + " superlattice.basis.atomic_properties.set_by_name(ProtoPropertyEnum.atomic_constraints, ArrayWithIds.from_values([[index not in interior_indices[name]] * 3 for index in range(superlattice.basis.number_of_atoms)]))\n", "for name in ANNEALED_SUPERLATTICE_NAMES:\n", " atoms = to_ase(materials_by_name[name])\n", - " atoms.set_constraint(FixAtoms(indices=interior_indices[name]))\n", " atoms.calc = calculator\n", " random_generator = np.random.default_rng(ANNEAL_SEED)\n", " MaxwellBoltzmannDistribution(atoms, temperature_K=ANNEAL_START_TEMPERATURE, rng=random_generator)\n", @@ -546,8 +548,7 @@ "\n", "relaxed_superlattices = {}\n", "for name, superlattice in unrelaxed_superlattices.items():\n", - " relaxed_superlattices[name] = relax_material(superlattice, calculator, fmax=RELAXATION_FORCE_THRESHOLD,\n", - " fixed_atom_indices=interior_indices[name])\n", + " relaxed_superlattices[name] = relax_material(superlattice, calculator, fmax=RELAXATION_FORCE_THRESHOLD)\n", " relaxed_superlattices[name].name = f\"{name} relaxed\"" ] }, From a7d4b8323acb116a7288c1825395495f36192d7e Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 16:41:25 -0800 Subject: [PATCH 06/11] SOF-8097: pin made #308 and standata #173 at their main merges Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e47864a68..880511b34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ jupyterlite = [ ] utils_standata = [ "mat3ra-utils", - "mat3ra-standata", + "mat3ra-standata @ git+https://github.com/mat3ra/standata.git@0086c44c7792f31ead7f7f9928bc34bf67d3792e", # standata #173; unpin on release ] api = [ "mat3ra-api-client>=2026.11.4.post0", @@ -36,7 +36,7 @@ materials = [ "mat3ra-notebooks-utils[utils_standata]", "pymatgen==2024.4.13", "pymatgen-analysis-defects<=2024.4.23", - "mat3ra-made", + "mat3ra-made @ git+https://github.com/mat3ra/made.git@12146cf552564f4b066ad5c629a7240e7ca1114a", # made #308; unpin on release "mat3ra-periodic-table" ] workflows = [ From 7b197e2b075857ebfc0b735e6f86afc4fbf9ad74 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 20:07:10 -0800 Subject: [PATCH 07/11] SOF-8097: SiO2/HfO2 monoclinic HfO2 slab with made's default termination, as the stack notebook Co-Authored-By: Claude Opus 5.5 --- .../interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb index deb75179b..e542369ad 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb @@ -67,7 +67,6 @@ "\n", "MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS = 5 # two SiO2 layers each: 10\n", "MONOCLINIC_FILM_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8, of which one is removed\n", - "MONOCLINIC_FILM_TERMINATION_FORMULA = \"Hf_P2/m_1\" # the slab from one O below the first Hf layer to one O above the last\n", "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_TOP = 2 # with the lowest O, one HfO2 layer; three O stay at each interface\n", "\n", @@ -168,7 +167,6 @@ "monoclinic_substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", " number_of_layers=MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", "monoclinic_film_slab = create_slab(monoclinic_film, FILM_MILLER_INDICES,\n", - " termination_top_formula=MONOCLINIC_FILM_TERMINATION_FORMULA,\n", " number_of_layers=MONOCLINIC_FILM_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", "monoclinic_superlattice = create_interface_zsl_between_slabs(\n", " substrate_slab=monoclinic_substrate_slab, film_slab=monoclinic_film_slab, gap=INTERFACE_DISTANCE, vacuum=VACUUM,\n", From 4e4f50bd36571c75178f5547026698bee5d50caf Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 21:26:55 -0800 Subject: [PATCH 08/11] SOF-8097: pin made #308 at 47b54d92 Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 880511b34..4427f13eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ materials = [ "mat3ra-notebooks-utils[utils_standata]", "pymatgen==2024.4.13", "pymatgen-analysis-defects<=2024.4.23", - "mat3ra-made @ git+https://github.com/mat3ra/made.git@12146cf552564f4b066ad5c629a7240e7ca1114a", # made #308; unpin on release + "mat3ra-made @ git+https://github.com/mat3ra/made.git@47b54d9214d729ffdc6f0b2c99c72b3b6981fd20", # made #308; unpin on release "mat3ra-periodic-table" ] workflows = [ From 232863013335d8c9dd8019cf5ba8ed403a937e06 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 21:37:29 -0800 Subject: [PATCH 09/11] SOF-8097: remove the SiO2/HfO2-only notebooks; the stack notebooks build and compute both models Co-Authored-By: Claude Opus 5.5 --- .../specific_examples/Introduction.ipynb | 1 - ...d_3d_silicon_dioxide_hafnium_dioxide.ipynb | 378 -------- ...n_dioxide_hafnium_dioxide_SIMULATION.ipynb | 846 ------------------ 3 files changed, 1225 deletions(-) delete mode 100644 other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb delete mode 100644 other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb diff --git a/other/materials_designer/specific_examples/Introduction.ipynb b/other/materials_designer/specific_examples/Introduction.ipynb index 6dda4163c..c7b385bab 100644 --- a/other/materials_designer/specific_examples/Introduction.ipynb +++ b/other/materials_designer/specific_examples/Introduction.ipynb @@ -29,7 +29,6 @@ "| `C-2D-INT-Z` | Interface ZSL | [Graphene/SiO₂ 2D–3D Interface](interface_2d_3d_graphene_silicon_dioxide.ipynb) | *To be added* | [[5]](#ref5) |\n", "| `C-2D-INT-Z` | Interface ZSL | [Cu/Cristobalite 3D–3D Interface](interface_3d_3d_copper_cristobalite.ipynb) | *To be added* | [[6]](#ref6) |\n", "| `C-2D-INT-Z` | Interface ZSL | [Graphene/Ni Interface Film XY Position Optimization](optimization_interface_film_xy_position_graphene_nickel.ipynb) | [Gr/Ni(111) Registry and Work of Adhesion](optimization_interface_film_xy_position_graphene_nickel_SIMULATION.ipynb) | [[7]](#ref7) |\n", - "| `C-2D-INT-Z` | Interface ZSL | [SiO₂/HfO₂ (001) Interfaces](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb) | [SiO₂/HfO₂ (001) Valence Band Offset](interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb) | [[27]](#ref27), [[28]](#ref28) |\n", "| `C-2D-INT-T` | Interface Twisted | *To be added* | — | — |\n", "| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate MoS₂ Bilayer](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb) | [Twisted MoS₂ Bilayer Band Structure](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide_SIMULATION.ipynb) | [[8]](#ref8) |\n", "| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate h-BN Bilayer](interface_bilayer_twisted_commensurate_lattices_boron_nitride.ipynb) | [Twisted h-BN Bilayer Flat Bands](interface_bilayer_twisted_commensurate_lattices_boron_nitride_SIMULATION.ipynb) | [[9]](#ref9) |\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb deleted file mode 100644 index e542369ad..000000000 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb +++ /dev/null @@ -1,378 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "0", - "metadata": {}, - "source": [ - "# SiO2/HfO2 (001) Superlattices with Monoclinic and Cubic HfO2\n", - "\n", - "## 0. Introduction\n", - "\n", - "This tutorial builds two SiO₂/HfO₂ (001) superlattices and their bulk reference cells after the publications:\n", - "\n", - "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", - "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", - "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", - "\n", - "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", - "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", - "\n", - "SiO₂ is ideal β-cristobalite (C9) and is the in-plane reference: its (001) face is the 5.23 × 5.23 Ų square cell,\n", - "turned 45° from the cubic cell, and HfO₂ is strained onto it. Both superlattices are periodic along [001] without\n", - "vacuum, so each has two SiO₂/HfO₂ interfaces.\n", - "\n", - "- **Monoclinic HfO₂** (P2₁/c), as in the first publication: ten SiO₂ layers (one Si each) and seven HfO₂ layers (two\n", - " Hf each), Hf₁₄Si₁₀O₄₈. Each interface carries three O between the last Si and the first Hf. The publication\n", - " stretches HfO₂ by 3.7 % along [100] and 2.1 % along [010] from its own lattice; here the strain follows from the\n", - " Standata lattices.\n", - "- **Cubic HfO₂** (Fm-3m), the model of the second publication, built after Sharia et al. [3]: twelve SiO₂ and six\n", - " HfO₂ layers, Hf₁₂Si₁₂O₄₈. Each interface plane carries three O: two bridge Si and Hf, one is bonded to Hf only, so\n", - " no Si–O bond is broken.\n", - "\n", - "Neither publication gives the separation of the two blocks: the builder sets the same distance between the facing\n", - "atomic planes at both interfaces, and both publications relax the atomic positions afterwards.\n", - "\n", - "The valence band offsets are computed from the superlattices and from bulk cells with the same in-plane lattice, so\n", - "all five materials are saved:\n", - "[the simulation notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb) loads them by name." - ] - }, - { - "cell_type": "markdown", - "id": "1", - "metadata": {}, - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up the parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2", - "metadata": {}, - "outputs": [], - "source": [ - "SUBSTRATE_NAME = \"mp-8352\" # SiO2, beta-cristobalite (C9), Standata\n", - "MONOCLINIC_FILM_NAME = \"mp-352\" # HfO2, monoclinic, Standata\n", - "CUBIC_FILM_NAME = \"mp-550893\" # HfO2, cubic, Standata\n", - "\n", - "SUBSTRATE_MILLER_INDICES = (1, 1, 0) # in the primitive cell: the (001) face, 5.23 Å square\n", - "FILM_MILLER_INDICES = (0, 0, 1)\n", - "# in Angstrom, between the facing atomic planes at both interfaces: about the spacing of an O plane and the next\n", - "# cation plane along [001] in the two oxides (0.92 Å in beta-cristobalite, 1.26 Å in cubic HfO2)\n", - "INTERFACE_DISTANCE = 1.0\n", - "VACUUM = 0.0 # in Angstrom: periodic along the stacking axis\n", - "\n", - "MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS = 5 # two SiO2 layers each: 10\n", - "MONOCLINIC_FILM_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8, of which one is removed\n", - "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # the lowest O\n", - "MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_TOP = 2 # with the lowest O, one HfO2 layer; three O stay at each interface\n", - "\n", - "CUBIC_SUBSTRATE_NUMBER_OF_LAYERS = 6 # two SiO2 layers each: 12\n", - "CUBIC_FILM_NUMBER_OF_LAYERS = 3 # two HfO2 layers each: 6\n", - "CUBIC_FILM_XY_SHIFT = (0, 0.25) # fractions of the in-plane cell: SiO2 interface O on HfO2 O sites\n", - "SILICON_OXYGEN_BOND_CUTOFF = 2.0 # in Angstrom, between the Si–O bonds (1.6–1.7 Å) and the next Si–O distance (3.1 Å)\n", - "\n", - "SUBSTRATE_BULK_NUMBER_OF_LAYERS = 2 # one beta-cristobalite period along [001]\n", - "\n", - "MAX_LENGTH_TOLERANCE = 0.05 # admits the 4 % mismatch of cubic HfO2\n", - "\n", - "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", - "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", - "SUBSTRATE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", - "MONOCLINIC_FILM_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", - "CUBIC_FILM_BULK_NAME = \"HfO2 cubic (001) bulk strained\"" - ] - }, - { - "cell_type": "markdown", - "id": "3", - "metadata": {}, - "source": [ - "### 1.2. Install Packages\n", - "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install` (see [README](../../README.ipynb))." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.packages import install_packages\n", - "\n", - "await install_packages(\"made|specific_examples\")" - ] - }, - { - "cell_type": "markdown", - "id": "5", - "metadata": {}, - "source": [ - "### 1.3. Load the materials\n", - "\n", - "The SiO₂ slab is cut from the primitive cell, where the Miller indices (1, 1, 0) select the cubic (001) face in the\n", - "45° cell. The interface builder strains HfO₂ onto it and re-creates its slabs from the bulk, so layer counts and atoms\n", - "are changed on the built superlattice." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.material import Material\n", - "from mat3ra.made.tools.helpers import (create_interface_zsl_between_slabs, create_slab,\n", - " get_material_with_conventional_lattice)\n", - "from mat3ra.standata.materials import Materials\n", - "\n", - "substrate = Material.create(Materials.get_by_name_first_match(SUBSTRATE_NAME))\n", - "monoclinic_film = get_material_with_conventional_lattice(\n", - " Material.create(Materials.get_by_name_first_match(MONOCLINIC_FILM_NAME)))\n", - "cubic_film = get_material_with_conventional_lattice(Material.create(Materials.get_by_name_first_match(CUBIC_FILM_NAME)))" - ] - }, - { - "cell_type": "markdown", - "id": "7", - "metadata": {}, - "source": [ - "## 2. Create the Superlattice with Monoclinic HfO₂\n", - "\n", - "The slab builder counts monoclinic (001) layers in pairs, so eight HfO₂ layers are built and one is removed. The\n", - "HfO₂ block as built ends in two O on each side; the block kept is one O higher, so it ends in one O against the\n", - "SiO₂ O plane and in three O against the SiO₂ Si. Each interface then carries three O, and the cell stays\n", - "stoichiometric. The kept block stays where the builder placed it, and the cell is shortened to the interface distance\n", - "across its boundary. The in-plane registry of the two blocks is not given in the publication; the builder's default is\n", - "kept." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n", - "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", - "from mat3ra.made.tools.modify import filter_by_ids\n", - "from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction\n", - "\n", - "monoclinic_substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", - " number_of_layers=MONOCLINIC_SUBSTRATE_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", - "monoclinic_film_slab = create_slab(monoclinic_film, FILM_MILLER_INDICES,\n", - " number_of_layers=MONOCLINIC_FILM_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", - "monoclinic_superlattice = create_interface_zsl_between_slabs(\n", - " substrate_slab=monoclinic_substrate_slab, film_slab=monoclinic_film_slab, gap=INTERFACE_DISTANCE, vacuum=VACUUM,\n", - " max_length_tol=MAX_LENGTH_TOLERANCE)\n", - "\n", - "labels = monoclinic_superlattice.basis.labels.values\n", - "film_layers = [layer for layer in get_atom_indices_by_layer(monoclinic_superlattice)\n", - " if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", - "removed_layers = (film_layers[:MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM]\n", - " + film_layers[-MONOCLINIC_FILM_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", - "monoclinic_superlattice = filter_by_ids(monoclinic_superlattice, [index for layer in removed_layers for index in layer],\n", - " invert=True, reset_ids=True)\n", - "monoclinic_superlattice = adjust_material_cell_to_set_gap_along_direction(monoclinic_superlattice, INTERFACE_DISTANCE)" - ] - }, - { - "cell_type": "markdown", - "id": "9", - "metadata": {}, - "source": [ - "## 3. Create the Superlattice with Cubic HfO₂\n", - "### 3.1. Stack the slabs\n", - "\n", - "The HfO₂ film is shifted in plane by a quarter of the cell, so that the O of SiO₂ at the interface sit on O sites of\n", - "HfO₂. As built, one interface plane is an HfO₂ O plane with four O, two of them bonded to the Si above, and the other\n", - "is the SiO₂ O plane with two O." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "10", - "metadata": {}, - "outputs": [], - "source": [ - "cubic_substrate_slab = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", - " number_of_layers=CUBIC_SUBSTRATE_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", - "cubic_film_slab = create_slab(cubic_film, FILM_MILLER_INDICES, number_of_layers=CUBIC_FILM_NUMBER_OF_LAYERS,\n", - " vacuum=VACUUM)\n", - "cubic_superlattice = create_interface_zsl_between_slabs(\n", - " substrate_slab=cubic_substrate_slab, film_slab=cubic_film_slab, gap=INTERFACE_DISTANCE, vacuum=VACUUM,\n", - " max_length_tol=MAX_LENGTH_TOLERANCE,\n", - " xy_shift=[CUBIC_FILM_XY_SHIFT[0] * cubic_substrate_slab.lattice.a,\n", - " CUBIC_FILM_XY_SHIFT[1] * cubic_substrate_slab.lattice.b])" - ] - }, - { - "cell_type": "markdown", - "id": "11", - "metadata": {}, - "source": [ - "### 3.2. Move one O to the other interface\n", - "\n", - "The four-O plane is the top atomic layer of the cell, below the SiO₂ Si across the cell boundary; the two-O plane is\n", - "the top layer of SiO₂. The first O of the four-O plane that is not bonded to that Si is removed, and an O is added at\n", - "the same in-plane position in the two-O plane. Each interface plane then carries three O, two bonded to Si and Hf and\n", - "one to Hf only: the structure of Sharia et al., who remove a different O from each of two four-O interface planes." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "12", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.tools.analyze.other import get_atom_indices_within_radius_pbc\n", - "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", - "from mat3ra.made.tools.helpers import create_multiple_defects\n", - "\n", - "layers = get_atom_indices_by_layer(cubic_superlattice)\n", - "labels = cubic_superlattice.basis.labels.values\n", - "silicon_layer, four_oxygen_plane = layers[0], layers[-1]\n", - "two_oxygen_plane = [layer for layer in layers if labels[layer[0]] == InterfacePartsEnum.SUBSTRATE.value][-1]\n", - "silicon_neighbor_ids = get_atom_indices_within_radius_pbc(cubic_superlattice, atom_index=silicon_layer[0],\n", - " radius=SILICON_OXYGEN_BOND_CUTOFF)\n", - "coordinates = cubic_superlattice.basis.coordinates.values\n", - "removed_coordinate = coordinates[[index for index in four_oxygen_plane if index not in silicon_neighbor_ids][0]]\n", - "added_coordinate = [*removed_coordinate[:2], coordinates[two_oxygen_plane[0]][2]]\n", - "\n", - "cubic_superlattice = create_multiple_defects(cubic_superlattice, [\n", - " PointDefectDict(type=\"vacancy\", coordinate=removed_coordinate, placement_method=\"closest_site\"),\n", - " PointDefectDict(type=\"interstitial\", coordinate=added_coordinate, element=\"O\", placement_method=\"exact_coordinate\"),\n", - "])" - ] - }, - { - "cell_type": "markdown", - "id": "13", - "metadata": {}, - "source": [ - "## 4. Create the Bulk Reference Cells\n", - "\n", - "SiO₂ is used as is, one β-cristobalite period along [001] in the 45° cell. Each HfO₂ is strained in plane to the cell\n", - "of its superlattice: a and b take the superlattice's lengths, c and the cell angles are kept, so the (001) layer\n", - "spacing is kept. Atom labels are removed from all five materials: labels break the Quantum ESPRESSO input." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "14", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.tools.operations.reusable.unary import strain_to_match_lattice\n", - "\n", - "substrate_bulk = create_slab(substrate, SUBSTRATE_MILLER_INDICES, use_conventional_cell=False,\n", - " number_of_layers=SUBSTRATE_BULK_NUMBER_OF_LAYERS, vacuum=VACUUM)\n", - "in_plane_lattice = {\"a\": substrate_bulk.lattice.a, \"b\": substrate_bulk.lattice.b}\n", - "monoclinic_film_bulk = strain_to_match_lattice(monoclinic_film, Material.create(\n", - " {**monoclinic_film.to_dict(), \"lattice\": {**monoclinic_film.lattice.to_dict(), **in_plane_lattice}}))\n", - "cubic_film_bulk = strain_to_match_lattice(cubic_film, Material.create(\n", - " {**cubic_film.to_dict(), \"lattice\": {**cubic_film.lattice.to_dict(), **in_plane_lattice}}))\n", - "\n", - "materials = [monoclinic_superlattice, cubic_superlattice, substrate_bulk, monoclinic_film_bulk, cubic_film_bulk]\n", - "names = [MONOCLINIC_SUPERLATTICE_NAME, CUBIC_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME, MONOCLINIC_FILM_BULK_NAME,\n", - " CUBIC_FILM_BULK_NAME]\n", - "for material, name in zip(materials, names):\n", - " material.name = name\n", - " material.set_labels_from_list([])" - ] - }, - { - "cell_type": "markdown", - "id": "15", - "metadata": {}, - "source": [ - "## 5. Visualize the Result(s)\n", - "\n", - "In each superlattice the SiO₂ block is at the bottom of the cell and the HfO₂ block on top; the second interface is\n", - "across the periodic boundary." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "16", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.ipython.entity.material.visualize import visualize_materials\n", - "\n", - "visualize_materials([{\"material\": material, \"title\": material.name, \"rotation\": \"-90x\"} for material in materials],\n", - " repetitions=[2, 2, 1])" - ] - }, - { - "cell_type": "markdown", - "id": "17", - "metadata": {}, - "source": [ - "## 6. Pass data to the outside runtime" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "18", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.material import set_materials\n", - "\n", - "set_materials(materials)" - ] - }, - { - "cell_type": "markdown", - "id": "19", - "metadata": {}, - "source": [ - "## References\n", - "\n", - "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", - "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", - "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", - "\n", - "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", - "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", - "\n", - "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", - "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", - "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)" - ] - } - ], - "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 -} diff --git a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb deleted file mode 100644 index e57ab8bb5..000000000 --- a/other/materials_designer/specific_examples/interface_3d_3d_silicon_dioxide_hafnium_dioxide_SIMULATION.ipynb +++ /dev/null @@ -1,846 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "0", - "metadata": {}, - "source": [ - "# Valence Band Offset of SiO₂/HfO₂ (001) Superlattices with Monoclinic and Cubic HfO₂\n", - "\n", - "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", - "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", - "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", - "\n", - "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", - "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", - "\n", - "Computes the valence band offset of the two SiO₂/HfO₂ (001) superlattices created in the\n", - "[structure notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb), with the platform's\n", - "Valence Band Offset (Bulk Method) workflow on each relaxed superlattice and its two bulk\n", - "cells, and compares each offset with its publication. Each bulk's valence band maximum is measured from its own average\n", - "electrostatic potential V̄, and the superlattice gives the step in V̄ between the two materials:\n", - "\n", - "ΔE_v = (E_VBM − V̄)_SiO₂ − (E_VBM − V̄)_HfO₂ + (V̄_SiO₂ − V̄_HfO₂)_superlattice\n", - "\n", - "ΔE_v is positive when the valence band maximum of SiO₂ lies above that of HfO₂, the sign convention of both\n", - "publications. Both publications use LDA, as this notebook does; the publications' values compared here are LDA\n", - "values, and the G0W0 corrections of Prodhomme et al. to the band edges are not computed.\n", - "\n", - "- **Monoclinic HfO₂**, after Prodhomme et al.: the atomic positions are annealed from 1000 K to 100 K in 1 ps, then\n", - " relaxed, as in the publication.\n", - "- **Cubic HfO₂**, the model of Robertson and Wallace, built after Sharia et al.: the atomic positions are relaxed.\n", - "\n", - "Prodhomme et al. relax with SIESTA; Robertson and Wallace relax in LDA, on the model of Sharia et al.; here the anneal\n", - "and the relaxation use the MACE-MP-0 machine-learned force field, trained on PBE data. Both move only the cation layer\n", - "on each side of an interface and the atoms between them; the block interiors are held at the bulk crystals, so that\n", - "each block centre has the structure of its bulk reference.\n", - "\n", - "

Usage

\n", - "\n", - "1. Create the materials in the [structure notebook](interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb), which saves the two superlattices and their three bulk cells to the `uploads` folder.\n", - "1. Set the material names and parameters in cells 1.2-1.5, 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; the last section prints the comparison with the manuscripts.\n", - "\n", - "## Summary\n", - "\n", - "1. Set up the environment and parameters: install packages (JupyterLite only) and configure the material names, model, anneal, relaxation and compute parameters.\n", - "1. Authenticate and initialize API client: authenticate via browser, initialize the client, then select account and project.\n", - "1. Load the two superlattices and the three bulks by name from the `uploads` folder or the platform, print their composition and geometry.\n", - "1. Configure the DFT model and a k-grid per material.\n", - "1. Configure compute: get the list of clusters and create a compute configuration.\n", - "1. Anneal the monoclinic superlattice with molecular dynamics on the MACE force field.\n", - "1. Relax the atomic positions of both superlattices on the same force field.\n", - "1. Configure the Valence Band Offset (Bulk Method) workflow for each superlattice: the model and a k-grid per material.\n", - "1. Run the jobs, or reuse ones that already ran on the same materials.\n", - "1. Retrieve the valence band offsets and the potential profiles, and plot the potentials with the bulk potentials overlaid.\n", - "1. Compare with the manuscripts." - ] - }, - { - "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.calculators.mlff import get_mlff_install_profiles\n", - "from mat3ra.notebooks_utils.packages import install_packages\n", - "\n", - "await install_packages(get_mlff_install_profiles(\"mace\"))\n", - "\n", - "from mat3ra.notebooks_utils.pyodide.packages.patches import apply_all_patches\n", - "\n", - "apply_all_patches(\"mace\")" - ] - }, - { - "cell_type": "markdown", - "id": "3", - "metadata": {}, - "source": [ - "### 1.2. Material names" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4", - "metadata": {}, - "outputs": [], - "source": [ - "# Names saved by interface_3d_3d_silicon_dioxide_hafnium_dioxide.ipynb.\n", - "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", - "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", - "SUBSTRATE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", - "MONOCLINIC_FILM_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", - "CUBIC_FILM_BULK_NAME = \"HfO2 cubic (001) bulk strained\"\n", - "\n", - "FILM_BULK_NAME_BY_SUPERLATTICE_NAME = {\n", - " MONOCLINIC_SUPERLATTICE_NAME: MONOCLINIC_FILM_BULK_NAME,\n", - " CUBIC_SUPERLATTICE_NAME: CUBIC_FILM_BULK_NAME,\n", - "}\n", - "ANNEALED_SUPERLATTICE_NAMES = [MONOCLINIC_SUPERLATTICE_NAME] # annealed before the relaxation, as Prodhomme et al." - ] - }, - { - "cell_type": "markdown", - "id": "5", - "metadata": {}, - "source": [ - "### 1.3. Parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6", - "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", - "\n", - "VBO_WORKFLOW_SEARCH_TERM = \"valence_band_offset_bulk\"\n", - "MY_WORKFLOW_NAME = \"Valence Band Offset (Bulk Method)\"\n", - "APPLICATION_NAME = \"espresso\"\n", - "\n", - "CLUSTER_NAME = None # specify full or partial name i.e. \"cluster-001\" to select\n", - "QUEUE_NAME = QueueName.OR\n", - "PPN = 16 # the OR queue allows at most 16 cores per node\n", - "TIME_LIMIT = \"04:00:00\"\n", - "\n", - "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", - "POLL_INTERVAL = 60 # seconds" - ] - }, - { - "cell_type": "markdown", - "id": "7", - "metadata": {}, - "source": [ - "### 1.4. DFT model parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8", - "metadata": {}, - "outputs": [], - "source": [ - "MODEL_SUBTYPE = \"lda\"\n", - "FUNCTIONAL = \"pz\" # both publications use LDA\n", - "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Hf, Si and O\n", - "BLOCK_LABEL = {\n", - " SUBSTRATE_BULK_NAME: \"SiO₂\", MONOCLINIC_FILM_BULK_NAME: \"monoclinic HfO₂\", CUBIC_FILM_BULK_NAME: \"cubic HfO₂\"\n", - "}\n", - "BLOCK_CATION = {SUBSTRATE_BULK_NAME: \"Si\", MONOCLINIC_FILM_BULK_NAME: \"Hf\", CUBIC_FILM_BULK_NAME: \"Hf\"} # marks a block\n", - "ECUTWFC = 40 # Ry, GBRV's recommended wavefunction cutoff\n", - "ECUTRHO = 200 # Ry, GBRV's recommended charge-density cutoff\n", - "ADDITIONAL_PARAMETERS = {\n", - " # Hf, the third species of the superlattices: its GBRV atomic density holds 10 of its 12 valence electrons;\n", - " # scaled by (12 + 2.4) / 12, the starting density is neutral in both blocks\n", - " \"system\": {\"starting_charge(3)\": -2.4},\n", - " # the long cells need local-TF mixing with a long history to converge\n", - " \"electrons\": {\"mixing_mode\": \"local-TF\", \"mixing_beta\": 0.2, \"mixing_ndim\": 20, \"electron_maxstep\": 200},\n", - "}\n", - "KPOINT_DENSITY = 3.5 # points per Å⁻¹, for the bulks\n", - "SUPERLATTICE_KGRID = [4, 4, 1] # Sharia et al.\n", - "\n", - "SCF_UNIT = \"pw_scf\"\n", - "BANDS_UNIT = \"pw_bands\"\n", - "AVERAGE_FLOWCHART_IDS = [ # average ESP units of the valence_band_offset_bulk workflow: superlattice, SiO₂, HfO₂\n", - " \"average-electrostatic-potential\", \"average-electrostatic-potential-left\", \"average-electrostatic-potential-right\"\n", - "]" - ] - }, - { - "cell_type": "markdown", - "id": "9", - "metadata": {}, - "source": [ - "### 1.5. Anneal and relaxation parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "10", - "metadata": {}, - "outputs": [], - "source": [ - "MACE_MODEL_FAMILY = \"MACE-MP-0\"\n", - "MACE_MODEL = \"large\"\n", - "MACE_DISPERSION = False\n", - "MACE_DEFAULT_DTYPE = \"float32\"\n", - "MACE_DEVICE = \"cpu\"\n", - "\n", - "ANNEAL_START_TEMPERATURE = 1000 # K\n", - "ANNEAL_END_TEMPERATURE = 100 # K\n", - "ANNEAL_DURATION = 1000 # fs\n", - "ANNEAL_TIMESTEP = 1 # fs\n", - "ANNEAL_FRICTION = 0.01 # 1/fs, Langevin thermostat\n", - "ANNEAL_SEED = 42 # initial velocities and thermostat noise\n", - "ANNEAL_LOG_INTERVAL = 100 # steps\n", - "RELAXATION_FORCE_THRESHOLD = 0.07 # eV/Å, the force threshold of Prodhomme et al.\n", - "INTERFACE_CATION_LAYERS = 1 # on each side of an interface; these and the atoms between them move, all others are fixed" - ] - }, - { - "cell_type": "markdown", - "id": "11", - "metadata": {}, - "source": [ - "## 2. Authenticate and initialize API client\n", - "### 2.1. Authenticate" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "12", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.auth import authenticate\n", - "\n", - "await authenticate()" - ] - }, - { - "cell_type": "markdown", - "id": "13", - "metadata": {}, - "source": [ - "### 2.2. Initialize API client" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "14", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.api_client import APIClient\n", - "\n", - "client = APIClient.authenticate()\n", - "client" - ] - }, - { - "cell_type": "markdown", - "id": "15", - "metadata": {}, - "source": [ - "### 2.3. Select account" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "16", - "metadata": {}, - "outputs": [], - "source": [ - "client.list_accounts()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "17", - "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": "18", - "metadata": {}, - "source": [ - "### 2.4. Select project" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "19", - "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": "20", - "metadata": {}, - "source": [ - "## 3. Load the materials\n", - "### 3.1. Load from the uploads folder and print composition and geometry\n", - "\n", - "Both superlattices are periodic along [001], with two SiO₂/HfO₂ interfaces each; HfO₂ is strained in plane to the\n", - "5.23 Å cell of SiO₂, and each HfO₂ bulk cell carries the same strain." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "21", - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "from collections import Counter\n", - "from mat3ra.notebooks_utils.core.entity.material.api import load_material\n", - "\n", - "MATERIAL_NAMES = [*FILM_BULK_NAME_BY_SUPERLATTICE_NAME, SUBSTRATE_BULK_NAME,\n", - " *FILM_BULK_NAME_BY_SUPERLATTICE_NAME.values()]\n", - "materials_by_name = {name: load_material(client, FOLDER, name, ACCOUNT_ID) for name in MATERIAL_NAMES}\n", - "\n", - "for name, material in materials_by_name.items():\n", - " lattice = material.lattice\n", - " print(f\"{name}: {dict(Counter(material.basis.elements.values))}, {material.basis.number_of_atoms} atoms, \"\n", - " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å\")" - ] - }, - { - "cell_type": "markdown", - "id": "22", - "metadata": {}, - "source": [ - "## 4. Configure the DFT model and k-grid\n", - "### 4.1. DFT model" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "23", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.standata.applications import ApplicationStandata\n", - "from mat3ra.standata.model_tree import ModelTreeStandata\n", - "from mat3ra.ade.application import Application\n", - "from mat3ra.mode import ModelFactory\n", - "\n", - "app_config = ApplicationStandata.get_by_name_first_match(APPLICATION_NAME)\n", - "app = Application(**app_config)\n", - "\n", - "model_config = ModelTreeStandata.get_model_by_parameters(type=\"dft\", subtype=MODEL_SUBTYPE, functional=FUNCTIONAL)\n", - "model_config[\"method\"] = {\"type\": \"pseudopotential\", \"subtype\": PSEUDOPOTENTIAL_TYPE}\n", - "model = ModelFactory.create(model_config)\n", - "print(f\"Using application: {app.name}, model: {MODEL_SUBTYPE} {FUNCTIONAL}, {PSEUDOPOTENTIAL_TYPE} pseudopotentials\")" - ] - }, - { - "cell_type": "markdown", - "id": "24", - "metadata": {}, - "source": [ - "### 4.2. k-grid per material" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "25", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.workflow import kgrid_from_density\n", - "\n", - "kgrid = {name: kgrid_from_density(material, KPOINT_DENSITY) for name, material in materials_by_name.items()}\n", - "kgrid.update({name: SUPERLATTICE_KGRID for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME})\n", - "for name, grid in kgrid.items():\n", - " print(f\"{name}: k-grid {grid}\")" - ] - }, - { - "cell_type": "markdown", - "id": "26", - "metadata": {}, - "source": [ - "## 5. Create the compute configuration\n", - "### 5.1. Select cluster" - ] - }, - { - "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. Anneal the monoclinic superlattice\n", - "\n", - "Molecular dynamics at fixed cell: velocities are drawn at the start temperature, and the thermostat temperature is\n", - "lowered at every step, linearly to the end temperature. The annealed structure is the starting point of the relaxation." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "31", - "metadata": {}, - "outputs": [], - "source": [ - "from ase import units\n", - "from ase.md import MDLogger\n", - "from ase.md.langevin import Langevin\n", - "from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n", - "from mat3ra.code.array_with_ids import ArrayWithIds\n", - "from mat3ra.esse.models.properties_directory.enum_options import ProtoPropertyEnum\n", - "from mat3ra.made.material import Material\n", - "from mat3ra.made.tools.convert import from_ase, to_ase\n", - "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", - "from mat3ra.notebooks_utils.calculators.mlff import create_mlff_calculator\n", - "\n", - "calculator = create_mlff_calculator(\n", - " \"mace\",\n", - " {\n", - " \"family\": MACE_MODEL_FAMILY,\n", - " \"model\": MACE_MODEL,\n", - " \"dispersion\": MACE_DISPERSION,\n", - " \"default_dtype\": MACE_DEFAULT_DTYPE,\n", - " \"device\": MACE_DEVICE,\n", - " },\n", - ")\n", - "temperatures = np.linspace(ANNEAL_START_TEMPERATURE, ANNEAL_END_TEMPERATURE, round(ANNEAL_DURATION / ANNEAL_TIMESTEP))\n", - "\n", - "\n", - "def get_interior_indices(superlattice, cations):\n", - " \"\"\"Atoms of each block, marked by its cation, between the block's outermost cation layers.\"\"\"\n", - " layers = get_atom_indices_by_layer(superlattice)\n", - " elements = superlattice.basis.elements.values\n", - " interior_indices = []\n", - " for cation in cations:\n", - " cation_layers = [index for index, layer in enumerate(layers) if cation in [elements[atom] for atom in layer]]\n", - " for layer in layers[cation_layers[INTERFACE_CATION_LAYERS - 1] + 1:cation_layers[-INTERFACE_CATION_LAYERS]]:\n", - " interior_indices.extend(layer)\n", - " return interior_indices\n", - "\n", - "\n", - "interior_indices = {\n", - " name: get_interior_indices(materials_by_name[name], [BLOCK_CATION[SUBSTRATE_BULK_NAME], BLOCK_CATION[bulk_name]])\n", - " for name, bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items()\n", - "}\n", - "\n", - "unrelaxed_superlattices = {name: materials_by_name[name] for name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME}\n", - "for name, superlattice in unrelaxed_superlattices.items():\n", - " superlattice.basis.atomic_properties.set_by_name(ProtoPropertyEnum.atomic_constraints, ArrayWithIds.from_values([[index not in interior_indices[name]] * 3 for index in range(superlattice.basis.number_of_atoms)]))\n", - "for name in ANNEALED_SUPERLATTICE_NAMES:\n", - " atoms = to_ase(materials_by_name[name])\n", - " atoms.calc = calculator\n", - " random_generator = np.random.default_rng(ANNEAL_SEED)\n", - " MaxwellBoltzmannDistribution(atoms, temperature_K=ANNEAL_START_TEMPERATURE, rng=random_generator)\n", - " dynamics = Langevin(atoms, ANNEAL_TIMESTEP * units.fs, temperature_K=ANNEAL_START_TEMPERATURE,\n", - " friction=ANNEAL_FRICTION / units.fs, rng=random_generator)\n", - " dynamics.attach(MDLogger(dynamics, atoms, \"-\", peratom=False), interval=ANNEAL_LOG_INTERVAL)\n", - " for temperature in temperatures:\n", - " dynamics.set_temperature(temperature_K=temperature)\n", - " dynamics.run(1)\n", - " unrelaxed_superlattices[name] = Material.create(from_ase(atoms))" - ] - }, - { - "cell_type": "markdown", - "id": "32", - "metadata": {}, - "source": [ - "## 7. Relax the superlattices\n", - "\n", - "Fixed-cell relaxation of the atomic positions on the same force field, to the force threshold of Prodhomme et al.; the\n", - "monoclinic superlattice starts from its annealed structure. Each relaxed superlattice is named ` relaxed`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "33", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.workflows.relaxation import relax_material\n", - "\n", - "relaxed_superlattices = {}\n", - "for name, superlattice in unrelaxed_superlattices.items():\n", - " relaxed_superlattices[name] = relax_material(superlattice, calculator, fmax=RELAXATION_FORCE_THRESHOLD)\n", - " relaxed_superlattices[name].name = f\"{name} relaxed\"" - ] - }, - { - "cell_type": "markdown", - "id": "34", - "metadata": {}, - "source": [ - "## 8. Configure the Valence Band Offset (Bulk Method) workflow\n", - "\n", - "The workflow computes the electrostatic potential of the superlattice, the band structure and electrostatic potential\n", - "of the two bulks, each material on its own k-grid, and from these the offset. One workflow is configured per\n", - "superlattice." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "35", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.standata.workflows import WorkflowStandata\n", - "from mat3ra.wode.context.providers import PointsGridDataProvider\n", - "from mat3ra.wode.workflows import Workflow\n", - "from mat3ra.notebooks_utils.ipython.entity.workflow.visualize import visualize_workflow\n", - "from mat3ra.notebooks_utils.workflow import apply_planewave_cutoffs, patch_workflow_qe_input\n", - "\n", - "job_material_names, job_materials, workflows = {}, {}, {}\n", - "for name, film_bulk_name in FILM_BULK_NAME_BY_SUPERLATTICE_NAME.items():\n", - " job_material_names[name] = [name, SUBSTRATE_BULK_NAME, film_bulk_name]\n", - " job_materials[name] = [relaxed_superlattices[name], materials_by_name[SUBSTRATE_BULK_NAME],\n", - " materials_by_name[film_bulk_name]]\n", - " workflow = Workflow.create(\n", - " WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(VBO_WORKFLOW_SEARCH_TERM)\n", - " )\n", - " workflow.name = MY_WORKFLOW_NAME\n", - " for unit_name in [SCF_UNIT, BANDS_UNIT]:\n", - " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", - " for subworkflow in workflow.subworkflows:\n", - " if subworkflow.application.name != APPLICATION_NAME:\n", - " continue\n", - " subworkflow.model = model\n", - " # the superlattice subworkflow has no \"Set Material Index\" unit: it runs on material 0\n", - " material_index = int(next((unit.value for unit in subworkflow.units\n", - " if unit.name.startswith(\"Set Material Index\")), 0))\n", - " material_name = job_material_names[name][material_index]\n", - " scf_unit = subworkflow.get_unit_by_name(name=SCF_UNIT)\n", - " kgrid_context = PointsGridDataProvider(material=job_materials[name][material_index],\n", - " dimensions=kgrid[material_name], isEdited=True).get_context_item_data()\n", - " scf_unit.add_context(kgrid_context)\n", - " subworkflow.set_unit(scf_unit)\n", - "\n", - " patch_workflow_qe_input(workflow, ADDITIONAL_PARAMETERS, unit_names=[SCF_UNIT])\n", - " workflows[name] = workflow\n", - "visualize_workflow(workflow)" - ] - }, - { - "cell_type": "markdown", - "id": "36", - "metadata": {}, - "source": [ - "## 9. Save the materials and run the jobs\n", - "\n", - "For each superlattice, a job that already ran on the same three materials is reused; otherwise a new one is created\n", - "and submitted. One job runs at a time." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "37", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.notebooks_utils.core.entity.job.api import get_kgrid_query\n", - "from mat3ra.notebooks_utils.core.entity.material.api import get_or_create_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 name, workflow in workflows.items():\n", - " saved_materials = [get_or_create_material(client, material, ACCOUNT_ID) for material in job_materials[name]]\n", - " material_ids = [material[\"_id\"] for material in saved_materials]\n", - " candidates = client.jobs.list({\n", - " \"_material._id\": material_ids[0], \"owner._id\": ACCOUNT_ID, \"workflow.name\": workflow.name,\n", - " \"status\": {\"$in\": [\"submitted\", \"queued\", \"active\", \"finished\"]}, **get_kgrid_query(kgrid[name], SCF_UNIT),\n", - " })\n", - " job = next((candidate for candidate in candidates\n", - " if [material[\"_id\"] for material in candidate[\"_materials\"]] == material_ids), None)\n", - " if job is None:\n", - " job = create_job(api_client=client, materials=saved_materials, workflow=workflow, project_id=project_id,\n", - " owner_id=ACCOUNT_ID, compute=compute.to_dict(), prefix=f\"{workflow.name} {name} {timestamp}\")\n", - " submit_jobs(client.jobs, [job[\"_id\"]])\n", - " print(f\"✅ Submitted job {job['_id']}\")\n", - " else:\n", - " print(f\"♻️ Reusing job {job['_id']}\")\n", - " await wait_for_jobs_to_finish_async(client.jobs, [job[\"_id\"]], poll_interval=POLL_INTERVAL)\n", - " job_ids[name] = job[\"_id\"]" - ] - }, - { - "cell_type": "markdown", - "id": "38", - "metadata": {}, - "source": [ - "## 10. Retrieve the results\n", - "### 10.1. Valence band offsets\n", - "\n", - "The workflow's last step computes ΔE_v with E_VBM from each bulk's band structure and V̄ of a bulk as the mean of its\n", - "planar-averaged electrostatic potential. In the superlattice, V̄ is read at the centre of each block, the bulk-like\n", - "region far from both interfaces, from the planar average smoothed by a double convolution with the two bulks' (001)\n", - "layer spacings, as in Prodhomme et al. The offset is stored with the job as its valence band offset property." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "39", - "metadata": {}, - "outputs": [], - "source": [ - "valence_band_offset_by_superlattice_name = {\n", - " name: client.properties.get_for_job(job_id, property_name=\"valence_band_offset\")[0][\"value\"]\n", - " for name, job_id in job_ids.items()\n", - "}" - ] - }, - { - "cell_type": "markdown", - "id": "40", - "metadata": {}, - "source": [ - "### 10.2. Potential across the superlattices\n", - "\n", - "One cell along [001] from its origin, the first SiO₂ layer: SiO₂ on the left, HfO₂ on the right. Each block spans its\n", - "(001) cation layers; each bulk's own potential (dotted) is overlaid on its block, aligned on the first cation layer\n", - "and shifted to the block's average over one (001) layer, one period of the potential, at the block's centre: the\n", - "one-layer average used for the overlay (dashed). Where the curves coincide, the block is bulk-like." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "41", - "metadata": {}, - "outputs": [], - "source": [ - "profiles = {\n", - " name: {\n", - " material_name: client.properties.get_for_job(job_id, property_name=\"average_potential_profile\",\n", - " unit_id=flowchart_id)[0]\n", - " for material_name, flowchart_id in zip(job_material_names[name], AVERAGE_FLOWCHART_IDS)\n", - " }\n", - " for name, job_id in job_ids.items()\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "42", - "metadata": {}, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt\n", - "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", - "\n", - "\n", - "def get_cation_layer_fractions(material, cation):\n", - " \"\"\"Crystal coordinates along c of the (001) layers that hold the cation, bottom first.\"\"\"\n", - " elements, coordinates = material.basis.elements.values, material.basis.coordinates.values\n", - " return [np.mean([coordinates[index][2] for index in layer if elements[index] == cation])\n", - " for layer in get_atom_indices_by_layer(material) if cation in [elements[index] for index in layer]]\n", - "\n", - "\n", - "figure, axes = plt.subplots(len(job_ids), 1, figsize=(10, 5 * len(job_ids)), squeeze=False)\n", - "for axis, (name, (_, substrate_bulk_name, film_bulk_name)) in zip(axes[:, 0], job_material_names.items()):\n", - " period = materials_by_name[name].lattice.c\n", - " positions = np.array(profiles[name][name][\"xDataArray\"])\n", - " planar_average = np.array(profiles[name][name][\"yDataSeries\"][0])\n", - " axis.plot(positions, planar_average, color=\"black\", label=\"superlattice\")\n", - " for bulk_name, color in ((substrate_bulk_name, \"tab:blue\"), (film_bulk_name, \"tab:red\")):\n", - " cation = BLOCK_CATION[bulk_name]\n", - " layer_heights = [fraction * period for fraction in get_cation_layer_fractions(materials_by_name[name], cation)]\n", - " spacing = (layer_heights[-1] - layer_heights[0]) / (len(layer_heights) - 1)\n", - " center = (layer_heights[0] + layer_heights[-1]) / 2\n", - " block_potential = planar_average[np.abs(positions - center) <= spacing / 2].mean()\n", - " region = np.linspace(layer_heights[0] - spacing / 2, layer_heights[-1] + spacing / 2, 400)\n", - " bulk_profile = profiles[name][bulk_name]\n", - " profile_length = len(bulk_profile[\"xDataArray\"]) * bulk_profile[\"xDataArray\"][1] # one bulk cell\n", - " bulk_layer_fractions = get_cation_layer_fractions(materials_by_name[bulk_name], cation)\n", - " bulk_fractions = (region - layer_heights[0]) / (spacing * len(bulk_layer_fractions)) + bulk_layer_fractions[0]\n", - " bulk_values = np.interp(bulk_fractions * profile_length, bulk_profile[\"xDataArray\"],\n", - " bulk_profile[\"yDataSeries\"][0], period=profile_length)\n", - " shift = block_potential - np.mean(bulk_profile[\"yDataSeries\"][0])\n", - " axis.plot(region, bulk_values + shift, color=color, linestyle=\":\", linewidth=2,\n", - " label=f\"bulk {BLOCK_LABEL[bulk_name]}, shifted\")\n", - " axis.hlines(block_potential, region[0], region[-1], color=color, linestyle=\"--\",\n", - " label=f\"V̄_{BLOCK_LABEL[bulk_name]} = {block_potential:.3f} eV\")\n", - " axis.text(center, 0.02, BLOCK_LABEL[bulk_name], transform=axis.get_xaxis_transform(), ha=\"center\")\n", - " axis.set_xlim(0, period)\n", - " axis.set_xlabel(\"position along (001) (Å)\")\n", - " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", - " axis.set_title(f\"{name}: ΔE_v = {valence_band_offset_by_superlattice_name[name]:.3f} eV\")\n", - " axis.legend(loc=\"upper right\", fontsize=8)\n", - "figure.tight_layout()\n", - "display_matplotlib_figure(figure)" - ] - }, - { - "cell_type": "markdown", - "id": "43", - "metadata": {}, - "source": [ - "## 11. Compare with the manuscripts\n", - "\n", - "Both publications define the offset as E_VBM(SiO₂) − E_VBM(HfO₂). Robertson and Wallace read it from the densities of\n", - "states of layers away from the interfaces; here both offsets come from the potential line-up, as in Prodhomme et al.\n", - "Settings that differ from the manuscripts: GBRV ultrasoft LDA pseudopotentials in plane waves at 40/200 Ry, against\n", - "the localized orbitals and Troullier–Martins pseudopotentials of Prodhomme et al.; the lattice constants of the\n", - "platform's SiO₂ and HfO₂ structures, so the in-plane strain of monoclinic HfO₂ is smaller than in Prodhomme et al., who\n", - "stretch HfO₂ by 3.7 % along [100] and 2.1 % along [010] onto the 5.23 Å SiO₂ face; the cell length along [001], which\n", - "Sharia et al. relax and which is kept as built here; and the k-points of the bulks, which Prodhomme et al. do not give\n", - "and Sharia et al. set to 8 × 8 × 8. In the monoclinic superlattice, after relaxation, two O at each interface bond to\n", - "both Si and Hf (twofold at one interface, threefold at the other); Prodhomme et al. report three threefold O. The value\n", - "of Robertson and Wallace is read from their Fig. 57a." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "44", - "metadata": {}, - "outputs": [], - "source": [ - "MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME = {\n", - " MONOCLINIC_SUPERLATTICE_NAME: (\"Prodhomme 2011\", 0.4), # eV, LDA, Table I\n", - " CUBIC_SUPERLATTICE_NAME: (\"Robertson and Wallace 2015\", -0.67), # eV, LDA, Fig. 57a\n", - "}\n", - "\n", - "for name, (source, manuscript_offset) in MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME.items():\n", - " film_label = BLOCK_LABEL[FILM_BULK_NAME_BY_SUPERLATTICE_NAME[name]]\n", - " offset = valence_band_offset_by_superlattice_name[name]\n", - " print(f\"VBO, SiO₂/HfO₂ ({film_label}): {source} {manuscript_offset:+} eV | ours {offset:+.2f} eV\")" - ] - }, - { - "cell_type": "markdown", - "id": "45", - "metadata": {}, - "source": [ - "## References\n", - "\n", - "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", - "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", - "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", - "\n", - "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", - "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", - "\n", - "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", - "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", - "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)\n", - "\n", - "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT\n", - "calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053\n", - "\n", - "[5] MACE-MP-0 foundation models: https://github.com/ACEsuit/mace" - ] - } - ], - "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 44ce2920de84edec12379fdaa2586d7702c452de Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 21:37:39 -0800 Subject: [PATCH 10/11] SOF-8097: stack calculation notebook, linked from the Introduction's stack row Co-Authored-By: Claude Opus 5.5 --- .../specific_examples/Introduction.ipynb | 2 +- ..._dioxide_titanium_nitride_SIMULATION.ipynb | 907 ++++++++++++++++++ 2 files changed, 908 insertions(+), 1 deletion(-) create mode 100644 other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb diff --git a/other/materials_designer/specific_examples/Introduction.ipynb b/other/materials_designer/specific_examples/Introduction.ipynb index c7b385bab..be2413729 100644 --- a/other/materials_designer/specific_examples/Introduction.ipynb +++ b/other/materials_designer/specific_examples/Introduction.ipynb @@ -22,7 +22,7 @@ "| `P-1D-NWR` | Nanowire | *To be added* | — | — |\n", "| `P-0D-NPR` | Nanoparticle | [Gold Nanocluster](nanocluster_gold.ipynb) | [Au Cluster Energy per Atom vs Size](nanocluster_gold_SIMULATION.ipynb) | [[2]](#ref2) |\n", "| `P-0D-NRB` | Nanoribbon | *To be added* | — | — |\n", - "| `C-2D-HST` | Heterostack | [Si/SiO₂/HfO₂/TiN Heterostructure](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb) | *To be added* | [[3]](#ref3) |\n", + "| `C-2D-HST` | Heterostack | [Si/SiO₂/HfO₂/TiN Heterostructure](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb) | [Si/SiO₂/HfO₂/TiN Valence Band Offsets](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb) | [[3]](#ref3), [[27]](#ref27), [[28]](#ref28) |\n", "| `C-2D-INT-S` | Interface Simple | [Si/Ge (001) Interface](interface_3d_3d_silicon_germanium.ipynb) | [Si/Ge (001) Valence Band Offset](interface_3d_3d_silicon_germanium_SIMULATION.ipynb) | [[23]](#ref23) |\n", "| `C-2D-INT-S` | Interface Simple | [GaAs/AlAs (110) Interface](interface_3d_3d_gallium_arsenide_aluminum_arsenide.ipynb) | [GaAs/AlAs (110) Valence Band Offset](interface_3d_3d_gallium_arsenide_aluminum_arsenide_SIMULATION.ipynb) | [[24]](#ref24) |\n", "| `C-2D-INT-Z` | Interface ZSL | [BN/Graphene 2D–2D Interface](interface_2d_2d_boron_nitride_graphene.ipynb) | [Gr/h-BN Stacking Energy and Band Gap](interface_2d_2d_boron_nitride_graphene_SIMULATION.ipynb) | [[4]](#ref4) |\n", diff --git a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb new file mode 100644 index 000000000..65bdf995d --- /dev/null +++ b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb @@ -0,0 +1,907 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0", + "metadata": {}, + "source": [ + "# Band Alignment of the High-k Metal Gate Stack: Valence Band Offsets of Si/SiO₂, SiO₂/HfO₂ and HfO₂/TiN\n", + "\n", + "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", + "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", + "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", + "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "Computes the valence band offsets of the interface superlattices created in the\n", + "[structure notebook](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb), with the\n", + "platform's Valence Band Offset (Bulk Method) workflow on each relaxed superlattice and its two bulk cells, and from\n", + "them the band alignment of the stack, as Prodhomme et al. Each bulk's valence band maximum is measured from its own\n", + "average electrostatic potential V̄, and the superlattice gives the step in V̄ between the two materials:\n", + "\n", + "ΔE_v = (E_VBM − V̄)_left − (E_VBM − V̄)_right + (V̄_left − V̄_right)_superlattice\n", + "\n", + "The left material is the one nearer Si in the stack, and ΔE_v is positive when its valence band maximum lies above\n", + "that of the right one, the sign convention of both publications. In HfO₂/TiN the right material is a metal: the pair\n", + "is computed with the Schottky Barrier Height (Bulk Method) workflow as the p-type Schottky barrier\n", + "Φ_p = E_F(TiN) − E_VBM(HfO₂), with the Fermi energy E_F of the TiN bulk measured from its own V̄, and its offset is\n", + "ΔE_v = −Φ_p.\n", + "\n", + "The three offsets of Prodhomme et al. add up to the offset between Si and the Fermi level of TiN (their Eq. 3),\n", + "VBO(Si/TiN) = ΔE_v(Si/SiO₂) + ΔE_v(SiO₂/HfO₂) + ΔE_v(HfO₂/TiN), and with the electron affinity χ and band gap E_g of Si\n", + "to the effective work function of TiN on the stack (their Eq. 2), W_eff = VBO(Si/TiN) + χ(Si) + E_g(Si). Both\n", + "publications use LDA, as this notebook does; their LDA values are compared here, and the G0W0 corrections of Prodhomme\n", + "et al. are not computed.\n", + "\n", + "- **Si/SiO₂, SiO₂/HfO₂ with monoclinic HfO₂, HfO₂/TiN**, after Prodhomme et al.: the atomic positions are annealed from\n", + " 1000 K to 100 K in 1 ps, then relaxed, as in the publication.\n", + "- **SiO₂/HfO₂ with cubic HfO₂**, the model of Robertson and Wallace, built after Sharia et al.: the atomic positions\n", + " are relaxed.\n", + "\n", + "Prodhomme et al. relax with SIESTA; Robertson and Wallace relax in LDA, on the model of Sharia et al.; here the anneal\n", + "and the relaxation use the MACE-MP-0 machine-learned force field, trained on PBE data. Both move only the cation layer\n", + "on each side of an interface and the atoms between them; the block interiors are held at the bulk crystals, so that\n", + "each block centre has the structure of its bulk reference.\n", + "\n", + "

Usage

\n", + "\n", + "1. Create the materials in the [structure notebook](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb), which saves the four superlattices and their bulk cells to the `uploads` folder.\n", + "1. Set the material names and parameters in cells 1.2-1.6, 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; the last section prints the comparison with the manuscripts.\n", + "\n", + "## Summary\n", + "\n", + "1. Set up the environment and parameters: install packages (JupyterLite only) and configure the material names, model, compute, anneal and relaxation parameters, and the values of the publications.\n", + "1. Authenticate and initialize API client: authenticate via browser, initialize the client, then select account and project.\n", + "1. Load the superlattices and the bulks by name from the `uploads` folder or the platform, print their composition and geometry.\n", + "1. Configure the DFT model and a k-grid per material.\n", + "1. Configure compute: get the list of clusters and create a compute configuration per superlattice.\n", + "1. Anneal the superlattices of Prodhomme et al. with molecular dynamics on the MACE force field.\n", + "1. Relax the atomic positions of all superlattices on the same force field.\n", + "1. Configure the valence band offset workflow for each superlattice: the model and a k-grid per material.\n", + "1. Run the jobs, or reuse ones that already ran on the same materials.\n", + "1. Retrieve the valence band offsets and the potential profiles, and plot the potentials.\n", + "1. Compare with the manuscripts: the offset of each interface, the stack and the effective work function." + ] + }, + { + "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.calculators.mlff import get_mlff_install_profiles\n", + "from mat3ra.notebooks_utils.packages import install_packages\n", + "\n", + "await install_packages(get_mlff_install_profiles(\"mace\"))\n", + "\n", + "from mat3ra.notebooks_utils.pyodide.packages.patches import apply_all_patches\n", + "\n", + "apply_all_patches(\"mace\")" + ] + }, + { + "cell_type": "markdown", + "id": "3", + "metadata": {}, + "source": [ + "### 1.2. Material names" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "# Names saved by heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb\n", + "SILICON_SUPERLATTICE_NAME = \"Si/SiO2 (001) superlattice 18+12 O-rich\"\n", + "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", + "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", + "TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 nitridized\"\n", + "SILICON_BULK_NAME = \"Si (001) bulk strained\"\n", + "SILICON_DIOXIDE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", + "MONOCLINIC_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", + "CUBIC_BULK_NAME = \"HfO2 cubic (001) bulk strained\"\n", + "HAFNIUM_DIOXIDE_BULK_NAME = \"HfO2 monoclinic (001) bulk 3x1\"\n", + "TITANIUM_NITRIDE_BULK_NAME = \"TiN (111) bulk strained\"\n", + "\n", + "BULK_NAMES_BY_SUPERLATTICE_NAME = { # left, right: the left material is nearer Si in the stack\n", + " SILICON_SUPERLATTICE_NAME: (SILICON_BULK_NAME, SILICON_DIOXIDE_BULK_NAME),\n", + " MONOCLINIC_SUPERLATTICE_NAME: (SILICON_DIOXIDE_BULK_NAME, MONOCLINIC_BULK_NAME),\n", + " CUBIC_SUPERLATTICE_NAME: (SILICON_DIOXIDE_BULK_NAME, CUBIC_BULK_NAME),\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: (HAFNIUM_DIOXIDE_BULK_NAME, TITANIUM_NITRIDE_BULK_NAME),\n", + "}\n", + "# the stack of Prodhomme et al., from Si to TiN; annealed before the relaxation, as in the publication\n", + "STACK_SUPERLATTICE_NAMES = [SILICON_SUPERLATTICE_NAME, MONOCLINIC_SUPERLATTICE_NAME, TITANIUM_NITRIDE_SUPERLATTICE_NAME]" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### 1.3. Parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6", + "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); None uses your default one\n", + "FOLDER = \"./uploads\"\n", + "\n", + "WORKFLOW_SEARCH_TERM_BY_SUPERLATTICE_NAME = {\n", + " SILICON_SUPERLATTICE_NAME: \"valence_band_offset_bulk\",\n", + " MONOCLINIC_SUPERLATTICE_NAME: \"valence_band_offset_bulk\",\n", + " CUBIC_SUPERLATTICE_NAME: \"valence_band_offset_bulk\",\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: \"schottky_barrier_bulk\", # Schottky Barrier Height (Bulk Method)\n", + "}\n", + "APPLICATION_NAME = \"espresso\"\n", + "\n", + "CLUSTER_NAME = None # full or partial name\n", + "QUEUE_NAME = QueueName.OF\n", + "TIME_LIMIT_BY_SUPERLATTICE_NAME = {\n", + " SILICON_SUPERLATTICE_NAME: \"04:00:00\",\n", + " MONOCLINIC_SUPERLATTICE_NAME: \"04:00:00\",\n", + " CUBIC_SUPERLATTICE_NAME: \"04:00:00\",\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: \"48:00:00\",\n", + "}\n", + "\n", + "timestamp = datetime.now().strftime(\"%Y-%m-%d %H:%M\")\n", + "POLL_INTERVAL = 60 # seconds" + ] + }, + { + "cell_type": "markdown", + "id": "7", + "metadata": {}, + "source": [ + "### 1.4. DFT model parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], + "source": [ + "MODEL_SUBTYPE = \"lda\"\n", + "FUNCTIONAL = \"pz\" # both publications use LDA\n", + "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Si, O, Hf, Ti and N\n", + "BLOCK_CATION_BY_BULK_NAME = { # marks the cation layers of each block\n", + " SILICON_BULK_NAME: \"Si\", SILICON_DIOXIDE_BULK_NAME: \"Si\", MONOCLINIC_BULK_NAME: \"Hf\", CUBIC_BULK_NAME: \"Hf\",\n", + " HAFNIUM_DIOXIDE_BULK_NAME: \"Hf\", TITANIUM_NITRIDE_BULK_NAME: \"Ti\",\n", + "}\n", + "ECUTWFC = 40 # Ry, GBRV's recommended wavefunction cutoff\n", + "ECUTRHO = 200 # Ry, GBRV's recommended charge-density cutoff\n", + "SMEARING = \"mv\" # Marzari-Vanderbilt, for the metal\n", + "DEGAUSS = 0.01 # Ry\n", + "# The GBRV atomic densities of Hf and Ti hold 10 and 11 of their 12 valence electrons; scaled by (12 + |charge|) / 12,\n", + "# the starting density is neutral in each block. The index is the position of the species in the superlattice.\n", + "SYSTEM_PARAMETERS_BY_SUPERLATTICE_NAME = {\n", + " SILICON_SUPERLATTICE_NAME: {},\n", + " MONOCLINIC_SUPERLATTICE_NAME: {\"starting_charge(3)\": -2.4},\n", + " CUBIC_SUPERLATTICE_NAME: {\"starting_charge(3)\": -2.4},\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: {\n", + " \"starting_charge(1)\": -2.4, \"starting_charge(3)\": -12 / 11, \"smearing\": SMEARING, \"degauss\": DEGAUSS\n", + " },\n", + "}\n", + "# the long cells need local-TF mixing with a long history to converge\n", + "ELECTRONS_PARAMETERS = {\"mixing_mode\": \"local-TF\", \"mixing_beta\": 0.2, \"mixing_ndim\": 20, \"electron_maxstep\": 200}\n", + "KPOINT_DENSITY = 3.5 # points per Å⁻¹, for the bulks\n", + "KGRID_BY_SUPERLATTICE_NAME = { # Sharia et al.'s 4 x 4 x 1 mesh (their cell: 5.19 Å); the same spacing on HfO2/TiN\n", + " SILICON_SUPERLATTICE_NAME: [4, 4, 1],\n", + " MONOCLINIC_SUPERLATTICE_NAME: [4, 4, 1],\n", + " CUBIC_SUPERLATTICE_NAME: [4, 4, 1],\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: [4, 2, 1],\n", + "}\n", + "\n", + "SCF_UNIT = \"pw_scf\"\n", + "BANDS_UNIT = \"pw_bands\"\n", + "SUPERLATTICE_AVERAGE_FLOWCHART_ID = \"average-electrostatic-potential\"" + ] + }, + { + "cell_type": "markdown", + "id": "9", + "metadata": {}, + "source": [ + "### 1.5. Anneal and relaxation parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], + "source": [ + "MACE_MODEL_FAMILY = \"MACE-MP-0\"\n", + "MACE_MODEL = \"large\"\n", + "MACE_DISPERSION = False\n", + "MACE_DEFAULT_DTYPE = \"float32\"\n", + "MACE_DEVICE = \"cpu\"\n", + "\n", + "ANNEAL_START_TEMPERATURE = 1000 # K\n", + "ANNEAL_END_TEMPERATURE = 100 # K\n", + "ANNEAL_DURATION = 1000 # fs\n", + "ANNEAL_TIMESTEP = 1 # fs\n", + "ANNEAL_FRICTION = 0.01 # 1/fs, Langevin thermostat\n", + "ANNEAL_SEED = 42 # initial velocities and thermostat noise\n", + "ANNEAL_LOG_INTERVAL = 100 # steps\n", + "RELAXATION_FORCE_THRESHOLD = 0.07 # eV/Å, the force threshold of Prodhomme et al.\n", + "INTERFACE_CATION_LAYERS = 1 # on each side of an interface; these and the atoms between them move, all others are fixed" + ] + }, + { + "cell_type": "markdown", + "id": "11", + "metadata": {}, + "source": [ + "### 1.6. Values of the publications" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "INTERFACE_LABEL_BY_SUPERLATTICE_NAME = {\n", + " SILICON_SUPERLATTICE_NAME: \"Si/SiO₂ (O-rich)\",\n", + " MONOCLINIC_SUPERLATTICE_NAME: \"SiO₂/HfO₂ (monoclinic HfO₂)\",\n", + " CUBIC_SUPERLATTICE_NAME: \"SiO₂/HfO₂ (cubic HfO₂)\",\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: \"HfO₂/TiN (nitridized)\",\n", + "}\n", + "MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME = { # eV, LDA\n", + " SILICON_SUPERLATTICE_NAME: (\"Prodhomme 2011\", 3.0), # Table I\n", + " MONOCLINIC_SUPERLATTICE_NAME: (\"Prodhomme 2011\", 0.4), # Table I\n", + " CUBIC_SUPERLATTICE_NAME: (\"Robertson and Wallace 2015\", -0.67), # Fig. 57a\n", + " TITANIUM_NITRIDE_SUPERLATTICE_NAME: (\"Prodhomme 2011\", -2.4), # Table I\n", + "}\n", + "MANUSCRIPT_SCHOTTKY_BARRIER_HEIGHT = (\"Prodhomme 2011\", \"+2.4\") # eV, p-type, HfO₂/TiN, LDA, −ΔE_v of Table I\n", + "MANUSCRIPT_STACK_OFFSET = (\"Prodhomme 2011\", \"+0.7 to +1.0\") # eV, VBO(Si/TiN), LDA, Table I\n", + "MANUSCRIPT_EFFECTIVE_WORK_FUNCTION = (\"Prodhomme 2011\", \"5.9 to 6.2\") # eV, LDA, Table I\n", + "SILICON_ELECTRON_AFFINITY = 4.1 # eV, Prodhomme et al., Eq. 2\n", + "SILICON_BAND_GAP = 1.1 # eV, Prodhomme et al., Eq. 2" + ] + }, + { + "cell_type": "markdown", + "id": "13", + "metadata": {}, + "source": [ + "## 2. Authenticate and initialize API client\n", + "### 2.1. Authenticate" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.auth import authenticate\n", + "\n", + "await authenticate()" + ] + }, + { + "cell_type": "markdown", + "id": "15", + "metadata": {}, + "source": [ + "### 2.2. Initialize API client" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.api_client import APIClient\n", + "\n", + "client = APIClient.authenticate()\n", + "client" + ] + }, + { + "cell_type": "markdown", + "id": "17", + "metadata": {}, + "source": [ + "### 2.3. Select account" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "18", + "metadata": {}, + "outputs": [], + "source": [ + "client.list_accounts()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "19", + "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": "20", + "metadata": {}, + "source": [ + "### 2.4. Select project" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21", + "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": "22", + "metadata": {}, + "source": [ + "## 3. Load the materials\n", + "### 3.1. Load from the uploads folder and print composition and geometry\n", + "\n", + "The superlattices are periodic along the interface normal, with two interfaces each, and each bulk cell has the\n", + "in-plane lattice of its superlattice." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "23", + "metadata": {}, + "outputs": [], + "source": [ + "from collections import Counter\n", + "from mat3ra.notebooks_utils.core.entity.material.api import load_material\n", + "\n", + "bulk_names = dict.fromkeys(name for names in BULK_NAMES_BY_SUPERLATTICE_NAME.values() for name in names)\n", + "materials_by_name = {name: load_material(client, FOLDER, name, ACCOUNT_ID)\n", + " for name in [*BULK_NAMES_BY_SUPERLATTICE_NAME, *bulk_names]}\n", + "\n", + "for name, material in materials_by_name.items():\n", + " lattice = material.lattice\n", + " print(f\"{name}: {dict(Counter(material.basis.elements.values))}, {material.basis.number_of_atoms} atoms, \"\n", + " f\"cell {lattice.a:.4f} x {lattice.b:.4f} x {lattice.c:.4f} Å\")" + ] + }, + { + "cell_type": "markdown", + "id": "24", + "metadata": {}, + "source": [ + "## 4. Configure the DFT model and k-grid\n", + "### 4.1. DFT model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.standata.applications import ApplicationStandata\n", + "from mat3ra.standata.model_tree import ModelTreeStandata\n", + "from mat3ra.ade.application import Application\n", + "from mat3ra.mode import ModelFactory\n", + "\n", + "app_config = ApplicationStandata.get_by_name_first_match(APPLICATION_NAME)\n", + "app = Application(**app_config)\n", + "\n", + "model_config = ModelTreeStandata.get_model_by_parameters(type=\"dft\", subtype=MODEL_SUBTYPE, functional=FUNCTIONAL)\n", + "model_config[\"method\"] = {\"type\": \"pseudopotential\", \"subtype\": PSEUDOPOTENTIAL_TYPE}\n", + "model = ModelFactory.create(model_config)\n", + "print(f\"Using application: {app.name}, model: {MODEL_SUBTYPE} {FUNCTIONAL}, {PSEUDOPOTENTIAL_TYPE} pseudopotentials\")" + ] + }, + { + "cell_type": "markdown", + "id": "26", + "metadata": {}, + "source": [ + "### 4.2. k-grid per material" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.workflow import kgrid_from_density\n", + "\n", + "kgrid = {name: kgrid_from_density(material, KPOINT_DENSITY) for name, material in materials_by_name.items()}\n", + "kgrid.update(KGRID_BY_SUPERLATTICE_NAME)\n", + "for name, grid in kgrid.items():\n", + " print(f\"{name}: k-grid {grid}\")" + ] + }, + { + "cell_type": "markdown", + "id": "28", + "metadata": {}, + "source": [ + "## 5. Create the compute configuration\n", + "### 5.1. Select cluster" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "29", + "metadata": {}, + "outputs": [], + "source": [ + "clusters = client.clusters.list()\n", + "print(f\"Available clusters: {[c['hostname'] for c in clusters]}\")" + ] + }, + { + "cell_type": "markdown", + "id": "30", + "metadata": {}, + "source": [ + "### 5.2. Create the compute configuration for each superlattice\n", + "\n", + "Each job runs on one node of its queue, with all the cores the queue allows per node." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31", + "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", + "ppn = next(queue[\"maxPPN\"] for queue in cluster[\"queues\"] if queue[\"name\"] == QUEUE_NAME.value)\n", + "compute_by_superlattice_name = {}\n", + "for name, time_limit in TIME_LIMIT_BY_SUPERLATTICE_NAME.items():\n", + " compute_by_superlattice_name[name] = Compute(cluster=cluster, queue=QUEUE_NAME, ppn=ppn, timeLimit=time_limit)\n", + " print(f\"{name}: cluster {cluster['hostname']}, queue {QUEUE_NAME.value}, ppn {ppn}, time limit {time_limit}\")" + ] + }, + { + "cell_type": "markdown", + "id": "32", + "metadata": {}, + "source": [ + "## 6. Anneal the superlattices of Prodhomme et al.\n", + "### 6.1. Select the interface regions\n", + "\n", + "The right block of a superlattice is the span of atomic layers that hold an element only its right bulk has; the left\n", + "block is the rest of the cell. In each block, the layers strictly between its outermost cation layers stay fixed in\n", + "the anneal and the relaxation; the cation layer on each side of an interface and the atoms between them move." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "33", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.helpers import get_atom_indices_by_layer\n", + "\n", + "fixed_atom_indices_by_superlattice_name = {}\n", + "for name, (left_bulk_name, right_bulk_name) in BULK_NAMES_BY_SUPERLATTICE_NAME.items():\n", + " elements = materials_by_name[name].basis.elements.values\n", + " layers = get_atom_indices_by_layer(materials_by_name[name])\n", + " layer_elements = [{elements[index] for index in layer} for layer in layers]\n", + " right_only_elements = (set(materials_by_name[right_bulk_name].basis.elements.values)\n", + " - set(materials_by_name[left_bulk_name].basis.elements.values))\n", + " right_layers = [position for position, layer_element_set in enumerate(layer_elements)\n", + " if layer_element_set & right_only_elements]\n", + " right_block = list(range(right_layers[0], right_layers[-1] + 1))\n", + " left_block = list(range(right_layers[-1] + 1, len(layers))) + list(range(right_layers[0]))\n", + " fixed_atom_indices_by_superlattice_name[name] = []\n", + " for block, bulk_name in ((left_block, left_bulk_name), (right_block, right_bulk_name)):\n", + " cation = BLOCK_CATION_BY_BULK_NAME[bulk_name]\n", + " cation_layers = [position for position in block if cation in layer_elements[position]]\n", + " interior = block[block.index(cation_layers[INTERFACE_CATION_LAYERS - 1]) + 1:\n", + " block.index(cation_layers[-INTERFACE_CATION_LAYERS])]\n", + " fixed_atom_indices_by_superlattice_name[name] += [index for position in interior for index in layers[position]]" + ] + }, + { + "cell_type": "markdown", + "id": "34", + "metadata": {}, + "source": [ + "### 6.2. Anneal\n", + "\n", + "Molecular dynamics at fixed cell: velocities are drawn at the start temperature, and the thermostat temperature is\n", + "lowered at every step, linearly to the end temperature. The annealed structure is the starting point of the relaxation." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from ase import units\n", + "from ase.md import MDLogger\n", + "from ase.md.langevin import Langevin\n", + "from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n", + "from mat3ra.code.array_with_ids import ArrayWithIds\n", + "from mat3ra.esse.models.properties_directory.enum_options import ProtoPropertyEnum\n", + "from mat3ra.made.material import Material\n", + "from mat3ra.made.tools.convert import from_ase, to_ase\n", + "from mat3ra.notebooks_utils.calculators.mlff import create_mlff_calculator\n", + "\n", + "calculator = create_mlff_calculator(\n", + " \"mace\",\n", + " {\n", + " \"family\": MACE_MODEL_FAMILY,\n", + " \"model\": MACE_MODEL,\n", + " \"dispersion\": MACE_DISPERSION,\n", + " \"default_dtype\": MACE_DEFAULT_DTYPE,\n", + " \"device\": MACE_DEVICE,\n", + " },\n", + ")\n", + "temperatures = np.linspace(ANNEAL_START_TEMPERATURE, ANNEAL_END_TEMPERATURE, round(ANNEAL_DURATION / ANNEAL_TIMESTEP))\n", + "\n", + "unrelaxed_superlattices = {name: materials_by_name[name] for name in BULK_NAMES_BY_SUPERLATTICE_NAME}\n", + "for name, superlattice in unrelaxed_superlattices.items():\n", + " superlattice.basis.atomic_properties.set_by_name(ProtoPropertyEnum.atomic_constraints, ArrayWithIds.from_values([[index not in fixed_atom_indices_by_superlattice_name[name]] * 3 for index in range(superlattice.basis.number_of_atoms)]))\n", + "for name in STACK_SUPERLATTICE_NAMES:\n", + " atoms = to_ase(materials_by_name[name])\n", + " atoms.calc = calculator\n", + " random_generator = np.random.default_rng(ANNEAL_SEED)\n", + " MaxwellBoltzmannDistribution(atoms, temperature_K=ANNEAL_START_TEMPERATURE, rng=random_generator)\n", + " dynamics = Langevin(atoms, ANNEAL_TIMESTEP * units.fs, temperature_K=ANNEAL_START_TEMPERATURE,\n", + " friction=ANNEAL_FRICTION / units.fs, rng=random_generator)\n", + " dynamics.attach(MDLogger(dynamics, atoms, \"-\", peratom=False), interval=ANNEAL_LOG_INTERVAL)\n", + " for temperature in temperatures:\n", + " dynamics.set_temperature(temperature_K=temperature)\n", + " dynamics.run(1)\n", + " unrelaxed_superlattices[name] = Material.create(from_ase(atoms))" + ] + }, + { + "cell_type": "markdown", + "id": "36", + "metadata": {}, + "source": [ + "## 7. Relax the superlattices\n", + "\n", + "Fixed-cell relaxation of the atomic positions on the same force field, to the force threshold of Prodhomme et al.; the\n", + "superlattices of Prodhomme et al. start from their annealed structures. Each relaxed superlattice is named\n", + "` relaxed`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "37", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.workflows.relaxation import relax_material\n", + "\n", + "relaxed_superlattices = {}\n", + "for name, superlattice in unrelaxed_superlattices.items():\n", + " relaxed_superlattices[name] = relax_material(superlattice, calculator, fmax=RELAXATION_FORCE_THRESHOLD)\n", + " relaxed_superlattices[name].name = f\"{name} relaxed\"" + ] + }, + { + "cell_type": "markdown", + "id": "38", + "metadata": {}, + "source": [ + "## 8. Configure the valence band offset workflows\n", + "\n", + "The workflow computes the electrostatic potential of the superlattice, the band structure and electrostatic potential\n", + "of the two bulks, each material on its own k-grid, and from these the offset. One workflow is configured per\n", + "superlattice. For HfO₂/TiN, the Schottky Barrier Height (Bulk Method) workflow computes the band structure of HfO₂\n", + "only; for TiN, smeared as a metal, it computes the Fermi energy and the electrostatic potential, and from these the\n", + "p-type Schottky barrier Φ_p = E_F(TiN) − E_VBM(HfO₂)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "39", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.standata.workflows import WorkflowStandata\n", + "from mat3ra.wode.context.providers import PointsGridDataProvider\n", + "from mat3ra.wode.workflows import Workflow\n", + "from mat3ra.notebooks_utils.ipython.entity.workflow.visualize import visualize_workflow\n", + "from mat3ra.notebooks_utils.workflow import apply_planewave_cutoffs, patch_workflow_qe_input\n", + "\n", + "job_material_names, job_materials, workflows = {}, {}, {}\n", + "for name, bulk_names in BULK_NAMES_BY_SUPERLATTICE_NAME.items():\n", + " job_material_names[name] = [name, *bulk_names]\n", + " job_materials[name] = [relaxed_superlattices[name], *[materials_by_name[bulk_name] for bulk_name in bulk_names]]\n", + " workflow = Workflow.create(WorkflowStandata.filter_by_application(app.name).get_by_name_first_match(\n", + " WORKFLOW_SEARCH_TERM_BY_SUPERLATTICE_NAME[name]))\n", + " for unit_name in [SCF_UNIT, BANDS_UNIT]:\n", + " apply_planewave_cutoffs(workflow, ECUTWFC, ECUTRHO, unit_name=unit_name)\n", + " for subworkflow in workflow.subworkflows:\n", + " if subworkflow.application.name != APPLICATION_NAME:\n", + " continue\n", + " subworkflow.model = model\n", + " # the superlattice subworkflow has no \"Set Material Index\" unit: it runs on material 0\n", + " material_index = int(next((unit.value for unit in subworkflow.units\n", + " if unit.name.startswith(\"Set Material Index\")), 0))\n", + " material_name = job_material_names[name][material_index]\n", + " scf_unit = subworkflow.get_unit_by_name(name=SCF_UNIT)\n", + " kgrid_context = PointsGridDataProvider(material=job_materials[name][material_index],\n", + " dimensions=kgrid[material_name], isEdited=True).get_context_item_data()\n", + " scf_unit.add_context(kgrid_context)\n", + " subworkflow.set_unit(scf_unit)\n", + "\n", + " patch_workflow_qe_input(workflow, {\"system\": SYSTEM_PARAMETERS_BY_SUPERLATTICE_NAME[name]},\n", + " unit_names=[SCF_UNIT, BANDS_UNIT])\n", + " patch_workflow_qe_input(workflow, {\"electrons\": ELECTRONS_PARAMETERS}, unit_names=[SCF_UNIT])\n", + " workflows[name] = workflow\n", + "visualize_workflow(workflow)" + ] + }, + { + "cell_type": "markdown", + "id": "40", + "metadata": {}, + "source": [ + "## 9. Save the materials and run the jobs\n", + "\n", + "For each superlattice, a job that already ran on the same three materials is reused; otherwise a new one is created\n", + "and submitted. One job runs at a time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.notebooks_utils.core.entity.job.api import get_kgrid_query\n", + "from mat3ra.notebooks_utils.core.entity.material.api import get_or_create_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 name, workflow in workflows.items():\n", + " saved_materials = [get_or_create_material(client, material, ACCOUNT_ID) for material in job_materials[name]]\n", + " material_ids = [material[\"_id\"] for material in saved_materials]\n", + " candidates = client.jobs.list({\n", + " \"_material._id\": material_ids[0], \"owner._id\": ACCOUNT_ID, \"workflow.name\": workflow.name,\n", + " \"status\": {\"$in\": [\"submitted\", \"queued\", \"active\", \"finished\"]}, **get_kgrid_query(kgrid[name], SCF_UNIT),\n", + " })\n", + " job = next((candidate for candidate in candidates\n", + " if [material[\"_id\"] for material in candidate[\"_materials\"]] == material_ids), None)\n", + " if job is None:\n", + " job = create_job(api_client=client, materials=saved_materials, workflow=workflow, project_id=project_id,\n", + " owner_id=ACCOUNT_ID, compute=compute_by_superlattice_name[name].to_dict(),\n", + " prefix=f\"{workflow.name} {name} {timestamp}\")\n", + " submit_jobs(client.jobs, [job[\"_id\"]])\n", + " print(f\"✅ Submitted job {job['_id']}\")\n", + " else:\n", + " print(f\"♻️ Reusing job {job['_id']}\")\n", + " await wait_for_jobs_to_finish_async(client.jobs, [job[\"_id\"]], poll_interval=POLL_INTERVAL)\n", + " job_ids[name] = job[\"_id\"]" + ] + }, + { + "cell_type": "markdown", + "id": "42", + "metadata": {}, + "source": [ + "## 10. Retrieve the results\n", + "### 10.1. Valence band offsets\n", + "\n", + "The workflow's last step computes ΔE_v with E_VBM from each bulk's band structure and V̄ of a bulk as the mean of its\n", + "electrostatic potential over its cell. In the superlattice, V̄ is read at the centre of each block, the bulk-like\n", + "region far from both interfaces, over one bulk cell. The offset is stored with the job as its valence band offset\n", + "property. For HfO₂/TiN, the job stores the p-type Schottky barrier Φ_p = E_F(TiN) − E_VBM(HfO₂), computed the same\n", + "way with the Fermi energy of the TiN bulk; its offset is ΔE_v = −Φ_p." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43", + "metadata": {}, + "outputs": [], + "source": [ + "valence_band_offset_by_superlattice_name = {\n", + " name: client.properties.get_for_job(job_id, property_name=\"valence_band_offset\")[0][\"value\"]\n", + " for name, job_id in job_ids.items() if name != TITANIUM_NITRIDE_SUPERLATTICE_NAME\n", + "}\n", + "schottky_barrier_height_p = client.properties.get_for_job(job_ids[TITANIUM_NITRIDE_SUPERLATTICE_NAME],\n", + " property_name=\"schottky_barrier_height_p\")[0][\"value\"]\n", + "valence_band_offset_by_superlattice_name[TITANIUM_NITRIDE_SUPERLATTICE_NAME] = -schottky_barrier_height_p\n", + "print(f\"p-type Schottky barrier, {INTERFACE_LABEL_BY_SUPERLATTICE_NAME[TITANIUM_NITRIDE_SUPERLATTICE_NAME]}: \"\n", + " f\"{' '.join(MANUSCRIPT_SCHOTTKY_BARRIER_HEIGHT)} eV | ours {schottky_barrier_height_p:+.2f} eV\")" + ] + }, + { + "cell_type": "markdown", + "id": "44", + "metadata": {}, + "source": [ + "### 10.2. Potential across the superlattices\n", + "\n", + "The planar average of the electrostatic potential along the interface normal, and its macroscopic average, as the\n", + "workflow stores them; the offset is in the title." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "from mat3ra.notebooks_utils.plot import display_matplotlib_figure\n", + "\n", + "figure, axes = plt.subplots(len(job_ids), 1, figsize=(10, 4 * len(job_ids)), squeeze=False)\n", + "for axis, (name, job_id) in zip(axes[:, 0], job_ids.items()):\n", + " profile = client.properties.get_for_job(job_id, property_name=\"average_potential_profile\",\n", + " unit_id=SUPERLATTICE_AVERAGE_FLOWCHART_ID)[0]\n", + " axis.plot(profile[\"xDataArray\"], profile[\"yDataSeries\"][0], color=\"black\", label=\"planar average\")\n", + " axis.plot(profile[\"xDataArray\"], profile[\"yDataSeries\"][1], color=\"tab:red\", label=\"macroscopic average\")\n", + " axis.set_xlabel(\"position along the interface normal (Å)\")\n", + " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", + " axis.set_title(f\"{INTERFACE_LABEL_BY_SUPERLATTICE_NAME[name]}: \"\n", + " f\"ΔE_v = {valence_band_offset_by_superlattice_name[name]:.3f} eV\")\n", + " axis.legend(loc=\"upper right\", fontsize=8)\n", + "figure.tight_layout()\n", + "display_matplotlib_figure(figure)" + ] + }, + { + "cell_type": "markdown", + "id": "46", + "metadata": {}, + "source": [ + "## 11. Compare with the manuscripts\n", + "\n", + "Prodhomme et al. define each offset as E_VBM(left) − E_VBM(right), the left material nearer Si; Robertson and Wallace\n", + "define the SiO₂/HfO₂ offset the same way and read it from the densities of states of layers away from the interfaces.\n", + "Here all offsets come from the potential line-up, as in Prodhomme et al. Settings that differ from the manuscripts:\n", + "GBRV ultrasoft LDA pseudopotentials in plane waves at 40/200 Ry, against the localized orbitals and Troullier–Martins\n", + "pseudopotentials of Prodhomme et al.; the lattice constants of the platform's structures, which set the in-plane\n", + "strains (Prodhomme et al. compress Si by 3 %, stretch monoclinic HfO₂ by 3.7 % along [100] and 2.1 % along [010], and\n", + "strain TiN by 1.8 % along [1-10] and −0.5 % along [11-2]); the cell length along the normal, which Sharia et al. relax\n", + "and which is kept as built here; and the k-points of the bulks, which Prodhomme et al. do not give and Sharia et al.\n", + "set to 8 × 8 × 8. In the monoclinic superlattice, after relaxation, two O at each interface bond to both Si and Hf;\n", + "Prodhomme et al. report three, each threefold. The value of Robertson and Wallace is read from their Fig. 57a. The\n", + "stack sum uses the monoclinic SiO₂/HfO₂ offset, as Prodhomme et al." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "47", + "metadata": {}, + "outputs": [], + "source": [ + "for name, (source, manuscript_offset) in MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME.items():\n", + " offset = valence_band_offset_by_superlattice_name[name]\n", + " print(f\"VBO, {INTERFACE_LABEL_BY_SUPERLATTICE_NAME[name]}: {source} {manuscript_offset:+} eV \"\n", + " f\"| ours {offset:+.2f} eV\")\n", + "\n", + "stack_offset = sum(valence_band_offset_by_superlattice_name[name] for name in STACK_SUPERLATTICE_NAMES)\n", + "effective_work_function = stack_offset + SILICON_ELECTRON_AFFINITY + SILICON_BAND_GAP\n", + "print(f\"VBO, Si/TiN: {' '.join(MANUSCRIPT_STACK_OFFSET)} eV | ours {stack_offset:+.2f} eV\")\n", + "print(f\"Effective work function, TiN: {' '.join(MANUSCRIPT_EFFECTIVE_WORK_FUNCTION)} eV \"\n", + " f\"| ours {effective_work_function:.2f} eV\")" + ] + }, + { + "cell_type": "markdown", + "id": "48", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "[1] P.-Y. Prodhomme, F. Fontaine-Vive, A. Van Der Geest, P. Blaise and J. Even, \"Ab initio calculation of effective\n", + "work functions for a TiN/HfO2/SiO2/Si transistor stack\", Appl. Phys. Lett. 99, 022101 (2011).\n", + "[DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "[2] J. Robertson and R. M. Wallace, \"High-K materials and metal gates for CMOS applications\", Mater. Sci. Eng. R 88,\n", + "1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "[3] O. Sharia, A. A. Demkov, G. Bersuker and B. H. Lee, \"Theoretical study of the insulator/insulator interface: Band\n", + "alignment at the SiO2/HfO2 junction\", Phys. Rev. B 75, 035306 (2007).\n", + "[DOI: 10.1103/PhysRevB.75.035306](https://doi.org/10.1103/PhysRevB.75.035306)\n", + "\n", + "[4] K. F. Garrity, J. W. Bennett, K. M. Rabe and D. Vanderbilt, \"Pseudopotentials for high-throughput DFT\n", + "calculations\", Comput. Mater. Sci. 81, 446 (2014). https://doi.org/10.1016/j.commatsci.2013.08.053\n", + "\n", + "[5] MACE-MP-0 foundation models: https://github.com/ACEsuit/mace" + ] + } + ], + "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 8710c4e9ffb44412222fd450c87cb32b01ee5a83 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 1 Dec 2026 21:56:50 -0800 Subject: [PATCH 11/11] SOF-8097: stack notebooks list the 4+1+5 HfO2/TiN superlattice as a commented-out alternative; structure intro covers the superlattices; review nits Co-Authored-By: Claude Opus 5.5 --- ...ide_hafnium_dioxide_titanium_nitride.ipynb | 93 +++++++++++++++---- ..._dioxide_titanium_nitride_SIMULATION.ipynb | 19 ++-- 2 files changed, 84 insertions(+), 28 deletions(-) diff --git a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb index bb3768f69..b1578b0d9 100644 --- a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb @@ -5,7 +5,7 @@ "id": "0", "metadata": {}, "source": [ - "# Create High-k Metal Gate Stack Tutorial (Simplified)\n", + "# High-k Metal Gate Stack: Heterostructure, Interface Superlattices and Bulk Reference Cells\n", "\n", "This notebook demonstrates how to create a high-k metal gate stack heterostructure with four materials: Si (substrate), SiO2 (gate oxide), HfO2 (high-k dielectric), and TiN (metal gate) using the **new simplified `create_heterostructure` function**.\n", "\n", @@ -15,6 +15,20 @@ "\n", "\"High-k\n", "\n", + "Sections 5–12 build the interfaces of the stack, Si/SiO₂, SiO₂/HfO₂ and HfO₂/TiN, as superlattices without vacuum,\n", + "and their bulk reference cells, after the publications:\n", + "\n", + "> **Pierre-Yves Prodhomme, Fabien Fontaine-Vive, Abram Van Der Geest, Philippe Blaise and Jacky Even**, \"Ab initio\n", + "> calculation of effective work functions for a TiN/HfO2/SiO2/Si transistor stack\", Applied Physics Letters 99,\n", + "> 022101 (2011). [DOI: 10.1063/1.3609869](https://doi.org/10.1063/1.3609869)\n", + "\n", + "> **John Robertson and Robert M. Wallace**, \"High-K materials and metal gates for CMOS applications\", Materials\n", + "> Science and Engineering: R: Reports 88, 1 (2015). [DOI: 10.1016/j.mser.2014.11.001](https://doi.org/10.1016/j.mser.2014.11.001)\n", + "\n", + "The valence band offsets are computed from the superlattices and from bulk cells with the same in-plane lattice, so\n", + "all are saved: [the simulation notebook](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb)\n", + "loads them by name.\n", + "\n", "## Key Improvements:\n", "- **Simplified Configuration**: Replace complex `SimpleNamespace` structures with simple lists\n", "- **Single Function Call**: Use `create_heterostructure()` instead of manual interface creation\n", @@ -91,6 +105,8 @@ "id": "3", "metadata": {}, "source": [ + "### 1.1. Interface superlattice parameters\n", + "\n", "Parameters of the interface superlattices and their bulk reference cells, built in sections 5–10." ] }, @@ -142,6 +158,8 @@ "\n", "HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS = 4 # two HfO2 layers each: 8\n", "TITANIUM_NITRIDE_NUMBER_OF_LAYERS = 6 # one Ti and one N plane each\n", + "# HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS = 3 # 4+1+5: four HfO2 layers between the interfacial layers\n", + "# TITANIUM_NITRIDE_NUMBER_OF_LAYERS = 5 # 4+1+5: five Ti planes\n", "TITANIUM_NITRIDE_MATCH_ID = 4 # three HfO2 cells along [100], one along [010]\n", "TITANIUM_NITRIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP = 1 # N: Ti at both ends\n", "HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_BOTTOM = 1 # O\n", @@ -160,6 +178,7 @@ "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", "TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 nitridized\"\n", "# TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 oxidized\"\n", + "# TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 4+1+5 nitridized\"\n", "SILICON_BULK_NAME = \"Si (001) bulk strained\"\n", "SILICON_DIOXIDE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", "MONOCLINIC_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", @@ -541,17 +560,11 @@ "metadata": {}, "source": [ "## 9. Create the HfO₂/TiN Superlattice\n", + "### 9.1. Stack the slabs\n", "\n", "Monoclinic HfO₂ (001), three cells along [100] and one along [010], with TiN (111) on it, as Prodhomme et al. TiN is\n", "strained in plane onto HfO₂: the publication stretches it by 1.8 % along [1-10] and compresses it by 0.5 % along\n", - "[11-2] on its lattices; the Standata lattices give 2.9 % along [1-10] and 0.0 % along [11-2]. The slab builder counts\n", - "monoclinic (001) layers in pairs: eight are built, and the O at both ends are removed, which leaves an Hf₂O₂ group at\n", - "each end. The publication shows one interface; both interfaces of the cell are built as it. At each end the outermost\n", - "HfO₂ layer becomes the interfacial layer of the publication, with Ti on the Hf sites and N on the O sites (nitridized);\n", - "in the oxidized interface, commented out in the parameters, the six O facing HfO₂ stay. Six HfO₂ layers remain between\n", - "them. TiN has six Ti planes and the five N planes between them, so that Ti faces the interfacial layer on both sides.\n", - "The second interface, across the cell boundary, gets the same distance as the first, and the cell starts at the HfO₂\n", - "block." + "[11-2] on its lattices; the Standata lattices give 2.9 % along [1-10] and 0.0 % along [11-2]." ] }, { @@ -562,7 +575,6 @@ "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface_material import get_interface_configuration\n", - "from mat3ra.made.tools.modify import translate_by_vector, wrap_to_unit_cell\n", "\n", "hafnium_dioxide_slab = create_slab(monoclinic_hafnium_dioxide, HAFNIUM_DIOXIDE_MILLER_INDICES,\n", " number_of_layers=HAFNIUM_DIOXIDE_NUMBER_OF_LAYERS, vacuum=SUPERLATTICE_VACUUM)\n", @@ -572,8 +584,28 @@ " substrate_slab=hafnium_dioxide_slab, film_slab=titanium_nitride_slab, gap=INTERFACE_DISTANCE,\n", " vacuum=SUPERLATTICE_VACUUM, match_id=TITANIUM_NITRIDE_MATCH_ID)\n", "titanium_nitride_supercell_matrix = get_interface_configuration(\n", - " titanium_nitride_superlattice).film_configuration.xy_supercell_matrix.model_dump()\n", + " titanium_nitride_superlattice).film_configuration.xy_supercell_matrix.model_dump()" + ] + }, + { + "cell_type": "markdown", + "id": "29", + "metadata": {}, + "source": [ + "### 9.2. Trim the blocks\n", "\n", + "The slab builder counts monoclinic (001) layers in pairs: eight are built, and the O at both ends are removed, which\n", + "leaves an Hf₂O₂ group at each end. TiN has six Ti planes and the five N planes between them, so that Ti faces the\n", + "interfacial layer on both sides. The second interface, across the cell boundary, gets the same distance as the first." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "30", + "metadata": {}, + "outputs": [], + "source": [ "labels = titanium_nitride_superlattice.basis.labels.values\n", "titanium_nitride_layers = [layer for layer in get_atom_indices_by_layer(titanium_nitride_superlattice)\n", " if labels[layer[0]] == InterfacePartsEnum.FILM.value]\n", @@ -591,7 +623,30 @@ " + hafnium_dioxide_layers[-HAFNIUM_DIOXIDE_ATOMIC_LAYERS_REMOVED_FROM_TOP:])\n", "titanium_nitride_superlattice = filter_by_ids(titanium_nitride_superlattice,\n", " [index for layer in removed_layers for index in layer],\n", - " invert=True, reset_ids=True)\n", + " invert=True, reset_ids=True)" + ] + }, + { + "cell_type": "markdown", + "id": "31", + "metadata": {}, + "source": [ + "### 9.3. Make the interfacial layers\n", + "\n", + "The publication shows one interface; both interfaces of the cell are built as it. At each end the outermost HfO₂\n", + "layer becomes the interfacial layer of the publication, with Ti on the Hf sites and N on the O sites (nitridized); in\n", + "the oxidized interface, commented out in the parameters, the six O facing HfO₂ stay. Six HfO₂ layers remain between\n", + "them. The cell starts at the HfO₂ block." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "32", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.modify import translate_by_vector, wrap_to_unit_cell\n", "\n", "labels = titanium_nitride_superlattice.basis.labels.values\n", "hafnium_dioxide_layers = [layer for layer in get_atom_indices_by_layer(titanium_nitride_superlattice)\n", @@ -612,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "29", + "id": "33", "metadata": {}, "source": [ "## 10. Create the Bulk Reference Cells\n", @@ -627,7 +682,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -665,7 +720,7 @@ }, { "cell_type": "markdown", - "id": "31", + "id": "35", "metadata": {}, "source": [ "## 11. Visualize the Superlattices and Bulk Cells\n", @@ -677,7 +732,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "33", + "id": "37", "metadata": {}, "source": [ "## 12. Pass the Superlattices and Bulk Cells to the Outside Runtime" @@ -696,7 +751,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -705,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "35", + "id": "39", "metadata": {}, "source": [ "## References\n", diff --git a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb index 65bdf995d..0d8716ad5 100644 --- a/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb +++ b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb @@ -113,6 +113,7 @@ "MONOCLINIC_SUPERLATTICE_NAME = \"SiO2/HfO2 monoclinic (001) superlattice 10+7\"\n", "CUBIC_SUPERLATTICE_NAME = \"SiO2/HfO2 cubic (001) superlattice 12+6\"\n", "TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 6+1+6 nitridized\"\n", + "# TITANIUM_NITRIDE_SUPERLATTICE_NAME = \"HfO2/TiN superlattice 4+1+5 nitridized\"\n", "SILICON_BULK_NAME = \"Si (001) bulk strained\"\n", "SILICON_DIOXIDE_BULK_NAME = \"SiO2 beta-cristobalite (001) bulk\"\n", "MONOCLINIC_BULK_NAME = \"HfO2 monoclinic (001) bulk strained\"\n", @@ -190,10 +191,6 @@ "MODEL_SUBTYPE = \"lda\"\n", "FUNCTIONAL = \"pz\" # both publications use LDA\n", "PSEUDOPOTENTIAL_TYPE = \"us\" # GBRV ultrasoft, the LDA family the platform publishes for Si, O, Hf, Ti and N\n", - "BLOCK_CATION_BY_BULK_NAME = { # marks the cation layers of each block\n", - " SILICON_BULK_NAME: \"Si\", SILICON_DIOXIDE_BULK_NAME: \"Si\", MONOCLINIC_BULK_NAME: \"Hf\", CUBIC_BULK_NAME: \"Hf\",\n", - " HAFNIUM_DIOXIDE_BULK_NAME: \"Hf\", TITANIUM_NITRIDE_BULK_NAME: \"Ti\",\n", - "}\n", "ECUTWFC = 40 # Ry, GBRV's recommended wavefunction cutoff\n", "ECUTRHO = 200 # Ry, GBRV's recommended charge-density cutoff\n", "SMEARING = \"mv\" # Marzari-Vanderbilt, for the metal\n", @@ -252,7 +249,11 @@ "ANNEAL_SEED = 42 # initial velocities and thermostat noise\n", "ANNEAL_LOG_INTERVAL = 100 # steps\n", "RELAXATION_FORCE_THRESHOLD = 0.07 # eV/Å, the force threshold of Prodhomme et al.\n", - "INTERFACE_CATION_LAYERS = 1 # on each side of an interface; these and the atoms between them move, all others are fixed" + "INTERFACE_CATION_LAYERS = 1 # on each side of an interface; these and the atoms between them move, all others are fixed\n", + "BLOCK_CATION_BY_BULK_NAME = { # marks the cation layers of each block\n", + " SILICON_BULK_NAME: \"Si\", SILICON_DIOXIDE_BULK_NAME: \"Si\", MONOCLINIC_BULK_NAME: \"Hf\", CUBIC_BULK_NAME: \"Hf\",\n", + " HAFNIUM_DIOXIDE_BULK_NAME: \"Hf\", TITANIUM_NITRIDE_BULK_NAME: \"Ti\",\n", + "}" ] }, { @@ -282,7 +283,6 @@ " CUBIC_SUPERLATTICE_NAME: (\"Robertson and Wallace 2015\", -0.67), # Fig. 57a\n", " TITANIUM_NITRIDE_SUPERLATTICE_NAME: (\"Prodhomme 2011\", -2.4), # Table I\n", "}\n", - "MANUSCRIPT_SCHOTTKY_BARRIER_HEIGHT = (\"Prodhomme 2011\", \"+2.4\") # eV, p-type, HfO₂/TiN, LDA, −ΔE_v of Table I\n", "MANUSCRIPT_STACK_OFFSET = (\"Prodhomme 2011\", \"+0.7 to +1.0\") # eV, VBO(Si/TiN), LDA, Table I\n", "MANUSCRIPT_EFFECTIVE_WORK_FUNCTION = (\"Prodhomme 2011\", \"5.9 to 6.2\") # eV, LDA, Table I\n", "SILICON_ELECTRON_AFFINITY = 4.1 # eV, Prodhomme et al., Eq. 2\n", @@ -702,7 +702,7 @@ " unit_names=[SCF_UNIT, BANDS_UNIT])\n", " patch_workflow_qe_input(workflow, {\"electrons\": ELECTRONS_PARAMETERS}, unit_names=[SCF_UNIT])\n", " workflows[name] = workflow\n", - "visualize_workflow(workflow)" + " visualize_workflow(workflow)" ] }, { @@ -779,8 +779,9 @@ "schottky_barrier_height_p = client.properties.get_for_job(job_ids[TITANIUM_NITRIDE_SUPERLATTICE_NAME],\n", " property_name=\"schottky_barrier_height_p\")[0][\"value\"]\n", "valence_band_offset_by_superlattice_name[TITANIUM_NITRIDE_SUPERLATTICE_NAME] = -schottky_barrier_height_p\n", + "source, manuscript_offset = MANUSCRIPT_OFFSET_BY_SUPERLATTICE_NAME[TITANIUM_NITRIDE_SUPERLATTICE_NAME]\n", "print(f\"p-type Schottky barrier, {INTERFACE_LABEL_BY_SUPERLATTICE_NAME[TITANIUM_NITRIDE_SUPERLATTICE_NAME]}: \"\n", - " f\"{' '.join(MANUSCRIPT_SCHOTTKY_BARRIER_HEIGHT)} eV | ours {schottky_barrier_height_p:+.2f} eV\")" + " f\"{source} {-manuscript_offset:+} eV | ours {schottky_barrier_height_p:+.2f} eV\")" ] }, { @@ -813,7 +814,7 @@ " axis.set_xlabel(\"position along the interface normal (Å)\")\n", " axis.set_ylabel(\"V̄(z), electrostatic (eV)\")\n", " axis.set_title(f\"{INTERFACE_LABEL_BY_SUPERLATTICE_NAME[name]}: \"\n", - " f\"ΔE_v = {valence_band_offset_by_superlattice_name[name]:.3f} eV\")\n", + " f\"ΔE_v = {valence_band_offset_by_superlattice_name[name]:.2f} eV\")\n", " axis.legend(loc=\"upper right\", fontsize=8)\n", "figure.tight_layout()\n", "display_matplotlib_figure(figure)"