diff --git a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb index 0b290348..a4f4b1de 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -52,21 +52,25 @@ "IS_TERMINATIONS_SELECTION_INTERACTIVE = False \n", "\n", "FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX]\n", - "FILM_MILLER_INDICES = (0, 0, 1)\n", + "FILM_MILLER_INDICES = (0,0,1)\n", "FILM_THICKNESS = 1 # in atomic layers\n", "FILM_VACUUM = 0.0 # in angstroms\n", "FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", "FILM_USE_ORTHOGONAL_Z = True\n", "\n", "SUBSTRATE_INDEX = 0\n", - "SUBSTRATE_MILLER_INDICES = (1, 1, 1)\n", + "SUBSTRATE_MILLER_INDICES = (0,0,1)\n", "SUBSTRATE_THICKNESS = 3 # in atomic layers\n", - "SUBSTRATE_VACUUM = 3.0 # in angstroms\n", + "SUBSTRATE_VACUUM = 0.0 # in angstroms\n", "SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", "SUBSTRATE_USE_ORTHOGONAL_Z = True\n", "\n", "# Maximum area for the superlattice search algorithm\n", "MAX_AREA = 50 # in Angstrom^2\n", + "# Additional fine-tuning parameters (increase values to get more strained matches):\n", + "MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2\n", + "MAX_ANGLE_TOLERANCE = 0.03\n", + "MAX_LENGTH_TOLERANCE = 0.03\n", "# Set the termination pair indices\n", "TERMINATION_PAIR_INDEX = 0 # Will be overridden in interactive selection is used\n", "INTERFACE_DISTANCE = 3.0 # in Angstrom\n", @@ -338,7 +342,10 @@ "source": [ "from mat3ra.made.tools.build.interface import ZSLStrainMatchingParameters\n", "zsl_strain_matching_parameters = ZSLStrainMatchingParameters(\n", - " max_area=MAX_AREA\n", + " max_area=MAX_AREA,\n", + " max_area_tol=MAX_AREA_TOLERANCE,\n", + " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", + " max_length_tol=MAX_LENGTH_TOLERANCE,\n", ")" ], "metadata": { diff --git a/other/materials_designer/create_interface_with_no_strain_matching.ipynb b/other/materials_designer/create_interface_with_no_strain_matching.ipynb index 8d726c28..26eb0202 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -44,6 +44,8 @@ "IS_TERMINATIONS_SELECTION_INTERACTIVE = False \n", "# Enable scaling of the film slab atomic coordinates to match the substrate lattice (preserve coordinates in crystal units).\n", "ENABLE_FILM_SCALING = True\n", + "# Create slabs for the film and substrate when creating the interface, otherwise use provided materials directly.\n", + "CREATE_SLABS = True \n", "\n", "FILM_INDEX = 1\n", "FILM_MILLER_INDICES = (0, 0, 1)\n", @@ -314,9 +316,7 @@ " substrate_termination=substrate_termination,\n", " interface_distance=INTERFACE_DISTANCE, # in Angstrom\n", " interface_vacuum=INTERFACE_VACUUM # in Angstrom\n", - ")\n", - "\n", - "interface = create_interface(interface_configuration)" + ")" ] }, { @@ -333,9 +333,9 @@ "outputs": [], "source": [ "from mat3ra.made.tools.build.interface import SimpleInterfaceBuilder, SimpleInterfaceBuilderParameters\n", - "if ENABLE_FILM_SCALING:\n", - " builder = SimpleInterfaceBuilder(build_parameters=SimpleInterfaceBuilderParameters(scale_film=True))\n", - " interface = builder.get_material(configuration=interface_configuration)" + "\n", + "builder = SimpleInterfaceBuilder(build_parameters=SimpleInterfaceBuilderParameters(scale_film=ENABLE_FILM_SCALING, create_slabs=CREATE_SLABS))\n", + "interface = builder.get_material(configuration=interface_configuration)" ], "metadata": { "collapsed": false diff --git a/other/materials_designer/specific_examples/heterostructure_high_k_metal_gate_stack.ipynb b/other/materials_designer/specific_examples/heterostructure_high_k_metal_gate_stack.ipynb new file mode 100644 index 00000000..0d7ca305 --- /dev/null +++ b/other/materials_designer/specific_examples/heterostructure_high_k_metal_gate_stack.ipynb @@ -0,0 +1,507 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e96bfb09b980e52b", + "metadata": { + "collapsed": false + }, + "source": [] + }, + { + "cell_type": "markdown", + "id": "3ae4cc7db0846f04", + "metadata": { + "collapsed": false + }, + "source": [ + "# Create High-k Metal Gate Stack Tutorial\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).\n", + "\n", + "We'll create a representation of the material from the [QuantumATK tutorial](https://docs.quantumatk.com/tutorials/hkmg_builder/hkmg_builder.html) without the amorphous step.\n", + "\n", + "\"High-k\n" + ] + }, + { + "cell_type": "markdown", + "id": "f1db6e522c6716dc", + "metadata": { + "collapsed": false + }, + "source": [ + "## 1. Configuration Parameters\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "813b06d4d77a8507", + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Global parameters\n", + "MAX_AREA = 200 # Maximum area for strain matching\n", + "MAX_AREA_RATIO_TOL = 0.25 # Maximum area ratio tolerance for strain matching\n", + "MAX_ANGLE_TOLERANCE = 0.15 # Maximum angle tolerance for strain matching\n", + "MAX_LENGTH_TOLERANCE = 0.15 # Maximum length tolerance for strain matching\n", + "\n", + "# Structure parameters for each layer\n", + "STRUCTURE_PARAMS = [\n", + " {\n", + " # Silicon substrate\n", + " \"slab_params\": {\n", + " \"miller_indices\": (1, 0, 0),\n", + " \"thickness\": 4, # atomic layers\n", + " \"vacuum\": 5.0, # Angstroms\n", + " \"use_orthogonal_z\": True\n", + " },\n", + " \"interface_distance\": None # No interface for substrate\n", + " },\n", + " {\n", + " # SiO2 layer\n", + " \"slab_params\": {\n", + " \"miller_indices\": (1,0,0),\n", + " \"thickness\": 3,\n", + " \"vacuum\": 5.0,\n", + " \"use_orthogonal_z\": True\n", + " },\n", + " \"interface_distance\": 2.5 # Distance to Si substrate\n", + " },\n", + " {\n", + " # HfO2 layer\n", + " \"slab_params\": {\n", + " \"miller_indices\": (0,0,1),\n", + " \"thickness\": 4,\n", + " \"vacuum\": 0.5,\n", + " \"xy_supercell_matrix\": [[1, 0], [0, 2]],\n", + " \"use_orthogonal_z\": True\n", + " },\n", + " \"interface_distance\": 2.5 # Distance to SiO2\n", + " },\n", + " {\n", + " # TiN layer\n", + " \"slab_params\": {\n", + " \"miller_indices\": (0,0, 1),\n", + " \"thickness\": 3,\n", + " \"vacuum\": 10.0, # Add vacuum to final layer\n", + " \"use_orthogonal_z\": True\n", + " },\n", + " \"interface_distance\": 2.5 # Distance to HfO2\n", + " }\n", + "]\n", + "\n", + "INTERFACE_1_INDEX = 11 " + ] + }, + { + "cell_type": "markdown", + "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))." + ], + "metadata": { + "collapsed": false + }, + "id": "a671bb0a66616061" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "import sys\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " import micropip\n", + "\n", + " await micropip.install('mat3ra-api-examples', deps=False)\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"specific_examples\")" + ], + "metadata": { + "collapsed": false + }, + "id": "c11956a7712639b9", + "execution_count": null + }, + { + "cell_type": "markdown", + "source": [ + "### 1.3. Get input material\n", + "In this notebook we will use materials from Standata." + ], + "metadata": { + "collapsed": false + }, + "id": "15599efa4b241366" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "from mat3ra.made.material import Material\n", + "from mat3ra.standata.materials import Materials\n", + "\n", + "materials_1 = [\n", + " Material(Materials.get_by_name_first_match(\"SiO2\")), # SiO2\n", + " Material(Materials.get_by_name_first_match(\"Silicon\")), # Si substrate\n", + " ]\n", + "materials_2 = [\n", + " Material(Materials.get_by_name_first_match(\"HfO2\")), # HfO2\n", + " Material(Materials.get_by_name_first_match(\"TiN\")), # TiN\n", + "]" + ], + "metadata": { + "collapsed": false + }, + "id": "474383a5e0f70d6", + "execution_count": null + }, + { + "cell_type": "markdown", + "id": "9fe9b39b05f1dc7e", + "metadata": { + "collapsed": false + }, + "source": [ + "## 2. Create Si/SiO2 Interface\n", + "### 2.1. Create Si/SiO2 Interface" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "59c8eb0e549ee69e", + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from mat3ra.made.tools.build.slab import SlabConfiguration, get_terminations, create_slab, PymatgenSlabGeneratorParameters\n", + "from mat3ra.made.tools.build.interface import (\n", + " InterfaceConfiguration,\n", + " ZSLStrainMatchingParameters,\n", + " ZSLStrainMatchingInterfaceBuilder,\n", + " ZSLStrainMatchingInterfaceBuilderParameters\n", + ")\n", + "from utils.visualize import visualize_materials as visualize\n", + "\n", + "film_params = STRUCTURE_PARAMS[1]\n", + "substrate_params = STRUCTURE_PARAMS[0]\n", + "\n", + "film_config = SlabConfiguration(\n", + " bulk=materials_1[1],\n", + " **film_params[\"slab_params\"]\n", + ")\n", + "\n", + "substrate_config = SlabConfiguration(\n", + " bulk=materials_1[0],\n", + " **substrate_params[\"slab_params\"]\n", + ")\n", + "params = PymatgenSlabGeneratorParameters(symmetrize = False)\n", + "\n", + "film_terminations = get_terminations(film_config, build_parameters=params)\n", + "substrate_terminations = get_terminations(substrate_config, build_parameters=params)\n", + "\n", + "film_termination = film_terminations[0]\n", + "substrate_termination = substrate_terminations[0]\n", + "\n", + "\n", + "interface_config = InterfaceConfiguration(\n", + " film_configuration=film_config,\n", + " substrate_configuration=substrate_config,\n", + " film_termination=film_termination,\n", + " substrate_termination=substrate_termination,\n", + " distance=film_params[\"interface_distance\"],\n", + " vacuum=film_params[\"slab_params\"][\"vacuum\"]\n", + ")\n", + "\n", + "\n", + "\n", + "builder = ZSLStrainMatchingInterfaceBuilder(\n", + " build_parameters=ZSLStrainMatchingInterfaceBuilderParameters(\n", + " strain_matching_parameters=ZSLStrainMatchingParameters(max_area=MAX_AREA, max_area_ratio_tol=MAX_AREA_RATIO_TOL, max_angle_tol=MAX_ANGLE_TOLERANCE, max_length_tol=MAX_LENGTH_TOLERANCE)\n", + " )\n", + ")\n", + "\n", + "interfaces = builder.get_materials(configuration=interface_config)\n", + "interface_1 = interfaces[INTERFACE_1_INDEX]" + ] + }, + { + "cell_type": "markdown", + "source": [ + "### 2.2. Visualize the Si/SiO2 Interface" + ], + "metadata": { + "collapsed": false + }, + "id": "b4d5e3261b720c9d" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "visualize(\n", + " interface_1,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2 Interface\"\n", + ")\n", + "\n", + "visualize(\n", + " interface_1,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2 Interface\",\n", + " rotation='-90x'\n", + ")\n" + ], + "metadata": { + "collapsed": false + }, + "id": "49c046cf4517ad91", + "execution_count": null + }, + { + "cell_type": "markdown", + "id": "4cc11d87adc5d979", + "metadata": { + "collapsed": false + }, + "source": [ + "## 3. Add HfO2 Layer\n", + "### 3.1. Add a layer with SimpleInterfaceBuilder" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "670fc0c56e8b22b5", + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from mat3ra.made.tools.build.interface import SimpleInterfaceBuilder, SimpleInterfaceBuilderParameters\n", + "\n", + "film_params = STRUCTURE_PARAMS[2]\n", + "\n", + "film_config = SlabConfiguration(\n", + " bulk=materials_2[0],\n", + " **film_params[\"slab_params\"]\n", + ")\n", + "\n", + "hfo2_slab= create_slab(film_config, build_parameters=params)\n", + "\n", + "film_config = SlabConfiguration(\n", + " bulk=hfo2_slab,\n", + " **film_params[\"slab_params\"]\n", + ")\n", + "\n", + "substrate_config = SlabConfiguration(\n", + " bulk=interface_1,\n", + " miller_indices=(0,0,1)\n", + ")\n", + "\n", + "film_terminations = get_terminations(film_config, build_parameters=params)\n", + "substrate_terminations = get_terminations(substrate_config, build_parameters=params)\n", + "\n", + "print(\"Film terminations:\", film_terminations)\n", + "print(\"Substrate terminations:\", substrate_terminations)\n", + "\n", + "\n", + "interface_config = InterfaceConfiguration(\n", + " film_configuration=film_config,\n", + " substrate_configuration=substrate_config,\n", + " film_termination=film_terminations[0],\n", + " substrate_termination=substrate_terminations[0],\n", + " distance=film_params[\"interface_distance\"],\n", + " vacuum=film_params[\"slab_params\"][\"vacuum\"]\n", + ")\n", + "\n", + "builder = SimpleInterfaceBuilder(build_parameters=SimpleInterfaceBuilderParameters(scale_film=True, build_slabs=False))\n", + "interface_2 = builder.get_material(configuration=interface_config)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "source": [ + "### 3.2. Visualize the Si/SiO2/HfO2 Interface" + ], + "metadata": { + "collapsed": false + }, + "id": "6f62d46be77dbf7f" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "visualize(\n", + " interface_2,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2/HfO2 Interface\"\n", + ")\n", + "\n", + "visualize(\n", + " interface_2,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2/HfO2 Interface\",\n", + " rotation='-90x'\n", + ")" + ], + "metadata": { + "collapsed": false + }, + "id": "5ddc3d75b43a3926", + "execution_count": null + }, + { + "cell_type": "markdown", + "id": "93705fda2bacc16e", + "metadata": { + "collapsed": false + }, + "source": [ + "## 4. Add TiN Layer\n", + "### 4.1. Add a layer with SimpleInterfaceBuilder" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46bce40c8d46f8bb", + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from mat3ra.made.tools.build.supercell import create_supercell\n", + "\n", + "film_params = STRUCTURE_PARAMS[3]\n", + "\n", + "interface_2 = create_supercell(interface_2, scaling_factor=[1, 1, -1])\n", + "\n", + "film_config = SlabConfiguration(\n", + " bulk=materials_2[1],\n", + " **film_params[\"slab_params\"]\n", + ")\n", + "\n", + "tin_slab = create_slab(film_config, build_parameters=params)\n", + "\n", + "film_config = SlabConfiguration(\n", + " bulk=tin_slab,\n", + " **film_params[\"slab_params\"]\n", + ")\n", + "\n", + "substrate_config = SlabConfiguration(\n", + " bulk=interface_2,\n", + " miller_indices=(0,0,1)\n", + ")\n", + "\n", + "film_terminations = get_terminations(film_config, build_parameters=params)\n", + "substrate_terminations = get_terminations(substrate_config, build_parameters=params)\n", + "\n", + "print(\"Film terminations:\", film_terminations)\n", + "print(\"Substrate terminations:\", substrate_terminations)\n", + "\n", + "interface_config = InterfaceConfiguration(\n", + " film_configuration=film_config,\n", + " substrate_configuration=substrate_config,\n", + " film_termination=film_terminations[0],\n", + " substrate_termination=substrate_terminations[0],\n", + " distance=film_params[\"interface_distance\"],\n", + " vacuum=film_params[\"slab_params\"][\"vacuum\"]\n", + ")\n", + "\n", + "builder = SimpleInterfaceBuilder(build_parameters=SimpleInterfaceBuilderParameters(scale_film=True, build_slabs=False))\n", + "\n", + "interface_3 = builder.get_material(configuration=interface_config)\n", + "# invert the interface along the z-axis to match example\n", + "interface_3 = create_supercell(interface_3, scaling_factor=[1, 1, -1])\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "source": [ + "### 4.2. Visualize the Si/SiO2/HfO2/TiN Interface" + ], + "metadata": { + "collapsed": false + }, + "id": "de4385aa81264e6b" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "visualize(\n", + " interface_3,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2/HfO2/TiN Interface\"\n", + ")\n", + "\n", + "visualize(\n", + " interface_3,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2/HfO2/TiN Interface\",\n", + " rotation='-90x'\n", + ")" + ], + "metadata": { + "collapsed": false + }, + "id": "2b3fda71c801aeff" + }, + { + "cell_type": "markdown", + "id": "ae16540b54491e35", + "metadata": { + "collapsed": false + }, + "source": [ + "## 5. Save final material\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "803792030da3a97", + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from utils.jupyterlite import download_content_to_file\n", + "\n", + "download_content_to_file(interface_3, \"heterostructure_high_k_metal_gate.json\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv-3.11", + "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.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}