diff --git a/other/materials_designer/specific_examples/Introduction.ipynb b/other/materials_designer/specific_examples/Introduction.ipynb index 9cc5eb8ec..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", @@ -107,7 +107,11 @@ "\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] Mu, X., Wu, Y., Zeng, B., Jiang, J., Zhou, Y., Yin, L., Liao, M., & Yang, Q. (2025). Polarization switching of HfO2 ferroelectric in bulk and electrode/ferroelectric/electrode heterostructure. *npj Computational Materials*, 11, 126. https://doi.org/10.1038/s41524-025-01633-2\n" + "[26] Mu, X., Wu, Y., Zeng, B., Jiang, J., Zhou, Y., Yin, L., Liao, M., & Yang, Q. (2025). Polarization switching of HfO2 ferroelectric in bulk and electrode/ferroelectric/electrode heterostructure. *npj Computational Materials*, 11, 126. https://doi.org/10.1038/s41524-025-01633-2\n", + "\n", + "[27] 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", + "[28] 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..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", @@ -90,6 +104,93 @@ "cell_type": "markdown", "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." + ] + }, + { + "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", + "# 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", + "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", + "# 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", + "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 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "7", "metadata": {}, "source": [ "### 1.3. Get input material\n", @@ -119,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "7", + "id": "9", "metadata": {}, "source": [ "## 2. Create the heterostructure\n", @@ -143,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "11", "metadata": {}, "source": [ "### 2.1. Create the heterostructure\n", @@ -169,7 +270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "11", + "id": "13", "metadata": {}, "source": [ "## 3. Visualize the material\n" @@ -198,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "13", + "id": "15", "metadata": {}, "source": [ "## 4. Save the material" @@ -223,7 +324,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -234,6 +335,447 @@ "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", + "### 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]." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "28", + "metadata": {}, + "outputs": [], + "source": [ + "from mat3ra.made.tools.analyze.interface_material import get_interface_configuration\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()" + ] + }, + { + "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", + "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)" + ] + }, + { + "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", + " 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": "33", + "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": "34", + "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": "35", + "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": "36", + "metadata": {}, + "outputs": [], + "source": [ + "visualize([{\"material\": material, \"title\": material.name, \"rotation\": \"-90x\"} for material in materials],\n", + " repetitions=[2, 2, 1])" + ] + }, + { + "cell_type": "markdown", + "id": "37", + "metadata": {}, + "source": [ + "## 12. Pass the Superlattices and Bulk Cells to the Outside Runtime" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "38", + "metadata": {}, + "outputs": [], + "source": [ + "set_materials(materials)" + ] + }, + { + "cell_type": "markdown", + "id": "39", + "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/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..0d8716ad5 --- /dev/null +++ b/other/materials_designer/specific_examples/heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride_SIMULATION.ipynb @@ -0,0 +1,908 @@ +{ + "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", + "# 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", + "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", + "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\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", + "}" + ] + }, + { + "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_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", + "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\"{source} {-manuscript_offset:+} 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]:.2f} 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 +} diff --git a/pyproject.toml b/pyproject.toml index e47864a68..4427f13eb 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@47b54d9214d729ffdc6f0b2c99c72b3b6981fd20", # made #308; unpin on release "mat3ra-periodic-table" ] workflows = [