From 789dadce631b7d2e01c97f49a36af4b0cf443c90 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 14:41:18 -0700 Subject: [PATCH 01/26] update: imports from top level helpers --- .../create_adatom_defect.ipynb | 45 +-- .../create_cluster_custom_shape.ipynb | 178 +++++------ .../create_cluster_specific_shape.ipynb | 158 +++++----- .../create_cluster_sphere.ipynb | 196 ++++++------ .../create_cutout_box.ipynb | 194 ++++++------ .../create_cutout_custom_shape.ipynb | 194 ++++++------ .../create_grain_boundary_crystal.ipynb | 236 ++++++++------- .../create_grain_boundary_film.ipynb | 168 ++++++----- .../create_heterostructure_example.ipynb | 124 ++++---- ...create_interface_with_min_strain_zsl.ipynb | 231 +++++++------- ...te_interface_with_no_strain_matching.ipynb | 76 ++--- .../create_island_defect.ipynb | 198 ++++++------ .../create_island_defect_custom.ipynb | 206 ++++++------- .../materials_designer/create_monolayer.ipynb | 186 ++++++------ .../create_nanoribbon.ipynb | 166 +++++----- .../materials_designer/create_nanowire.ipynb | 194 ++++++------ .../create_nanowire_custom_shape.ipynb | 202 ++++++------- .../create_perturbation.ipynb | 176 +++++------ .../create_perturbation_custom.ipynb | 206 ++++++------- .../create_point_defect.ipynb | 66 ++-- other/materials_designer/create_slab.ipynb | 270 +++++++++-------- .../materials_designer/create_supercell.ipynb | 166 +++++----- .../create_terrace_defect.ipynb | 203 +++++++------ ...interface_with_commensurate_lattices.ipynb | 52 ++-- ...e_twisted_interface_with_nanoribbons.ipynb | 144 ++++----- other/materials_designer/passivate_edge.ipynb | 58 ++-- other/materials_designer/passivate_slab.ipynb | 49 +-- .../defect_point_interstitial_tin_oxide.ipynb | 168 ++++++----- .../defect_point_substitution_graphene.ipynb | 170 +++++------ .../defect_surface_step_platinum.ipynb | 72 ++--- ...ide_hafnium_dioxide_titanium_nitride.ipynb | 283 ++++++++++++++---- ...terface_2d_2d_boron_nitride_graphene.ipynb | 142 ++++----- .../specific_examples/nanocluster_gold.ipynb | 42 +-- .../passivation_surface_silicon.ipynb | 196 ++++++------ .../perturbation_ripple_graphene.ipynb | 224 +++++++------- .../slab_strontium_titanate.ipynb | 74 ++--- 36 files changed, 2976 insertions(+), 2737 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index 185cda2e..8e12efd6 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -47,10 +47,11 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "42487847a9bdb6a5", + "metadata": {}, + "outputs": [], "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", @@ -74,8 +75,7 @@ "VACUUM = 5.0 # Vacuum thickness in Angstrom\n", "XY_SUPERCELL_MATRIX = [[2, 0], [0, 2]] # Supercell matrix for the slab\n", "TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used." - ], - "id": "42487847a9bdb6a5" + ] }, { "cell_type": "markdown", @@ -89,10 +89,11 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "84be13304382106", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -105,26 +106,27 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "id": "84be13304382106" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 1.3. Get input material", - "id": "c7ca14890a9205db" + "id": "c7ca14890a9205db", + "metadata": {}, + "source": [ + "### 1.3. Get input material" + ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "540dc3a04b706af6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "id": "540dc3a04b706af6" + ] }, { "cell_type": "markdown", @@ -137,14 +139,14 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "426b290f92c6bc26", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab, get_slab_terminations\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_slab, get_slab_terminations, select_slab_termination\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "material = materials[MATERIAL_INDEX]\n", @@ -166,8 +168,7 @@ " use_conventional_cell=True\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])" - ], - "id": "426b290f92c6bc26" + ] }, { "cell_type": "markdown", @@ -186,7 +187,7 @@ }, "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.adatom.helpers import create_multiple_adatom_defects\n", + "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", "slab_with_adatom = create_multiple_adatom_defects(\n", " slab=slab,\n", diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index 8ff2546f..0ac079b9 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create a cluster of custom shape from a bulk material\n", "\n", @@ -19,35 +23,37 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n" - ], + "id": "5e43ff288847b784", "metadata": { "collapsed": false }, - "id": "5e43ff288847b784" + "source": [ + "## 1. Prepare the Environment\n" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.1. 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))." - ], + "id": "9adf37a8d2620dc4", "metadata": { "collapsed": false }, - "id": "9adf37a8d2620dc4" + "source": [ + "### 1.1. 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": "d9e6be14343d00a1", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -59,57 +65,57 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d9e6be14343d00a1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set up cluster parameters" - ], + "id": "26066db067a41c93", "metadata": { "collapsed": false }, - "id": "26066db067a41c93" + "source": [ + "### 1.2. Set up cluster parameters" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9d8b1890b34d850a", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "RADIUS = 0.3 # in crystal units\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster\n", "USE_CARTESIAN_COORDINATES = False\n", "NAME = \"Icosahedron\" # Name of the cluster" - ], - "metadata": { - "collapsed": false - }, - "id": "9d8b1890b34d850a", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Set coordinates condition" - ], + "id": "3aae932e71fa71a9", "metadata": { "collapsed": false }, - "id": "3aae932e71fa71a9" + "source": [ + "### 1.3. Set coordinates condition" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "8e382d5ab459e2d", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import numpy as np\n", "from scipy.spatial import ConvexHull\n", "from typing import List\n", - "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n", + "from mat3ra.made.tools.helpers import CoordinateCondition\n", "\n", "\n", "class CustomCoordinateCondition(CoordinateCondition):\n", @@ -135,111 +141,105 @@ "\n", " \n", "condition = CustomCoordinateCondition(radius=RADIUS)" - ], - "metadata": { - "collapsed": false - }, - "id": "8e382d5ab459e2d", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Target Material\n", - "### 2.1. Set the cluster configuration\n" - ], + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material\n", + "### 2.1. Set the cluster configuration\n" + ] }, { "cell_type": "code", - "source": [ - "from mat3ra.made.tools.build.nanoparticle.helpers import create_nanoparticle_from_material\n", - "material = materials[0]\n", - "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" - ], + "execution_count": null, + "id": "8fbe260fa14db47a", "metadata": { "collapsed": false }, - "id": "8fbe260fa14db47a", "outputs": [], - "execution_count": null + "source": [ + "from mat3ra.made.tools.helpers import create_nanoparticle_from_material\n", + "material = materials[0]\n", + "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "visualize([{\"material\": cluster, \"title\": f\"Cluster\"},\n", - " {\"material\": cluster, \"title\": f\"Cluster\", \"rotation\": \"-90x\"}])" - ], + "execution_count": null, + "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "id": "509b18661a069e42", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "visualize([{\"material\": cluster, \"title\": f\"Cluster\"},\n", + " {\"material\": cluster, \"title\": f\"Cluster\", \"rotation\": \"-90x\"}])" + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61daa5afcbc078a9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {NAME}\"\n", "set_materials(cluster)" - ], - "metadata": { - "collapsed": false - }, - "id": "61daa5afcbc078a9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 507c21b7..70ed3b25 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create a nanocluster with a specific shape.\n", "\n", @@ -19,35 +23,37 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n" - ], + "id": "5e43ff288847b784", "metadata": { "collapsed": false }, - "id": "5e43ff288847b784" + "source": [ + "## 1. Prepare the Environment\n" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.1. 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))." - ], + "id": "9adf37a8d2620dc4", "metadata": { "collapsed": false }, - "id": "9adf37a8d2620dc4" + "source": [ + "### 1.1. 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": "d9e6be14343d00a1", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -59,27 +65,27 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d9e6be14343d00a1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set up cluster parameters\n", - "Parameters for the cuboctahedron and icosahedron shapes can be found at [ASE Clusters](https://wiki.fysik.dtu.dk/ase/ase/cluster/cluster.html#ase.cluster.Cluster)." - ], + "id": "26066db067a41c93", "metadata": { "collapsed": false }, - "id": "26066db067a41c93" + "source": [ + "### 1.2. Set up cluster parameters\n", + "Parameters for the cuboctahedron and icosahedron shapes can be found at [ASE Clusters](https://wiki.fysik.dtu.dk/ase/ase/cluster/cluster.html#ase.cluster.Cluster)." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9d8b1890b34d850a", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.nanoparticle.enums import NanoparticleShapesEnum\n", "\n", @@ -88,115 +94,109 @@ " \"length\": 5,\n", " \"cutoff\": 2\n", "}" - ], - "metadata": { - "collapsed": false - }, - "id": "9d8b1890b34d850a", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Target Material\n", - "\n" - ], + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material\n", + "\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a990fa35742d7269", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.nanoparticle.helpers import create_nanoparticle_by_shape\n", + "from mat3ra.made.tools.helpers import create_nanoparticle_by_shape\n", "\n", "cluster = create_nanoparticle_by_shape(\n", " crystal=materials[0],\n", " shape=shape,\n", " parameters=parameters\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "a990fa35742d7269", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials\n", - "\n", - "visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}],viewer=\"wave\")" - ], + "execution_count": null, + "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "id": "509b18661a069e42", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials\n", + "\n", + "visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}],viewer=\"wave\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61daa5afcbc078a9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {shape.name.capitalize()} cluster\"\n", "set_materials(cluster)" - ], - "metadata": { - "collapsed": false - }, - "id": "61daa5afcbc078a9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index a414ae11..20ddd845 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create a cluster from a bulk material\n", "\n", @@ -19,50 +23,52 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up cluster parameters" - ], + "id": "5e43ff288847b784", "metadata": { "collapsed": false }, - "id": "5e43ff288847b784" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up cluster parameters" + ] }, { "cell_type": "code", - "source": [ - "RADIUS = 4.5 # in Angstroms\n", - "VACUUM = 10.0 # in Angstroms on each side\n", - "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster" - ], + "execution_count": null, + "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "id": "9d8b1890b34d850a", "outputs": [], - "execution_count": null + "source": [ + "RADIUS = 4.5 # in Angstroms\n", + "VACUUM = 10.0 # in Angstroms on each side\n", + "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster" + ] }, { "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))." - ], + "id": "bb64de5ff32649f8", "metadata": { "collapsed": false }, - "id": "bb64de5ff32649f8" + "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": "ef664b14457530fd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -74,54 +80,54 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "ef664b14457530fd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())\n" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())\n" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create a slab of sufficient size" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.4. Create a slab of sufficient size" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7fcb1e02e84c5f35", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "# Create analyzer to get terminations\n", @@ -148,53 +154,53 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7fcb1e02e84c5f35", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Target Material\n", - "### 2.1. Create spherical cluster\n" - ], + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material\n", + "### 2.1. Create spherical cluster\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a990fa35742d7269", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_sphere, add_vacuum, add_vacuum_sides\n", "\n", "cluster = filter_by_sphere(material=slab, center_coordinate=[0.5, 0.5, 0.5], radius=RADIUS)\n", "cluster = add_vacuum(cluster, VACUUM, to_bottom=True, on_top=True)\n", "cluster = add_vacuum_sides(cluster, VACUUM, on_x=True, on_y=True)" - ], - "metadata": { - "collapsed": false - }, - "id": "a990fa35742d7269", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Set lattice to Cubic" - ], + "id": "a01018588e6e55fc", "metadata": { "collapsed": false }, - "id": "a01018588e6e55fc" + "source": [ + "### 2.2. Set lattice to Cubic" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "4f78c4743b370c3b", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.lattice import Lattice\n", "\n", @@ -203,64 +209,58 @@ "cubic_vector_2 = [0, current_vector_2[1], 0]\n", "cubic_vector_3 = [0, 0, current_vector_3[2]]\n", "cluster.lattice = Lattice.from_vectors_array([cubic_vector_1, cubic_vector_2, cubic_vector_3], type=\"CUB\")" - ], - "metadata": { - "collapsed": false - }, - "id": "4f78c4743b370c3b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "509b18661a069e42", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}])\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "509b18661a069e42", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61daa5afcbc078a9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} Cluster R={RADIUS}A\"\n", "set_materials(cluster)" - ], - "metadata": { - "collapsed": false - }, - "id": "61daa5afcbc078a9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cutout_box.ipynb b/other/materials_designer/create_cutout_box.ipynb index 2304507b..9d2cfd2b 100644 --- a/other/materials_designer/create_cutout_box.ipynb +++ b/other/materials_designer/create_cutout_box.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create slab with box cutout\n", "\n", @@ -19,28 +23,30 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", + "id": "5e43ff288847b784", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up cluster parameters\n", "Min and Max coordinates correspond to opposite vertices of the parallelogram.\n", "\n", "\"Box" - ], - "metadata": { - "collapsed": false - }, - "id": "5e43ff288847b784" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9d8b1890b34d850a", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Box cutout parameters\n", "MIN_COORDINATE = [0.25, 0.25, 0.5]\n", @@ -55,27 +61,27 @@ " \"use_orthogonal_c\": True,\n", " \"xy_supercell_matrix\": [[10, 0], [0, 10]]\n", "}" - ], - "metadata": { - "collapsed": false - }, - "id": "9d8b1890b34d850a", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "bb64de5ff32649f8", "metadata": { "collapsed": false }, - "id": "bb64de5ff32649f8" + "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": "ef664b14457530fd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -87,52 +93,52 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "ef664b14457530fd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create a slab if the input material is not a slab" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.4. Create a slab if the input material is not a slab" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "bfce9928ba2d0c7e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "# Create analyzer to get terminations\n", "slab = create_slab(\n", @@ -143,52 +149,52 @@ " use_orthogonal_c=DEFAULT_SLAB_PARAMETERS[\"use_orthogonal_c\"],\n", " xy_supercell_matrix=DEFAULT_SLAB_PARAMETERS[\"xy_supercell_matrix\"]\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "bfce9928ba2d0c7e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.5. Visualize the slab" - ], + "id": "580036d8d11b8bed", "metadata": { "collapsed": false }, - "id": "580036d8d11b8bed" + "source": [ + "### 1.5. Visualize the slab" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7fcb1e02e84c5f35", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7fcb1e02e84c5f35", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Target Material\n", - "### 2.1. Create a cutout" - ], + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material\n", + "### 2.1. Create a cutout" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a990fa35742d7269", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_box\n", "\n", @@ -199,64 +205,58 @@ " invert_selection=True,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "a990fa35742d7269", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "509b18661a069e42", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_box_cutout, \"title\": f\"Cluster\"}])\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_box_cutout, \"title\": f\"Cluster\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "509b18661a069e42", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61daa5afcbc078a9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "slab_with_box_cutout.name += \" with box cutout\"\n", "set_materials(slab_with_box_cutout)" - ], - "metadata": { - "collapsed": false - }, - "id": "61daa5afcbc078a9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index bf514e52..5997f396 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create a custom-shape cutout\n", "\n", @@ -20,26 +24,28 @@ "\n", "## Resulting structure:\n", "" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", + "id": "98aa134f51746218", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. 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": "98aa134f51746218" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "280f9794a876678b", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -51,26 +57,26 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "280f9794a876678b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set up structure parameters " - ], + "id": "b3d4d3ea7b589f89", "metadata": { "collapsed": false }, - "id": "b3d4d3ea7b589f89" + "source": [ + "### 1.2. Set up structure parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "5177e239254e3601", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Slab parameters\n", "MILLER_INDICES = (0, 0, 1)\n", @@ -87,30 +93,30 @@ "CAVITY_TOP_Z = 0.5\n", "\n", "NAME = \"Custom Shape - Etching Pattern\"" - ], - "metadata": { - "collapsed": false - }, - "id": "5177e239254e3601", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Create a condition on coordinates\n" - ], + "id": "361c291aaf3feb2a", "metadata": { "collapsed": false }, - "id": "361c291aaf3feb2a" + "source": [ + "### 1.3. Create a condition on coordinates\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "56c8227695643174", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from typing import List\n", "\n", - "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n", + "from mat3ra.made.tools.helpers import CoordinateCondition\n", "\n", "\n", "# Example of a custom coordinate condition. Adapt coordinate conditions to your needs.\n", @@ -172,81 +178,81 @@ " channel_depth=CHANNEL_TOP_Z,\n", " cavity_depth=CAVITY_TOP_Z,\n", ").condition" - ], - "metadata": { - "collapsed": false - }, - "id": "56c8227695643174", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "91724db55eddad60", "metadata": { "collapsed": false }, - "id": "91724db55eddad60" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "ceebf2a5229da67c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0]" - ], - "metadata": { - "collapsed": false - }, - "id": "ceebf2a5229da67c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "13964644436b4156", "metadata": { "collapsed": false }, - "id": "13964644436b4156" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "45f0c424ece00186", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize(material, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(material, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "45f0c424ece00186", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create target material\n", - "### 2.1. Create a slab and apply the cutout condition" - ], + "id": "615800437b2ef7a", "metadata": { "collapsed": false }, - "id": "615800437b2ef7a" + "source": [ + "## 2. Create target material\n", + "### 2.1. Create a slab and apply the cutout condition" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "422815d29aa347a1", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_condition_on_coordinates, add_vacuum\n", "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "# Create analyzer to get terminations\n", "analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material, miller_indices=MILLER_INDICES)\n", @@ -265,62 +271,56 @@ ")\n", "resulting_material = filter_by_condition_on_coordinates(slab_unit_cell, condition)\n", "resulting_material = add_vacuum(resulting_material, VACUUM)" - ], - "metadata": { - "collapsed": false - }, - "id": "422815d29aa347a1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the result" - ], + "id": "57cc38ec0df3c1f7", "metadata": { "collapsed": false }, - "id": "57cc38ec0df3c1f7" + "source": [ + "## 3. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"0x\")\n", - "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"-90x\")\n", - "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"-90x,-90y\")" - ], + "execution_count": null, + "id": "2a9627cd4a261067", "metadata": { "collapsed": false }, - "id": "2a9627cd4a261067", "outputs": [], - "execution_count": null + "source": [ + "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"0x\")\n", + "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"-90x\")\n", + "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"-90x,-90y\")" + ] }, { "cell_type": "markdown", - "source": [ - "# 4. Pass material to the outside runtime" - ], + "id": "c67e6f5363e80942", "metadata": { "collapsed": false }, - "id": "c67e6f5363e80942" + "source": [ + "# 4. Pass material to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "cbee60d4b936e5cb", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "resulting_material.name = NAME\n", "set_materials(resulting_material)" - ], - "metadata": { - "collapsed": false - }, - "id": "cbee60d4b936e5cb", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 2487443c..97c3eab4 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -2,14 +2,18 @@ "cells": [ { "cell_type": "markdown", - "source": [], + "id": "ba979b741d79bad2", "metadata": { "collapsed": false }, - "id": "ba979b741d79bad2" + "source": [] }, { "cell_type": "markdown", + "id": "64cac14fa1273938", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Grain Boundary with Strain Matching\n", "\n", @@ -35,27 +39,29 @@ "1. We perform strain matching on the slabs to extract the supercell dimensions.\n", "2. When the strain matching is finished, the grain boundary with the lowest strain (and reasonable number of atoms) is selected.\n", "3. For more information about grain boundaries, see the Introduction notebook.\n" - ], - "metadata": { - "collapsed": false - }, - "id": "64cac14fa1273938" + ] }, { "cell_type": "markdown", + "id": "31ef78017669ea95", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", "\n", "Set the following flags to control the notebook behavior " - ], - "metadata": { - "collapsed": false - }, - "id": "31ef78017669ea95" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "38eac66e44951f88", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Parameters for Phase 1\n", "PHASE_1_MILLER_INDICES = (1, 1, 1)\n", @@ -77,27 +83,27 @@ "\n", "# index of the grain boundary to select after strain matching\n", "MATCH_ID = 0 # if None, the grain boundary with the lowest strain will be selected" - ], - "metadata": { - "collapsed": false - }, - "id": "38eac66e44951f88", - "outputs": [], - "execution_count": null + ] }, { "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`." - ], + "id": "63f9747e4a43c49d", "metadata": { "collapsed": false }, - "id": "63f9747e4a43c49d" + "source": [ + "### 1.2. Install Packages\n", + "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install`." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "26c1a6af762eda56", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -109,80 +115,80 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"create_grain_boundary.ipynb\")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "26c1a6af762eda56", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "1e2caebbe15a0e06", "metadata": { "collapsed": false }, - "id": "1e2caebbe15a0e06" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "c269a9fe44c400be", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0]" - ], - "metadata": { - "collapsed": false - }, - "id": "c269a9fe44c400be", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview Material" - ], + "id": "91b2b7a5a2996487", "metadata": { "collapsed": false }, - "id": "91b2b7a5a2996487" + "source": [ + "### 1.4. Preview Material" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "\n", - "visualize([material], repetitions=[3, 3, 1], rotation=\"0x\")" - ], + "execution_count": null, + "id": "4fb3d10f24145759", "metadata": { "collapsed": false }, - "id": "4fb3d10f24145759", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "\n", + "visualize([material], repetitions=[3, 3, 1], rotation=\"0x\")" + ] }, { "cell_type": "markdown", + "id": "ed7b0a774220a297", + "metadata": { + "collapsed": false + }, "source": [ "## 2. Configure slabs and select termination pair\n", "\n", "### 2.1. Create Phase 1 and Phase 2 Slabs\n", "Get the terminations for the two slabs of phases." - ], - "metadata": { - "collapsed": false - }, - "id": "ed7b0a774220a297" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "70ce21f35a487b63", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "phase_1_terminations = get_slab_terminations(\n", " material=material,\n", @@ -193,27 +199,26 @@ " material=material,\n", " miller_indices=PHASE_2_MILLER_INDICES,\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "70ce21f35a487b63", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.3. Visualize slabs for all possible terminations", - "id": "d233c1437eb21960" + "id": "d233c1437eb21960", + "metadata": {}, + "source": [ + "### 2.3. Visualize slabs for all possible terminations" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "cd8e53c68e1c7569", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination=termination) for termination in\n", " phase_1_terminations]\n", @@ -228,41 +233,48 @@ "\n", "visualize(phase_1_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(phase_2_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "id": "cd8e53c68e1c7569", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.4. Select terminations for the grain boundary phases", - "id": "5fd99a07e51380b0" + "id": "5fd99a07e51380b0", + "metadata": {}, + "source": [ + "### 2.4. Select terminations for the grain boundary phases" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "9109ac095608d82a", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import select_slab_termination\n", "phase_1_selected_termination = select_slab_termination(phase_1_terminations, PHASE_1_TERMINATION_FORMULA)\n", "phase_2_selected_termination = select_slab_termination(phase_2_terminations, PHASE_2_TERMINATION_FORMULA)" - ], - "id": "9109ac095608d82a", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 3. Create grain boundary", + "id": "20186205803e07d9", "metadata": { "collapsed": false }, - "id": "20186205803e07d9" + "source": [ + "## 3. Create grain boundary" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e9977c17f97f0035", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.grain_boundary.helpers import create_grain_boundary_planar\n", + "from mat3ra.made.tools.helpers import create_grain_boundary_planar\n", "\n", "grain_boundary = create_grain_boundary_planar(\n", " phase_1_material=material,\n", @@ -276,60 +288,54 @@ " max_area_ratio_tol=0.2,\n", " match_id =MATCH_ID,\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "e9977c17f97f0035", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Preview the grain boundary" - ], + "id": "aa55348911eb6679", "metadata": { "collapsed": false }, - "id": "aa55348911eb6679" + "source": [ + "## 4. Preview the grain boundary" + ] }, { "cell_type": "code", - "source": [ - "visualize([grain_boundary], repetitions=[1, 1, 1])\n", - "visualize([grain_boundary], repetitions=[1, 1, 1], rotation=\"-90x\")" - ], + "execution_count": null, + "id": "abd081a986bdca0", "metadata": { "collapsed": false }, - "id": "abd081a986bdca0", "outputs": [], - "execution_count": null + "source": [ + "visualize([grain_boundary], repetitions=[1, 1, 1])\n", + "visualize([grain_boundary], repetitions=[1, 1, 1], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 5. Pass data to the outside runtime" - ], + "id": "bde2ea26c96543f5", "metadata": { "collapsed": false }, - "id": "bde2ea26c96543f5" + "source": [ + "## 5. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(grain_boundary)" - ], + "execution_count": null, + "id": "76469e88bd21a25d", "metadata": { "collapsed": false }, - "id": "76469e88bd21a25d", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(grain_boundary)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_grain_boundary_film.ipynb b/other/materials_designer/create_grain_boundary_film.ipynb index 037ea924..e81fac8c 100644 --- a/other/materials_designer/create_grain_boundary_film.ipynb +++ b/other/materials_designer/create_grain_boundary_film.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "415ed707e27a6c8e", + "metadata": { + "collapsed": false + }, "source": [ "# Create a 2D Surface Grain Boundary in a film\n", "\n", @@ -23,14 +27,14 @@ "2. The two orientations are placed next to each other in the x-direction with a gap in between.\n", "1. Atoms on the edge of the left orientation are handled to overlap with the right orientation in the interfacial region.\n", "1. For more information, see the [Introduction](Introduction.ipynb) notebook.\n" - ], - "metadata": { - "collapsed": false - }, - "id": "415ed707e27a6c8e" + ] }, { "cell_type": "markdown", + "id": "a080006df3785cc5", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -40,14 +44,16 @@ "For example of Graphene at 17.9 degrees: orange and green atoms are present with the value of 0.5 Angstroms, with value of 0, they will not be included.\n", "\n", "\"Edge\n" - ], - "metadata": { - "collapsed": false - }, - "id": "a080006df3785cc5" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "338ee3c51155e086", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_INDEX = 0 # Index in the list of materials\n", @@ -76,27 +82,27 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [3, 3, 1]" - ], - "metadata": { - "collapsed": false - }, - "id": "338ee3c51155e086", - "outputs": [], - "execution_count": null + ] }, { "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`." - ], + "id": "6463f9bbcd3be7c7", "metadata": { "collapsed": false }, - "id": "6463f9bbcd3be7c7" + "source": [ + "### 1.2. Install packages\n", + "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install`." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7e22d1f4da825575", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -108,51 +114,51 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7e22d1f4da825575", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Load and preview input material" - ], + "id": "4a1cfe15caa44c3e", "metadata": { "collapsed": false }, - "id": "4a1cfe15caa44c3e" + "source": [ + "### 1.3. Load and preview input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "a1635c31132962f6", "metadata": { "collapsed": false }, - "id": "a1635c31132962f6", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Prepare Material\n", - "### 2.1. Select and visualize initial material" - ], + "id": "32b3ad775543b06f", "metadata": { "collapsed": false }, - "id": "32b3ad775543b06f" + "source": [ + "## 2. Prepare Material\n", + "### 2.1. Select and visualize initial material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61f0870d8104cd21", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -160,27 +166,29 @@ "\n", "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)" - ], - "metadata": { - "collapsed": false - }, - "id": "61f0870d8104cd21", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 3. Generate Surface Grain Boundary\n", + "id": "34d6c7a337f1e40b", "metadata": { "collapsed": false }, - "id": "34d6c7a337f1e40b" + "source": [ + "## 3. Generate Surface Grain Boundary\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "33a2c8a9be436745", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", - "from mat3ra.made.tools.build.grain_boundary import create_grain_boundary_linear\n", + "from mat3ra.made.tools.helpers import create_grain_boundary_linear\n", "\n", "\n", "grain_boundary = create_grain_boundary_linear(\n", @@ -193,24 +201,26 @@ " miller_indices=MILLER_INDICES,\n", " vacuum=VACUUM\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "33a2c8a9be436745", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 4. Preview grain boundary", + "id": "8b2f0574a20089a5", "metadata": { "collapsed": false }, - "id": "8b2f0574a20089a5" + "source": [ + "## 4. Preview grain boundary" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7f558a8e9d417cef", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "actual_angle = grain_boundary.metadata.build[-1].configuration.get(\"actual_angle\")\n", "print(actual_angle)\n", @@ -220,37 +230,31 @@ "\n", "visualize_materials(grain_boundary, repetitions=[1, 1, 1])\n", "visualize_materials(grain_boundary, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7f558a8e9d417cef", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 5. Pass data to the outside runtime\n" - ], + "id": "afcc004c5878b56f", "metadata": { "collapsed": false }, - "id": "afcc004c5878b56f" + "source": [ + "### 5. Pass data to the outside runtime\n" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(grain_boundary)" - ], + "execution_count": null, + "id": "20e46167358d63", "metadata": { "collapsed": false }, - "id": "20e46167358d63", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(grain_boundary)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index e6bb0b7d..fc0fc705 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -47,10 +47,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9e90252bcef065c9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Enable interactive selection of terminations via UI prompt\n", "IS_TERMINATIONS_SELECTION_INTERACTIVE = False \n", @@ -91,9 +93,7 @@ "# Set termination pair indices for both interfaces\n", "TERMINATION_PAIR_INDEX_01 = 0\n", "TERMINATION_PAIR_INDEX_12 = 0\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -109,10 +109,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a4d99b5b40274810", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -122,9 +124,7 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -140,10 +140,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e90d5bf2655f5e0f", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", @@ -162,9 +164,7 @@ "except IndexError:\n", " print(\"Please select Material 2. Material 2 is set to Material 0.\")\n", " material2 = material0\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -180,17 +180,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6253034909a0fef9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([material0, material1, material2], repetitions=[3, 3, 1], rotation=\"0x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -208,12 +208,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "de4fe773ee9c8a61", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", "\n", "# Slab Configuration for Material 1 (Film) - using correct parameters like ZSL notebook\n", @@ -254,9 +256,7 @@ "\n", "visualize(material1_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(material0_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -270,10 +270,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4e467693b61f0125", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from itertools import product\n", "\n", @@ -281,9 +283,7 @@ "print(\"Termination Pairs for First Interface (Material1, Material0)\")\n", "for idx, termination_pair in enumerate(termination_pairs_01):\n", " print(f\" {idx}: {termination_pair}\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -297,10 +297,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c99cb2e5bbcd24df", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "from utils.io import ui_prompt_select_array_element_by_index, ui_prompt_select_array_element_by_index_pyodide\n", @@ -326,9 +328,7 @@ " termination_pairs_01,\n", " element_name=\"Material1/Material0 termination pair\"\n", " )\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -342,10 +342,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9e87ca9779cee593", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", "\n", @@ -374,9 +376,7 @@ "# Build the actual slabs\n", "material1_slab = SlabBuilder().get_material(material1_slab_config)\n", "material0_slab = SlabBuilder().get_material(material0_slab_config)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -390,10 +390,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9b72198198a18278", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", "\n", @@ -409,9 +411,7 @@ "\n", "# Get ZSL matches\n", "matches_01 = zsl_analyzer_01.zsl_match_holders\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -425,13 +425,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "32e05e63fea1b5a3", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "PLOT_SETTINGS = {\n", " \"HEIGHT\": 600,\n", @@ -455,9 +457,7 @@ ")\n", "\n", "selected_interfaces_01 = [interface_01]\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -471,16 +471,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "1148759314be11cc", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(selected_interfaces_01, repetitions=[3, 3, 1])\n", "visualize(selected_interfaces_01, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -498,10 +498,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "636e0e4c45b02925", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "\n", @@ -523,9 +525,7 @@ "\n", "# Visualize the substrate (first interface)\n", "visualize([{\"material\": substrate_second, \"title\": \"First Interface (Substrate)\"}], repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -539,18 +539,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "41b3d541c1ebfe5a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "termination_pairs_12 = list(product(material2_slab_terminations, substrate_second_slab_terminations)) \n", "print(\"Termination Pairs for Second Interface (Material2, First Interface Substrate)\")\n", "for idx, termination_pair in enumerate(termination_pairs_12):\n", " print(f\" {idx}: {termination_pair}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -564,10 +564,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f9d2b5429447338e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Select terminations for Material 2 and the substrate using the newer approach\n", "material2_termination = select_slab_termination(material2_slab_terminations, None) # None means use first termination\n", @@ -590,9 +592,7 @@ " termination_pairs_12,\n", " element_name=\"Material2/First Interface termination pair\"\n", " )" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -606,10 +606,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "fa7e6b937d2b78a0", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Create slab configurations and slabs for the second interface using the newer approach\n", "material2_termination, substrate_second_termination = termination_pair_second\n", @@ -628,9 +630,7 @@ "material2_slab = SlabBuilder().get_material(material2_slab_config)\n", "\n", "# For the substrate (first interface), we'll use it as-is since it's already built" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -644,10 +644,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6f30c6961f7abbfe", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Set up ZSL Interface Analyzer for the second interface\n", "# Note: For the second interface, we need to create a slab configuration for the substrate (first interface)\n", @@ -671,9 +673,7 @@ "\n", "# Get ZSL matches for the second interface\n", "matches_12 = zsl_analyzer_12.zsl_match_holders" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -687,10 +687,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "43f233403393eb2a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "plot_strain_vs_area(matches_12, PLOT_SETTINGS)\n", "\n", @@ -708,9 +710,7 @@ ")\n", "\n", "selected_interfaces_12 = [interface_12]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -724,16 +724,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "fffbf9243911a98", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(selected_interfaces_12, repetitions=[3, 3, 1])\n", "visualize(selected_interfaces_12, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -747,16 +747,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "47f9a1aa1578c37", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(selected_interfaces_12, repetitions=[3, 3, 1], title=\"Final Heterostructure (First Interface + Material2)\")\n", "visualize(selected_interfaces_12, repetitions=[3, 3, 1], rotation=\"-90x\", title=\"Final Heterostructure (First Interface + Material2) Rotated\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -772,10 +772,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "1b466c32b0d82431", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", @@ -783,9 +785,7 @@ "final_heterostructure.name = f\"{material0.name} - {material1.name} - {material2.name} - Heterostructure\"\n", "\n", "set_materials(final_heterostructure)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { 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 ceee6024..ab03a982 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -34,19 +34,21 @@ }, { "cell_type": "markdown", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", "\n", "Set the following flags to control the notebook behavior " - ], - "metadata": { - "collapsed": false - } + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX]\n", "FILM_MILLER_INDICES = (0, 0, 1)\n", @@ -81,22 +83,25 @@ "# Whether to reduce the resulting interface cell to the primitive cell after the interface creation.\n", "# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search.\n", "REDUCE_RESULT_CELL_TO_PRIMITIVE = True" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": { + "collapsed": false + }, "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 - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -108,23 +113,23 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "### 1.3. Get input materials and assign `substrate` and `film`\n", "Materials are loaded with `get_data()`. The first material is assigned as substrate and the second as film." - ], - "metadata": {} + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", @@ -135,75 +140,77 @@ "except IndexError:\n", " print(\"Film material not found. Re-using substrate material as film.\")\n", " film = substrate" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview Substrate and Film" - ], "metadata": { "collapsed": false - } + }, + "source": [ + "### 1.4. Preview Substrate and Film" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "\n", - "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" - ], + "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "\n", + "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 2. Configure slabs for interface\n" + "metadata": {}, + "source": [ + "## 2. Configure slabs for interface\n" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.1. Get possible terminations for the slabs" + "metadata": {}, + "source": [ + "### 2.1. Get possible terminations for the slabs" + ] }, { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "film_slab_terminations = get_slab_terminations(material=film, miller_indices=FILM_MILLER_INDICES)\n", "substrate_slab_terminations = get_slab_terminations(material=substrate, miller_indices=SUBSTRATE_MILLER_INDICES)\n", "print(\"Film slab terminations:\", film_slab_terminations)\n", "print(\"Substrate slab terminations:\", substrate_slab_terminations)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Visualize slabs for all possible terminations" + "metadata": {}, + "source": [ + "### 2.2. Visualize slabs for all possible terminations" + ] }, { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", " in\n", @@ -220,28 +227,28 @@ "\n", "visualize(film_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(substrate_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.3. Select terminations for the Slabs" + "metadata": {}, + "source": [ + "### 2.3. Select terminations for the Slabs" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 2.4. Create Substrate and Layer Slabs\n", "Slab Configuration lets define the slab thickness, vacuum, and the Miller indices of the interfacial plane and get the slabs with possible terminations.\n", @@ -249,11 +256,13 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", + "from mat3ra.made.tools.helpers import SlabBuilder\n", + "from mat3ra.made.tools.helpers import SlabConfiguration\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", @@ -275,21 +284,21 @@ "\n", "substrate_slab = SlabBuilder().get_material(substrate_slab_config)\n", "film_slab = SlabBuilder().get_material(film_slab_config)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.2. Analyze possible interfaces with ZSL Analyzer\n", "The search algorithm for supercells matching can be tuned by setting its parameters directly, otherwise the default values are used." ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", "\n", @@ -302,38 +311,43 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell=False # Reduces supercell matrices in analyzer\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": { + "collapsed": false + }, "source": [ "### 3.3. Generate interfaces with strain matcher\n", "Interfaces are sorted by size and strain." - ], - "metadata": { - "collapsed": false - } + ] }, { - "metadata": {}, "cell_type": "code", - "source": "matches = zsl_analyzer.zsl_match_holders", + "execution_count": null, + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "matches = zsl_analyzer.zsl_match_holders" + ] }, { "cell_type": "markdown", - "source": [ - "### 3.4. Plot interfaces by size and strain\n" - ], "metadata": { "collapsed": false - } + }, + "source": [ + "### 3.4. Plot interfaces by size and strain\n" + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", "\n", @@ -344,16 +358,11 @@ "}\n", "\n", "plot_strain_vs_area(matches, PLOT_SETTINGS)" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.5. Select the interface\n", "\n", @@ -361,17 +370,19 @@ ] }, { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, - "cell_type": "code", - "source": "selected_index = 0", "outputs": [], - "execution_count": null + "source": [ + "selected_index = 0" + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "## 3. Create the interface\n", "\n", @@ -379,10 +390,12 @@ ] }, { + "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "\n", "interface = create_zsl_interface_between_slabs(\n", @@ -397,30 +410,28 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell_to_primitive=REDUCE_RESULT_CELL_TO_PRIMITIVE,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Preview the selected material" - ], "metadata": { "collapsed": false - } + }, + "source": [ + "## 4. Preview the selected material" + ] }, { "cell_type": "code", - "source": [ - "visualize(interface, repetitions=[1, 1, 1])\n", - "visualize(interface, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], + "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], - "execution_count": null + "source": [ + "visualize(interface, repetitions=[1, 1, 1])\n", + "visualize(interface, repetitions=[1, 1, 1], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", @@ -431,14 +442,14 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(interface)" - ], - "outputs": [], - "execution_count": null + ] } ], "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 88a539c8..cf791807 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -38,7 +38,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "# Create slabs for the film and substrate when creating the interface, otherwise use provided materials directly.\n", "CREATE_SLABS = True \n", @@ -65,9 +67,7 @@ "\n", "INTERFACE_DISTANCE = 3.0 # in Angstrom\n", "INTERFACE_VACUUM = 20.0 # in Angstrom" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -82,9 +82,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -94,9 +96,7 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -110,9 +110,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", @@ -123,9 +125,7 @@ "except IndexError:\n", " print(\"Please select a film material. Film is set to substrate.\")\n", " film = substrate" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -138,15 +138,15 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -165,15 +165,15 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "film_slab_terminations = get_slab_terminations(film, miller_indices=FILM_MILLER_INDICES)\n", "substrate_slab_terminations = get_slab_terminations(substrate, miller_indices=SUBSTRATE_MILLER_INDICES)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -184,12 +184,14 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import select_slab_termination\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", " in\n", @@ -206,9 +208,7 @@ "\n", "visualize(film_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(substrate_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -219,13 +219,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -238,9 +238,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "if CREATE_SLABS:\n", " film_slab = create_slab(\n", @@ -267,9 +269,7 @@ "else:\n", " film_slab = film\n", " substrate_slab = substrate\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -282,9 +282,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.interface.helpers import create_simple_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_simple_between_slabs as create_simple_interface_between_slabs\n", "\n", "interface = create_simple_interface_between_slabs(\n", " film_slab=film_slab,\n", @@ -293,19 +295,17 @@ " vacuum=INTERFACE_VACUUM,\n", " xy_shift=FILM_XY_SHIFT\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "visualize([interface], repetitions=[3, 3, 1])\n", "visualize([interface], repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -316,13 +316,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "set_materials(interface)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index 02ea0fbb..d1f1b1b5 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create island defect on a slab\n", "\n", @@ -19,25 +23,27 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up defect parameters " - ], + "id": "5e43ff288847b784", "metadata": { "collapsed": false }, - "id": "5e43ff288847b784" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up defect parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9d8b1890b34d850a", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "\n", "# Shape-specific parameters\n", @@ -90,27 +96,27 @@ "# 'max_z': 1\n", "# }\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "9d8b1890b34d850a", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "bb64de5ff32649f8", "metadata": { "collapsed": false }, - "id": "bb64de5ff32649f8" + "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": "ef664b14457530fd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -120,51 +126,51 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "ef664b14457530fd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview Slab or create a new one" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.4. Preview Slab or create a new one" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7fcb1e02e84c5f35", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "slab = materials[0]\n", @@ -183,83 +189,83 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7fcb1e02e84c5f35", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Target Material\n", - "### 2.1. Initialize the defect conditions" - ], + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material\n", + "### 2.1. Initialize the defect conditions" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e2d24109d3068c9e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.utils.coordinate import CylinderCoordinateCondition\n", + "from mat3ra.made.tools.helpers import CylinderCoordinateCondition\n", "\n", "condition = CylinderCoordinateCondition(\n", " center_position=CENTER_POSITION,\n", " radius=SHAPE_PARAMETERS['radius'],\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "e2d24109d3068c9e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Create the island" - ], + "id": "489b51f0ee122c48", "metadata": { "collapsed": false }, - "id": "489b51f0ee122c48" + "source": [ + "### 2.2. Create the island" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a990fa35742d7269", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.island.helpers import create_island_defect\n", + "from mat3ra.made.tools.helpers import create_island\n", "\n", - "slab_with_island = create_island_defect(\n", + "slab_with_island = create_island(\n", " slab=slab,\n", " condition=condition,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "a990fa35742d7269", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "509b18661a069e42", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}] ,\n", @@ -267,37 +273,31 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "509b18661a069e42", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(slab_with_island)" - ], + "execution_count": null, + "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "id": "61daa5afcbc078a9", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(slab_with_island)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_island_defect_custom.ipynb b/other/materials_designer/create_island_defect_custom.ipynb index 06c6e160..22e07554 100644 --- a/other/materials_designer/create_island_defect_custom.ipynb +++ b/other/materials_designer/create_island_defect_custom.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create Custom Shape Island Defect on a Slab\n", "\n", @@ -20,26 +24,28 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", + "id": "e82522518cb8724c", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. 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": "e82522518cb8724c" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b1216c665d6cf493", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "from typing import List\n", @@ -51,30 +57,27 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "b1216c665d6cf493", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Create custom Coordinate Conditions" - ], + "id": "c360bd0ea9a5f262", "metadata": { "collapsed": false }, - "id": "c360bd0ea9a5f262" + "source": [ + "### 1.2. Create custom Coordinate Conditions" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "55f4289a6545c504", + "metadata": {}, + "outputs": [], "source": [ "import numpy as np\n", - "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n", + "from mat3ra.made.tools.helpers import CoordinateCondition\n", "\n", "# Custom Coordinate Condition for a torus shape\n", "class CustomCoordinateCondition(CoordinateCondition):\n", @@ -89,24 +92,24 @@ " # Calculate the distance from the torus surface\n", " distance_to_torus = np.sqrt((xy_distance - self.major_radius) ** 2 + (coord[2] - self.center[2]) ** 2)\n", " return distance_to_torus <= self.minor_radius\n" - ], - "id": "55f4289a6545c504", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Set the parameters\n" - ], + "id": "535bbac2c3f2832b", "metadata": { "collapsed": false }, - "id": "535bbac2c3f2832b" + "source": [ + "### 1.3. Set the parameters\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "4f6c437b81325730", + "metadata": {}, + "outputs": [], "source": [ "CENTER_POSITION = [0.5, 0.5, 0.5] # Center of the torus in crystal coordinates\n", "MAJOR_RADIUS = 0.3 # Major radius of the torus\n", @@ -124,74 +127,77 @@ " \"use_orthogonal_c\": True,\n", " \"xy_supercell_matrix\": [[10, 0], [0, 10]]\n", "}" - ], - "id": "4f6c437b81325730", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Initialize the Coordinate Condition" - ], + "id": "8ab363bab5c5f7cc", "metadata": { "collapsed": false }, - "id": "8ab363bab5c5f7cc" + "source": [ + "### 1.4. Initialize the Coordinate Condition" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "87c3850f6c7178b2", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "coordinate_condition = CustomCoordinateCondition(\n", " center=CENTER_POSITION,\n", " major_radius=MAJOR_RADIUS,\n", " minor_radius=MINOR_RADIUS\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "87c3850f6c7178b2", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.5. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.5. Get input material" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.6. Preview Slab or create a new one" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.6. Preview Slab or create a new one" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7fcb1e02e84c5f35", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "slab = materials[0]\n", @@ -208,53 +214,55 @@ " \n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7fcb1e02e84c5f35", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 2. Create the Target Material", + "id": "690241d87e7bbbe0", "metadata": { "collapsed": false }, - "id": "690241d87e7bbbe0" + "source": [ + "## 2. Create the Target Material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e2d24109d3068c9e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.island.helpers import create_island_defect\n", + "from mat3ra.made.tools.helpers import create_island\n", "\n", - "slab_with_island = create_island_defect(\n", + "slab_with_island = create_island(\n", " slab=slab,\n", " condition=coordinate_condition,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "e2d24109d3068c9e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize the Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "509b18661a069e42", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect\"}],\n", @@ -262,37 +270,31 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect\"}])" - ], - "metadata": { - "collapsed": false - }, - "id": "509b18661a069e42", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(slab_with_island)" - ], + "execution_count": null, + "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "id": "61daa5afcbc078a9", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(slab_with_island)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_monolayer.ipynb b/other/materials_designer/create_monolayer.ipynb index 628da7f9..f8ef61a8 100644 --- a/other/materials_designer/create_monolayer.ipynb +++ b/other/materials_designer/create_monolayer.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "a79609c9bc772c5c", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Monolayer\n", "\n", @@ -13,25 +17,27 @@ "1. Set notebook parameters in cell 1.1. below (or use the default values).\n", "1. Click “Run” > “Run All” to run all cells. \n", "1. Scroll down to view results. " - ], - "metadata": { - "collapsed": false - }, - "id": "a79609c9bc772c5c" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up transformation parameters " - ], + "id": "47d31d9834478007", "metadata": { "collapsed": false }, - "id": "47d31d9834478007" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up transformation parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a2c8922a4e627887", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "XY_SUPERCELL_MATRIX = [\n", " [3, 0],\n", @@ -39,27 +45,27 @@ "]\n", "\n", "VACUUM = 10.0 # Angstrom" - ], - "metadata": { - "collapsed": false - }, - "id": "a2c8922a4e627887", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "6fab076ea1d7a223", "metadata": { "collapsed": false }, - "id": "6fab076ea1d7a223" + "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": "b0c332f1c1f451fd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -71,157 +77,157 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "b0c332f1c1f451fd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "3e9934b458d6cb4", "metadata": { "collapsed": false }, - "id": "3e9934b458d6cb4" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "74cd0d5a3881ab47", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0]" - ], - "metadata": { - "collapsed": false - }, - "id": "74cd0d5a3881ab47", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "d4535caf6debb8d4", "metadata": { "collapsed": false }, - "id": "d4535caf6debb8d4" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "d6bea39864c23ab5", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")\n", "visualize(material, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d6bea39864c23ab5", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create Monolayer" - ], + "id": "5473c36cd254aa89", "metadata": { "collapsed": false }, - "id": "5473c36cd254aa89" + "source": [ + "## 2. Create Monolayer" + ] }, { "cell_type": "markdown", - "source": "### 2.1. Create a monolayer unit cell", + "id": "ee17958872d03410", "metadata": { "collapsed": false }, - "id": "ee17958872d03410" + "source": [ + "### 2.1. Create a monolayer unit cell" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "f05c4872edfef910", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.monolayer.helpers import create_monolayer\n", + "from mat3ra.made.tools.helpers import create_monolayer\n", "\n", "monolayer = create_monolayer(\n", " crystal=material,\n", " vacuum=VACUUM,\n", ")" - ], - "id": "f05c4872edfef910", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2 Create a supercell", - "id": "372400a5610d7247" + "id": "372400a5610d7247", + "metadata": {}, + "source": [ + "### 2.2 Create a supercell" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "25d6681d5c1bfb0", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.operations.core.unary import supercell\n", "\n", "monolayer = supercell(\n", " material=monolayer,\n", " supercell_matrix=XY_SUPERCELL_MATRIX, )" - ], - "id": "25d6681d5c1bfb0", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 3. Visualize the result", - "id": "82f9dfac4c711634" + "id": "82f9dfac4c711634", + "metadata": {}, + "source": [ + "## 3. Visualize the result" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "ab5c2f5ee249525c", + "metadata": {}, + "outputs": [], "source": [ "visualize(monolayer, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(monolayer, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "id": "ab5c2f5ee249525c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "# 4. Pass material to the outside runtime" - ], + "id": "6ce5f7dd9a919a08", "metadata": { "collapsed": false }, - "id": "6ce5f7dd9a919a08" + "source": [ + "# 4. Pass material to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(monolayer)" - ], + "execution_count": null, + "id": "865c71d008d87beb", "metadata": { "collapsed": false }, - "id": "865c71d008d87beb", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(monolayer)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index 9d4f5d28..8abcf09d 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "367a698b29e22bd7", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Nanoribbon of a 2D material\n", "\n", @@ -22,25 +26,27 @@ "## Notes\n", "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "367a698b29e22bd7" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up nanoribbon parameters " - ], + "id": "193a4e6a78fd5bd7", "metadata": { "collapsed": false }, - "id": "193a4e6a78fd5bd7" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up nanoribbon parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a40d7b697c413113", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", @@ -51,27 +57,27 @@ "VACUUM_WIDTH = 10.0 # in Angstroms\n", "VACUUM_LENGTH = 10.0 # in Angstroms\n", "EDGE_TYPE = \"zigzag\" # \"zigzag\" or \"armchair\"" - ], - "metadata": { - "collapsed": false - }, - "id": "a40d7b697c413113", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "49c9f5022d50517e", "metadata": { "collapsed": false }, - "id": "49c9f5022d50517e" + "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": "c6d9f8e57bef2f91", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -81,76 +87,78 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "c6d9f8e57bef2f91", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials\n", - "Materials are loaded with `get_materials()`." - ], + "id": "edf02101e27a2742", "metadata": { "collapsed": false }, - "id": "edf02101e27a2742" + "source": [ + "### 1.3. Get input materials\n", + "Materials are loaded with `get_materials()`." + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "e0c53233ce728cc1", "metadata": { "collapsed": false }, - "id": "e0c53233ce728cc1", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview Material" - ], + "id": "cf29b7f6fe114d8f", "metadata": { "collapsed": false }, - "id": "cf29b7f6fe114d8f" + "source": [ + "### 1.4. Preview Material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "897ba7aa4e402d24", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "material = materials[MATERIAL_INDEX]\n", "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "897ba7aa4e402d24", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 2. Create the Nanoribbon\n", + "id": "39a93c4635762a83", "metadata": { "collapsed": false }, - "id": "39a93c4635762a83" + "source": [ + "## 2. Create the Nanoribbon\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "1991efeeebe39db4", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.lattice_lines import EdgeTypes\n", - "from mat3ra.made.tools.build.nanoribbon.helpers import create_nanoribbon\n", + "from mat3ra.made.tools.helpers import EdgeTypes\n", + "from mat3ra.made.tools.helpers import create_nanoribbon\n", "\n", "\n", "nanoribbon = create_nanoribbon(\n", @@ -162,59 +170,53 @@ " use_rectangular_lattice=True,\n", " edge_type=EdgeTypes.zigzag if EDGE_TYPE == \"zigzag\" else EdgeTypes.armchair\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "1991efeeebe39db4", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the Nanoribbon" - ], + "id": "eecd561cd92fb18a", "metadata": { "collapsed": false }, - "id": "eecd561cd92fb18a" + "source": [ + "## 3. Visualize the Nanoribbon" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "visualize([{\"material\": nanoribbon, \"title\": \"Nanoribbon\"}])" - ], + "execution_count": null, + "id": "1ee393a7f2ec3bc8", "metadata": { "collapsed": false }, - "id": "1ee393a7f2ec3bc8", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "visualize([{\"material\": nanoribbon, \"title\": \"Nanoribbon\"}])" + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "9e0b241366592109", "metadata": { "collapsed": false }, - "id": "9e0b241366592109" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "set_materials(nanoribbon)" - ], + "execution_count": null, + "id": "29dfa0a329cca2fa", "metadata": { "collapsed": false }, - "id": "29dfa0a329cca2fa", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "set_materials(nanoribbon)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_nanowire.ipynb b/other/materials_designer/create_nanowire.ipynb index 2bedf982..a3784a0b 100644 --- a/other/materials_designer/create_nanowire.ipynb +++ b/other/materials_designer/create_nanowire.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "c9f342d4ac1988c6", + "metadata": { + "collapsed": false + }, "source": [ "# Create a nanowire\n", "\n", @@ -13,52 +17,54 @@ "1. Set notebook parameters in cell 1.1. below (or use the default values).\n", "1. Click “Run” > “Run All” to run all cells. \n", "1. Scroll down to view results. " - ], - "metadata": { - "collapsed": false - }, - "id": "c9f342d4ac1988c6" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up nanowire parameters" - ], + "id": "cbcd112c418fcaa4", "metadata": { "collapsed": false }, - "id": "cbcd112c418fcaa4" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up nanowire parameters" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "2269749714d81b93", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "MILLER_INDICES= (0,0,1) # Miller indices of the nanowire direction\n", "RADIUS = 5.0 # Wire radius in Angstroms\n", "LENGTH = 30.0 # Wire length in Angstroms\n", "VACUUM = 10.0 # Vacuum thickness on the sides in Angstroms\n", "ALIGN_ALONG_X = True" - ], - "metadata": { - "collapsed": false - }, - "id": "2269749714d81b93", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "65c906791f69bac9", "metadata": { "collapsed": false }, - "id": "65c906791f69bac9" + "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": "6dac92b719d539ec", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -69,81 +75,81 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "6dac92b719d539ec", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "2fe1d71e1b02aed9", "metadata": { "collapsed": false }, - "id": "2fe1d71e1b02aed9" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b95701d7a0e593fe", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0] " - ], - "metadata": { - "collapsed": false - }, - "id": "b95701d7a0e593fe", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "a8ebe61794b2e803", "metadata": { "collapsed": false }, - "id": "a8ebe61794b2e803" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "visualize(material, repetitions=[3,3,3], rotation=\"0x\")\n", - "visualize(material, repetitions=[3,3,3], rotation=\"-90x\")" - ], + "execution_count": null, + "id": "c98ec170f3ee6d24", "metadata": { "collapsed": false }, - "id": "c98ec170f3ee6d24", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "visualize(material, repetitions=[3,3,3], rotation=\"0x\")\n", + "visualize(material, repetitions=[3,3,3], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create nanowire\n", - "### 2.1. Create a slab and cut a cylinder" - ], + "id": "38ecf94e650e268d", "metadata": { "collapsed": false }, - "id": "38ecf94e650e268d" + "source": [ + "## 2. Create nanowire\n", + "### 2.1. Create a slab and cut a cylinder" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "c4b34b3287960dcc", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import math\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "from mat3ra.made.tools.modify import filter_by_cylinder, add_vacuum_sides\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab_unit_cell = create_slab(\n", " crystal=material,\n", @@ -159,84 +165,78 @@ "supercell = create_supercell(slab_unit_cell, supercell_matrix=[[n_for_x, 0, 0], [0, n_for_y, 0], [0, 0, n_for_z]])\n", "nanowire_z = filter_by_cylinder(supercell, radius=RADIUS, use_cartesian_coordinates=True)\n", "nanowire_z = add_vacuum_sides(nanowire_z, vacuum=VACUUM, on_x=True, on_y=True) " - ], - "metadata": { - "collapsed": false - }, - "id": "c4b34b3287960dcc", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Rotate to align along X axis (optional)" - ], + "id": "ae940638396f93a6", "metadata": { "collapsed": false }, - "id": "ae940638396f93a6" + "source": [ + "### 2.2. Rotate to align along X axis (optional)" + ] }, { "cell_type": "code", - "source": [ - "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", - "nanowire_x = create_supercell(nanowire_z, supercell_matrix=rotate_90_degree_matrix)\n", - "nanowire = nanowire_x if ALIGN_ALONG_X else nanowire_z" - ], + "execution_count": null, + "id": "7401ab24726bf4e5", "metadata": { "collapsed": false }, - "id": "7401ab24726bf4e5", "outputs": [], - "execution_count": null + "source": [ + "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", + "nanowire_x = create_supercell(nanowire_z, supercell_matrix=rotate_90_degree_matrix)\n", + "nanowire = nanowire_x if ALIGN_ALONG_X else nanowire_z" + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the result" - ], + "id": "d8f41816d0b48edc", "metadata": { "collapsed": false }, - "id": "d8f41816d0b48edc" + "source": [ + "## 3. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90x\")\n", - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90y\")" - ], + "execution_count": null, + "id": "aea078560283ca95", "metadata": { "collapsed": false }, - "id": "aea078560283ca95", "outputs": [], - "execution_count": null + "source": [ + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90x\")\n", + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90y\")" + ] }, { "cell_type": "markdown", - "source": [ - "# 4. Pass material to the outside runtime" - ], + "id": "a212abe25bf59b4f", "metadata": { "collapsed": false }, - "id": "a212abe25bf59b4f" + "source": [ + "# 4. Pass material to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "set_materials(nanowire)" - ], + "execution_count": null, + "id": "cdaf612bc6198546", "metadata": { "collapsed": false }, - "id": "cdaf612bc6198546", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "set_materials(nanowire)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_nanowire_custom_shape.ipynb b/other/materials_designer/create_nanowire_custom_shape.ipynb index d34c9371..da0f892a 100644 --- a/other/materials_designer/create_nanowire_custom_shape.ipynb +++ b/other/materials_designer/create_nanowire_custom_shape.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "bfcbf5c3f9adb668", + "metadata": { + "collapsed": false + }, "source": [ "# Create a nanowire with a custom cross-section shape\n", "\n", @@ -13,35 +17,37 @@ "1. Set notebook parameters in cell 1.1. below (or use the default values).\n", "1. Click “Run” > “Run All” to run all cells. \n", "1. Scroll down to view results. " - ], - "metadata": { - "collapsed": false - }, - "id": "bfcbf5c3f9adb668" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment" - ], + "id": "e3702ff2a5270ce6", "metadata": { "collapsed": false }, - "id": "e3702ff2a5270ce6" + "source": [ + "## 1. Prepare the Environment" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.1. 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))." - ], + "id": "e4fdd50d405fcd11", "metadata": { "collapsed": false }, - "id": "e4fdd50d405fcd11" + "source": [ + "### 1.1. 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": "bd0fdddfd8880b40", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -52,26 +58,26 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "bd0fdddfd8880b40", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set up transformation parameters " - ], + "id": "dcf793dd6eecabb8", "metadata": { "collapsed": false }, - "id": "dcf793dd6eecabb8" + "source": [ + "### 1.2. Set up transformation parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e93f72e7c37dea10", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from typing import List\n", "\n", @@ -88,7 +94,7 @@ "ALIGN_ALONG_X = True\n", "\n", "import numpy as np\n", - "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n", + "from mat3ra.made.tools.helpers import CoordinateCondition\n", "\n", "# Custom Coordinate Condition for a hollow cylinder shape\n", "class CustomCoordinateCondition(CoordinateCondition):\n", @@ -104,80 +110,80 @@ " distance_to_torus = np.sqrt((xy_distance - self.major_radius) ** 2 + (coord[2] - self.center[2]) ** 2)\n", " return distance_to_torus <= self.minor_radius\n", "condition = CustomCoordinateCondition(center=CENTER_COORDINATE, major_radius=MAJOR_RADIUS, minor_radius=MINOR_RADIUS).condition" - ], - "metadata": { - "collapsed": false - }, - "id": "e93f72e7c37dea10", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "f348991bf39a14e7", "metadata": { "collapsed": false }, - "id": "f348991bf39a14e7" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "4b72580121ca40d0", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0] " - ], - "metadata": { - "collapsed": false - }, - "id": "4b72580121ca40d0", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "aa183a2ac1a6993", "metadata": { "collapsed": false }, - "id": "aa183a2ac1a6993" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "visualize(material, repetitions=[3,3,3], rotation=\"0x\")\n", - "visualize(material, repetitions=[3,3,3], rotation=\"-90x\")" - ], + "execution_count": null, + "id": "d3cba46f185c1a1b", "metadata": { "collapsed": false }, - "id": "d3cba46f185c1a1b", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "visualize(material, repetitions=[3,3,3], rotation=\"0x\")\n", + "visualize(material, repetitions=[3,3,3], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create nanowire\n", - "### 2.1. Create a slab and cut a cylinder" - ], + "id": "ba9e20ebe63ffda7", "metadata": { "collapsed": false }, - "id": "ba9e20ebe63ffda7" + "source": [ + "## 2. Create nanowire\n", + "### 2.1. Create a slab and cut a cylinder" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "2795d5bdbbaafbe6", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "from mat3ra.made.tools.modify import add_vacuum_sides, filter_by_condition_on_coordinates\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab_unit_cell = create_slab(\n", " crystal=material,\n", @@ -190,84 +196,78 @@ "supercell = create_supercell(slab_unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "nanowire_z = filter_by_condition_on_coordinates(supercell, condition=condition, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)\n", "nanowire_z = add_vacuum_sides(nanowire_z, vacuum=VACUUM, on_x=True, on_y=True) " - ], - "metadata": { - "collapsed": false - }, - "id": "2795d5bdbbaafbe6", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Rotate the nanowire to align along X axis" - ], + "id": "751d9531a5e5bf86", "metadata": { "collapsed": false }, - "id": "751d9531a5e5bf86" + "source": [ + "### 2.2. Rotate the nanowire to align along X axis" + ] }, { "cell_type": "code", - "source": [ - "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", - "nanowire_x = create_supercell(nanowire_z, supercell_matrix=rotate_90_degree_matrix)\n", - "nanowire = nanowire_x if ALIGN_ALONG_X else nanowire_z" - ], + "execution_count": null, + "id": "87534e47ecdb9dc6", "metadata": { "collapsed": false }, - "id": "87534e47ecdb9dc6", "outputs": [], - "execution_count": null + "source": [ + "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", + "nanowire_x = create_supercell(nanowire_z, supercell_matrix=rotate_90_degree_matrix)\n", + "nanowire = nanowire_x if ALIGN_ALONG_X else nanowire_z" + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the result" - ], + "id": "d8f41816d0b48edc", "metadata": { "collapsed": false }, - "id": "d8f41816d0b48edc" + "source": [ + "## 3. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90x\")\n", - "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90y\")" - ], + "execution_count": null, + "id": "aea078560283ca95", "metadata": { "collapsed": false }, - "id": "aea078560283ca95", "outputs": [], - "execution_count": null + "source": [ + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90x\")\n", + "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"-90y\")" + ] }, { "cell_type": "markdown", - "source": [ - "# 4. Pass material to the outside runtime" - ], + "id": "a212abe25bf59b4f", "metadata": { "collapsed": false }, - "id": "a212abe25bf59b4f" + "source": [ + "# 4. Pass material to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "set_materials(nanowire)" - ], + "execution_count": null, + "id": "cdaf612bc6198546", "metadata": { "collapsed": false }, - "id": "cdaf612bc6198546", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "set_materials(nanowire)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_perturbation.ipynb b/other/materials_designer/create_perturbation.ipynb index 1c0c9988..9aecb9d2 100644 --- a/other/materials_designer/create_perturbation.ipynb +++ b/other/materials_designer/create_perturbation.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "367a698b29e22bd7", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Perturbation in a Material\n", "\n", @@ -18,25 +22,27 @@ "## Notes\n", "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "367a698b29e22bd7" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up perturbation parameters" - ], + "id": "193a4e6a78fd5bd7", "metadata": { "collapsed": false }, - "id": "193a4e6a78fd5bd7" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up perturbation parameters" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a40d7b697c413113", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# string representation of the perturbation function, function of x, y, z variables\n", "perturbation_function = \"0.5 * sin (2 * pi * x) \"\n", @@ -46,27 +52,27 @@ "SUPERCELL_MATRIX = [[30, 0, 0], [0, 30, 0], [0, 0, 1]]\n", "\n", "PRESERVE_GEODESIC_DISTANCE = False" - ], - "metadata": { - "collapsed": false - }, - "id": "a40d7b697c413113", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "49c9f5022d50517e", "metadata": { "collapsed": false }, - "id": "49c9f5022d50517e" + "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": "c6d9f8e57bef2f91", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -78,82 +84,82 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "c6d9f8e57bef2f91", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials\n", - "Materials are loaded with `get_materials()`." - ], + "id": "edf02101e27a2742", "metadata": { "collapsed": false }, - "id": "edf02101e27a2742" + "source": [ + "### 1.3. Get input materials\n", + "Materials are loaded with `get_materials()`." + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "e0c53233ce728cc1", "metadata": { "collapsed": false }, - "id": "e0c53233ce728cc1", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create and preview Supercell" - ], + "id": "cf29b7f6fe114d8f", "metadata": { "collapsed": false }, - "id": "cf29b7f6fe114d8f" + "source": [ + "### 1.4. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "897ba7aa4e402d24", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "897ba7aa4e402d24", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "39a93c4635762a83", + "metadata": { + "collapsed": false + }, "source": [ "## 2. Create the SineWave Perturbation\n", "### 2.1. Set sine wave perturbation parameters\n", "Use perturbation function imported from `mat3ra.made.tools.utils.perturbation` folder." - ], - "metadata": { - "collapsed": false - }, - "id": "39a93c4635762a83" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "1991efeeebe39db4", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.perturbation.helpers import create_perturbation\n", + "from mat3ra.made.tools.helpers import create_perturbation\n", "\n", "material_with_perturbation = create_perturbation(\n", " material=supercell,\n", @@ -161,26 +167,26 @@ " is_isometric=PRESERVE_GEODESIC_DISTANCE,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "1991efeeebe39db4", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 3. Visualize the Result" - ], + "id": "eecd561cd92fb18a", "metadata": { "collapsed": false }, - "id": "eecd561cd92fb18a" + "source": [ + "### 3. Visualize the Result" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "1ee393a7f2ec3bc8", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -188,37 +194,31 @@ " {\"material\": material_with_perturbation, \"title\": f\"Material with perturbation\"},\n", " {\"material\": material_with_perturbation, \"title\": f\"Material with perturbation\", \"rotation\": \"-90x\"},\n", " ])" - ], - "metadata": { - "collapsed": false - }, - "id": "1ee393a7f2ec3bc8", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "9e0b241366592109", "metadata": { "collapsed": false }, - "id": "9e0b241366592109" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(material_with_perturbation)" - ], + "execution_count": null, + "id": "29dfa0a329cca2fa", "metadata": { "collapsed": false }, - "id": "29dfa0a329cca2fa", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(material_with_perturbation)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_perturbation_custom.ipynb b/other/materials_designer/create_perturbation_custom.ipynb index 1b04ee6e..d87fba39 100644 --- a/other/materials_designer/create_perturbation_custom.ipynb +++ b/other/materials_designer/create_perturbation_custom.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "367a698b29e22bd7", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Custom Perturbation in a Material\n", "\n", @@ -19,35 +23,37 @@ "## Notes\n", "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "367a698b29e22bd7" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment" - ], + "id": "193a4e6a78fd5bd7", "metadata": { "collapsed": false }, - "id": "193a4e6a78fd5bd7" + "source": [ + "## 1. Prepare the Environment" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.1. 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))." - ], + "id": "f38b2711726e5859", "metadata": { "collapsed": false }, - "id": "f38b2711726e5859" + "source": [ + "### 1.1. 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": "7a6e28cfae1a7b46", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -59,26 +65,26 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7a6e28cfae1a7b46", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set Generic Perturbation Parameters" - ], + "id": "11db992e02891067", "metadata": { "collapsed": false }, - "id": "11db992e02891067" + "source": [ + "### 1.2. Set Generic Perturbation Parameters" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a40d7b697c413113", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Set whether to preserve geodesic distance and scale the cell accordingly to match PBC\n", "PRESERVE_GEODESIC_DISTANCE = True\n", @@ -88,27 +94,27 @@ "\n", "# Set whether to use Cartesian coordinates for the perturbation function\n", "USE_CARTESIAN_COORDINATES = False" - ], - "metadata": { - "collapsed": false - }, - "id": "a40d7b697c413113", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Define Custom Perturbation Function\n", - "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." - ], + "id": "e6a19c741406eafe", "metadata": { "collapsed": false }, - "id": "e6a19c741406eafe" + "source": [ + "### 1.3. Define Custom Perturbation Function\n", + "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "203911c2413c7447", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sympy as sp\n", "\n", @@ -124,81 +130,81 @@ "# Define the perturbation function\n", "custom_sympy_function = AMPLITUDE * sp.sin(2 * sp.pi * x / WAVELENGTH + PHASE) * sp.sin(\n", " 2 * sp.pi * y / WAVELENGTH)" - ], - "metadata": { - "collapsed": false - }, - "id": "203911c2413c7447", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Get input materials\n", - "Materials are loaded with `get_materials()`." - ], + "id": "edf02101e27a2742", "metadata": { "collapsed": false }, - "id": "edf02101e27a2742" + "source": [ + "### 1.4. Get input materials\n", + "Materials are loaded with `get_materials()`." + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "e0c53233ce728cc1", "metadata": { "collapsed": false }, - "id": "e0c53233ce728cc1", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.5. Create and preview Supercell" - ], + "id": "cf29b7f6fe114d8f", "metadata": { "collapsed": false }, - "id": "cf29b7f6fe114d8f" + "source": [ + "### 1.5. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "897ba7aa4e402d24", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "897ba7aa4e402d24", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create a target material\n", - "### 2.1. Set custom perturbation parameters\n" - ], + "id": "6d4adf0d580e0340", "metadata": { "collapsed": false }, - "id": "6d4adf0d580e0340" + "source": [ + "## 2. Create a target material\n", + "### 2.1. Set custom perturbation parameters\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "8d90932312c418ee", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.perturbation.helpers import create_perturbation\n", + "from mat3ra.made.tools.helpers import create_perturbation\n", "\n", "\n", "material_with_perturbation = create_perturbation(\n", @@ -207,62 +213,56 @@ " is_isometric=PRESERVE_GEODESIC_DISTANCE,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "8d90932312c418ee", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 3. Visualize the Material" - ], + "id": "10e7ca8950839991", "metadata": { "collapsed": false }, - "id": "10e7ca8950839991" + "source": [ + "### 3. Visualize the Material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "cbfe0878a16f6c83", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "visualize([\n", " {\"material\": material_with_perturbation, \"title\": f\"Material with custom perturbation\"},\n", " {\"material\": material_with_perturbation, \"title\": f\"Material with custom perturbation\", \"rotation\": \"-90x\"}\n", "])" - ], - "metadata": { - "collapsed": false - }, - "id": "cbfe0878a16f6c83", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "9e0b241366592109", "metadata": { "collapsed": false }, - "id": "9e0b241366592109" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials(material_with_perturbation)" - ], + "execution_count": null, + "id": "29dfa0a329cca2fa", "metadata": { "collapsed": false }, - "id": "29dfa0a329cca2fa", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials(material_with_perturbation)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index 4aabdc74..b10e9caa 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -38,10 +38,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Selected material will be used as a unit cell to create a supercell first.\n", "SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 3]]\n", @@ -53,13 +55,13 @@ " \"element\": \"C\",\n", " \"placement_method\": \"closest_site\",\n", " },\n", - " \n", + "\n", " {\n", " \"type\": \"vacancy\",\n", - " \"coordinate\": [0.25, 0.25, 0.25], # Crystal coordinates \n", + " \"coordinate\": [0.25, 0.25, 0.25], # Crystal coordinates\n", " \"placement_method\": \"closest_site\",\n", " },\n", - " \n", + "\n", " {\n", " \"type\": \"interstitial\",\n", " \"coordinate\": [0.75, 0.75, 0.75], # Crystal coordinates\n", @@ -67,9 +69,7 @@ " \"placement_method\": \"voronoi_site\",\n", " },\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -83,10 +83,11 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "b0a44e0207ea7299", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -98,8 +99,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "id": "b0a44e0207ea7299" + ] }, { "cell_type": "markdown", @@ -107,21 +107,23 @@ "metadata": { "collapsed": false }, - "source": "### 1.3. Get input materials" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -135,20 +137,20 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e2d24109d3068c9e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -163,10 +165,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e385e50ae11ed2b9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "print(\"Defect configurations:\")\n", "for i, defect_dict in enumerate(DEFECT_CONFIGS):\n", @@ -177,9 +181,7 @@ " print(f\" - Element: {defect_dict['element']}\")\n", " \n", "print(f\"\\nTotal defects to create: {len(DEFECT_CONFIGS)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -193,12 +195,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.point.helpers import create_multiple_defects\n", + "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defects = create_multiple_defects(\n", " material=supercell,\n", @@ -207,9 +211,7 @@ "\n", "print(f\"Original atoms: {len(supercell.basis.elements.ids)}\")\n", "print(f\"Final atoms: {len(material_with_defects.basis.elements.ids)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -223,10 +225,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -235,9 +239,7 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defects, \"title\": f\"Material with defects\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -250,18 +252,18 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "bd4fa88a015b0dd4", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "# Set the material name and pass to outside runtime\n", "material_with_defects.name = f\"{unit_cell.name} with {len(DEFECT_CONFIGS)} defects\"\n", "set_materials([material_with_defects])" - ], - "id": "bd4fa88a015b0dd4" + ] } ], "metadata": { diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index fba5772a..20b87808 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "95a274d80df28ccd", + "metadata": { + "collapsed": false + }, "source": [ "# Create a slab with specified termination\n", "\n", @@ -21,25 +25,27 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "95a274d80df28ccd" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up defect parameters " - ], + "id": "d55eaee8bc55bffd", "metadata": { "collapsed": false }, - "id": "d55eaee8bc55bffd" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up defect parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "4b64735060047bec", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Enable interactive selection of terminations via UI prompt\n", "IS_TERMINATIONS_SELECTION_INTERACTIVE = False \n", @@ -55,27 +61,27 @@ "SLAB_TERMINATION_FORMULA = None\n", "# if None, the index of all possible terminations will be used\n", "TERMINATION_INDEX = 0" - ], - "metadata": { - "collapsed": false - }, - "id": "4b64735060047bec", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "5e0ce05f6f031b3f", "metadata": { "collapsed": false }, - "id": "5e0ce05f6f031b3f" + "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": "b457673560550933", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -86,173 +92,175 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "b457673560550933", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "1659a8e9afe434fb", "metadata": { "collapsed": false }, - "id": "1659a8e9afe434fb" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b588ccfe51967a86", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0]" - ], - "metadata": { - "collapsed": false - }, - "id": "b588ccfe51967a86", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "8c13970a869adfa9", "metadata": { "collapsed": false }, - "id": "8c13970a869adfa9" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", - "source": [ - "from utils.visualize import visualize_materials as visualize\n", - "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")\n", - "visualize(material, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], + "execution_count": null, + "id": "c4f6e2697f97965f", "metadata": { "collapsed": false }, - "id": "c4f6e2697f97965f", "outputs": [], - "execution_count": null + "source": [ + "from utils.visualize import visualize_materials as visualize\n", + "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")\n", + "visualize(material, repetitions=[3, 3, 1], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", + "id": "6634dae92a6c07b9", + "metadata": { + "collapsed": false + }, "source": [ "## 2. Configure slab and select termination\n", "\n", "### 2.1. Create crystal lattice planes analyzer\n", "CrystalLatticePlanesMaterialAnalyzer is used to analyze the crystal lattice planes of the material and determine possible terminations for the slab.\n" - ], - "metadata": { - "collapsed": false - }, - "id": "6634dae92a6c07b9" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "3ad6765249610aa4", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", "\n", "analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material, miller_indices=MILLER_INDICES)" - ], - "id": "3ad6765249610aa4", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Get possible terminations for the slabs" - ], + "id": "afb4c9bb89c8690b", "metadata": { "collapsed": false }, - "id": "afb4c9bb89c8690b" + "source": [ + "### 2.2. Get possible terminations for the slabs" + ] }, { "cell_type": "code", - "source": "slab_terminations = analyzer.terminations", + "execution_count": null, + "id": "70bec9d69d58b28a", "metadata": { "collapsed": false }, - "id": "70bec9d69d58b28a", "outputs": [], - "execution_count": null + "source": [ + "slab_terminations = analyzer.terminations" + ] }, { "cell_type": "markdown", - "source": [ - "### 2.3. Visualize slabs for all possible terminations" - ], + "id": "c6e2e18452972b21", "metadata": { "collapsed": false }, - "id": "c6e2e18452972b21" + "source": [ + "### 2.3. Visualize slabs for all possible terminations" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "246cb1f0437dbde0", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "\n", "slabs = [analyzer.get_material_with_termination_without_vacuum(termination) for termination in slab_terminations]\n", "\n", "visualize([{\"material\":slab, \"title\": slab.name} for slab in slabs ], repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "246cb1f0437dbde0", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.4. Print terminations for the Slab" - ], + "id": "c06cd779e3b76a5f", "metadata": { "collapsed": false }, - "id": "c06cd779e3b76a5f" + "source": [ + "### 2.4. Print terminations for the Slab" + ] }, { "cell_type": "code", - "source": [ - "print(\"Terminations\")\n", - "for idx, termination in enumerate(slab_terminations):\n", - " print(f\" {idx}: {termination}\")" - ], + "execution_count": null, + "id": "92bdfc42a0d8e0c", "metadata": { "collapsed": false }, - "id": "92bdfc42a0d8e0c", "outputs": [], - "execution_count": null + "source": [ + "print(\"Terminations\")\n", + "for idx, termination in enumerate(slab_terminations):\n", + " print(f\" {idx}: {termination}\")" + ] }, { "cell_type": "markdown", - "source": [ - "### 2.5. Select termination for the Slab" - ], + "id": "51e59fdb80b92b2d", "metadata": { "collapsed": false }, - "id": "51e59fdb80b92b2d" + "source": [ + "### 2.5. Select termination for the Slab" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "905e116e59b3e16e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import select_slab_termination\n", "from utils.io import ui_prompt_select_array_element_by_index, ui_prompt_select_array_element_by_index_pyodide\n", "\n", "termination_index = TERMINATION_INDEX\n", @@ -266,30 +274,30 @@ " termination = await ui_prompt_select_array_element_by_index_pyodide(slab_terminations, element_name=\"termination\")\n", " else:\n", " termination = ui_prompt_select_array_element_by_index(slab_terminations, element_name=\"termination\")" - ], - "metadata": { - "collapsed": false - }, - "id": "905e116e59b3e16e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "143bc82b430b37d5", + "metadata": { + "collapsed": false + }, "source": [ "## 3. Create the slab with selected termination\n", "\n", "3.1. Create slab with specified termination" - ], - "metadata": { - "collapsed": false - }, - "id": "143bc82b430b37d5" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "aeeac03a236fe058", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab = create_slab(crystal=material,\n", " termination=termination,\n", @@ -300,59 +308,57 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX,\n", " use_orthogonal_c=USE_ORTHOGONAL_C,\n", " )\n" - ], - "metadata": { - "collapsed": false - }, - "id": "aeeac03a236fe058", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 4. Visualize the resulting slab", + "id": "301dd99ed1425f62", "metadata": { "collapsed": false }, - "id": "301dd99ed1425f62" + "source": [ + "## 4. Visualize the resulting slab" + ] }, { "cell_type": "code", - "source": "visualize(slab, repetitions=[1, 1, 1], rotation=\"0x\")", + "execution_count": null, + "id": "19b8867953bc3f1b", "metadata": { "collapsed": false }, - "id": "19b8867953bc3f1b", "outputs": [], - "execution_count": null + "source": [ + "visualize(slab, repetitions=[1, 1, 1], rotation=\"0x\")" + ] }, { "cell_type": "markdown", - "source": [ - "# 5. Pass material to the outside runtime" - ], + "id": "d667623ad5f2e061", "metadata": { "collapsed": false }, - "id": "d667623ad5f2e061" + "source": [ + "# 5. Pass material to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "set_materials(slab)" - ], + "execution_count": null, + "id": "3705115f04ac0010", "metadata": { "collapsed": false }, - "id": "3705115f04ac0010", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "set_materials(slab)" + ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": ".venv-3.11.2", "language": "python", "name": "python3" }, @@ -366,7 +372,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.6" + "version": "3.11.2" } }, "nbformat": 4, diff --git a/other/materials_designer/create_supercell.ipynb b/other/materials_designer/create_supercell.ipynb index 72fb5cb0..a729ae98 100644 --- a/other/materials_designer/create_supercell.ipynb +++ b/other/materials_designer/create_supercell.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "bfcbf5c3f9adb668", + "metadata": { + "collapsed": false + }, "source": [ "# Create a supercell\n", "\n", @@ -13,25 +17,27 @@ "1. Set notebook parameters in cell 1.1. below (or use the default values).\n", "1. Click “Run” > “Run All” to run all cells. \n", "1. Scroll down to view results. " - ], - "metadata": { - "collapsed": false - }, - "id": "bfcbf5c3f9adb668" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up transformation parameters " - ], + "id": "e3702ff2a5270ce6", "metadata": { "collapsed": false }, - "id": "e3702ff2a5270ce6" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up transformation parameters " + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e93f72e7c37dea10", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "SUPERCELL_MATRIX = [\n", " [3, 0, 0], \n", @@ -41,27 +47,27 @@ "\n", "# or use the scaling factor\n", "SCALING_FACTOR = None # [3, 3, 1]" - ], - "metadata": { - "collapsed": false - }, - "id": "e93f72e7c37dea10", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "9f3ffe460d75942f", "metadata": { "collapsed": false }, - "id": "9f3ffe460d75942f" + "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": "9eb0650f7183279c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -72,136 +78,130 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "9eb0650f7183279c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials" - ], + "id": "f348991bf39a14e7", "metadata": { "collapsed": false }, - "id": "f348991bf39a14e7" + "source": [ + "### 1.3. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "4b72580121ca40d0", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[0]" - ], - "metadata": { - "collapsed": false - }, - "id": "4b72580121ca40d0", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Preview the material" - ], + "id": "aa183a2ac1a6993", "metadata": { "collapsed": false }, - "id": "aa183a2ac1a6993" + "source": [ + "### 1.4. Preview the material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "d3cba46f185c1a1b", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "repetitions = SCALING_FACTOR if SCALING_FACTOR else [3, 3, 1]\n", "visualize(material, repetitions=repetitions, rotation=\"0x\")\n", "visualize(material, repetitions=repetitions, rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d3cba46f185c1a1b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create supercell" - ], + "id": "ba9e20ebe63ffda7", "metadata": { "collapsed": false }, - "id": "ba9e20ebe63ffda7" + "source": [ + "## 2. Create supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "2795d5bdbbaafbe6", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "if SUPERCELL_MATRIX:\n", " supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "elif SCALING_FACTOR:\n", " supercell = create_supercell(material, scaling_factor=SCALING_FACTOR)" - ], - "metadata": { - "collapsed": false - }, - "id": "2795d5bdbbaafbe6", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the result" - ], + "id": "d8f41816d0b48edc", "metadata": { "collapsed": false }, - "id": "d8f41816d0b48edc" + "source": [ + "## 3. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")\n", - "visualize(supercell, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], + "execution_count": null, + "id": "aea078560283ca95", "metadata": { "collapsed": false }, - "id": "aea078560283ca95", "outputs": [], - "execution_count": null + "source": [ + "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")\n", + "visualize(supercell, repetitions=[1, 1, 1], rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "# 4. Pass material to the outside runtime" - ], + "id": "a212abe25bf59b4f", "metadata": { "collapsed": false }, - "id": "a212abe25bf59b4f" + "source": [ + "# 4. Pass material to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "set_materials(supercell)" - ], + "execution_count": null, + "id": "cdaf612bc6198546", "metadata": { "collapsed": false }, - "id": "cdaf612bc6198546", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "set_materials(supercell)" + ] } ], "metadata": { diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index 5cd58ac7..e6fe7e46 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f5ca6879c3872454", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Terrace Defect on a Slab\n", "\n", @@ -18,29 +22,28 @@ "## Notes\n", "\n", "1. The input material must be a Slab, or slab will be generated with provided parameters." - ], - "metadata": { - "collapsed": false - }, - "id": "f5ca6879c3872454" + ] }, { "cell_type": "markdown", + "id": "ff0f33c4e6ac1303", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", "The cut direction, pivot coordinate, and number of added layers define the terrace defect, shown in the image below.\n", "\n", "\"Terrace" - ], - "metadata": { - "collapsed": false - }, - "id": "ff0f33c4e6ac1303" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "581cb3ccf2a95f8a", + "metadata": {}, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_INDEX = 0 # Which material to use from input list\n", @@ -64,24 +67,27 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [3, 3, 1] # Structure repeat in view" - ], - "id": "581cb3ccf2a95f8a", - "outputs": [], - "execution_count": null + ] }, { "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`." - ], + "id": "ac4ec25db74d75f4", "metadata": { "collapsed": false }, - "id": "ac4ec25db74d75f4" + "source": [ + "### 1.2. Install packages\n", + "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install`." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "38574beae9a769cd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -93,48 +99,48 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "38574beae9a769cd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Load input material" - ], + "id": "c0eab57550f40708", "metadata": { "collapsed": false }, - "id": "c0eab57550f40708" + "source": [ + "### 1.3. Load input material" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "2eed23af0ec63634", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "material = materials[MATERIAL_INDEX]" - ], - "id": "2eed23af0ec63634", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 1.4. Create a slab if the input material is not a slab", - "id": "2c0d3e29ca42f099" + "id": "2c0d3e29ca42f099", + "metadata": {}, + "source": [ + "### 1.4. Create a slab if the input material is not a slab" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "92ad17e2b0032fda", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab_if_not, SlabConfiguration\n", + "from mat3ra.made.tools.helpers import create_slab_if_not\n", + "from mat3ra.made.tools.build.slab.helpers import SlabConfiguration\n", "\n", "default_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=material,\n", @@ -144,23 +150,26 @@ ")\n", "\n", "slab = create_slab_if_not(material, default_slab_config)" - ], - "id": "92ad17e2b0032fda", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.5. Visualize slab" - ], + "id": "916c8b16e01f86ff", "metadata": { "collapsed": false }, - "id": "916c8b16e01f86ff" + "source": [ + "### 1.5. Visualize slab" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "16bb968a93de4b9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -168,29 +177,29 @@ " print(\"Initial slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "16bb968a93de4b9", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create target material\n", - "### 2.1. Set up terrace configuration and builder\n" - ], + "id": "9edaa3afb28ee0ad", "metadata": { "collapsed": false }, - "id": "9edaa3afb28ee0ad" + "source": [ + "## 2. Create target material\n", + "### 2.1. Set up terrace configuration and builder\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "c318fd03c7e667df", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.terrace.helpers import create_terrace\n", + "from mat3ra.made.tools.helpers import create_terrace\n", "\n", "terrace_slab = create_terrace(\n", " slab=slab,\n", @@ -200,22 +209,24 @@ " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " rotate_to_match_pbc=ROTATE_TO_MATCH_PBC\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "c318fd03c7e667df", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 2.2. Print the parameters of the created terrace defect", - "id": "8547862478ab0c7f" + "id": "8547862478ab0c7f", + "metadata": {}, + "source": [ + "## 2.2. Print the parameters of the created terrace defect" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "256bc04ff0aa1810", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "\n", "print(\"\\nTerrace defect created with:\")\n", @@ -223,59 +234,53 @@ "print(f\"Pivot point: {PIVOT_COORDINATE}\")\n", "print(f\"Added layers: {NUMBER_OF_ADDED_LAYERS}\")\n", "print(f\"Number of atoms: {len(terrace_slab.basis.elements.ids)}\")" - ], - "metadata": { - "collapsed": false - }, - "id": "256bc04ff0aa1810", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize the result" - ], + "id": "9bee7a912a90e33c", "metadata": { "collapsed": false }, - "id": "9bee7a912a90e33c" + "source": [ + "## 3. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "print(\"Final structure with terrace:\")\n", - "visualize_materials(terrace_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", - "visualize_materials(terrace_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], + "execution_count": null, + "id": "4ffdd8589b02de16", "metadata": { "collapsed": false }, - "id": "4ffdd8589b02de16", "outputs": [], - "execution_count": null + "source": [ + "print(\"Final structure with terrace:\")\n", + "visualize_materials(terrace_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", + "visualize_materials(terrace_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime\n" - ], + "id": "d65865cbab99478", "metadata": { "collapsed": false }, - "id": "d65865cbab99478" + "source": [ + "## 4. Pass data to the outside runtime\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "a57ecc6fe9c89ceb", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(terrace_slab)" - ], - "id": "a57ecc6fe9c89ceb", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb index 15d28cfa..d40231c7 100644 --- a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb +++ b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb @@ -51,10 +51,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "be4987fdf0286ebb", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Material selection and basic parameters\n", "FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX]\n", @@ -81,9 +83,7 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [3, 3, 1]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -98,10 +98,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9f851434739f468a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -112,9 +114,7 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -129,17 +129,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d3a815612098f191", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -154,10 +154,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c920d29700ada27a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -168,9 +170,7 @@ " visualize_materials(film, repetitions=VISUALIZE_REPETITIONS)\n", " if substrate is not film:\n", " visualize_materials(substrate, repetitions=VISUALIZE_REPETITIONS)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -185,14 +185,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d48726a8e99c5590", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.interface.helpers import create_commensurate_interface\n", + "from mat3ra.made.tools.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_interface_commensurate as create_commensurate_interface\n", "\n", "# Create slab from the material\n", "slab = create_slab(\n", @@ -216,9 +218,7 @@ " direction=AxisEnum[STACKING_DIRECTION], # Stacking direction for the interface\n", " gap=INTERFACE_DISTANCE, # Gap between layers\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -232,10 +232,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "51acc60bf57a26d5", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# The interface was created above using create_commensurate_interface\n", "print(\"\\\\nInterface created successfully!\")\n", @@ -249,9 +251,7 @@ " print(\"\\\\nVisualizing the created interface:\")\n", " visualize_materials(interface, repetitions=[1, 1, 1])\n", " visualize_materials(interface, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -266,10 +266,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "8fa34c8952f76602", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# The interface is already created above, so just display final results\n", "selected_interface = interface\n", @@ -284,9 +286,7 @@ "print(\"\\\\nFinal interface visualization:\")\n", "visualize_materials(selected_interface, repetitions=[1, 1, 1])\n", "visualize_materials(selected_interface, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -300,17 +300,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "28bebacd2e299c2c", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(selected_interface)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb index ce76d0d6..61afefc6 100644 --- a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb +++ b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "66b6951c7a25247c", + "metadata": { + "collapsed": false + }, "source": [ "# Create a Twisted Interface between Nanoribbons\n", "\n", @@ -26,27 +30,26 @@ "1. The top nanoribbon is rotated by the specified twist angle.\n", "1. Vacuum is added along x and y directions to isolate the ribbons.\n", "1. For more information, see [Introduction](Introduction.ipynb)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "66b6951c7a25247c" + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "edec1dd3f8ff0782", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", "Set the following flags to control the notebook behavior\n" - ], - "id": "edec1dd3f8ff0782" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "746db0506f54aeb1", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "# Material selection and basic parameters\n", "FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX]\n", @@ -68,25 +71,25 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [3, 3, 1]" - ], - "id": "746db0506f54aeb1", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "7e386d88600feb21", + "metadata": {}, "source": [ "### 1.2. Install packages\n", "Explanation is [here](under_the_hood.ipynb#1.2.-Install-packages)." - ], - "id": "7e386d88600feb21" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "e5ab0c9b90ba9901", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "import sys\n", "\n", @@ -97,48 +100,48 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "id": "e5ab0c9b90ba9901", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "b38044cae8eca705", + "metadata": {}, "source": [ "### 1.3. Load and preview input materials\n", "Explanation is [here](under_the_hood.ipynb#2.-Data-Exchange)." - ], - "id": "b38044cae8eca705" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "d117934379d38f08", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "id": "d117934379d38f08", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "90d5d8e7cf4f4378", + "metadata": {}, "source": [ " ## 2. Prepare Materials\n", " ### 2.1. Select and visualize initial materials" - ], - "id": "90d5d8e7cf4f4378" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "d934062047d9cef", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -149,29 +152,29 @@ " visualize_materials(film, repetitions=VISUALIZE_REPETITIONS)\n", " if substrate is not film:\n", " visualize_materials(substrate, repetitions=VISUALIZE_REPETITIONS)" - ], - "id": "d934062047d9cef", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "7dc8fddf36069105", + "metadata": {}, "source": [ "## 3. Generate Twisted Interface\n", "### 3.1. Set up interface configuration and builder\n" - ], - "id": "7dc8fddf36069105" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "28ed39605a8b29e", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ - "from mat3ra.made.tools.build.interface import create_twisted_interface\n", + "from mat3ra.made.tools.helpers import create_interface_twisted\n", "# Create nanoribbons from the materials first\n", - "from mat3ra.made.tools.build.nanoribbon.helpers import create_nanoribbon\n", + "from mat3ra.made.tools.helpers import create_nanoribbon\n", "\n", "# Create nanoribbons for both materials\n", "nanoribbon1 = create_nanoribbon(\n", @@ -191,7 +194,7 @@ ")\n", "\n", "# Create the twisted interface using the manual approach\n", - "interface = create_twisted_interface(\n", + "interface = create_interface_twisted(\n", " material1=nanoribbon1,\n", " material2=nanoribbon2,\n", " angle=TARGET_TWIST_ANGLE,\n", @@ -199,22 +202,24 @@ " vacuum_y=VACUUM_Y,\n", " gap=INTERFACE_DISTANCE,\n", ")" - ], - "id": "28ed39605a8b29e", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 3.2. Generate and analyze interfaces\n", - "id": "53ced0bb45a414d5" + "id": "53ced0bb45a414d5", + "metadata": {}, + "source": [ + "### 3.2. Generate and analyze interfaces\n" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "5b234db939623503", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "# The interface was already created above using the manual approach\n", "print(\"\\\\nInterface created successfully!\")\n", @@ -229,47 +234,46 @@ " print(\"\\\\nVisualizing the created interface:\")\n", " visualize_materials(interface, repetitions=[1, 1, 1])\n", " visualize_materials(interface, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "id": "5b234db939623503", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "3deba4978643a165", + "metadata": {}, "source": [ "## 4. Preview the selected material\n", "By default, the first interface is selected. You can change the selection by changing the `selected_interface` index." - ], - "id": "3deba4978643a165" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 5. Pass data to the outside runtime\n", - "id": "b1d073366e81aeaf" + "id": "b1d073366e81aeaf", + "metadata": {}, + "source": [ + "### 5. Pass data to the outside runtime\n" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "4660ac6aad47b522", "metadata": { "collapsed": false }, - "cell_type": "code", + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "interface.name += f\" ({TARGET_TWIST_ANGLE} degrees)\"\n", "set_materials(interface)" - ], - "id": "4660ac6aad47b522", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "code", - "source": "", + "execution_count": null, "id": "b231dde70694dd41", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [] } ], "metadata": { diff --git a/other/materials_designer/passivate_edge.ipynb b/other/materials_designer/passivate_edge.ipynb index 6f3ea75c..ad0aa936 100644 --- a/other/materials_designer/passivate_edge.ipynb +++ b/other/materials_designer/passivate_edge.ipynb @@ -48,8 +48,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7e8d8696bb1035e5", "metadata": {}, + "outputs": [], "source": [ "# Enable interactive selection of coordination threshold\n", "IS_COORDINATION_SELECTION_INTERACTIVE = False\n", @@ -71,9 +73,7 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -88,10 +88,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4b010bef5b031158", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -103,9 +105,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -119,10 +119,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3a53ff74253cb09a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "from utils.visualize import visualize_materials\n", @@ -134,9 +136,7 @@ " print(\"Initial nanoribbon structure:\")\n", " visualize_materials(nanoribbon, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(nanoribbon, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -151,17 +151,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "575e8fba623c06e4", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.plot import plot_rdf\n", "\n", "plot_rdf(nanoribbon, cutoff=10.0)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -175,13 +175,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "54c265d8ca9408af", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.io import select_coordination_threshold\n", - "from mat3ra.made.tools.build.passivation.helpers import get_unique_coordination_numbers, get_coordination_numbers_distribution\n", + "from mat3ra.made.tools.helpers import get_unique_coordination_numbers, get_coordination_numbers_distribution\n", "\n", "coordination_search_radius = None # Change this value according to the RDF plot if needed, Angstroms.\n", "cutoff = coordination_search_radius or COORDINATION_SEARCH_RADIUS\n", @@ -207,9 +209,7 @@ "\n", "print(f\"\\nSelected coordination threshold: {coordination_threshold}\")\n", "print(f\"Atoms with coordination <= {coordination_threshold} will be passivated\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -224,10 +224,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "aca1c76a52e5376a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "passivation_params = {\n", " \"shadowing_radius\": COORDINATION_SEARCH_RADIUS,\n", @@ -241,9 +243,7 @@ "print(f\" Coordination threshold: {passivation_params['coordination_threshold']}\")\n", "print(f\" Number of bonds to passivate: {passivation_params['number_of_bonds_to_passivate']}\")\n", "print(f\" Symmetry tolerance: {passivation_params['symmetry_tolerance']}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -257,12 +257,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3c36dc3654f544c1", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.passivation.helpers import passivate_dangling_bonds\n", + "from mat3ra.made.tools.helpers import passivate_dangling_bonds\n", "\n", "passivated_nanoribbon = passivate_dangling_bonds(\n", " material=nanoribbon,\n", @@ -277,9 +279,7 @@ "print(f\"Original atoms: {len(nanoribbon.basis.elements.ids)}\")\n", "print(f\"Final atoms: {len(passivated_nanoribbon.basis.elements.ids)}\")\n", "print(f\"Passivant atoms added: {len(passivated_nanoribbon.basis.elements.ids) - len(nanoribbon.basis.elements.ids)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -293,17 +293,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d08ff21e3650ba5d", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", "visualize_materials(passivated_nanoribbon, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", "visualize_materials(passivated_nanoribbon, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -317,18 +317,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "2d69736d0c71858c", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "passivated_nanoribbon.name = f\"{nanoribbon.name} {PASSIVANT}-passivated\"\n", "set_materials(passivated_nanoribbon)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index cf7c1203..4a472edb 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -44,10 +44,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "92b3518bebdcf547", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_INDEX = 0 # Which material to use from input list\n", @@ -75,9 +77,7 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -92,10 +92,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "42863fe84bfab53c", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -108,9 +110,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -124,18 +124,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a51551f4af6456c7", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "from utils.visualize import visualize_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -149,12 +149,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "ad71f877f76f0550", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab_if_not, SlabConfiguration\n", + "from mat3ra.made.tools.helpers import create_slab_if_not\n", + "from mat3ra.made.tools.build.slab import SlabConfiguration\n", "from mat3ra.made.tools.modify import translate_to_z_level\n", "\n", "material = materials[MATERIAL_INDEX]\n", @@ -172,9 +175,7 @@ " print(\"Initial slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -189,13 +190,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a4ed473eb2129ac4", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.passivation.helpers import passivate_surface\n", - "from mat3ra.made.tools.enums import SurfaceTypesEnum\n", + "from mat3ra.made.tools.helpers import passivate_surface\n", + "from mat3ra.made.tools.helpers import SurfaceTypesEnum\n", "\n", "passivated_slab = passivate_surface(\n", " slab,\n", @@ -211,9 +214,7 @@ "print(f\"Bond length: {BOND_LENGTH} Å\")\n", "print(f\"Surfaces passivated: {SURFACE}\")\n", "print(f\"Number of atoms: {len(passivated_slab.basis.elements.ids)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -227,17 +228,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c4b5e1e0ec0ab02a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", "visualize_materials(passivated_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", "visualize_materials(passivated_slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -251,17 +252,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d66a15a29d27c6ea", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(passivated_slab)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index bd822e00..70fd16b8 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Oxygen interstitial Defect(s) in SnO.\n", "\n", @@ -17,26 +21,28 @@ "\"SnO\n", "\n", "!Note: Voronoi site placement method is used for the interstitial defect, for a precise reproduction relaxation is needed." - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", + "id": "5e43ff288847b784", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", "Defect Configuration parameters are described in [Defect Configuration](https://github.com/Exabyte-io/made/blob/8196b759242551c77d1791bf5bd2f4150763cfef/src/py/mat3ra/made/tools/build/defect/configuration.py#L102)." - ], - "metadata": { - "collapsed": false - }, - "id": "5e43ff288847b784" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9d8b1890b34d850a", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "MATERIAL_NAME = \"SnO\"\n", "SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 2]]\n", @@ -55,27 +61,27 @@ " \"placement_method\": \"voronoi_site\"\n", " }\n", "]" - ], - "metadata": { - "collapsed": false - }, - "id": "9d8b1890b34d850a", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "bb64de5ff32649f8", "metadata": { "collapsed": false }, - "id": "bb64de5ff32649f8" + "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": "ef664b14457530fd", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -87,141 +93,137 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "metadata": { - "collapsed": false - }, - "id": "ef664b14457530fd", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material" - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "be38fdda1984c654", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "metadata": { - "collapsed": false - }, - "id": "be38fdda1984c654", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create and preview Supercell" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.4. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e2d24109d3068c9e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.build.supercell import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "e2d24109d3068c9e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 2. Create the Defects", + "id": "5da5b0380583c952", "metadata": { "collapsed": false }, - "id": "5da5b0380583c952" + "source": [ + "## 2. Create the Defects" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a990fa35742d7269", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.point.helpers import create_multiple_defects\n", + "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defect = create_multiple_defects(\n", " supercell,\n", " defect_dicts=DEFECT_CONFIGS,\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "a990fa35742d7269", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize Result(s)" - ], + "id": "462549d016073446", "metadata": { "collapsed": false }, - "id": "462549d016073446" + "source": [ + "## 3. Visualize Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "509b18661a069e42", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "metadata": { - "collapsed": false - }, - "id": "509b18661a069e42", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "61daa5afcbc078a9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "material_with_defect.name = \"Sn15 O17, Interstitial O Defect\"\n", "set_materials([material_with_defect])\n", "download_content_to_file(material_with_defect.to_json(), f\"{material_with_defect.name}.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "61daa5afcbc078a9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index 10d384a9..c53833ea 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f0ccd3190ce70a68", + "metadata": { + "collapsed": false + }, "source": [ "# Substitutional Point Defects in Graphene\n", "\n", @@ -18,14 +22,14 @@ "![Fig 1.](https://github.com/Exabyte-io/documentation/raw/12617167278ae3523adc028583b21ea4e8ebd197/images/tutorials/materials/defects/defect_creation_point_substitution_graphene/0-figure-from-manuscript.webp)\n", "\n", "In this notebook we will reproduce material from FIG. 1 b)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f0ccd3190ce70a68" + ] }, { "cell_type": "markdown", + "id": "aae97744e3023a1b", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -33,14 +37,16 @@ "\n", "Note that we use approximate coordinates in crystal coordinates to define the defect positions. The approximate coordinates are used to find the closest site in the crystal to the given coordinates. The approximate coordinates are in the range of [0, 1] for each axis. Adjust the approximate coordinates to place the defect at the desired site in the crystal. Using the visuals provided in the notebook could help in determining the approximate coordinates.\n", "(Coordinates found using 3D editor in Materials Designer)" - ], - "metadata": { - "collapsed": false - }, - "id": "aae97744e3023a1b" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "dff59577346dbece", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Element to be placed at the site (ignored for vacancy)\n", "CHEMICAL_ELEMENT = \"N\"\n", @@ -78,27 +84,27 @@ " },\n", "\n", "]" - ], - "metadata": { - "collapsed": false - }, - "id": "dff59577346dbece", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "14d161d4b61ca219", "metadata": { "collapsed": false }, - "id": "14d161d4b61ca219" + "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": "8c6ea8b36f1a6cc", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -110,141 +116,137 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "metadata": { - "collapsed": false - }, - "id": "8c6ea8b36f1a6cc", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Load input material\n", - "In this notebook we will use the material from the `uploads` folder that has a few pre-set materials." - ], + "id": "da6733a515019677", "metadata": { "collapsed": false }, - "id": "da6733a515019677" + "source": [ + "### 1.3. Load input material\n", + "In this notebook we will use the material from the `uploads` folder that has a few pre-set materials." + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import load_material_from_folder\n", - "\n", - "material = load_material_from_folder(\"../uploads\", \"Graphene\")" - ], + "execution_count": null, + "id": "14c40630ba2974e6", "metadata": { "collapsed": false }, - "id": "14c40630ba2974e6", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import load_material_from_folder\n", + "\n", + "material = load_material_from_folder(\"../uploads\", \"Graphene\")" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create and preview Supercell" - ], + "id": "9fcc51573071c301", "metadata": { "collapsed": false }, - "id": "9fcc51573071c301" + "source": [ + "### 1.4. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6d5a793dd5e45f16", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.build.supercell import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "6d5a793dd5e45f16", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 2. Create the Defects", + "id": "e41cf1646620915d", "metadata": { "collapsed": false }, - "id": "e41cf1646620915d" + "source": [ + "## 2. Create the Defects" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "db2d621e2fd4bbeb", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.point.helpers import create_multiple_defects\n", + "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defect = create_multiple_defects(\n", " supercell,\n", " defect_dicts=DEFECT_CONFIGS,\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "db2d621e2fd4bbeb", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize Result(s)" - ], + "id": "2b58b5e76bd167d8", "metadata": { "collapsed": false }, - "id": "2b58b5e76bd167d8" + "source": [ + "## 3. Visualize Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "d4a1e920884b1a48", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d4a1e920884b1a48", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Write resulting material to the folder" - ], + "id": "865c3b666e06fd10", "metadata": { "collapsed": false }, - "id": "865c3b666e06fd10" + "source": [ + "## 4. Write resulting material to the folder" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7dcf867f46422fa9", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"N-doped Graphene\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"N-doped_Graphene.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7dcf867f46422fa9", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb index 75f8b0ee..1ac77af8 100644 --- a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb @@ -38,10 +38,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4b64735060047bec", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "MATERIAL_NAME = \"Pt\"\n", "MILLER_INDICES = (2, 1, 1)\n", @@ -52,9 +54,7 @@ "USE_CONVENTIONAL_CELL = True\n", "\n", "VISUALIZATION_REPETITIONS = [1, 1, 1]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -69,10 +69,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b457673560550933", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -84,9 +86,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -100,18 +100,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b588ccfe51967a86", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -125,18 +125,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c4f6e2697f97965f", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize(material, repetitions=VISUALIZATION_REPETITIONS, rotation=\"0x\")\n", "visualize(material, repetitions=VISUALIZATION_REPETITIONS, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -153,10 +153,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e9d81088", "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab_211 = create_slab(\n", " crystal=material,\n", @@ -167,9 +169,7 @@ " use_conventional_cell=USE_CONVENTIONAL_CELL,\n", " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -177,20 +177,22 @@ "metadata": { "collapsed": false }, - "source": "### 2.2. Visualize the slab" + "source": [ + "### 2.2. Visualize the slab" + ] }, { "cell_type": "code", + "execution_count": null, "id": "246cb1f0437dbde0", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(slab_211, repetitions=VISUALIZATION_REPETITIONS, rotation=\"0x\")\n", "visualize(slab_211, repetitions=VISUALIZATION_REPETITIONS, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -205,10 +207,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d6d9b6b5600a4eef", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "# Material selection\n", @@ -241,9 +245,7 @@ "SHOW_INTERMEDIATE_STEPS = True\n", "# Structure repeat in view\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -257,12 +259,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f838761790cb392c", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.terrace.helpers import create_terrace\n", + "from mat3ra.made.tools.helpers import create_terrace\n", "\n", "slab_111 = create_slab(\n", " crystal=material,\n", @@ -281,9 +285,7 @@ " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " rotate_to_match_pbc=ROTATE_TO_MATCH_PBC\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -291,19 +293,21 @@ "metadata": { "collapsed": false }, - "source": "### 3.3. Visualize the terrace defect" + "source": [ + "### 3.3. Visualize the terrace defect" + ] }, { "cell_type": "code", + "execution_count": null, "id": "138a639f8a2b16bb", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(terrace_slab, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -317,19 +321,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3705115f04ac0010", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials([slab_211, terrace_slab])\n", "download_content_to_file(slab_211.to_json(), \"Pt_211_step.json\")\n", "download_content_to_file(terrace_slab.to_json(), \"Pt_111_terrace.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { 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 eedaa8fb..5fe4773a 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 @@ -1,5 +1,42 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "2ea560eb", + "metadata": {}, + "outputs": [], + "source": [ + "# Materials configuration for heterostructure (bottom to top):\n", + "# Si (substrate) -> SiO2 -> HfO2 -> TiN\n", + "\n", + "# Miller indices for each layer's surface orientation\n", + "MILLER_INDICES = [\n", + " (1, 0, 0), # Silicon substrate\n", + " (1, 0, 0), # SiO2 layer \n", + " (0, 0, 1), # HfO2 layer\n", + " (0, 0, 1), # TiN layer\n", + "]\n", + "\n", + "# Number of atomic layers for each material\n", + "THICKNESSES = [\n", + " 4, # Silicon substrate\n", + " 3, # SiO2 layer\n", + " 2, # HfO2 layer \n", + " 3, # TiN layer\n", + "]\n", + "\n", + "# Gaps between adjacent layers in Angstroms\n", + "GAPS = [\n", + " 2.5, # Gap between Si and SiO2\n", + " 3.0, # Gap between SiO2 and HfO2\n", + " 2.5, # Gap between HfO2 and TiN\n", + "]\n", + "\n", + "# Total vacuum at the top of the structure in Angstroms\n", + "VACUUM = 10.0\n" + ] + }, { "cell_type": "markdown", "id": "3ae4cc7db0846f04", @@ -7,13 +44,20 @@ "collapsed": false }, "source": [ - "# Create High-k Metal Gate Stack Tutorial\n", + "# Create High-k Metal Gate Stack Tutorial (Simplified)\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", - "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", + "This approach replaces the complex multi-step interface creation with a single function call that automatically handles strain matching and layer stacking.\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" + "\"High-k\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", + "- **Automatic Optimization**: Built-in strain matching and supercell optimization\n" ] }, { @@ -27,10 +71,19 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "d437c36db077a11c", + "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:28.479435Z", + "start_time": "2025-08-07T00:21:28.472616Z" + } + }, + "outputs": [], "source": [ "from types import SimpleNamespace\n", + "from mat3ra.made.tools.helpers import create_heterostructure \n", "\n", "# Global parameters\n", "MAX_AREA = 200 # Maximum area for strain matching\n", @@ -92,10 +145,7 @@ "]\n", "\n", "INTERFACE_1_INDEX = 11 # was found in the previous runs" - ], - "id": "d437c36db077a11c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -110,10 +160,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c11956a7712639b9", "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:28.628889Z", + "start_time": "2025-08-07T00:21:28.626767Z" + }, "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -125,9 +181,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -142,10 +196,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "474383a5e0f70d6", "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:31.458912Z", + "start_time": "2025-08-07T00:21:28.637631Z" + }, "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", @@ -158,9 +218,73 @@ " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"HfO2.*MCL\")), # HfO2\n", " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"TiN\")), # TiN\n", "]" - ], + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1f2d02fa", + "metadata": {}, + "outputs": [], + "source": [ + "# Create heterostructure using the new simplified approach\n", + "from mat3ra.made.tools.helpers import create_heterostructure\n", + "from mat3ra.standata.materials import Materials\n", + "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", + "\n", + "# Get materials from Standata\n", + "crystals = [\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"Silicon\")),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"SiO2\")),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"HfO2.*MCL\")),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"TiN\")),\n", + "]\n", + "\n", + "# Create the heterostructure with simplified parameters\n", + "heterostructure = create_heterostructure(\n", + " crystals=crystals,\n", + " miller_indices=MILLER_INDICES,\n", + " thicknesses=THICKNESSES,\n", + " gaps=GAPS,\n", + " vacuum=VACUUM,\n", + " use_conventional_cell=True,\n", + " optimize_layer_supercells=True,\n", + ")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a8cd46c4", + "metadata": {}, + "outputs": [], + "source": [ + "# Visualize the heterostructure\n", + "from utils.visualize import visualize_materials as visualize\n", + "\n", + "visualize(\n", + " heterostructure,\n", + " repetitions=[1, 1, 1],\n", + " title=\"Si/SiO2/HfO2/TiN Heterostructure\",\n", + " viewer=\"wave\",\n", + " rotation='-90x'\n", + ")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f9857a66", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "# Save the heterostructure\n", + "from utils.jupyterlite import download_content_to_file, set_materials\n", + "\n", + "heterostructure.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", + "set_materials(heterostructure)\n", + "download_content_to_file(heterostructure.to_json(), \"heterostructure_high_k_metal_gate.json\")\n" + ] }, { "cell_type": "markdown", @@ -175,15 +299,21 @@ }, { "cell_type": "code", + "execution_count": null, "id": "59c8eb0e549ee69e", "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:34.850966Z", + "start_time": "2025-08-07T00:21:31.467448Z" + }, "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "from utils.visualize import visualize_materials as visualize\n", + "from mat3ra.made.tools.build.compound_pristine_structures.two_dimensional.interface import \\\n", + " create_interface_zsl_between_slabs, create_interface_simple_between_slabs\n", "\n", "film_1_params = STRUCTURE_PARAMS[1] # SiO2 layer\n", "substrate_1_params = STRUCTURE_PARAMS[0] # Silicon substrate\n", @@ -212,7 +342,7 @@ "film_1_slab = SlabBuilder().get_material(film_1_slab_config)\n", "\n", "# Create Si/SiO2 interface using modern ZSL helper - select specified match\n", - "interface_1 = create_zsl_interface_between_slabs(\n", + "interface_1 = create_interface_zsl_between_slabs(\n", " substrate_slab=substrate_1_slab,\n", " film_slab=film_1_slab,\n", " gap=film_1_params.interface_distance,\n", @@ -224,9 +354,7 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell_to_primitive=False,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -240,10 +368,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "49c046cf4517ad91", "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:35.383861Z", + "start_time": "2025-08-07T00:21:34.872412Z" + }, "collapsed": false }, + "outputs": [], "source": [ "visualize(\n", " interface_1,\n", @@ -257,9 +391,7 @@ " title=\"Si/SiO2 Interface\",\n", " rotation='-90x'\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -273,11 +405,18 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "449228d73d589d08", + "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:25:00.988961Z", + "start_time": "2025-08-07T00:23:54.433051Z" + } + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.interface import create_simple_interface_between_slabs\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "film_2_params = STRUCTURE_PARAMS[2] # HfO2 layer\n", "\n", @@ -294,24 +433,20 @@ "\n", "interface_1_slab = create_slab(\n", " crystal=interface_1, # Use the Si/SiO2 interface slab\n", - " miller_indices=(0,0,1),\n", - " number_of_layers=film_2_params.slab_params.thickness,\n", + "\n", " vacuum=0.0, # No vacuum for interface slab\n", " xy_supercell_matrix=film_2_params.slab_params.xy_supercell_matrix,\n", " use_orthogonal_c=film_2_params.slab_params.USE_ORTHOGONAL_C\n", ")\n", "\n", "# Create Si/SiO2/HfO2 interface using SimpleInterfaceBuilder\n", - "interface_2 = create_simple_interface_between_slabs(\n", + "interface_2 = create_interface_simple_between_slabs(\n", " film_slab=film_2_slab,\n", " substrate_slab=interface_1_slab,\n", " gap=film_2_params.interface_distance, # Distance to SiO2\n", " vacuum=film_2_params.vacuum # Vacuum for HfO2-terminating interface layer\n", ")\n" - ], - "id": "449228d73d589d08", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -325,10 +460,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "5ddc3d75b43a3926", "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:38.790507Z", + "start_time": "2025-08-06T23:57:36.608292Z" + }, "collapsed": false }, + "outputs": [], "source": [ "visualize(\n", " interface_2,\n", @@ -342,9 +483,7 @@ " title=\"Si/SiO2/HfO2 Interface\",\n", " rotation='-90x'\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -359,10 +498,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9900d149e4148bfa", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:38.804788Z", + "start_time": "2025-08-06T23:57:37.044816Z" + } + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "\n", + "from mat3ra.made.tools.build_components.entities.reusable.three_dimensional.supercell.helpers import create_supercell\n", "\n", "film_3_params = STRUCTURE_PARAMS[3] # TiN layer\n", "\n", @@ -379,9 +526,7 @@ "\n", "# Flip interface_2 for stacking TiN on top\n", "interface_2_flipped = create_supercell(interface_2, scaling_factor=[1, -1, -1])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -393,15 +538,20 @@ }, { "cell_type": "code", + "execution_count": null, "id": "2da4c0aae9175936", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2025-08-07T00:21:38.805715Z", + "start_time": "2025-08-06T23:57:37.450542Z" + } + }, + "outputs": [], "source": [ "# TiN slab and interface_2_flipped are ready for final interface creation\n", "print(\"TiN slab created successfully\")\n", "print(\"Si/SiO2/HfO2 interface prepared for TiN layer addition\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -412,12 +562,16 @@ ] }, { + "cell_type": "code", + "execution_count": null, + "id": "baf2ba664817c0bc", "metadata": { - "jupyter": { - "is_executing": true + "ExecuteTime": { + "end_time": "2025-08-07T00:21:38.806294Z", + "start_time": "2025-08-06T23:57:37.492175Z" } }, - "cell_type": "code", + "outputs": [], "source": [ "# Create final Si/SiO2/HfO2/TiN interface configuration\n", "interface_2_flipped_slab = create_slab(\n", @@ -429,7 +583,7 @@ " use_orthogonal_c=film_3_params.slab_params.USE_ORTHOGONAL_C\n", ")\n", "\n", - "interface_3 = create_simple_interface_between_slabs(\n", + "interface_3 = create_interface_simple_between_slabs(\n", " film_slab=tin_slab,\n", " substrate_slab=interface_2_flipped_slab,\n", " gap=film_3_params.interface_distance,\n", @@ -438,10 +592,7 @@ "\n", "# Invert the interface along the z-axis to match example orientation\n", "interface_3 = create_supercell(interface_3, scaling_factor=[1, -1, -1])" - ], - "id": "baf2ba664817c0bc", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -449,14 +600,18 @@ "metadata": { "collapsed": false }, - "source": "### 4.4. Visualize the Si/SiO2/HfO2/TiN Interface" + "source": [ + "### 4.4. Visualize the Si/SiO2/HfO2/TiN Interface" + ] }, { "cell_type": "code", + "execution_count": null, "id": "2b3fda71c801aeff", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize(\n", " interface_3,\n", @@ -464,9 +619,7 @@ " viewer=\"wave\",\n", " rotation='-90x'\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -480,23 +633,31 @@ }, { "cell_type": "code", + "execution_count": null, "id": "803792030da3a97", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "interface_3.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", "set_materials(interface_3)\n", "download_content_to_file(interface_3.to_json(), \"heterostructure_high_k_metal_gate.json\")" - ], + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d69fffa6670c3f33", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [] } ], "metadata": { "kernelspec": { - "display_name": ".venv-3.11", + "display_name": ".venv-3.11.2", "language": "python", "name": "python3" }, @@ -510,7 +671,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.11.2" } }, "nbformat": 4, diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index 25525cb1..d76cd8b5 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -35,8 +35,10 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "FILM_MILLER_INDICES = (0, 0, 1)\n", "FILM_THICKNESS = 1 # in atomic layers\n", @@ -63,9 +65,7 @@ "\n", "# Whether to reduce the resulting interface cell to the primitive cell after the interface creation.\n", "REDUCE_RESULT_CELL_TO_PRIMITIVE = True" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -79,9 +79,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -93,9 +95,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_interface_with_min_strain_zsl.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -106,17 +106,17 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "film = Material.create(Materials.get_by_name_first_match(\"Graphene\"))\n", "substrate = Material.create(Materials.get_by_name_and_categories(\"BN\", \"2D\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -129,16 +129,16 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -151,17 +151,17 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "film_slab_terminations = get_slab_terminations(material=film, miller_indices=FILM_MILLER_INDICES)\n", "substrate_slab_terminations = get_slab_terminations(material=substrate, miller_indices=SUBSTRATE_MILLER_INDICES)\n", "print(\"Film slab terminations:\", film_slab_terminations)\n", "print(\"Substrate slab terminations:\", substrate_slab_terminations)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -174,11 +174,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", @@ -196,24 +198,24 @@ "\n", "visualize(film_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(substrate_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.3. Select terminations for the Slabs" + "metadata": {}, + "source": [ + "### 2.3. Select terminations for the Slabs" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -228,9 +230,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", @@ -255,9 +259,7 @@ "\n", "substrate_slab = SlabBuilder().get_material(substrate_slab_config)\n", "film_slab = SlabBuilder().get_material(film_slab_config)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -272,9 +274,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", "\n", @@ -287,9 +291,7 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell=False # Reduces supercell matrices in analyzer\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -303,14 +305,14 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "matches = zsl_analyzer.zsl_match_holders" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -323,9 +325,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", "\n", @@ -336,9 +340,7 @@ "}\n", "\n", "plot_strain_vs_area(matches, PLOT_SETTINGS)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -353,13 +355,15 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "selected_index = 0\n", "\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "interface = create_zsl_interface_between_slabs(\n", " substrate_slab=substrate_slab,\n", @@ -373,9 +377,7 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell_to_primitive=REDUCE_RESULT_CELL_TO_PRIMITIVE,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -387,26 +389,28 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "visualize(interface, repetitions=[3, 3, 1])\n", "visualize(interface, repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 4.2. Shift film along y-axis\n", "Shifting with the step of a/sqrt(3)/2 angstroms, where a is the lattice constant of the interface." ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import numpy as np\n", "from mat3ra.made.tools.modify import interface_displace_part\n", @@ -419,46 +423,50 @@ " displacement=[0, n * a / np.sqrt(3) / 2, 0],\n", " use_cartesian_coordinates=True)\n", " shifted_interfaces.append(shifted_interface)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 4.3. Preview the shifted materials" + "metadata": {}, + "source": [ + "### 4.3. Preview the shifted materials" + ] }, { - "metadata": {}, "cell_type": "code", - "source": "visualize(shifted_interfaces, repetitions=[3, 3, 1])", + "execution_count": null, + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "visualize(shifted_interfaces, repetitions=[3, 3, 1])" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 5. Pass data to the outside runtime" + "metadata": {}, + "source": [ + "## 5. Pass data to the outside runtime" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(shifted_interfaces)\n", "for idx, shifted_interface in enumerate(shifted_interfaces):\n", " download_content_to_file(shifted_interface.to_json(), f\"interface_{idx}.json\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "code", - "source": "", + "execution_count": null, + "metadata": {}, "outputs": [], - "execution_count": null + "source": [] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index 2bb3513f..bd7e0566 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -49,10 +49,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d9e6be14343d00a1", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -64,9 +66,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -80,8 +80,11 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "56b9bd10", + "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "from mat3ra.made.tools.build.nanoparticle.enums import NanoparticleShapesEnum as Shapes\n", @@ -135,10 +138,7 @@ " )\n", " )\n", "]\n" - ], - "id": "56b9bd10", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -152,18 +152,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(\"Gold\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -177,21 +177,21 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.nanoparticle.helpers import create_nanoparticle_by_shape\n", + "from mat3ra.made.tools.helpers import create_nanoparticle_by_shape\n", "\n", "nanoparticles = [create_nanoparticle_by_shape(\n", " crystal=material,\n", " shape=config.shape,\n", " parameters=config.parameters\n", ") for config in NANOPARTICLE_CONFIGS]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -205,10 +205,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -216,9 +218,7 @@ "icosahedra_particles = nanoparticles[3:6]\n", "visualize(cuboctahedra_particles, rotation=\"45y,45x\")\n", "visualize(icosahedra_particles, rotation=\"60x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -232,19 +232,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials(nanoparticles)\n", "for idx, nanoparticle in enumerate(nanoparticles):\n", " download_content_to_file(nanoparticle.to_json(), f\"gold_nanocluster_{idx}.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index 8acd46cc..0d065ab1 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "81aa051ca1ca2e05", + "metadata": { + "collapsed": false + }, "source": [ "# Passivation of Silicon (001) Surface\n", "\n", @@ -18,26 +22,25 @@ "This notebook will focus on recreating the material from Fig. 8.:\n", "\n", "\"H-Passivated" - ], - "metadata": { - "collapsed": false - }, - "id": "81aa051ca1ca2e05" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the environment\n", - "### 1.1. Set up the notebook" - ], + "id": "af879d0489a86849", "metadata": { "collapsed": false }, - "id": "af879d0489a86849" + "source": [ + "## 1. Prepare the environment\n", + "### 1.1. Set up the notebook" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "8d5e0a40537f4bdc", + "metadata": {}, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_NAME = \"Silicon.*100.*reconstructed\" # Name (regex) of the material to import from Standata\n", @@ -54,24 +57,27 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view" - ], - "id": "8d5e0a40537f4bdc", - "outputs": [], - "execution_count": null + ] }, { "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`." - ], + "id": "f6106dbafce082a1", "metadata": { "collapsed": false }, - "id": "f6106dbafce082a1" + "source": [ + "### 1.2. Install packages\n", + "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install`." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "d1eb85a3125e3839", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -83,52 +89,52 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "metadata": { - "collapsed": false - }, - "id": "d1eb85a3125e3839", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Load and preview input material" - ], + "id": "43ee49c4858d165f", "metadata": { "collapsed": false }, - "id": "43ee49c4858d165f" + "source": [ + "### 1.3. Load and preview input material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "f71a66a67f9ae8e6", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "slab = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "metadata": { - "collapsed": false - }, - "id": "f71a66a67f9ae8e6", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Prepare the material\n", - "### 2.1. Visualize original material" - ], + "id": "51bb05eecc1f3abe", "metadata": { "collapsed": false }, - "id": "51bb05eecc1f3abe" + "source": [ + "## 2. Prepare the material\n", + "### 2.1. Visualize original material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "83efe492d92bf80c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -136,27 +142,24 @@ " print(\"Initial slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "83efe492d92bf80c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Adjust structure to match the one from the manuscript" - ], + "id": "e14ecd35964002f3", "metadata": { "collapsed": false }, - "id": "e14ecd35964002f3" + "source": [ + "### 2.2. Adjust structure to match the one from the manuscript" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "36744eb087509500", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "# Find coordinates of the Si atoms, list in descending order, and change the second one from the top\n", @@ -175,43 +178,47 @@ "new_coordinates[index_to_adjust] = adjusted_coordinate\n", "slab.set_coordinates(new_coordinates)\n", "slab = translate_to_z_level(slab, \"center\")" - ], - "id": "36744eb087509500", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.3. Visualize adjusted material", - "id": "b0f46550198b1b9d" + "id": "b0f46550198b1b9d", + "metadata": {}, + "source": [ + "### 2.3. Visualize adjusted material" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "9f86e4cc49f97922", + "metadata": {}, + "outputs": [], "source": [ "if SHOW_INTERMEDIATE_STEPS:\n", " print(\"Adjusted slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "id": "9f86e4cc49f97922", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 3. Create passivated material\n", + "id": "751ab019a379e07e", "metadata": { "collapsed": false }, - "id": "751ab019a379e07e" + "source": [ + "## 3. Create passivated material\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "12ddeb6233df033d", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.passivation.helpers import passivate_surface\n", + "from mat3ra.made.tools.helpers import passivate_surface\n", "\n", "passivated_slab = passivate_surface(\n", " material=slab,\n", @@ -227,58 +234,55 @@ "print(f\"Bond length: {BOND_LENGTH} Å\")\n", "print(f\"Surfaces passivated: {SURFACE}\")\n", "print(f\"Number of atoms: {len(passivated_slab.basis.elements.ids)}\")" - ], - "id": "12ddeb6233df033d", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Visualize the result" - ], + "id": "e2118b4c4bcf322f", "metadata": { "collapsed": false }, - "id": "e2118b4c4bcf322f" + "source": [ + "## 4. Visualize the result" + ] }, { "cell_type": "code", - "source": [ - "print(\"Final passivated structure:\")\n", - "visualize_materials(passivated_slab, viewer=\"wave\")" - ], + "execution_count": null, + "id": "4680f4f7906f6f2c", "metadata": { "collapsed": false }, - "id": "4680f4f7906f6f2c", "outputs": [], - "execution_count": null + "source": [ + "print(\"Final passivated structure:\")\n", + "visualize_materials(passivated_slab, viewer=\"wave\")" + ] }, { "cell_type": "markdown", - "source": [ - "### 5. Pass data to the outside runtime\n" - ], + "id": "bde2ccf31660d4fd", "metadata": { "collapsed": false }, - "id": "bde2ccf31660d4fd" + "source": [ + "### 5. Pass data to the outside runtime\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b3c536f6ca85e403", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(passivated_slab)\n", "download_content_to_file(passivated_slab.to_json(), f\"{slab.name}_passivated.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "b3c536f6ca85e403", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb index b8bf8121..9a97291e 100644 --- a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb +++ b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "367a698b29e22bd7", + "metadata": { + "collapsed": false + }, "source": [ "# Ripple perturbation of a graphene sheet.\n", "\n", @@ -18,35 +22,37 @@ "Recreating material from Fig. 1:\n", "\n", "\"Rippling\n" - ], - "metadata": { - "collapsed": false - }, - "id": "367a698b29e22bd7" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment" - ], + "id": "193a4e6a78fd5bd7", "metadata": { "collapsed": false }, - "id": "193a4e6a78fd5bd7" + "source": [ + "## 1. Prepare the Environment" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.1. 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))." - ], + "id": "f38b2711726e5859", "metadata": { "collapsed": false }, - "id": "f38b2711726e5859" + "source": [ + "### 1.1. 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": "7a6e28cfae1a7b46", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -58,26 +64,26 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7a6e28cfae1a7b46", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Set Nanoribbon and Perturbation Parameters" - ], + "id": "11db992e02891067", "metadata": { "collapsed": false }, - "id": "11db992e02891067" + "source": [ + "### 1.2. Set Nanoribbon and Perturbation Parameters" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a40d7b697c413113", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Set whether to preserve geodesic distance and scale the cell accordingly to match PBC\n", "PRESERVE_GEODESIC_DISTANCE = False\n", @@ -89,27 +95,27 @@ "# Set whether to use Cartesian coordinates for the perturbation function\n", "USE_CARTESIAN_COORDINATES = False\n", "MATERIAL_NAME = \"Graphene\"" - ], - "metadata": { - "collapsed": false - }, - "id": "a40d7b697c413113", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Define Custom Perturbation Function\n", - "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." - ], + "id": "e6a19c741406eafe", "metadata": { "collapsed": false }, - "id": "e6a19c741406eafe" + "source": [ + "### 1.3. Define Custom Perturbation Function\n", + "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." + ] }, { "cell_type": "code", + "execution_count": null, + "id": "203911c2413c7447", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sympy as sp\n", "\n", @@ -143,53 +149,53 @@ "\n", "# Combine waves with edge mask\n", "custom_sympy_function = AMPLITUDE * wave_pattern * edge_mask" - ], - "metadata": { - "collapsed": false - }, - "id": "203911c2413c7447", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Get input materials" - ], + "id": "edf02101e27a2742", "metadata": { "collapsed": false }, - "id": "edf02101e27a2742" + "source": [ + "### 1.4. Get input materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e0c53233ce728cc1", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "metadata": { - "collapsed": false - }, - "id": "e0c53233ce728cc1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.5. Create and preview Nanoribbon" - ], + "id": "cf29b7f6fe114d8f", "metadata": { "collapsed": false }, - "id": "cf29b7f6fe114d8f" + "source": [ + "### 1.5. Create and preview Nanoribbon" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "897ba7aa4e402d24", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.nanoribbon.helpers import create_nanoribbon\n", + "from mat3ra.made.tools.helpers import create_nanoribbon\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "supercell = create_nanoribbon(\n", @@ -200,113 +206,109 @@ " vacuum_length=VACUUM_SIZE,\n", ")\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "897ba7aa4e402d24", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create a target material\n", - "### 2.1. Set custom perturbation parameters\n" - ], + "id": "6d4adf0d580e0340", "metadata": { "collapsed": false }, - "id": "6d4adf0d580e0340" + "source": [ + "## 2. Create a target material\n", + "### 2.1. Set custom perturbation parameters\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "8d90932312c418ee", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.perturbation.helpers import PerturbationFunctionHolder\n", - "from mat3ra.made.tools.utils.perturbation import PerturbationFunctionHolder\n", + "from mat3ra.made.tools.helpers import PerturbationFunctionHolder\n", + "from mat3ra.made.tools.helpers import PerturbationFunctionHolder\n", "\n", "custom_perturbation_function = PerturbationFunctionHolder(\n", " function=custom_sympy_function,\n", " variable_names=variable_names,\n", " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "8d90932312c418ee", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Apply perturbation to the material" - ], + "id": "7695d5d1df6be2e3", "metadata": { "collapsed": false }, - "id": "7695d5d1df6be2e3" + "source": [ + "### 2.2. Apply perturbation to the material" + ] }, { "cell_type": "code", - "source": [ - "from mat3ra.made.tools.build.perturbation.helpers import create_perturbation\n", - "\n", - "material_with_custom_perturbation = create_perturbation(material=supercell,\n", - " perturbation_function=custom_sympy_function, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" - ], + "execution_count": null, + "id": "69ccc90b8c5c1191", "metadata": { "collapsed": false }, - "id": "69ccc90b8c5c1191", "outputs": [], - "execution_count": null + "source": [ + "from mat3ra.made.tools.helpers import create_perturbation\n", + "\n", + "material_with_custom_perturbation = create_perturbation(material=supercell,\n", + " perturbation_function=custom_sympy_function, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" + ] }, { "cell_type": "markdown", - "source": [ - "### 3. Visualize the Material" - ], + "id": "10e7ca8950839991", "metadata": { "collapsed": false }, - "id": "10e7ca8950839991" + "source": [ + "### 3. Visualize the Material" + ] }, { "cell_type": "code", - "source": "visualize(material_with_custom_perturbation, viewer=\"wave\")", + "execution_count": null, + "id": "cbfe0878a16f6c83", "metadata": { "collapsed": false }, - "id": "cbfe0878a16f6c83", "outputs": [], - "execution_count": null + "source": [ + "visualize(material_with_custom_perturbation, viewer=\"wave\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "9e0b241366592109", "metadata": { "collapsed": false }, - "id": "9e0b241366592109" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "29dfa0a329cca2fa", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(material_with_custom_perturbation)\n", "download_content_to_file(material_with_custom_perturbation.to_json(), f\"{MATERIAL_NAME}_edge_perturbation.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "29dfa0a329cca2fa", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index cde34f05..96e3a1e0 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -37,10 +37,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4b64735060047bec", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "MILLER_INDICES = (0, 1, 1)\n", "THICKNESS = 3 # in atomic layers\n", @@ -48,9 +50,7 @@ "XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", "USE_ORTHOGONAL_C = True\n", "USE_CONVENTIONAL_CELL = True\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -65,10 +65,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b457673560550933", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -80,9 +82,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -96,18 +96,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b588ccfe51967a86", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_first_match(\"SrTiO3\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -121,18 +121,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "c4f6e2697f97965f", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize(material, repetitions=[3, 3, 3], rotation=\"0x\")\n", "visualize(material, repetitions=[3, 3, 3], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -140,22 +140,24 @@ "metadata": { "collapsed": false }, - "source": "## 2. Get possible terminations for the slab\n" + "source": [ + "## 2. Get possible terminations for the slab\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "730569ace3c4024", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "slab_terminations = get_slab_terminations(material, miller_indices=MILLER_INDICES)\n", "\n", "print(\"Terminations\")\n", "for idx, termination in enumerate(slab_terminations):\n", " print(f\" {idx}: {termination}\")" - ], - "id": "730569ace3c4024", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -163,13 +165,18 @@ "metadata": { "collapsed": false }, - "source": "## 3. Create and visualize slabs" + "source": [ + "## 3. Create and visualize slabs" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "958bccf0c45b902b", + "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slabs = [create_slab(\n", " crystal=material,\n", @@ -183,30 +190,29 @@ ") for termination in slab_terminations]\n", "\n", "visualize([{\"material\": slab, \"title\": slab.name} for slab in slabs], repetitions=[3, 3, 1], viewer=\"wave\")\n" - ], - "id": "958bccf0c45b902b", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 4. Download materials", - "id": "63ceec59586339f0" + "id": "63ceec59586339f0", + "metadata": {}, + "source": [ + "## 4. Download materials" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "6e7d16e2a84a9dbb", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(slabs)\n", "for slab in slabs:\n", " download_content_to_file(slab.to_json(), f\"{slab.name}.json\")" - ], - "id": "6e7d16e2a84a9dbb", - "outputs": [], - "execution_count": null + ] } ], "metadata": { From ad1c38e742cfabb865a784fae6c66791b6612110 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 15:16:37 -0700 Subject: [PATCH 02/26] update: heterostructure nb --- ...ide_hafnium_dioxide_titanium_nitride.ipynb | 579 +++--------------- 1 file changed, 87 insertions(+), 492 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 5fe4773a..e68c512d 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 @@ -1,42 +1,5 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "2ea560eb", - "metadata": {}, - "outputs": [], - "source": [ - "# Materials configuration for heterostructure (bottom to top):\n", - "# Si (substrate) -> SiO2 -> HfO2 -> TiN\n", - "\n", - "# Miller indices for each layer's surface orientation\n", - "MILLER_INDICES = [\n", - " (1, 0, 0), # Silicon substrate\n", - " (1, 0, 0), # SiO2 layer \n", - " (0, 0, 1), # HfO2 layer\n", - " (0, 0, 1), # TiN layer\n", - "]\n", - "\n", - "# Number of atomic layers for each material\n", - "THICKNESSES = [\n", - " 4, # Silicon substrate\n", - " 3, # SiO2 layer\n", - " 2, # HfO2 layer \n", - " 3, # TiN layer\n", - "]\n", - "\n", - "# Gaps between adjacent layers in Angstroms\n", - "GAPS = [\n", - " 2.5, # Gap between Si and SiO2\n", - " 3.0, # Gap between SiO2 and HfO2\n", - " 2.5, # Gap between HfO2 and TiN\n", - "]\n", - "\n", - "# Total vacuum at the top of the structure in Angstroms\n", - "VACUUM = 10.0\n" - ] - }, { "cell_type": "markdown", "id": "3ae4cc7db0846f04", @@ -71,81 +34,58 @@ ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "d437c36db077a11c", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:28.479435Z", - "start_time": "2025-08-07T00:21:28.472616Z" - } - }, - "outputs": [], "source": [ "from types import SimpleNamespace\n", - "from mat3ra.made.tools.helpers import create_heterostructure \n", - "\n", - "# 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", " SimpleNamespace(\n", " # Silicon substrate\n", + " name = \"Silicon\",\n", " slab_params=SimpleNamespace(\n", - " miller_indices=(1, 0, 0),\n", + " miller_indices=(0, 0, 1),\n", " thickness=4, # atomic layers\n", - " vacuum=5.0, # Angstroms\n", - " USE_ORTHOGONAL_C=True\n", + " xy_supercell_matrix=[[2, 0], [0, 2]],\n", " ),\n", " termination_formula=None, # Use default termination for substrate\n", - " interface_distance=None # No interface for substrate\n", " ),\n", " SimpleNamespace(\n", " # SiO2 layer\n", + " name = \"SiO2\",\n", " slab_params=SimpleNamespace(\n", - " miller_indices=(1, 0, 0),\n", - " thickness=3,\n", - " vacuum=5.0,\n", - " USE_ORTHOGONAL_C=True\n", + " miller_indices=(1, 1, 1),\n", + " thickness=5,\n", " ),\n", " termination_formula=None, # Use default termination for SiO2\n", - " interface_distance=2.5, # Distance to Si substrate\n", - " vacuum=0.5 # Vacuum for SiO2-terminating interface layer\n", " ),\n", " SimpleNamespace(\n", " # HfO2 layer\n", + " name = \"HfO2.*MCL\",\n", " slab_params=SimpleNamespace(\n", " miller_indices=(0, 0, 1),\n", " thickness=2,\n", - " vacuum=0.5,\n", - " xy_supercell_matrix=[[2, 0], [0, 2]],\n", - " USE_ORTHOGONAL_C=True\n", " ),\n", " termination_formula=None, # Use default termination for HfO2\n", - " interface_distance=3.0, # Distance to SiO2\n", - " vacuum=0.5 # Vacuum for HfO2-terminating interface layer\n", " ),\n", " SimpleNamespace(\n", " # TiN layer\n", + " name = \"TiN\",\n", " slab_params=SimpleNamespace(\n", - " miller_indices=(0, 0, 1),\n", - " thickness=3,\n", - " vacuum=5.0, # Add vacuum to final layer\n", - " USE_ORTHOGONAL_C=True,\n", - " xy_supercell_matrix=[[3, 0], [0, 3]]\n", + " miller_indices=(1, 1, 1),\n", + " thickness=5,\n", " ),\n", " termination_formula=None, # Use default termination for TiN\n", - " interface_distance=2.5, # Distance to HfO2\n", - " vacuum=10.0 # Vacuum for TiN-terminating interface layer\n", " )\n", "]\n", "\n", - "INTERFACE_1_INDEX = 11 # was found in the previous runs" - ] + "GAPS = [1.0, 1.0, 1.0] # Gaps between layers\n", + "\n", + "VACUUM = 10.0 # Vacuum thickness over the heterostructure" + ], + "id": "d437c36db077a11c", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -160,16 +100,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "c11956a7712639b9", "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:28.628889Z", - "start_time": "2025-08-07T00:21:28.626767Z" - }, "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -181,7 +115,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -195,464 +131,123 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "id": "474383a5e0f70d6", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:31.458912Z", - "start_time": "2025-08-07T00:21:28.637631Z" - }, - "collapsed": false - }, - "outputs": [], - "source": [ - "from mat3ra.standata.materials import Materials\n", - "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", - "\n", - "materials_1 = [\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"SiO2\")), # SiO2\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"Silicon\")), # Si substrate\n", - "]\n", - "materials_2 = [\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"HfO2.*MCL\")), # HfO2\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"TiN\")), # TiN\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1f2d02fa", "metadata": {}, - "outputs": [], + "cell_type": "code", "source": [ - "# Create heterostructure using the new simplified approach\n", - "from mat3ra.made.tools.helpers import create_heterostructure\n", "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", + "from mat3ra.made.tools.helpers import StackComponentDict\n", "\n", "# Get materials from Standata\n", "crystals = [\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"Silicon\")),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"SiO2\")),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"HfO2.*MCL\")),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(\"TiN\")),\n", - "]\n", - "\n", - "# Create the heterostructure with simplified parameters\n", - "heterostructure = create_heterostructure(\n", - " crystals=crystals,\n", - " miller_indices=MILLER_INDICES,\n", - " thicknesses=THICKNESSES,\n", - " gaps=GAPS,\n", - " vacuum=VACUUM,\n", - " use_conventional_cell=True,\n", - " optimize_layer_supercells=True,\n", - ")\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a8cd46c4", - "metadata": {}, + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[0].name)),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[1].name)),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[2].name)),\n", + " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[3].name))\n", + "]" + ], + "id": "1ef3c5ae52672e83", "outputs": [], - "source": [ - "# Visualize the heterostructure\n", - "from utils.visualize import visualize_materials as visualize\n", - "\n", - "visualize(\n", - " heterostructure,\n", - " repetitions=[1, 1, 1],\n", - " title=\"Si/SiO2/HfO2/TiN Heterostructure\",\n", - " viewer=\"wave\",\n", - " rotation='-90x'\n", - ")\n" - ] + "execution_count": null }, { - "cell_type": "code", - "execution_count": null, - "id": "f9857a66", "metadata": {}, - "outputs": [], - "source": [ - "# Save the heterostructure\n", - "from utils.jupyterlite import download_content_to_file, set_materials\n", - "\n", - "heterostructure.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", - "set_materials(heterostructure)\n", - "download_content_to_file(heterostructure.to_json(), \"heterostructure_high_k_metal_gate.json\")\n" - ] - }, - { "cell_type": "markdown", - "id": "9fe9b39b05f1dc7e", - "metadata": { - "collapsed": false - }, "source": [ - "## 2. Create Si/SiO2 Interface\n", - "### 2.1. Create Si/SiO2 Interface" - ] + "## 2. Create the heterostructure\n", + " ### 2.1. Create a list of dictionaries for each layer's parameters" + ], + "id": "988a23f9a0675323" }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "59c8eb0e549ee69e", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:34.850966Z", - "start_time": "2025-08-07T00:21:31.467448Z" - }, - "collapsed": false - }, - "outputs": [], - "source": [ - "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", - "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.compound_pristine_structures.two_dimensional.interface import \\\n", - " create_interface_zsl_between_slabs, create_interface_simple_between_slabs\n", - "\n", - "film_1_params = STRUCTURE_PARAMS[1] # SiO2 layer\n", - "substrate_1_params = STRUCTURE_PARAMS[0] # Silicon substrate\n", - "\n", - "# Create slab configurations\n", - "substrate_1_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=materials_1[1], # Silicon \n", - " miller_indices=substrate_1_params.slab_params.miller_indices,\n", - " number_of_layers=substrate_1_params.slab_params.thickness,\n", - " vacuum=0.0,\n", - " termination_formula=substrate_1_params.termination_formula,\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "film_1_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=materials_1[0], # SiO2\n", - " miller_indices=film_1_params.slab_params.miller_indices,\n", - " number_of_layers=film_1_params.slab_params.thickness,\n", - " vacuum=0.0,\n", - " termination_formula=film_1_params.termination_formula,\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "# Create slabs\n", - "substrate_1_slab = SlabBuilder().get_material(substrate_1_slab_config)\n", - "film_1_slab = SlabBuilder().get_material(film_1_slab_config)\n", - "\n", - "# Create Si/SiO2 interface using modern ZSL helper - select specified match\n", - "interface_1 = create_interface_zsl_between_slabs(\n", - " substrate_slab=substrate_1_slab,\n", - " film_slab=film_1_slab,\n", - " gap=film_1_params.interface_distance,\n", - " vacuum=film_1_params.vacuum,\n", - " match_id=INTERFACE_1_INDEX, # Use specified match from parameters\n", - " max_area=MAX_AREA,\n", - " max_area_ratio_tol=MAX_AREA_RATIO_TOL,\n", - " max_length_tol=MAX_LENGTH_TOLERANCE,\n", - " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", - " reduce_result_cell_to_primitive=False,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "b4d5e3261b720c9d", - "metadata": { - "collapsed": false - }, "source": [ - "### 2.2. Visualize the Si/SiO2 Interface" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "49c046cf4517ad91", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:35.383861Z", - "start_time": "2025-08-07T00:21:34.872412Z" - }, - "collapsed": false - }, + "stack_component_dicts = [\n", + " StackComponentDict(\n", + " crystal=crystals[i],\n", + " miller_indices=dict.slab_params.miller_indices,\n", + " thickness=dict.slab_params.thickness,\n", + " xy_supercell_matrix=dict.slab_params.xy_supercell_matrix if hasattr(dict.slab_params, 'xy_supercell_matrix') else None,\n", + " ) for i, dict in enumerate(STRUCTURE_PARAMS)\n", + "]" + ], + "id": "a038f7e04d307710", "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" - ] + "execution_count": null }, { + "metadata": {}, "cell_type": "markdown", - "id": "4cc11d87adc5d979", - "metadata": { - "collapsed": false - }, "source": [ - "## 3. Add HfO2 Layer\n", - "### 3.1. Add a layer with SimpleInterfaceBuilder" - ] + "### 2.1. Create the heterostructure\n", + "Using the `create_heterostructure` function, then flipping to match the example." + ], + "id": "3da2b64a397a1c1e" }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "449228d73d589d08", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:25:00.988961Z", - "start_time": "2025-08-07T00:23:54.433051Z" - } - }, - "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import create_slab\n", - "\n", - "film_2_params = STRUCTURE_PARAMS[2] # HfO2 layer\n", - "\n", - "# Create HfO2 slab with specified supercell matrix\n", - "film_2_slab = create_slab(\n", - " crystal=materials_2[0], # HfO2\n", - " termination=None, # Use default termination\n", - " miller_indices=film_2_params.slab_params.miller_indices,\n", - " number_of_layers=film_2_params.slab_params.thickness,\n", - " vacuum=film_2_params.slab_params.vacuum,\n", - " xy_supercell_matrix=film_2_params.slab_params.xy_supercell_matrix,\n", - " use_orthogonal_c=film_2_params.slab_params.USE_ORTHOGONAL_C\n", - ")\n", - "\n", - "interface_1_slab = create_slab(\n", - " crystal=interface_1, # Use the Si/SiO2 interface slab\n", - "\n", - " vacuum=0.0, # No vacuum for interface slab\n", - " xy_supercell_matrix=film_2_params.slab_params.xy_supercell_matrix,\n", - " use_orthogonal_c=film_2_params.slab_params.USE_ORTHOGONAL_C\n", - ")\n", + "from mat3ra.made.tools.operations.core.unary import rotate\n", + "from mat3ra.made.tools.helpers import create_heterostructure\n", "\n", - "# Create Si/SiO2/HfO2 interface using SimpleInterfaceBuilder\n", - "interface_2 = create_interface_simple_between_slabs(\n", - " film_slab=film_2_slab,\n", - " substrate_slab=interface_1_slab,\n", - " gap=film_2_params.interface_distance, # Distance to SiO2\n", - " vacuum=film_2_params.vacuum # Vacuum for HfO2-terminating interface layer\n", - ")\n" - ] - }, - { - "cell_type": "markdown", - "id": "6f62d46be77dbf7f", - "metadata": { - "collapsed": false - }, - "source": [ - "### 3.2. Visualize the Si/SiO2/HfO2 Interface" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5ddc3d75b43a3926", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:38.790507Z", - "start_time": "2025-08-06T23:57:36.608292Z" - }, - "collapsed": false - }, - "outputs": [], - "source": [ - "visualize(\n", - " interface_2,\n", - " repetitions=[1, 1, 1],\n", - " title=\"Si/SiO2/HfO2 Interface\"\n", + "heterostructure = create_heterostructure(\n", + " stack_component_dicts= stack_component_dicts,\n", + " gaps= GAPS,\n", + " vacuum=VACUUM,\n", + " use_conventional_cell=True,\n", + " optimize_layer_supercells=True,\n", ")\n", "\n", - "visualize(\n", - " interface_2,\n", - " repetitions=[1, 1, 1],\n", - " title=\"Si/SiO2/HfO2 Interface\",\n", - " rotation='-90x'\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "93705fda2bacc16e", - "metadata": { - "collapsed": false - }, - "source": [ - "## 4. Add TiN Layer\n", - "### 4.1. Create a TiN Slab" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "9900d149e4148bfa", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:38.804788Z", - "start_time": "2025-08-06T23:57:37.044816Z" - } - }, + "flipped_heterostructure = rotate(heterostructure, angle=90, axis=[1,0,0])" + ], + "id": "d534ad4b1b1be01c", "outputs": [], - "source": [ - "\n", - "from mat3ra.made.tools.build_components.entities.reusable.three_dimensional.supercell.helpers import create_supercell\n", - "\n", - "film_3_params = STRUCTURE_PARAMS[3] # TiN layer\n", - "\n", - "# Create TiN slab with specified supercell matrix\n", - "tin_slab = create_slab(\n", - " crystal=materials_2[1], # TiN\n", - " termination=None, # Use default termination\n", - " miller_indices=film_3_params.slab_params.miller_indices,\n", - " number_of_layers=film_3_params.slab_params.thickness,\n", - " vacuum=film_3_params.slab_params.vacuum,\n", - " xy_supercell_matrix=film_3_params.slab_params.xy_supercell_matrix,\n", - " use_orthogonal_c=film_3_params.slab_params.USE_ORTHOGONAL_C\n", - ")\n", - "\n", - "# Flip interface_2 for stacking TiN on top\n", - "interface_2_flipped = create_supercell(interface_2, scaling_factor=[1, -1, -1])" - ] + "execution_count": null }, { - "cell_type": "markdown", - "id": "37ffd5a46a4b3f8", "metadata": {}, - "source": [ - "### 4.2. Get terminations for TiN and Si/SiO2/HfO2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2da4c0aae9175936", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:38.805715Z", - "start_time": "2025-08-06T23:57:37.450542Z" - } - }, - "outputs": [], - "source": [ - "# TiN slab and interface_2_flipped are ready for final interface creation\n", - "print(\"TiN slab created successfully\")\n", - "print(\"Si/SiO2/HfO2 interface prepared for TiN layer addition\")" - ] - }, - { "cell_type": "markdown", - "id": "29288bf265f1175b", - "metadata": {}, - "source": [ - "### 4.3. Add TiN layer with SimpleInterfaceBuilder" - ] + "source": "## 3. Visualize the material\n", + "id": "1e7b3bbe711cd26" }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "baf2ba664817c0bc", - "metadata": { - "ExecuteTime": { - "end_time": "2025-08-07T00:21:38.806294Z", - "start_time": "2025-08-06T23:57:37.492175Z" - } - }, - "outputs": [], "source": [ - "# Create final Si/SiO2/HfO2/TiN interface configuration\n", - "interface_2_flipped_slab = create_slab(\n", - " crystal=interface_2_flipped, # Use the flipped Si/SiO2/HfO2 interface slab\n", - " miller_indices=(0, 0, 1),\n", - " number_of_layers=film_3_params.slab_params.thickness,\n", - " vacuum=0.0, # No vacuum for interface slab\n", - " xy_supercell_matrix=film_3_params.slab_params.xy_supercell_matrix,\n", - " use_orthogonal_c=film_3_params.slab_params.USE_ORTHOGONAL_C\n", - ")\n", - "\n", - "interface_3 = create_interface_simple_between_slabs(\n", - " film_slab=tin_slab,\n", - " substrate_slab=interface_2_flipped_slab,\n", - " gap=film_3_params.interface_distance,\n", - " vacuum=film_3_params.vacuum\n", - ")\n", + "from utils.visualize import visualize_materials as visualize\n", "\n", - "# Invert the interface along the z-axis to match example orientation\n", - "interface_3 = create_supercell(interface_3, scaling_factor=[1, -1, -1])" - ] - }, - { - "cell_type": "markdown", - "id": "de4385aa81264e6b", - "metadata": { - "collapsed": false - }, - "source": [ - "### 4.4. Visualize the Si/SiO2/HfO2/TiN Interface" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2b3fda71c801aeff", - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ "visualize(\n", - " interface_3,\n", - " title=\"Si/SiO2/HfO2/TiN Interface\",\n", + " flipped_heterostructure,\n", + " repetitions=[1, 1, 1],\n", " viewer=\"wave\",\n", " rotation='-90x'\n", - ")" - ] + ")\n" + ], + "id": "a5bf257d138dfbaa", + "outputs": [], + "execution_count": null }, { + "metadata": {}, "cell_type": "markdown", - "id": "ae16540b54491e35", - "metadata": { - "collapsed": false - }, - "source": [ - "## 5. Save final material\n" - ] + "source": "## 4. Save the material", + "id": "1886c9e81c03d2ef" }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "803792030da3a97", - "metadata": { - "collapsed": false - }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", - "interface_3.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", - "set_materials(interface_3)\n", - "download_content_to_file(interface_3.to_json(), \"heterostructure_high_k_metal_gate.json\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d69fffa6670c3f33", - "metadata": {}, + "\n", + "flipped_heterostructure.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", + "set_materials(flipped_heterostructure)\n", + "download_content_to_file(flipped_heterostructure.to_json(), \"heterostructure_high_k_metal_gate.json\")\n" + ], + "id": "5a245b0917b5c527", "outputs": [], - "source": [] + "execution_count": null } ], "metadata": { From 734c38b6bc093f36110f9fecd502fb445f2b839a Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 15:18:04 -0700 Subject: [PATCH 03/26] update: imports --- utils/jupyterlite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/jupyterlite.py b/utils/jupyterlite.py index 3f9f9218..e5fc7cb3 100644 --- a/utils/jupyterlite.py +++ b/utils/jupyterlite.py @@ -129,7 +129,7 @@ def get_materials(globals_dict: Optional[Dict] = None) -> List[Any]: List[Material]: A list of Material objects. """ from mat3ra.made.material import Material - from mat3ra.made.tools.build.metadata import MaterialWithBuildMetadata + from mat3ra.made.tools.build_components import MaterialWithBuildMetadata if globals_dict is None: # Get the globals of the caller for correct variable assignment during the execution of data_bridge extension @@ -184,7 +184,7 @@ def load_materials_from_folder(folder_path: Optional[str] = None, verbose: bool List[Material]: A list of Material objects loaded from the folder. """ from mat3ra.made.material import Material - from mat3ra.made.tools.build.metadata import MaterialWithBuildMetadata + from mat3ra.made.tools.build_components import MaterialWithBuildMetadata folder_path = folder_path or UPLOADS_FOLDER @@ -291,7 +291,7 @@ def download_content_to_file(content: Any, filename: str): filename (str): The name of the file to download. """ from mat3ra.made.material import Material - from mat3ra.made.tools.build.metadata import MaterialWithBuildMetadata + from mat3ra.made.tools.build_components import MaterialWithBuildMetadata if isinstance(content, dict): content = json.dumps(content, indent=4) From d0d2c2b25042cbef795cf7e4ad9749c601eaf8aa Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 15:18:15 -0700 Subject: [PATCH 04/26] update: improt made --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 42b15df5..2b9b8a99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "matplotlib>=3.4.1", "pandas>=1.5.3", "pymatgen==2024.4.13", - "mat3ra-made>=2025.8.1.post1", + "mat3ra-made @ git+https://github.com/Exabyte-io/made.git@82bb88c824e51d667580f300a4f8e3ed94c9d640", "mat3ra-utils>=2024.6.11.post0", ] From 1c63d1e6cd53049b4aee3d9aebe95baf4d507813 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 15:21:53 -0700 Subject: [PATCH 05/26] update: slab related --- .../create_adatom_defect.ipynb | 2 +- .../create_cluster_sphere.ipynb | 2 +- .../create_cutout_custom_shape.ipynb | 16 +++++------ ...create_interface_with_min_strain_zsl.ipynb | 27 +++++++++---------- ...te_interface_with_no_strain_matching.ipynb | 12 ++++----- other/materials_designer/create_slab.ipynb | 2 +- ...terface_2d_2d_boron_nitride_graphene.ipynb | 4 +-- ...rface_2d_3d_graphene_silicon_dioxide.ipynb | 4 +-- .../interface_3d_3d_copper_cristobalite.ipynb | 4 +-- .../slab_strontium_titanate.ipynb | 2 +- 10 files changed, 36 insertions(+), 39 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index 8e12efd6..8c6f81f7 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -159,7 +159,7 @@ "\n", "slab = create_slab(\n", " crystal=material,\n", - " termination=termination,\n", + " termination_top=termination,\n", " miller_indices=MILLER_INDICES,\n", " number_of_layers=SLAB_THICKNESS,\n", " vacuum=VACUUM,\n", diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index 20ddd845..70473113 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -139,7 +139,7 @@ "\n", "slab = create_slab(\n", " crystal=materials[0],\n", - " termination=termination,\n", + " termination_top=termination,\n", " miller_indices=Z_ORIENTATION,\n", " number_of_layers=1,\n", " vacuum=0,\n", diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index 5997f396..d476adee 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -106,13 +106,10 @@ ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "56c8227695643174", - "metadata": { - "collapsed": false - }, "outputs": [], + "execution_count": null, "source": [ "from typing import List\n", "\n", @@ -175,10 +172,11 @@ " right_wall_position=RIGHT_WALL_POSITION,\n", " left_channel_position=LEFT_CHANNEL_POSITION,\n", " right_channel_position=RIGHT_CHANNEL_POSITION,\n", - " channel_depth=CHANNEL_TOP_Z,\n", - " cavity_depth=CAVITY_TOP_Z,\n", + " channel_top_z=CHANNEL_TOP_Z,\n", + " cavity_top_z=CAVITY_TOP_Z,\n", ").condition" - ] + ], + "id": "322ca726a11952d5" }, { "cell_type": "markdown", @@ -263,7 +261,7 @@ "\n", "slab_unit_cell = create_slab(\n", " crystal=material,\n", - " termination=termination,\n", + " termination_top=termination,\n", " miller_indices=MILLER_INDICES,\n", " number_of_layers=THICKNESS,\n", " vacuum=VACUUM,\n", 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 ab03a982..9435b1d1 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -202,23 +202,23 @@ ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, "outputs": [], + "execution_count": null, "source": [ "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", - "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for\n", + " termination\n", " in\n", " film_slab_terminations]\n", "\n", - "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", - " for termination in\n", - " substrate_slab_terminations]\n", + "substrate_slabs = [\n", + " create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination_top=termination, vacuum=0)\n", + " for termination in\n", + " substrate_slab_terminations]\n", "\n", "film_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in\n", " zip(film_slabs, film_slab_terminations)]\n", @@ -256,20 +256,19 @@ ] }, { - "cell_type": "code", - "execution_count": null, "metadata": {}, + "cell_type": "code", "outputs": [], + "execution_count": null, "source": [ - "from mat3ra.made.tools.helpers import SlabBuilder\n", - "from mat3ra.made.tools.helpers import SlabConfiguration\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", " number_of_layers=SUBSTRATE_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=SUBSTRATE_TERMINATION_FORMULA,\n", + " termination_top_formula=SUBSTRATE_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -278,7 +277,7 @@ " miller_indices=FILM_MILLER_INDICES,\n", " number_of_layers=FILM_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=FILM_TERMINATION_FORMULA,\n", + " termination_bottom_formula=FILM_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", 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 cf791807..6bba434b 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -193,11 +193,11 @@ "from mat3ra.made.tools.helpers import create_slab\n", "from mat3ra.made.tools.helpers import select_slab_termination\n", "\n", - "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", " film_slab_terminations]\n", "\n", - "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", + "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination_top=termination, vacuum=0)\n", " for termination in\n", " substrate_slab_terminations]\n", "\n", @@ -237,10 +237,10 @@ ] }, { - "cell_type": "code", - "execution_count": null, "metadata": {}, + "cell_type": "code", "outputs": [], + "execution_count": null, "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "\n", @@ -248,7 +248,7 @@ " film_slab = create_slab(\n", " crystal=film,\n", " miller_indices=FILM_MILLER_INDICES,\n", - " termination=film_termination,\n", + " termination_bottom=film_termination,\n", " number_of_layers=FILM_THICKNESS, # in atomic layers\n", " vacuum=FILM_VACUUM, # in angstroms\n", " xy_supercell_matrix=FILM_XY_SUPERCELL_MATRIX,\n", @@ -259,7 +259,7 @@ " substrate_slab = create_slab(\n", " crystal=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", - " termination=substrate_termination,\n", + " termination_top=substrate_termination,\n", " number_of_layers=SUBSTRATE_THICKNESS, # in atomic layers\n", " vacuum=SUBSTRATE_VACUUM, # in angstroms\n", " xy_supercell_matrix=SUBSTRATE_XY_SUPERCELL_MATRIX,\n", diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index 20b87808..6c20116e 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -300,7 +300,7 @@ "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab = create_slab(crystal=material,\n", - " termination=termination,\n", + " termination_top=termination,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL,\n", " miller_indices=MILLER_INDICES,\n", " number_of_layers= THICKNESS,\n", diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index d76cd8b5..e18249d0 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -183,11 +183,11 @@ "from mat3ra.made.tools.helpers import create_slab\n", "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "\n", - "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", " film_slab_terminations]\n", "\n", - "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", + "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination_top=termination, vacuum=0)\n", " for termination in\n", " substrate_slab_terminations]\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index 43ae3e3d..917d41b8 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -185,11 +185,11 @@ "from mat3ra.made.tools.build.slab.helpers import create_slab\n", "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "\n", - "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", " film_slab_terminations]\n", "\n", - "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", + "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination_top=termination, vacuum=0)\n", " for termination in\n", " substrate_slab_terminations]\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index 0b648aee..1a127217 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -186,11 +186,11 @@ "from mat3ra.made.tools.build.slab.helpers import create_slab\n", "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "\n", - "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", " film_slab_terminations]\n", "\n", - "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", + "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination_top=termination, vacuum=0)\n", " for termination in\n", " substrate_slab_terminations]\n", "\n", diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index 96e3a1e0..4b0553d9 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -180,7 +180,7 @@ "\n", "slabs = [create_slab(\n", " crystal=material,\n", - " termination=termination,\n", + " termination_top=termination,\n", " miller_indices=MILLER_INDICES,\n", " number_of_layers=THICKNESS,\n", " vacuum=VACUUM,\n", From 3db060e86aab3d1896484f6e66757c4e05d34356 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 15:45:39 -0700 Subject: [PATCH 06/26] update: imports in specific examples (claude) --- .../create_point_defect_pair.ipynb | 154 ++++++++-------- .../custom_cutout_etched_silicon.ipynb | 82 +++++---- ...anar_grain_boundary_2d_boron_nitride.ipynb | 50 +++--- ..._grain_boundary_3d_fcc_metals_copper.ipynb | 86 +++++---- ...island_molybdenum_disulfide_platinum.ipynb | 76 ++++---- .../defect_point_interstitial_tin_oxide.ipynb | 2 +- .../defect_point_pair_gallium_nitride.ipynb | 50 +++--- .../defect_point_substitution_graphene.ipynb | 2 +- .../defect_point_vacancy_boron_nitride.ipynb | 48 ++--- .../defect_surface_adatom_graphene.ipynb | 168 +++++++++--------- ...fect_surface_island_titanium_nitride.ipynb | 50 +++--- ...rface_2d_3d_graphene_silicon_dioxide.ipynb | 121 +++++++------ .../interface_3d_3d_copper_cristobalite.ipynb | 115 ++++++------ ...surate_lattices_molybdenum_disulfide.ipynb | 92 +++++----- ...er_twisted_nanoribbons_boron_nitride.ipynb | 166 ++++++++--------- ...ace_film_xy_position_graphene_nickel.ipynb | 56 +++--- .../passivation_edge_nanowire_silicon.ipynb | 66 +++---- 17 files changed, 713 insertions(+), 671 deletions(-) diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index b49b9792..58aabea6 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "f2e1e795020d7b3f", + "metadata": { + "collapsed": false + }, "source": [ "# Create a point defect pair in a bulk material\n", "\n", @@ -18,27 +22,26 @@ "\n", "1. For more information, see [Introduction](Introduction.ipynb)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f2e1e795020d7b3f" + ] }, { "cell_type": "markdown", + "id": "5e43ff288847b784", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", "Defect Configuration parameters are described in [Defect Configuration](https://github.com/Exabyte-io/made/blob/8196b759242551c77d1791bf5bd2f4150763cfef/src/py/mat3ra/made/tools/build/defect/configuration.py#L102)." - ], - "metadata": { - "collapsed": false - }, - "id": "5e43ff288847b784" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "71f275fbc0163e6f", + "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -61,23 +64,23 @@ " # \"site_id\": 0, # Index of the atom in the host material\n", " # \"coordinate\": None, # Exact position (override the approximate coordinate)\n", ")" - ], - "id": "71f275fbc0163e6f", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "709d92aa693bd65f", + "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))." - ], - "id": "709d92aa693bd65f" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "d499bc9a7f6855f7", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -89,77 +92,77 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "id": "d499bc9a7f6855f7", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input materials\n", - "Materials are loaded with `get_materials()`." - ], + "id": "919ad7af8dceeedd", "metadata": { "collapsed": false }, - "id": "919ad7af8dceeedd" + "source": [ + "### 1.3. Get input materials\n", + "Materials are loaded with `get_materials()`." + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import get_materials\n", - "\n", - "materials = get_materials(globals())" - ], + "execution_count": null, + "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "id": "be38fdda1984c654", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import get_materials\n", + "\n", + "materials = get_materials(globals())" + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create and preview Supercell" - ], + "id": "a132fe0ef8bbf0d0", "metadata": { "collapsed": false }, - "id": "a132fe0ef8bbf0d0" + "source": [ + "### 1.4. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "e2d24109d3068c9e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.utils.coordinate import create_supercell\n", "\n", "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "e2d24109d3068c9e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create the Defect\n", - "### 2.1. Initialize Configuration and Builder parameters" - ], + "id": "5da5b0380583c952", "metadata": { "collapsed": false }, - "id": "5da5b0380583c952" + "source": [ + "## 2. Create the Defect\n", + "### 2.1. Initialize Configuration and Builder parameters" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "c4f50fb621da6474", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defect.pair_defect.helpers import create_pair_defect\n", "\n", @@ -177,20 +180,22 @@ " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG,\n", " 'placement_method') else None,\n", ")" - ], - "id": "c4f50fb621da6474", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 3. Visualize Result(s)", - "id": "ae5f5d5e9be9113" + "id": "ae5f5d5e9be9113", + "metadata": {}, + "source": [ + "## 3. Visualize Result(s)" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "8308ef3260816859", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -199,34 +204,31 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}])" - ], - "id": "8308ef3260816859", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Pass data to the outside runtime" - ], + "id": "d381df29a6bbdd82", "metadata": { "collapsed": false }, - "id": "d381df29a6bbdd82" + "source": [ + "## 4. Pass data to the outside runtime" + ] }, { "cell_type": "code", - "source": [ - "from utils.jupyterlite import set_materials\n", - "\n", - "set_materials([material_with_defect])" - ], + "execution_count": null, + "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "id": "61daa5afcbc078a9", "outputs": [], - "execution_count": null + "source": [ + "from utils.jupyterlite import set_materials\n", + "\n", + "set_materials([material_with_defect])" + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb index bf32dd3f..b3230b08 100644 --- a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb +++ b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb @@ -40,10 +40,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "280f9794a876678b", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -55,9 +57,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -71,10 +71,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "5177e239254e3601", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Slab parameters\n", "MILLER_INDICES = (0, 0, 1)\n", @@ -91,9 +93,7 @@ "CAVITY_TOP_Z = 0.5\n", "\n", "NAME = \"Custom Shape - Etching Pattern\"" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -107,14 +107,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "56c8227695643174", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from typing import List\n", "\n", - "from mat3ra.made.tools.utils.coordinate import CoordinateCondition\n", + "from mat3ra.made.tools.helpers import CoordinateCondition\n", "\n", "\n", "# Example of a custom coordinate condition. Adapt coordinate conditions to your needs.\n", @@ -176,48 +178,50 @@ " channel_top_z=CHANNEL_TOP_Z,\n", " cavity_top_z=CAVITY_TOP_Z,\n", ").condition" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 1.4. Get input materials", - "id": "73bcac566392be2e" + "id": "73bcac566392be2e", + "metadata": {}, + "source": [ + "### 1.4. Get input materials" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "db7ec34d105a7f63", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material_json = Materials.get_by_name_first_match(\"Si\")\n", "material = Material.create(material_json)" - ], - "id": "db7ec34d105a7f63", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 1.5. Preview the material", - "id": "f85547bcf667a508" + "id": "f85547bcf667a508", + "metadata": {}, + "source": [ + "### 1.5. Preview the material" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "f00247a517992ddf", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize(material, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(material, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "id": "f00247a517992ddf", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -232,10 +236,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "8938220048670941", "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "slab = create_slab(\n", " crystal=material,\n", @@ -248,9 +254,7 @@ ")\n", "\n", "visualize(slab, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -262,15 +266,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e1a13d9490a4d5ca", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_condition_on_coordinates, add_vacuum\n", "resulting_material = filter_by_condition_on_coordinates(slab, condition)\n", "resulting_material = add_vacuum(resulting_material, VACUUM)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -284,14 +288,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "20f499a8dd2362e0", "metadata": {}, + "outputs": [], "source": [ "visualize(resulting_material, title=\"Resulting Material\", rotation=\"-90x\")\n", "visualize(resulting_material, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -305,18 +309,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "cbee60d4b936e5cb", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "resulting_material.name = NAME\n", "set_materials(resulting_material)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb index 6a3327f7..7405651b 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb @@ -37,10 +37,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "338ee3c51155e086", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_NAME = \"Boron_Nitride\" # Name of the material to import from Standata\n", @@ -58,9 +60,7 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [3, 3, 1]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -75,10 +75,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7e22d1f4da825575", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -90,9 +92,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -106,18 +106,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a1635c31132962f6", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -132,18 +132,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "61f0870d8104cd21", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -158,13 +158,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "33a2c8a9be436745", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", - "from mat3ra.made.tools.build.grain_boundary import create_grain_boundary_linear\n", + "from mat3ra.made.tools.helpers import create_grain_boundary_linear\n", "\n", "grain_boundary = create_grain_boundary_linear(\n", " material=material,\n", @@ -178,9 +180,7 @@ "\n", "# We need to remove overlapping atoms at the boundary line\n", "grain_boundary.basis.resolve_colliding_coordinates(tolerance=OVERLAP_TOLERANCE)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -194,18 +194,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d7007fe825463e5a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "actual_angle = grain_boundary.metadata.build[-1].configuration.get(\"actual_angle\", \"unknown\")\n", "print(f\"Target angle: {TARGET_TWIST_ANGLE}°\")\n", "print(f\"Actual angle: {actual_angle}°\")\n", "print(f\"Number of atoms: {len(grain_boundary.basis.elements.ids)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -219,15 +219,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7f558a8e9d417cef", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize_materials(grain_boundary, title=\"Grain Boundary\", viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -241,18 +241,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "20e46167358d63", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(grain_boundary)\n", "download_content_to_file(grain_boundary.to_json(), \"grain_boundary_2d_boron_nitride.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index 564a9c39..ca7fe7b1 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -39,10 +39,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "45730b0f5384262b", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "MATERIAL_NAME = \"Cu\"\n", "\n", @@ -60,9 +62,7 @@ "\n", "# Maximum area for the superlattice search algorithm\n", "MAX_AREA = 200 # in Angstrom^2\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -77,10 +77,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "bae18ae87d3cc5ba", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -92,9 +94,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_grain_boundary.ipynb\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -108,18 +108,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "950e5bef61bbd84a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "\n", "material = MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -133,17 +133,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4ebde830102b0b94", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([material], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -170,12 +170,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "5bdc0e37e3ec9891", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "phase_1_terminations = get_slab_terminations(material=material, miller_indices=PHASE_1_MILLER_INDICES)\n", "phase_2_terminations = get_slab_terminations(material=material, miller_indices=PHASE_2_MILLER_INDICES)\n", @@ -186,9 +188,7 @@ "print(f\"Phase 2 Terminations:\")\n", "for idx, termination in enumerate(phase_2_terminations):\n", " print(f\" {idx}: {termination}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -202,12 +202,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f75092312b399f84", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination=termination) for termination\n", " in phase_1_terminations]\n", @@ -218,20 +220,22 @@ " repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize([{\"material\": slab, \"title\": slab.name} for slab in phase_2_slabs],\n", " repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.4. Create slabs with specified Miller indices and thickness", - "id": "df2fe7c010c0e4d2" + "id": "df2fe7c010c0e4d2", + "metadata": {}, + "source": [ + "### 2.4. Create slabs with specified Miller indices and thickness" + ] }, { "cell_type": "code", + "execution_count": null, "id": "29dd6499", "metadata": {}, + "outputs": [], "source": [ "# Create phase 1 slab\n", "phase_1_slab = create_slab(\n", @@ -256,9 +260,7 @@ "# Visualize the phase slabs\n", "visualize([{\"material\": phase_1_slab, \"title\": \"Phase 1 Slab\"}, {\"material\": phase_2_slab, \"title\": \"Phase 2 Slab\"}],\n", " repetitions=[2, 2, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -266,16 +268,20 @@ "metadata": { "collapsed": false }, - "source": "### 2.5. Create Grain Boundary" + "source": [ + "### 2.5. Create Grain Boundary" + ] }, { "cell_type": "code", + "execution_count": null, "id": "40b6c8662d071f18", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.grain_boundary.helpers import create_grain_boundary_planar\n", + "from mat3ra.made.tools.helpers import create_grain_boundary_planar\n", "\n", "\n", "grain_boundary = create_grain_boundary_planar(\n", @@ -290,9 +296,7 @@ " max_length_tol = 0.05,\n", " max_angle_tol = 0.02,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -300,17 +304,21 @@ "metadata": { "collapsed": false }, - "source": "## 3. Visualize the Material" + "source": [ + "## 3. Visualize the Material" + ] }, { "cell_type": "code", + "execution_count": null, "id": "892c0e7c932cd725", "metadata": { "collapsed": false }, - "source": "visualize([grain_boundary], repetitions=[1, 1, 1], viewer=\"wave\")", "outputs": [], - "execution_count": null + "source": [ + "visualize([grain_boundary], repetitions=[1, 1, 1], viewer=\"wave\")" + ] }, { "cell_type": "markdown", @@ -318,23 +326,25 @@ "metadata": { "collapsed": false }, - "source": "## 4. Save the final material" + "source": [ + "## 4. Save the final material" + ] }, { "cell_type": "code", + "execution_count": null, "id": "503eff0dd5c1a160", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(grain_boundary)\n", "download_content_to_file(grain_boundary.to_json(),\n", " f\"{MATERIAL_NAME}-{PHASE_1_MILLER_INDICES}-{PHASE_2_MILLER_INDICES}_grain_boundary.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index 3e048010..52286cf0 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -36,10 +36,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Slab parameters\n", "MATERIAL_NAME = \"MoS2.*2D\" # Name of the material (regex) to be loaded from Standata\n", @@ -69,9 +71,7 @@ " [5 / 9, 7 / 9, 0], # 3rd atom, next clockwise atop Mo\n", " [4 / 9, 5 / 9, 0], # 4th topmost atom, atop S\n", "]\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -86,10 +86,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "ef664b14457530fd", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -101,9 +103,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -118,10 +118,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.standata.materials import Materials\n", @@ -132,9 +134,7 @@ "# Preview materials\n", "visualize_materials([substrate])\n", "visualize_materials([substrate], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -148,10 +148,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f174b6be", "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "\n", @@ -165,9 +167,7 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -175,17 +175,24 @@ "metadata": { "collapsed": false }, - "source": "## 2. Create the Defects" + "source": [ + "## 2. Create the Defects" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "#### 2.1. Create the defct dictionaries", - "id": "174048812b11801e" + "id": "174048812b11801e", + "metadata": {}, + "source": [ + "#### 2.1. Create the defct dictionaries" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "15bb5f2376e31ea7", + "metadata": {}, + "outputs": [], "source": [ "\n", "DEFECT_DICTS = [\n", @@ -198,34 +205,33 @@ " }\n", " for i, coordinate in enumerate(COORDINATES)\n", "]" - ], - "id": "15bb5f2376e31ea7", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Create the defects", - "id": "f31763784a1abb19" + "id": "f31763784a1abb19", + "metadata": {}, + "source": [ + "### 2.2. Create the defects" + ] }, { "cell_type": "code", + "execution_count": null, "id": "e385e50ae11ed2b9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.adatom.helpers import create_multiple_adatom_defects\n", + "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", "slab_with_adatom = create_multiple_adatom_defects(\n", " slab=slab,\n", " defect_dicts=DEFECT_DICTS,\n", " placement_method=PLACEMENT_METHOD,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -239,19 +245,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -265,18 +271,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials([slab_with_adatom])\n", "download_content_to_file(slab_with_adatom.to_json(), \"MoS2_Pt_island.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index 70fd16b8..ee28e92e 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -140,7 +140,7 @@ "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index b94d2b2a..2e2643e0 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -28,8 +28,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f941f8a0bb45817f", "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -48,9 +50,7 @@ " coordinate=[0.5, 0.5, 0.65],\n", " placement_method=\"closest_site\",\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -63,8 +63,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e02d623e22f90fc7", "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -76,9 +78,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -93,10 +93,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4a6bab14f63024d1", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", @@ -104,19 +106,17 @@ "\n", "material = Material.create(Materials.get_by_name_first_match(\"GaN\"))\n", "visualize(material)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "c574c219", "metadata": {}, + "outputs": [], "source": [ "unit_cell = material\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -130,23 +130,25 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4580fda63efa927e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "85013c49", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defect.pair_defect.helpers import create_pair_defect\n", "\n", @@ -161,9 +163,7 @@ " element_2=SECONDARY_DEFECT_CONFIG.element if hasattr(SECONDARY_DEFECT_CONFIG, \"element\") else None,\n", " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG, 'placement_method') else None,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -187,19 +187,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "951f0cffe9389d5e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -213,18 +213,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b9e1aba13faf1bf0", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"Mg substitution and vacancy in GaN.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index c53833ea..9a964462 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -163,7 +163,7 @@ "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index 00c4d728..bd6263ce 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -43,10 +43,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "dff59577346dbece", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Matrix to get the supercell of primitive hBN exactly as shown in the manuscript\n", "SUPERCELL_MATRIX = [[-6, -6, 0], [-2, 2, 0], [0, 0, 1]]\n", @@ -57,9 +59,7 @@ " \"placement_method\": \"closest_site\",\n", " \"use_cartesian_coordinates\": False\n", " }\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -74,10 +74,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "8c6ea8b36f1a6cc", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -89,9 +91,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -106,18 +106,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "14c40630ba2974e6", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_and_categories(\"Boron_Nitride\", \"2D\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -131,13 +131,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6d5a793dd5e45f16", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.build.supercell import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "nanoribbon = create_supercell(\n", " material=material,\n", " supercell_matrix=SUPERCELL_MATRIX,\n", @@ -145,9 +147,7 @@ ")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -155,14 +155,18 @@ "metadata": { "collapsed": false }, - "source": "## 2. Create the Defect\n" + "source": [ + "## 2. Create the Defect\n" + ] }, { "cell_type": "code", + "execution_count": null, "id": "db2d621e2fd4bbeb", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defect.point.helpers import create_point_defect_vacancy\n", "\n", @@ -172,9 +176,7 @@ " placement_method=DEFECT_CONFIG[\"placement_method\"],\n", " use_cartesian_coordinates=DEFECT_CONFIG[\"use_cartesian_coordinates\"]\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -188,19 +190,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d4a1e920884b1a48", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": nanoribbon, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": \"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -214,19 +216,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7dcf867f46422fa9", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"B-vacancy h-BN\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"B-vacancy_hexagonal_boron_nitride.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index 1af29eba..b2c50d09 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "c62d2c5007947f56", + "metadata": { + "collapsed": false + }, "source": [ "# Adatom Defect on Graphene surface\n", "\n", @@ -19,26 +23,28 @@ "\n", "![Fig 1.](https://github.com/Exabyte-io/documentation/raw/12617167278ae3523adc028583b21ea4e8ebd197/images/tutorials/materials/defects/defect-surface-adatom-graphene/me_adatom_on_hollow_graphene.webp)\n", "\n" - ], - "metadata": { - "collapsed": false - }, - "id": "c62d2c5007947f56" + ] }, { "cell_type": "markdown", + "id": "4d0772a456c9952c", + "metadata": { + "collapsed": false + }, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", "Adatom Defect Configuration parameters are described in [Adatom Defect Configuration](https://github.com/Exabyte-io/made/blob/8196b759242551c77d1791bf5bd2f4150763cfef/src/py/mat3ra/made/tools/build/defect/configuration.py#L141).\n" - ], - "metadata": { - "collapsed": false - }, - "id": "4d0772a456c9952c" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b5459bac655071be", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Name of material to find in Standata\n", "MATERIAL_NAME = \"Graphene\"\n", @@ -66,27 +72,27 @@ " {\"chemical_element\": \"Pd\", \"distance_z\": 2.21, \"position_on_surface\": BRIDGE_SITE_COORDINATE},\n", " # {\"chemical_element\": \"Au\", \"distance_z\": 2.69, \"position_on_surface\": TOP_SITE_COORDINATE},\n", "]" - ], - "metadata": { - "collapsed": false - }, - "id": "b5459bac655071be", - "outputs": [], - "execution_count": null + ] }, { "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))." - ], + "id": "d572e8697122fef5", "metadata": { "collapsed": false }, - "id": "d572e8697122fef5" + "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": "58b0da5bbc87efc6", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -98,53 +104,53 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "metadata": { - "collapsed": false - }, - "id": "58b0da5bbc87efc6", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Load input material" - ], + "id": "b342c025f3e369d4", "metadata": { "collapsed": false }, - "id": "b342c025f3e369d4" + "source": [ + "### 1.3. Load input material" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7ebdb82cd32c735c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "metadata": { - "collapsed": false - }, - "id": "7ebdb82cd32c735c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.4. Create and preview Supercell" - ], + "id": "8f459296488702b1", "metadata": { "collapsed": false }, - "id": "8f459296488702b1" + "source": [ + "### 1.4. Create and preview Supercell" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "926503f431d18cad", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", "supercell = create_slab(crystal=material,\n", @@ -152,24 +158,26 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", " )\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "metadata": { - "collapsed": false - }, - "id": "926503f431d18cad", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 2. Create the Defect", + "id": "2de6554d42e97c9d", "metadata": { "collapsed": false }, - "id": "2de6554d42e97c9d" + "source": [ + "## 2. Create the Defect" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6fc8ad13e12845f", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defect.adatom.helpers import create_adatom_defect\n", "\n", @@ -180,52 +188,52 @@ " distance_z=adatom_parameters[\"distance_z\"],\n", " position_on_surface=adatom_parameters[\"position_on_surface\"],\n", ") for adatom_parameters in ADATOM_PARAMETERS]" - ], - "metadata": { - "collapsed": false - }, - "id": "6fc8ad13e12845f", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 3. Visualize Result(s)" - ], + "id": "5ebf2d6bb1a82b9a", "metadata": { "collapsed": false }, - "id": "5ebf2d6bb1a82b9a" + "source": [ + "## 3. Visualize Result(s)" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "93a18e3e1d6e3e6e", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "for material_with_defect in materials_with_adatom:\n", " title = f\"{material_with_defect.name} adatom\"\n", " visualize([{\"material\": material_with_defect, \"title\": title}], viewer=\"wave\")" - ], - "metadata": { - "collapsed": false - }, - "id": "93a18e3e1d6e3e6e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 4. Download the Results" - ], + "id": "61176790d8d979e0", "metadata": { "collapsed": false }, - "id": "61176790d8d979e0" + "source": [ + "## 4. Download the Results" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "20ab1b4be207428c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -233,13 +241,7 @@ "for material_with_defect in materials_with_adatom:\n", " download_content_to_file(material_with_defect.to_json(),\n", " f\"{material_with_defect.name}.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "20ab1b4be207428c", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index 094bc200..41c17fbd 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -36,10 +36,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "139422d7e6c3cb3e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "NUMBER_OF_ADDED_LAYERS = 0.5\n", "\n", @@ -56,9 +58,7 @@ " \"USE_ORTHOGONAL_C\": True,\n", " \"xy_supercell_matrix\": [[10, 0], [0, 10]]\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -73,10 +73,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a457db594c9e2b24", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -89,9 +91,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -106,18 +106,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "ba2d38ba55128111", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_first_match(\"TiN\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -131,10 +131,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "df4c56a0", "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials\n", "\n", "slab = create_slab(\n", @@ -148,9 +150,7 @@ ")\n", "\n", "visualize_materials(slab)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -158,16 +158,20 @@ "metadata": { "collapsed": false }, - "source": "## 2. Create the Target Material" + "source": [ + "## 2. Create the Target Material" + ] }, { "cell_type": "code", + "execution_count": null, "id": "c1dfcb6ba96a8856", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.utils.coordinate import BoxCoordinateCondition\n", + "from mat3ra.made.tools.helpers import BoxCoordinateCondition\n", "from mat3ra.made.tools.build.defect.island.helpers import create_island_defect\n", "\n", "coordinate_condition = BoxCoordinateCondition(\n", @@ -181,9 +185,7 @@ " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", " use_cartesian_coordinates=False,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -197,19 +199,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "70d32719704d9ef2", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize_materials([{\"material\": slab, \"title\": \"Original material\", \"rotation\": \"-45x\"},\n", " {\"material\": slab_with_island,\n", " \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\",\"rotation\": \"-45x\"}],\n", " # viewer=\"wave\"\n", " )" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -223,18 +225,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3ec05765edc89d01", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(slab_with_island)\n", "download_content_to_file(slab_with_island.to_json(), \"TiN_slab_with_island.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index 917d41b8..679e0ad2 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -37,9 +37,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "FILM_MILLER_INDICES = (0, 0, 1)\n", "FILM_THICKNESS = 1 # in atomic layers\n", @@ -66,9 +68,7 @@ "\n", "# Whether to reduce the resulting interface cell to the primitive cell after the interface creation.\n", "REDUCE_RESULT_CELL_TO_PRIMITIVE = True" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -82,9 +82,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -96,9 +98,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_interface_with_min_strain_zsl.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -109,18 +109,18 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "film = Material.create(Materials.get_by_name_first_match(\"Graphene\"))\n", "substrate = Material.create(Materials.get_by_name_first_match(\"SiO2\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -133,16 +133,16 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -155,17 +155,17 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "film_slab_terminations = get_slab_terminations(material=film, miller_indices=FILM_MILLER_INDICES)\n", "substrate_slab_terminations = get_slab_terminations(material=substrate, miller_indices=SUBSTRATE_MILLER_INDICES)\n", "print(\"Film slab terminations:\", film_slab_terminations)\n", "print(\"Substrate slab terminations:\", substrate_slab_terminations)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -178,12 +178,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", @@ -200,9 +201,7 @@ "\n", "visualize(film_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(substrate_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -215,15 +214,15 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -236,7 +235,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", @@ -261,13 +262,11 @@ "\n", "substrate_slab = SlabBuilder().get_material(substrate_slab_config)\n", "film_slab = SlabBuilder().get_material(film_slab_config)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "## 3. Analyze possible interfaces with ZSL Analyzer\n", "### 3.1. Initialize ZSL Analyzer\n", @@ -276,7 +275,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", "\n", @@ -289,13 +290,11 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell=False # Reduces supercell matrices in analyzer\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.2. Generate matches with strain analyzer\n", "Matches are sorted by size and strain.\n" @@ -303,21 +302,25 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "matches = zsl_analyzer.zsl_match_holders\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 3.3. Plot matches by area and strain\n" + "metadata": {}, + "source": [ + "### 3.3. Plot matches by area and strain\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", "\n", @@ -328,13 +331,11 @@ "}\n", "\n", "plot_strain_vs_area(matches, PLOT_SETTINGS)\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.4. Select the interface\n", "\n", @@ -343,11 +344,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "selected_index = 0\n", "\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "interface = create_zsl_interface_between_slabs(\n", " substrate_slab=substrate_slab,\n", @@ -361,48 +364,50 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell_to_primitive=REDUCE_RESULT_CELL_TO_PRIMITIVE,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 4. Preview the selected interface\n" + "metadata": {}, + "source": [ + "## 4. Preview the selected interface\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "visualize(interface, repetitions=[1, 1, 1])\n", "visualize(interface, repetitions=[1, 1, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 5. Pass data to the outside runtime\n" + "metadata": {}, + "source": [ + "## 5. Pass data to the outside runtime\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials(interface)\n", "download_content_to_file(interface.to_json(), f\"{interface.name}.json\")" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "code", - "source": "", + "execution_count": null, + "metadata": {}, "outputs": [], - "execution_count": null + "source": [] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index 1a127217..6f9393be 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -37,9 +37,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "FILM_MILLER_INDICES = (0, 0, 1)\n", "FILM_THICKNESS = 3 # in atomic layers\n", @@ -66,9 +68,7 @@ "\n", "# Whether to reduce the resulting interface cell to the primitive cell after the interface creation.\n", "REDUCE_RESULT_CELL_TO_PRIMITIVE = False" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -82,9 +82,11 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -96,9 +98,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_interface_with_min_strain_zsl.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -110,18 +110,18 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "film = Material.create(Materials.get_by_name_first_match(\"Copper\"))\n", "substrate = Material.create(Materials.get_by_name_first_match(\"Cristobalite\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -134,16 +134,16 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([substrate, film], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -156,17 +156,17 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import get_slab_terminations\n", + "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", "film_slab_terminations = get_slab_terminations(material=film, miller_indices=FILM_MILLER_INDICES)\n", "substrate_slab_terminations = get_slab_terminations(material=substrate, miller_indices=SUBSTRATE_MILLER_INDICES)\n", "print(\"Film slab terminations:\", film_slab_terminations)\n", "print(\"Substrate slab terminations:\", substrate_slab_terminations)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -179,12 +179,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", + "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", @@ -201,9 +202,7 @@ "\n", "visualize(film_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize(substrate_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -216,15 +215,15 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": { "collapsed": false }, + "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -237,7 +236,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", @@ -262,13 +263,11 @@ "\n", "substrate_slab = SlabBuilder().get_material(substrate_slab_config)\n", "film_slab = SlabBuilder().get_material(film_slab_config)" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "## 3. Analyze possible interfaces with ZSL Analyzer\n", "### 3.1. Initialize ZSL Analyzer\n", @@ -277,7 +276,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", "\n", @@ -290,13 +291,11 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell=False # Reduces supercell matrices in analyzer\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.2. Generate matches with strain analyzer\n", "Matches are sorted by size and strain.\n" @@ -304,21 +303,25 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "matches = zsl_analyzer.zsl_match_holders\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 3.3. Plot matches by area and strain\n" + "metadata": {}, + "source": [ + "### 3.3. Plot matches by area and strain\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", "\n", @@ -329,13 +332,11 @@ "}\n", "\n", "plot_strain_vs_area(matches, PLOT_SETTINGS)\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "metadata": {}, "source": [ "### 3.4. Select the interface\n", "\n", @@ -344,11 +345,13 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "selected_index = 0\n", "\n", - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "interface = create_zsl_interface_between_slabs(\n", " substrate_slab=substrate_slab,\n", @@ -362,41 +365,43 @@ " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", " reduce_result_cell_to_primitive=REDUCE_RESULT_CELL_TO_PRIMITIVE,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 4. Preview the selected interface\n" + "metadata": {}, + "source": [ + "## 4. Preview the selected interface\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "visualize(interface, repetitions=[1, 1, 1])\n", "visualize(interface, repetitions=[1, 1, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 5. Pass data to the outside runtime\n" + "metadata": {}, + "source": [ + "## 5. Pass data to the outside runtime\n" + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials(interface)\n", "download_content_to_file(interface.to_json(), f\"{interface.name}.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 0088668e..83a96207 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -35,8 +35,11 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "81f392a7dbdd0acb", + "metadata": {}, + "outputs": [], "source": [ "# Uncomment lines to reproduce specific cases from the article\n", "INTERFACE_PARAMETERS = [\n", @@ -62,10 +65,7 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [3, 3, 1]" - ], - "id": "81f392a7dbdd0acb", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -80,10 +80,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "9f851434739f468a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -95,9 +97,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -111,8 +111,11 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "a8d47cc0e54bca82", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -127,28 +130,28 @@ "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")\n" - ], - "id": "a8d47cc0e54bca82", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "fe47bcbd429ee0d5", + "metadata": {}, "source": [ " ## 3. Generate Twisted Interface\n", " ### 3.1. Create slab\n" - ], - "id": "fe47bcbd429ee0d5" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "dcf5e2daa1d04a62", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", - "from mat3ra.made.tools.build.interface.helpers import create_commensurate_interface\n", + "from mat3ra.made.tools.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_interface_commensurate as create_commensurate_interface\n", "\n", "slab = create_slab(\n", " crystal=material,\n", @@ -159,20 +162,22 @@ "slab = translate_to_z_level(slab, \"center\")\n", "\n", "visualize_materials(slab, rotation=\"-90x\")" - ], - "id": "dcf5e2daa1d04a62", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 3.2. Create twisted interfaces", - "id": "8c4c87d9ff529b17" + "id": "8c4c87d9ff529b17", + "metadata": {}, + "source": [ + "### 3.2. Create twisted interfaces" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "ec61eca814b922f5", + "metadata": {}, + "outputs": [], "source": [ "interfaces = []\n", "for parameters in INTERFACE_PARAMETERS:\n", @@ -188,10 +193,7 @@ " )\n", " interfaces.append(interface)\n", " print(f\"Created interface with twist angle {parameters['angle']}° and {len(interface.basis.elements.ids)} atoms\")\n" - ], - "id": "ec61eca814b922f5", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -204,27 +206,32 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "65811e9ed95eb5db", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "for interface in interfaces:\n", " visualize_materials(interface, viewer=\"wave\")\n" - ], - "id": "65811e9ed95eb5db", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 5. Download materials\n", - "id": "c395226b74ee0ea1" + "id": "c395226b74ee0ea1", + "metadata": {}, + "source": [ + "## 5. Download materials\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "d548c123372d9205", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -232,10 +239,7 @@ "\n", "for idx, interface in enumerate(interfaces):\n", " download_content_to_file(interface.to_json(), f\"twisted_interface_{idx}.json\")" - ], - "id": "d548c123372d9205", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index 13f43157..044c8b37 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "6b26b3bd88c951b3", + "metadata": { + "collapsed": false + }, "source": [ "# Twisted bilayer Boron Nitride (TBBN).\n", "\n", @@ -23,25 +27,27 @@ "The image shows the twisted bilayer h-BN structure with a twist angle of 2.64° (a) and 62.64° (b).\n", "\n", "\"Twisted" - ], - "metadata": { - "collapsed": false - }, - "id": "6b26b3bd88c951b3" + ] }, { "cell_type": "markdown", - "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up structure parameters\n" - ], + "id": "21f76cc671b0e835", "metadata": { "collapsed": false }, - "id": "21f76cc671b0e835" + "source": [ + "## 1. Prepare the Environment\n", + "### 1.1. Set up structure parameters\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "47af0a587ce80b91", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "# Material and structure parameters\n", "TWIST_ANGLE_A = 2.64 # Twist angle in degrees for A material\n", @@ -60,26 +66,26 @@ "# Visualization settings\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [1, 1, 1]" - ], - "metadata": { - "collapsed": false - }, - "id": "47af0a587ce80b91", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.2. Install Packages\n" - ], + "id": "4b91848e28033a8b", "metadata": { "collapsed": false }, - "id": "4b91848e28033a8b" + "source": [ + "### 1.2. Install Packages\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "f67b53c0f60f257c", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -91,27 +97,27 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "metadata": { - "collapsed": false - }, - "id": "f67b53c0f60f257c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 1.3. Get input material\n", - "We'll use hexagonal boron nitride (h-BN) as our starting material.\n" - ], + "id": "c4370f1ce85b6507", "metadata": { "collapsed": false }, - "id": "c4370f1ce85b6507" + "source": [ + "### 1.3. Get input material\n", + "We'll use hexagonal boron nitride (h-BN) as our starting material.\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "f1c2ac4b7553961b", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -126,30 +132,30 @@ "\n", "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "f1c2ac4b7553961b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "## 2. Create Twisted Bilayer Structure\n", - "### 2.1. Create nanoribbon\n" - ], + "id": "26064d36be06507f", "metadata": { "collapsed": false }, - "id": "26064d36be06507f" + "source": [ + "## 2. Create Twisted Bilayer Structure\n", + "### 2.1. Create nanoribbon\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "80ac5dd96d8622b7", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "\n", - "from mat3ra.made.tools.build.nanoribbon.helpers import create_nanoribbon\n", + "from mat3ra.made.tools.helpers import create_nanoribbon\n", "\n", "nanoribbon = create_nanoribbon(\n", " material=material,\n", @@ -158,27 +164,24 @@ " vacuum_length=VACUUM_PADDING,\n", " vacuum_width=VACUUM_PADDING,\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "80ac5dd96d8622b7", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.2. Generate and analyze interfaces\n" - ], + "id": "f3019591d1ab5506", "metadata": { "collapsed": false }, - "id": "f3019591d1ab5506" + "source": [ + "### 2.2. Generate and analyze interfaces\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "2293065288b4308c", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.interface.helpers import create_twisted_interface\n", "\n", @@ -199,46 +202,49 @@ " vacuum_x=VACUUM_PADDING,\n", " vacuum_y=VACUUM_PADDING,\n", ")" - ], - "id": "2293065288b4308c", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "### 2.3. Select and visualize the best interface\n" - ], + "id": "fe5b798439e5b43a", "metadata": { "collapsed": false }, - "id": "fe5b798439e5b43a" + "source": [ + "### 2.3. Select and visualize the best interface\n" + ] }, { "cell_type": "code", - "source": [ - "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS)\n", - "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")" - ], + "execution_count": null, + "id": "c4049a69b2dcbaa1", "metadata": { "collapsed": false }, - "id": "c4049a69b2dcbaa1", "outputs": [], - "execution_count": null + "source": [ + "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS)\n", + "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")" + ] }, { "cell_type": "markdown", - "source": [ - "## 5. Download the Materials\n" - ], + "id": "d58a1e4ada9d1a74", "metadata": { "collapsed": false }, - "id": "d58a1e4ada9d1a74" + "source": [ + "## 5. Download the Materials\n" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a64a81bb1ab4d47d", + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "interface_a.name += f\" ({TWIST_ANGLE_A} degrees)\"\n", @@ -246,13 +252,7 @@ "set_materials([interface_a, interface_b])\n", "download_content_to_file(interface_a.to_json(), \"twisted_bilayer_h-BN_A.json\")\n", "download_content_to_file(interface_b.to_json(), \"twisted_bilayer_h-BN_B.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "a64a81bb1ab4d47d", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index fe80befa..3ac4e05c 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -30,10 +30,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6cc535057854a4d1", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -45,9 +47,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_interface_with_min_strain_zsl.ipynb\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -61,8 +61,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a2b35c2f3e3b092a", "metadata": {}, + "outputs": [], "source": [ "# Material selection\n", "SUBSTRATE_NAME = \"Nickel\"\n", @@ -105,9 +107,7 @@ "# Visualization parameters\n", "SHOW_3D_LANDSCAPE = False # Whether to show 3D energy landscape\n", "STRUCTURE_REPETITIONS = [3, 3, 1] # Repetitions for structure visualization\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -122,10 +122,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f1047ca2cc30b87a", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.standata.materials import Materials\n", @@ -136,9 +138,7 @@ "\n", "# Preview materials\n", "visualize_materials([substrate, film], repetitions=STRUCTURE_REPETITIONS, rotation=\"0x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -152,8 +152,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "4943dcc4a793f623", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", @@ -182,9 +184,7 @@ "# Visualize the created slabs\n", "visualize_materials([{\"material\": film_slab, \"title\": \"Film Slab\"}, {\"material\": substrate_slab, \"title\": \"Substrate Slab\"}],\n", " repetitions=[3, 3, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -196,10 +196,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e64b278750d997f0", "metadata": {}, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n", + "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", "\n", "interface_material = create_zsl_interface_between_slabs(\n", " substrate_slab=substrate_slab,\n", @@ -219,9 +221,7 @@ "# Visualize interface\n", "visualize_materials([interface_material], repetitions=STRUCTURE_REPETITIONS)\n", "visualize_materials([interface_material], repetitions=STRUCTURE_REPETITIONS, rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -236,10 +236,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "3dd3a069a69b4be1", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.build.interface import get_optimal_film_displacement\n", "from mat3ra.made.tools.modify import interface_displace_part\n", @@ -269,9 +271,7 @@ " use_cartesian_coordinates=USE_CARTESIAN\n", ")\n", "print(f\"\\nOptimal displacement vector: {optimal_displacement}\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -285,8 +285,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "291e197f524e12d2", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.utils.jupyterlite.plot import plot_2d_heatmap, plot_3d_surface\n", "\n", @@ -308,9 +310,7 @@ " displacement=optimal_displacement,\n", " use_cartesian_coordinates=USE_CARTESIAN\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -322,8 +322,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "aa330d1c1a0b249e", "metadata": {}, + "outputs": [], "source": [ "print(\"\\nVisualization of original and optimized materials:\")\n", "visualize_materials([{\"material\": interface_material, \"title\": \"Original Interface\"},\n", @@ -334,9 +336,7 @@ " {\"material\": optimized_material, \"title\": \"Optimized Interface\"}],\n", " repetitions=STRUCTURE_REPETITIONS,\n", " rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -350,19 +350,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "fb3a1781c32f144f", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "optimized_material.name = f\"{interface_material.name}_optimized_xy\"\n", "set_materials(optimized_material)\n", "download_content_to_file(optimized_material.to_json(), f\"{interface_material.name}_optimized_xy.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 1ff2f029..686cdc61 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -38,10 +38,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f704e7abe8fbe895", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "# Enable interactive selection of coordination threshold\n", "IS_COORDINATION_SELECTION_INTERACTIVE = False\n", @@ -51,9 +53,7 @@ "COORDINATION_SEARCH_RADIUS = 2.5 # in Angstroms (sphere in which to search for neighbors)\n", "COORDINATION_THRESHOLD = 3 # Coordination number below which to passivate\n", "MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -68,10 +68,12 @@ }, { "cell_type": "code", + "execution_count": null, "id": "37904650f2478a1d", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "import sys\n", "\n", @@ -83,9 +85,7 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -101,18 +101,18 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6d48372afc12056e", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "silicon = Material.create(Materials.get_by_name_first_match('Silicon'))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -127,13 +127,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "f8431fd833f6ed", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import rotate, filter_by_box, add_vacuum_sides, translate_to_center\n", - "from mat3ra.made.tools.build.slab.helpers import create_slab\n", + "from mat3ra.made.tools.helpers import create_slab\n", "\n", "silicon_slab = create_slab(\n", " crystal=silicon, \n", @@ -152,9 +154,7 @@ "# visualize_materials([{\"material\": rotated_slab},{\"material\": silicon_nanowire}, {\"material\": silicon_nanowire, \"rotation\": \"-90x\"}])\n", "nanowire_xy_pbc = rotate(silicon_nanowire, \"z\", 90+angle)\n", "nanowire_xy_pbc = add_vacuum_sides(nanowire_xy_pbc, 10.0, on_x=True, on_y=True)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -168,17 +168,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "76a4b4b6318d2549", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([{\"material\": nanowire_xy_pbc}, {\"material\": nanowire_xy_pbc, \"rotation\": \"-90x\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -192,17 +192,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "bb206aac50a38bb6", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.plot import plot_rdf\n", "\n", "plot_rdf(nanowire_xy_pbc, cutoff=10.0)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -217,13 +217,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7b80ee26896bbbfb", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "from utils.io import select_coordination_threshold\n", - "from mat3ra.made.tools.build.passivation.helpers import get_unique_coordination_numbers\n", + "from mat3ra.made.tools.helpers import get_unique_coordination_numbers\n", "\n", "coordination_numbers = get_unique_coordination_numbers(material = nanowire_xy_pbc, cutoff=10.0)\n", "\n", @@ -232,9 +234,7 @@ "coordination_threshold = COORDINATION_THRESHOLD\n", "if IS_COORDINATION_SELECTION_INTERACTIVE:\n", " coordination_threshold = await select_coordination_threshold(coordination_numbers, COORDINATION_THRESHOLD)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -248,12 +248,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "398b2dedef23e0fc", "metadata": { "collapsed": false }, + "outputs": [], "source": [ - "from mat3ra.made.tools.build.passivation.helpers import passivate_dangling_bonds\n", + "from mat3ra.made.tools.helpers import passivate_dangling_bonds\n", "\n", "passivated_nanowire = passivate_dangling_bonds(\n", " material=nanowire_xy_pbc,\n", @@ -263,9 +265,7 @@ " coordination_threshold=coordination_threshold,\n", " number_of_bonds_to_passivate=MAX_BONDS_TO_SATURATE,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -279,15 +279,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "cb85e7e42c0944f2", "metadata": { "collapsed": false }, + "outputs": [], "source": [ "visualize_materials(passivated_nanowire, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -301,17 +301,17 @@ }, { "cell_type": "code", + "execution_count": null, "id": "51a4fc8cbadfb526", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "passivated_nanowire.name = \"H-Passivated Silicon Nanowire\"\n", "set_materials(passivated_nanowire)\n", "download_content_to_file(passivated_nanowire.to_json(), \"passivated_nanowire.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { From c06d1a4b45e1fbd48b7145e1a89745bc7a838352 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 19:33:03 -0700 Subject: [PATCH 07/26] update: new dicts for point def --- .../create_adatom_defect.ipynb | 82 +++++++++++------- .../create_point_defect.ipynb | 83 +++++++++---------- .../create_point_defect_pair.ipynb | 48 +++++------ 3 files changed, 115 insertions(+), 98 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index 8c6f81f7..ee0bf0b7 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -47,26 +47,25 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "id": "42487847a9bdb6a5", "metadata": {}, - "outputs": [], + "cell_type": "code", "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", "ELEMENT = \"Si\" # Chemical element of the adatom\n", + "\n", + "# Dictionaries are validated and converted to AdatomDefectDict objects below\n", "DEFECT_CONFIGS = [\n", " {\n", " \"type\": \"adatom\",\n", - " \"coordinate\": [0.5, 0.5], # Crystal coordinates on the surface (x, y)\n", + " \"coordinate_2d\": [0.5, 0.5], # Crystal coordinates on the surface (x, y)\n", " \"distance_z\": 1.0, # Method to place the adatom\n", " \"element\": ELEMENT,\n", " }\n", "]\n", "\n", "\n", - "PLACEMENT_METHOD = \"new_crystal_site\" # Method to place the adatom, e.g., \"NEW_CRYSTAL_SITE\", \"EQUIDISTANT\", \"EXACT_COORDINATE\"\n", + "PLACEMENT_METHOD = \"new_crystal_site\" # Method to place the adatom, e.g., \"new_crystal_site\", \"exact_coordinate\", \"equidistant\"\n", "\n", "\n", "# Slab parameters\n", @@ -75,7 +74,10 @@ "VACUUM = 5.0 # Vacuum thickness in Angstrom\n", "XY_SUPERCELL_MATRIX = [[2, 0], [0, 2]] # Supercell matrix for the slab\n", "TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used." - ] + ], + "id": "79de96979d6a5b5e", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -90,10 +92,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "84be13304382106", "metadata": {}, - "outputs": [], "source": [ "import sys\n", "\n", @@ -106,7 +106,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -118,15 +120,15 @@ }, { "cell_type": "code", - "execution_count": null, "id": "540dc3a04b706af6", "metadata": {}, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -140,10 +142,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "426b290f92c6bc26", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", "from mat3ra.made.tools.helpers import create_slab, get_slab_terminations, select_slab_termination\n", @@ -168,7 +168,9 @@ " use_conventional_cell=True\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -179,22 +181,44 @@ ] }, { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.1. Validate defect dictionaries and prepare them", + "id": "fcea7b8a14938125" + }, + { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "source": [ + "from mat3ra.made.tools import AdatomDefectDict\n", + "\n", + "defect_dicts = [AdatomDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]" + ], + "id": "2bcabf1e719bc9ec", "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.2. Create the adatom defect", + "id": "63872a6268960590" + }, + { + "metadata": {}, + "cell_type": "code", "source": [ "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", "slab_with_adatom = create_multiple_adatom_defects(\n", " slab=slab,\n", - " defect_dicts=DEFECT_CONFIGS,\n", + " defect_dicts=defect_dicts,\n", " placement_method=PLACEMENT_METHOD,\n", ")" - ] + ], + "id": "da2f772cc8d6ad4", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -208,10 +232,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "256b07fb2dd39ae2", "metadata": {}, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -221,7 +243,9 @@ "],\n", " viewer=\"wave\"\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -235,17 +259,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials([slab_with_adatom])" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index b10e9caa..aaf31c1f 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -37,13 +37,8 @@ ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, - "outputs": [], "source": [ "# Selected material will be used as a unit cell to create a supercell first.\n", "SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 3]]\n", @@ -69,7 +64,10 @@ " \"placement_method\": \"voronoi_site\",\n", " },\n", "]" - ] + ], + "id": "5381fc1b249aec6a", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -84,10 +82,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "b0a44e0207ea7299", "metadata": {}, - "outputs": [], "source": [ "import sys\n", "\n", @@ -99,7 +95,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -113,17 +111,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -137,12 +135,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e2d24109d3068c9e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", @@ -150,7 +146,9 @@ "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -160,18 +158,16 @@ }, "source": [ "## 2. Create Multiple Defects\n", - "### 2.1. Prepare defect dictionaries for creation" + "### 2.1. Prepare defect dictionaries and validate them" ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "e385e50ae11ed2b9", - "metadata": { - "collapsed": false - }, - "outputs": [], "source": [ + "from mat3ra.made.tools import PointDefectDict\n", + "defect_dicts = [PointDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]\n", + "\n", "print(\"Defect configurations:\")\n", "for i, defect_dict in enumerate(DEFECT_CONFIGS):\n", " print(f\"\\n{i+1}. {defect_dict['type'].upper()}:\")\n", @@ -181,37 +177,34 @@ " print(f\" - Element: {defect_dict['element']}\")\n", " \n", "print(f\"\\nTotal defects to create: {len(DEFECT_CONFIGS)}\")" - ] + ], + "id": "26cb7d7e372468ee", + "outputs": [], + "execution_count": null }, { + "metadata": {}, "cell_type": "markdown", - "id": "489b51f0ee122c48", - "metadata": { - "collapsed": false - }, - "source": [ - "### 2.2. Create multiple defects using the newer approach" - ] + "source": "### 2.2. Create multiple defects using the newer approach", + "id": "70515db37f45bb66" }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defects = create_multiple_defects(\n", " material=supercell,\n", - " defect_dicts=DEFECT_CONFIGS,\n", + " defect_dicts=defect_dicts,\n", ")\n", "\n", "print(f\"Original atoms: {len(supercell.basis.elements.ids)}\")\n", "print(f\"Final atoms: {len(material_with_defects.basis.elements.ids)}\")" - ] + ], + "id": "dfeddc9c3c0954a1", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -225,12 +218,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -239,7 +230,9 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defects, \"title\": f\"Material with defects\"}])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -253,17 +246,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "bd4fa88a015b0dd4", "metadata": {}, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "# Set the material name and pass to outside runtime\n", "material_with_defects.name = f\"{unit_cell.name} with {len(DEFECT_CONFIGS)} defects\"\n", "set_materials([material_with_defects])" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index 58aabea6..ddac2a7f 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -38,10 +38,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "71f275fbc0163e6f", "metadata": {}, - "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -64,7 +62,9 @@ " # \"site_id\": 0, # Index of the atom in the host material\n", " # \"coordinate\": None, # Exact position (override the approximate coordinate)\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -77,10 +77,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d499bc9a7f6855f7", "metadata": {}, - "outputs": [], "source": [ "import sys\n", "\n", @@ -92,7 +90,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -107,17 +107,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -131,20 +131,20 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e2d24109d3068c9e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", - "from mat3ra.made.tools.utils.coordinate import create_supercell\n", + "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -159,14 +159,12 @@ }, { "cell_type": "code", - "execution_count": null, "id": "c4f50fb621da6474", "metadata": {}, - "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.pair_defect.helpers import create_pair_defect\n", + "from mat3ra.made.tools.helpers import create_defect_pair\n", "\n", - "material_with_defect = create_pair_defect(\n", + "material_with_defect = create_defect_pair(\n", " material=supercell,\n", " defect_type_1=PRIMARY_DEFECT_CONFIG.defect_type,\n", " coordinate_1=PRIMARY_DEFECT_CONFIG.coordinate,\n", @@ -180,7 +178,9 @@ " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG,\n", " 'placement_method') else None,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -192,10 +192,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8308ef3260816859", "metadata": {}, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -204,7 +202,9 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -218,17 +218,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials([material_with_defect])" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { From 2d074bdf0e795c49f4d0e70c536795cc39686dad Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 19:41:16 -0700 Subject: [PATCH 08/26] tmp: new made --- config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index c407b873..e20c6c02 100644 --- a/config.yml +++ b/config.yml @@ -31,9 +31,9 @@ default: - uncertainties==3.1.6 - jinja2 - pymatgen-analysis-defects<=2024.4.23 - - mat3ra-made==2025.8.1.post1 -# - mat3ra-code -# - mat3ra-esse + - https://exabyte-io.github.io/made/mat3ra_made-0.1.dev1+g5326929-py3-none-any.whl # mat3ra-made==2025.8.1.post1 + - mat3ra-code + - mat3ra-esse notebooks: - name: create_interface_with_min_strain_zsl.ipynb packages_common: From 03efa43911b8625685c650e5751e28ec3a657db1 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 19:46:39 -0700 Subject: [PATCH 09/26] tmp: new ax --- other/materials_designer/create_adatom_defect.ipynb | 10 +++++----- .../create_cluster_custom_shape.ipynb | 2 +- .../create_cluster_specific_shape.ipynb | 2 +- other/materials_designer/create_cluster_sphere.ipynb | 2 +- other/materials_designer/create_cutout_box.ipynb | 2 +- .../create_cutout_custom_shape.ipynb | 2 +- .../create_grain_boundary_crystal.ipynb | 2 +- .../create_grain_boundary_film.ipynb | 2 +- .../create_heterostructure_example.ipynb | 2 +- .../create_interface_with_min_strain_zsl.ipynb | 8 +++----- .../create_interface_with_no_strain_matching.ipynb | 2 +- .../create_interface_with_relaxation_ase_emt.ipynb | 2 +- other/materials_designer/create_island_defect.ipynb | 2 +- .../create_island_defect_custom.ipynb | 2 +- other/materials_designer/create_monolayer.ipynb | 2 +- other/materials_designer/create_nanoribbon.ipynb | 2 +- other/materials_designer/create_nanowire.ipynb | 2 +- .../create_nanowire_custom_shape.ipynb | 2 +- other/materials_designer/create_perturbation.ipynb | 2 +- .../create_perturbation_custom.ipynb | 2 +- other/materials_designer/create_point_defect.ipynb | 10 +++++----- .../materials_designer/create_point_defect_pair.ipynb | 2 +- other/materials_designer/create_slab.ipynb | 2 +- other/materials_designer/create_supercell.ipynb | 2 +- other/materials_designer/create_terrace_defect.ipynb | 2 +- ..._twisted_interface_with_commensurate_lattices.ipynb | 2 +- .../create_twisted_interface_with_nanoribbons.ipynb | 2 +- other/materials_designer/custom_transformation.ipynb | 2 +- .../import_material_from_jarvis_db_entry.ipynb | 2 +- .../import_materials_from_files.ipynb | 2 +- .../import_materials_from_standata.ipynb | 2 +- other/materials_designer/optimize_film_position.ipynb | 2 +- other/materials_designer/passivate_edge.ipynb | 2 +- other/materials_designer/passivate_slab.ipynb | 2 +- .../custom_cutout_etched_silicon.ipynb | 2 +- ...defect_planar_grain_boundary_2d_boron_nitride.ipynb | 2 +- ...ct_planar_grain_boundary_3d_fcc_metals_copper.ipynb | 2 +- ...t_adatom_island_molybdenum_disulfide_platinum.ipynb | 2 +- .../defect_point_interstitial_tin_oxide.ipynb | 2 +- .../defect_point_pair_gallium_nitride.ipynb | 2 +- .../defect_point_substitution_graphene.ipynb | 2 +- .../defect_point_vacancy_boron_nitride.ipynb | 2 +- .../defect_surface_adatom_graphene.ipynb | 2 +- .../defect_surface_island_titanium_nitride.ipynb | 2 +- .../defect_surface_step_platinum.ipynb | 2 +- ...icon_dioxide_hafnium_dioxide_titanium_nitride.ipynb | 2 +- .../interface_2d_2d_boron_nitride_graphene.ipynb | 2 +- .../interface_2d_3d_graphene_silicon_dioxide.ipynb | 2 +- .../interface_3d_3d_copper_cristobalite.ipynb | 2 +- ...ed_commensurate_lattices_molybdenum_disulfide.ipynb | 2 +- ...ace_bilayer_twisted_nanoribbons_boron_nitride.ipynb | 2 +- .../specific_examples/nanocluster_gold.ipynb | 2 +- ...on_interface_film_xy_position_graphene_nickel.ipynb | 2 +- .../passivation_edge_nanowire_silicon.ipynb | 2 +- .../passivation_surface_silicon.ipynb | 2 +- .../perturbation_ripple_graphene.ipynb | 2 +- .../specific_examples/slab_strontium_titanate.ipynb | 2 +- other/materials_designer/under_the_hood.ipynb | 2 +- .../api_interoperability_showcase.ipynb | 2 +- 59 files changed, 69 insertions(+), 71 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index ee0bf0b7..6d3d4edb 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -91,24 +91,24 @@ ] }, { - "cell_type": "code", - "id": "84be13304382106", "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "import sys\n", "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils', deps=False)\n", "\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" ], - "outputs": [], - "execution_count": null + "id": "9eeac88f287b5c19" }, { "cell_type": "markdown", diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index 0ac079b9..34c4af7d 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 70ed3b25..73a4dad7 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index 70473113..208aaa20 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -75,7 +75,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_box.ipynb b/other/materials_designer/create_cutout_box.ipynb index 9d2cfd2b..7bef05bf 100644 --- a/other/materials_designer/create_cutout_box.ipynb +++ b/other/materials_designer/create_cutout_box.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index d476adee..f6be579c 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 97c3eab4..09b8ee2f 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_film.ipynb b/other/materials_designer/create_grain_boundary_film.ipynb index e81fac8c..9cebd419 100644 --- a/other/materials_designer/create_grain_boundary_film.ipynb +++ b/other/materials_designer/create_grain_boundary_film.ipynb @@ -109,7 +109,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index fc0fc705..6bd071ba 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -120,7 +120,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n" 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 9435b1d1..2d57f9b0 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -96,19 +96,17 @@ ] }, { + "metadata": {}, "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, "outputs": [], + "execution_count": null, "source": [ "import sys\n", "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 6bba434b..eb92ec9a 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -92,7 +92,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb index 10b252be..26a23fc3 100644 --- a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb @@ -68,7 +68,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index d1f1b1b5..a6953a54 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -122,7 +122,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_island_defect_custom.ipynb b/other/materials_designer/create_island_defect_custom.ipynb index 22e07554..8b18dd1a 100644 --- a/other/materials_designer/create_island_defect_custom.ipynb +++ b/other/materials_designer/create_island_defect_custom.ipynb @@ -53,7 +53,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_monolayer.ipynb b/other/materials_designer/create_monolayer.ipynb index f8ef61a8..7c8f454c 100644 --- a/other/materials_designer/create_monolayer.ipynb +++ b/other/materials_designer/create_monolayer.ipynb @@ -72,7 +72,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index 8abcf09d..d87e4e74 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -83,7 +83,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire.ipynb b/other/materials_designer/create_nanowire.ipynb index a3784a0b..8b4e8773 100644 --- a/other/materials_designer/create_nanowire.ipynb +++ b/other/materials_designer/create_nanowire.ipynb @@ -71,7 +71,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire_custom_shape.ipynb b/other/materials_designer/create_nanowire_custom_shape.ipynb index da0f892a..94ab5266 100644 --- a/other/materials_designer/create_nanowire_custom_shape.ipynb +++ b/other/materials_designer/create_nanowire_custom_shape.ipynb @@ -54,7 +54,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_perturbation.ipynb b/other/materials_designer/create_perturbation.ipynb index 9aecb9d2..ae33413d 100644 --- a/other/materials_designer/create_perturbation.ipynb +++ b/other/materials_designer/create_perturbation.ipynb @@ -79,7 +79,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_perturbation_custom.ipynb b/other/materials_designer/create_perturbation_custom.ipynb index d87fba39..e602456e 100644 --- a/other/materials_designer/create_perturbation_custom.ipynb +++ b/other/materials_designer/create_perturbation_custom.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index aaf31c1f..1f2c492f 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -81,23 +81,23 @@ ] }, { - "cell_type": "code", - "id": "b0a44e0207ea7299", "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "import sys\n", "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" ], - "outputs": [], - "execution_count": null + "id": "cff4001d6747796e" }, { "cell_type": "markdown", diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index ddac2a7f..7c8e66f5 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -85,7 +85,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index 6c20116e..220ce565 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_supercell.ipynb b/other/materials_designer/create_supercell.ipynb index a729ae98..9459d0a4 100644 --- a/other/materials_designer/create_supercell.ipynb +++ b/other/materials_designer/create_supercell.ipynb @@ -74,7 +74,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index e6fe7e46..8c547ffb 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -94,7 +94,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb index d40231c7..5d864e01 100644 --- a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb +++ b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb index 61afefc6..08302de0 100644 --- a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb +++ b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb @@ -96,7 +96,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/custom_transformation.ipynb b/other/materials_designer/custom_transformation.ipynb index f4aa1bb4..03d85f57 100644 --- a/other/materials_designer/custom_transformation.ipynb +++ b/other/materials_designer/custom_transformation.ipynb @@ -26,7 +26,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb index 9aed8797..4f81e672 100644 --- a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +++ b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb @@ -67,7 +67,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_materials_from_files.ipynb b/other/materials_designer/import_materials_from_files.ipynb index e89afed1..1713e21a 100644 --- a/other/materials_designer/import_materials_from_files.ipynb +++ b/other/materials_designer/import_materials_from_files.ipynb @@ -74,7 +74,7 @@ "import sys\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"import_materials_from_files.ipynb\")" diff --git a/other/materials_designer/import_materials_from_standata.ipynb b/other/materials_designer/import_materials_from_standata.ipynb index 83c23a9f..dff95ef1 100644 --- a/other/materials_designer/import_materials_from_standata.ipynb +++ b/other/materials_designer/import_materials_from_standata.ipynb @@ -37,7 +37,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " await micropip.install('mat3ra-standata', deps=False)\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", diff --git a/other/materials_designer/optimize_film_position.ipynb b/other/materials_designer/optimize_film_position.ipynb index 721c445e..fe1d2ea9 100644 --- a/other/materials_designer/optimize_film_position.ipynb +++ b/other/materials_designer/optimize_film_position.ipynb @@ -37,7 +37,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_edge.ipynb b/other/materials_designer/passivate_edge.ipynb index ad0aa936..87a7260e 100644 --- a/other/materials_designer/passivate_edge.ipynb +++ b/other/materials_designer/passivate_edge.ipynb @@ -100,7 +100,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index 4a472edb..de241df4 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -105,7 +105,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"mat3ra-api-examples\", deps=False)\n", + " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb index b3230b08..eefae48a 100644 --- a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb +++ b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb index 7405651b..b9c56ea7 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb @@ -87,7 +87,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index ca7fe7b1..197d613c 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -89,7 +89,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index 52286cf0..cb3b3340 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -98,7 +98,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index ee28e92e..34342a0c 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index 2e2643e0..c7f0687a 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -73,7 +73,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index 9a964462..cb2f71e3 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -111,7 +111,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index bd6263ce..63df8798 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -86,7 +86,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index b2c50d09..39a78581 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -99,7 +99,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index 41c17fbd..89b35d4b 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -86,7 +86,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"mat3ra-api-examples\", deps=False)\n", + " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb index 1ac77af8..289368ea 100644 --- a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb @@ -81,7 +81,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 e68c512d..85cac98c 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 @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index e18249d0..fca9471d 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -90,7 +90,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index 679e0ad2..cbf618f6 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -93,7 +93,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index 6f9393be..df6fa5a5 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -93,7 +93,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 83a96207..7bcbf5ce 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -92,7 +92,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index 044c8b37..788126e6 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -92,7 +92,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index bd7e0566..98241fdb 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -61,7 +61,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index 3ac4e05c..2b0dcffa 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -42,7 +42,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 686cdc61..32d51c99 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -80,7 +80,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index 0d065ab1..ad9b6efe 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -84,7 +84,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb index 9a97291e..4ed28a2f 100644 --- a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb +++ b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb @@ -59,7 +59,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index 4b0553d9..a05f16e2 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -77,7 +77,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/under_the_hood.ipynb b/other/materials_designer/under_the_hood.ipynb index 1ed26ba6..bcf3df0f 100644 --- a/other/materials_designer/under_the_hood.ipynb +++ b/other/materials_designer/under_the_hood.ipynb @@ -27,7 +27,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n", diff --git a/other/materialsproject/api_interoperability_showcase.ipynb b/other/materialsproject/api_interoperability_showcase.ipynb index 0c595d96..f7bbec8d 100644 --- a/other/materialsproject/api_interoperability_showcase.ipynb +++ b/other/materialsproject/api_interoperability_showcase.ipynb @@ -95,7 +95,7 @@ " )\n", " \n", " import micropip\n", - " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", " await micropip.install(\"exabyte-api-client\")\n", " from utils.jupyterlite import install_packages\n", " await install_packages(\"api_interoperability_showcase.ipynb\",\"../../config.yml\")" From 122623f9db3499715ab212cc6f201d30b63b1907 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Thu, 7 Aug 2025 21:33:29 -0700 Subject: [PATCH 10/26] tmp: new ax --- other/materials_designer/create_adatom_defect.ipynb | 2 +- other/materials_designer/create_cluster_custom_shape.ipynb | 2 +- other/materials_designer/create_cluster_specific_shape.ipynb | 2 +- other/materials_designer/create_cluster_sphere.ipynb | 2 +- other/materials_designer/create_cutout_box.ipynb | 2 +- other/materials_designer/create_cutout_custom_shape.ipynb | 2 +- other/materials_designer/create_grain_boundary_crystal.ipynb | 2 +- other/materials_designer/create_grain_boundary_film.ipynb | 2 +- other/materials_designer/create_heterostructure_example.ipynb | 2 +- .../create_interface_with_min_strain_zsl.ipynb | 2 +- .../create_interface_with_no_strain_matching.ipynb | 2 +- .../create_interface_with_relaxation_ase_emt.ipynb | 2 +- other/materials_designer/create_island_defect.ipynb | 2 +- other/materials_designer/create_island_defect_custom.ipynb | 2 +- other/materials_designer/create_monolayer.ipynb | 2 +- other/materials_designer/create_nanoribbon.ipynb | 2 +- other/materials_designer/create_nanowire.ipynb | 2 +- other/materials_designer/create_nanowire_custom_shape.ipynb | 2 +- other/materials_designer/create_perturbation.ipynb | 2 +- other/materials_designer/create_perturbation_custom.ipynb | 2 +- other/materials_designer/create_point_defect.ipynb | 2 +- other/materials_designer/create_point_defect_pair.ipynb | 2 +- other/materials_designer/create_slab.ipynb | 2 +- other/materials_designer/create_supercell.ipynb | 2 +- other/materials_designer/create_terrace_defect.ipynb | 2 +- .../create_twisted_interface_with_commensurate_lattices.ipynb | 2 +- .../create_twisted_interface_with_nanoribbons.ipynb | 2 +- other/materials_designer/custom_transformation.ipynb | 2 +- .../import_material_from_jarvis_db_entry.ipynb | 2 +- other/materials_designer/import_materials_from_files.ipynb | 2 +- other/materials_designer/import_materials_from_standata.ipynb | 2 +- other/materials_designer/optimize_film_position.ipynb | 2 +- other/materials_designer/passivate_edge.ipynb | 2 +- other/materials_designer/passivate_slab.ipynb | 2 +- .../specific_examples/custom_cutout_etched_silicon.ipynb | 2 +- .../defect_planar_grain_boundary_2d_boron_nitride.ipynb | 2 +- .../defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb | 2 +- ...fect_point_adatom_island_molybdenum_disulfide_platinum.ipynb | 2 +- .../specific_examples/defect_point_interstitial_tin_oxide.ipynb | 2 +- .../specific_examples/defect_point_pair_gallium_nitride.ipynb | 2 +- .../specific_examples/defect_point_substitution_graphene.ipynb | 2 +- .../specific_examples/defect_point_vacancy_boron_nitride.ipynb | 2 +- .../specific_examples/defect_surface_adatom_graphene.ipynb | 2 +- .../defect_surface_island_titanium_nitride.ipynb | 2 +- .../specific_examples/defect_surface_step_platinum.ipynb | 2 +- ...licon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb | 2 +- .../interface_2d_2d_boron_nitride_graphene.ipynb | 2 +- .../interface_2d_3d_graphene_silicon_dioxide.ipynb | 2 +- .../specific_examples/interface_3d_3d_copper_cristobalite.ipynb | 2 +- ...yer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb | 2 +- .../interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb | 2 +- .../materials_designer/specific_examples/nanocluster_gold.ipynb | 2 +- ...ptimization_interface_film_xy_position_graphene_nickel.ipynb | 2 +- .../specific_examples/passivation_edge_nanowire_silicon.ipynb | 2 +- .../specific_examples/passivation_surface_silicon.ipynb | 2 +- .../specific_examples/perturbation_ripple_graphene.ipynb | 2 +- .../specific_examples/slab_strontium_titanate.ipynb | 2 +- other/materials_designer/under_the_hood.ipynb | 2 +- other/materialsproject/api_interoperability_showcase.ipynb | 2 +- 59 files changed, 59 insertions(+), 59 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index 6d3d4edb..081d79c6 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -101,7 +101,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils', deps=False)\n", "\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index 34c4af7d..c28cf5f8 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 73a4dad7..5bd29326 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index 208aaa20..b012379d 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -75,7 +75,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_box.ipynb b/other/materials_designer/create_cutout_box.ipynb index 7bef05bf..408c27b8 100644 --- a/other/materials_designer/create_cutout_box.ipynb +++ b/other/materials_designer/create_cutout_box.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index f6be579c..835339d9 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 09b8ee2f..820dabf2 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_film.ipynb b/other/materials_designer/create_grain_boundary_film.ipynb index 9cebd419..801c27d5 100644 --- a/other/materials_designer/create_grain_boundary_film.ipynb +++ b/other/materials_designer/create_grain_boundary_film.ipynb @@ -109,7 +109,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index 6bd071ba..61882fba 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -120,7 +120,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n" 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 2d57f9b0..d6ddca31 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -106,7 +106,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 eb92ec9a..5f2cc384 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -92,7 +92,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb index 26a23fc3..357c4dde 100644 --- a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb @@ -68,7 +68,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index a6953a54..e76d4d4f 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -122,7 +122,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_island_defect_custom.ipynb b/other/materials_designer/create_island_defect_custom.ipynb index 8b18dd1a..23eef0ec 100644 --- a/other/materials_designer/create_island_defect_custom.ipynb +++ b/other/materials_designer/create_island_defect_custom.ipynb @@ -53,7 +53,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_monolayer.ipynb b/other/materials_designer/create_monolayer.ipynb index 7c8f454c..186d996e 100644 --- a/other/materials_designer/create_monolayer.ipynb +++ b/other/materials_designer/create_monolayer.ipynb @@ -72,7 +72,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index d87e4e74..281cf163 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -83,7 +83,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire.ipynb b/other/materials_designer/create_nanowire.ipynb index 8b4e8773..cffe0007 100644 --- a/other/materials_designer/create_nanowire.ipynb +++ b/other/materials_designer/create_nanowire.ipynb @@ -71,7 +71,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire_custom_shape.ipynb b/other/materials_designer/create_nanowire_custom_shape.ipynb index 94ab5266..23200288 100644 --- a/other/materials_designer/create_nanowire_custom_shape.ipynb +++ b/other/materials_designer/create_nanowire_custom_shape.ipynb @@ -54,7 +54,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_perturbation.ipynb b/other/materials_designer/create_perturbation.ipynb index ae33413d..e8f00862 100644 --- a/other/materials_designer/create_perturbation.ipynb +++ b/other/materials_designer/create_perturbation.ipynb @@ -79,7 +79,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_perturbation_custom.ipynb b/other/materials_designer/create_perturbation_custom.ipynb index e602456e..9a1533e4 100644 --- a/other/materials_designer/create_perturbation_custom.ipynb +++ b/other/materials_designer/create_perturbation_custom.ipynb @@ -60,7 +60,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index 1f2c492f..6ec9c852 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -91,7 +91,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index 7c8e66f5..161dfdee 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -85,7 +85,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index 220ce565..0d786a92 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_supercell.ipynb b/other/materials_designer/create_supercell.ipynb index 9459d0a4..9446b2d2 100644 --- a/other/materials_designer/create_supercell.ipynb +++ b/other/materials_designer/create_supercell.ipynb @@ -74,7 +74,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index 8c547ffb..a18e973e 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -94,7 +94,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb index 5d864e01..ccde4fe6 100644 --- a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb +++ b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb index 08302de0..8f7292c1 100644 --- a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb +++ b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb @@ -96,7 +96,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/custom_transformation.ipynb b/other/materials_designer/custom_transformation.ipynb index 03d85f57..fd09417a 100644 --- a/other/materials_designer/custom_transformation.ipynb +++ b/other/materials_designer/custom_transformation.ipynb @@ -26,7 +26,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb index 4f81e672..90755f79 100644 --- a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +++ b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb @@ -67,7 +67,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_materials_from_files.ipynb b/other/materials_designer/import_materials_from_files.ipynb index 1713e21a..53a20c37 100644 --- a/other/materials_designer/import_materials_from_files.ipynb +++ b/other/materials_designer/import_materials_from_files.ipynb @@ -74,7 +74,7 @@ "import sys\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"import_materials_from_files.ipynb\")" diff --git a/other/materials_designer/import_materials_from_standata.ipynb b/other/materials_designer/import_materials_from_standata.ipynb index dff95ef1..05cdbcf8 100644 --- a/other/materials_designer/import_materials_from_standata.ipynb +++ b/other/materials_designer/import_materials_from_standata.ipynb @@ -37,7 +37,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " await micropip.install('mat3ra-standata', deps=False)\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", diff --git a/other/materials_designer/optimize_film_position.ipynb b/other/materials_designer/optimize_film_position.ipynb index fe1d2ea9..6dfcbd61 100644 --- a/other/materials_designer/optimize_film_position.ipynb +++ b/other/materials_designer/optimize_film_position.ipynb @@ -37,7 +37,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_edge.ipynb b/other/materials_designer/passivate_edge.ipynb index 87a7260e..8dbd2e23 100644 --- a/other/materials_designer/passivate_edge.ipynb +++ b/other/materials_designer/passivate_edge.ipynb @@ -100,7 +100,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index de241df4..8e4ac958 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -105,7 +105,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb index eefae48a..1a2918b7 100644 --- a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb +++ b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb index b9c56ea7..e8bd10ba 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb @@ -87,7 +87,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index 197d613c..d2c6f71d 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -89,7 +89,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index cb3b3340..b7b3338f 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -98,7 +98,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index 34342a0c..6a86aa8e 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -88,7 +88,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index c7f0687a..a4b67dec 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -73,7 +73,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index cb2f71e3..180b1303 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -111,7 +111,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index 63df8798..201b2a94 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -86,7 +86,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index 39a78581..68a40908 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -99,7 +99,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index 89b35d4b..e5d1cb53 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -86,7 +86,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb index 289368ea..5ca9c39f 100644 --- a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb @@ -81,7 +81,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 85cac98c..4e66e2af 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 @@ -110,7 +110,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index fca9471d..89155a77 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -90,7 +90,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index cbf618f6..1a231181 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -93,7 +93,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index df6fa5a5..058ee802 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -93,7 +93,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 7bcbf5ce..54267d1f 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -92,7 +92,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index 788126e6..0e4b59fd 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -92,7 +92,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index 98241fdb..cbde960b 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -61,7 +61,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index 2b0dcffa..f814aa84 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -42,7 +42,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 32d51c99..b52901a1 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -80,7 +80,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index ad9b6efe..888854f8 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -84,7 +84,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb index 4ed28a2f..a3f09c24 100644 --- a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb +++ b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb @@ -59,7 +59,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index a05f16e2..a9b2245a 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -77,7 +77,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/under_the_hood.ipynb b/other/materials_designer/under_the_hood.ipynb index bcf3df0f..2bc17e91 100644 --- a/other/materials_designer/under_the_hood.ipynb +++ b/other/materials_designer/under_the_hood.ipynb @@ -27,7 +27,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n", diff --git a/other/materialsproject/api_interoperability_showcase.ipynb b/other/materialsproject/api_interoperability_showcase.ipynb index f7bbec8d..bb84af2d 100644 --- a/other/materialsproject/api_interoperability_showcase.ipynb +++ b/other/materialsproject/api_interoperability_showcase.ipynb @@ -95,7 +95,7 @@ " )\n", " \n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g2d074bd-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install(\"exabyte-api-client\")\n", " from utils.jupyterlite import install_packages\n", " await install_packages(\"api_interoperability_showcase.ipynb\",\"../../config.yml\")" From d5cbaec16f652f3d148dd1add764acaf46b9927a Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 10:30:00 -0700 Subject: [PATCH 11/26] update: fix cluster nbs --- .../create_adatom_defect.ipynb | 12 ++--- .../create_cluster_custom_shape.ipynb | 50 ++++++++++--------- .../create_cluster_specific_shape.ipynb | 38 +++++++------- .../create_cluster_sphere.ipynb | 48 +++++++++--------- 4 files changed, 74 insertions(+), 74 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index 081d79c6..fa4b44af 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -93,8 +93,6 @@ { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "import sys\n", "\n", @@ -108,7 +106,9 @@ "\n", " await install_packages(\"\")" ], - "id": "9eeac88f287b5c19" + "id": "9eeac88f287b5c19", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -258,16 +258,14 @@ ] }, { + "metadata": {}, "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials([slab_with_adatom])" ], + "id": "1335b6828e00116d", "outputs": [], "execution_count": null } diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index c28cf5f8..ac2c4422 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -48,12 +48,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d9e6be14343d00a1", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -65,7 +63,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -79,19 +79,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "RADIUS = 0.3 # in crystal units\n", + "RADIUS = 5.3 # in crystal units\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster\n", - "USE_CARTESIAN_COORDINATES = False\n", + "USE_CARTESIAN_COORDINATES = True\n", "NAME = \"Icosahedron\" # Name of the cluster" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -105,12 +105,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8e382d5ab459e2d", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import numpy as np\n", "from scipy.spatial import ConvexHull\n", @@ -141,7 +139,9 @@ "\n", " \n", "condition = CustomCoordinateCondition(radius=RADIUS)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -155,17 +155,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -180,17 +180,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8fbe260fa14db47a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ + "from mat3ra.made.tools.modify import wrap_to_unit_cell\n", "from mat3ra.made.tools.helpers import create_nanoparticle_from_material\n", "material = materials[0]\n", - "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" - ] + "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)\n", + "cluster = wrap_to_unit_cell(cluster)" + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -204,17 +206,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize([{\"material\": cluster, \"title\": f\"Cluster\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\", \"rotation\": \"-90x\"}])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -228,18 +230,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {NAME}\"\n", "set_materials(cluster)" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 5bd29326..54f459d0 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -48,12 +48,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d9e6be14343d00a1", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -65,7 +63,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -80,21 +80,21 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "from mat3ra.made.tools.build.nanoparticle.enums import NanoparticleShapesEnum\n", + "from mat3ra.made.tools.build.pristine_structures.zero_dimensional.nanoparticle import NanoparticleShapesEnum\n", "\n", "shape = NanoparticleShapesEnum.OCTAHEDRON\n", "parameters = {\n", " \"length\": 5,\n", " \"cutoff\": 2\n", "}" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -108,17 +108,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -133,12 +133,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_nanoparticle_by_shape\n", "\n", @@ -147,7 +145,9 @@ " shape=shape,\n", " parameters=parameters\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -161,17 +161,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}],viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -185,18 +185,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {shape.name.capitalize()} cluster\"\n", "set_materials(cluster)" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index b012379d..1aa3285d 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -38,17 +38,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "RADIUS = 4.5 # in Angstroms\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -63,12 +63,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ef664b14457530fd", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -80,7 +78,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -94,17 +94,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -118,12 +118,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7fcb1e02e84c5f35", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", @@ -154,7 +152,9 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -169,19 +169,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_sphere, add_vacuum, add_vacuum_sides\n", "\n", "cluster = filter_by_sphere(material=slab, center_coordinate=[0.5, 0.5, 0.5], radius=RADIUS)\n", "cluster = add_vacuum(cluster, VACUUM, to_bottom=True, on_top=True)\n", "cluster = add_vacuum_sides(cluster, VACUUM, on_x=True, on_y=True)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -195,12 +195,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "4f78c4743b370c3b", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.lattice import Lattice\n", "\n", @@ -209,7 +207,9 @@ "cubic_vector_2 = [0, current_vector_2[1], 0]\n", "cubic_vector_3 = [0, 0, current_vector_3[2]]\n", "cluster.lattice = Lattice.from_vectors_array([cubic_vector_1, cubic_vector_2, cubic_vector_3], type=\"CUB\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -223,19 +223,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}])\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -249,18 +249,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} Cluster R={RADIUS}A\"\n", "set_materials(cluster)" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { From 523289aa5fa10dd675b427c673d42e426f9ef86d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 10:33:20 -0700 Subject: [PATCH 12/26] update: fix other nbs --- .../create_island_defect.ipynb | 50 +++++++++---------- .../create_nanoribbon.ipynb | 46 ++++++++--------- .../create_point_defect.ipynb | 6 +-- .../create_terrace_defect.ipynb | 2 +- other/materials_designer/passivate_slab.ipynb | 2 +- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index e76d4d4f..86ea3f18 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -38,12 +38,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "\n", "# Shape-specific parameters\n", @@ -96,7 +94,9 @@ "# 'max_z': 1\n", "# }\n", "\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -111,12 +111,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ef664b14457530fd", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -126,7 +124,9 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -140,16 +140,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -163,12 +163,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7fcb1e02e84c5f35", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", @@ -189,7 +187,9 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -204,20 +204,20 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e2d24109d3068c9e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import CylinderCoordinateCondition\n", + "from mat3ra.made.tools.entities.coordinate import CylinderCoordinateCondition\n", "\n", "condition = CylinderCoordinateCondition(\n", " center_position=CENTER_POSITION,\n", " radius=SHAPE_PARAMETERS['radius'],\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -231,12 +231,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_island\n", "\n", @@ -246,7 +244,9 @@ " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", ")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -260,12 +260,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}] ,\n", @@ -273,7 +271,9 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -287,17 +287,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(slab_with_island)" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index 281cf163..d1f26944 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -41,12 +41,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a40d7b697c413113", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", @@ -57,7 +55,9 @@ "VACUUM_WIDTH = 10.0 # in Angstroms\n", "VACUUM_LENGTH = 10.0 # in Angstroms\n", "EDGE_TYPE = \"zigzag\" # \"zigzag\" or \"armchair\"" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -72,12 +72,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "c6d9f8e57bef2f91", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -87,7 +85,9 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -102,16 +102,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e0c53233ce728cc1", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "materials = get_materials(globals())" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -125,18 +125,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "897ba7aa4e402d24", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "material = materials[MATERIAL_INDEX]\n", "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -150,14 +150,12 @@ }, { "cell_type": "code", - "execution_count": null, "id": "1991efeeebe39db4", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import EdgeTypes\n", + "from mat3ra.made.tools.helpers import EdgeTypesEnum\n", "from mat3ra.made.tools.helpers import create_nanoribbon\n", "\n", "\n", @@ -168,9 +166,11 @@ " vacuum_width=VACUUM_WIDTH,\n", " vacuum_length=VACUUM_LENGTH,\n", " use_rectangular_lattice=True,\n", - " edge_type=EdgeTypes.zigzag if EDGE_TYPE == \"zigzag\" else EdgeTypes.armchair\n", + " edge_type=EdgeTypesEnum.zigzag if EDGE_TYPE == \"zigzag\" else EdgeTypesEnum.armchair\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -184,16 +184,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "1ee393a7f2ec3bc8", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize([{\"material\": nanoribbon, \"title\": \"Nanoribbon\"}])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -207,16 +207,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "29dfa0a329cca2fa", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "set_materials(nanoribbon)" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index 6ec9c852..f21b562b 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -83,8 +83,6 @@ { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "import sys\n", "\n", @@ -97,7 +95,9 @@ "\n", " await install_packages(\"\")" ], - "id": "cff4001d6747796e" + "id": "cff4001d6747796e", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index a18e973e..a17fe0d2 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -139,8 +139,8 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration\n", "from mat3ra.made.tools.helpers import create_slab_if_not\n", - "from mat3ra.made.tools.build.slab.helpers import SlabConfiguration\n", "\n", "default_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=material,\n", diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index 8e4ac958..3310136f 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -156,8 +156,8 @@ }, "outputs": [], "source": [ + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration\n", "from mat3ra.made.tools.helpers import create_slab_if_not\n", - "from mat3ra.made.tools.build.slab import SlabConfiguration\n", "from mat3ra.made.tools.modify import translate_to_z_level\n", "\n", "material = materials[MATERIAL_INDEX]\n", From 1cdb0711e77aa6b97c6518ec68fd837b7d725ab7 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 11:17:47 -0700 Subject: [PATCH 13/26] update: fix other nbs 2 --- .../create_grain_boundary_crystal.ipynb | 4 +- ..._grain_boundary_3d_fcc_metals_copper.ipynb | 68 ++++++++-------- ...island_molybdenum_disulfide_platinum.ipynb | 63 +++++++-------- .../defect_point_interstitial_tin_oxide.ipynb | 73 +++++++++++------ .../defect_point_pair_gallium_nitride.ipynb | 78 ++++++++----------- ...fect_surface_island_titanium_nitride.ipynb | 2 +- 6 files changed, 154 insertions(+), 134 deletions(-) diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 820dabf2..2462ddac 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -220,10 +220,10 @@ "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "\n", - "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination=termination) for termination in\n", + "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination_top=termination) for termination in\n", " phase_1_terminations]\n", "\n", - "phase_2_slabs = [create_slab(material, miller_indices=PHASE_2_MILLER_INDICES, termination=termination) for termination in\n", + "phase_2_slabs = [create_slab(material, miller_indices=PHASE_2_MILLER_INDICES, termination_top=termination) for termination in\n", " phase_2_terminations]\n", "\n", "phase_1_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index d2c6f71d..7229e93a 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -39,12 +39,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "45730b0f5384262b", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "MATERIAL_NAME = \"Cu\"\n", "\n", @@ -62,7 +60,9 @@ "\n", "# Maximum area for the superlattice search algorithm\n", "MAX_AREA = 200 # in Angstrom^2\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -77,12 +77,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "bae18ae87d3cc5ba", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -94,7 +92,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_grain_boundary.ipynb\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -108,18 +108,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "950e5bef61bbd84a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "\n", "material = MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -133,17 +133,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "4ebde830102b0b94", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([material], repetitions=[3, 3, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -170,12 +170,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "5bdc0e37e3ec9891", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", @@ -188,7 +186,9 @@ "print(f\"Phase 2 Terminations:\")\n", "for idx, termination in enumerate(phase_2_terminations):\n", " print(f\" {idx}: {termination}\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -202,25 +202,25 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f75092312b399f84", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "\n", - "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination=termination) for termination\n", + "phase_1_slabs = [create_slab(material, miller_indices=PHASE_1_MILLER_INDICES, termination_top=termination) for termination\n", " in phase_1_terminations]\n", - "phase_2_slabs = [create_slab(material, miller_indices=PHASE_2_MILLER_INDICES, termination=termination) for termination\n", + "phase_2_slabs = [create_slab(material, miller_indices=PHASE_2_MILLER_INDICES, termination_top=termination) for termination\n", " in phase_2_terminations]\n", "\n", "visualize([{\"material\": slab, \"title\": slab.name} for slab in phase_1_slabs],\n", " repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize([{\"material\": slab, \"title\": slab.name} for slab in phase_2_slabs],\n", " repetitions=[3, 3, 1], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -232,15 +232,13 @@ }, { "cell_type": "code", - "execution_count": null, "id": "29dd6499", "metadata": {}, - "outputs": [], "source": [ "# Create phase 1 slab\n", "phase_1_slab = create_slab(\n", " crystal=material,\n", - " termination=None, # Use default termination\n", + " termination_top=None, # Use default termination\n", " miller_indices=PHASE_1_MILLER_INDICES,\n", " number_of_layers=PHASE_1_THICKNESS,\n", " vacuum=0.0,\n", @@ -250,7 +248,7 @@ "# Create phase 2 slab \n", "phase_2_slab = create_slab(\n", " crystal=material,\n", - " termination=None, # Use default termination\n", + " termination_top=None, # Use default termination\n", " miller_indices=PHASE_2_MILLER_INDICES,\n", " number_of_layers=PHASE_2_THICKNESS,\n", " vacuum=0.0,\n", @@ -260,7 +258,9 @@ "# Visualize the phase slabs\n", "visualize([{\"material\": phase_1_slab, \"title\": \"Phase 1 Slab\"}, {\"material\": phase_2_slab, \"title\": \"Phase 2 Slab\"}],\n", " repetitions=[2, 2, 1], rotation=\"-90x\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -274,12 +274,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "40b6c8662d071f18", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_grain_boundary_planar\n", "\n", @@ -296,7 +294,9 @@ " max_length_tol = 0.05,\n", " max_angle_tol = 0.02,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -310,15 +310,15 @@ }, { "cell_type": "code", - "execution_count": null, "id": "892c0e7c932cd725", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "visualize([grain_boundary], repetitions=[1, 1, 1], viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -332,19 +332,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "503eff0dd5c1a160", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(grain_boundary)\n", "download_content_to_file(grain_boundary.to_json(),\n", " f\"{MATERIAL_NAME}-{PHASE_1_MILLER_INDICES}-{PHASE_2_MILLER_INDICES}_grain_boundary.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index b7b3338f..79e844d7 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -36,13 +36,12 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ + "\n", "# Slab parameters\n", "MATERIAL_NAME = \"MoS2.*2D\" # Name of the material (regex) to be loaded from Standata\n", "MILLER_INDICES = (0, 0, 1) # Miller indices of the surface\n", @@ -71,7 +70,9 @@ " [5 / 9, 7 / 9, 0], # 3rd atom, next clockwise atop Mo\n", " [4 / 9, 5 / 9, 0], # 4th topmost atom, atop S\n", "]\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -86,24 +87,25 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ef664b14457530fd", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\n", + " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -118,12 +120,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.standata.materials import Materials\n", @@ -134,7 +134,9 @@ "# Preview materials\n", "visualize_materials([substrate])\n", "visualize_materials([substrate], rotation=\"-90x\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -148,18 +150,15 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f174b6be", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", "\n", - "\n", "slab = create_slab(\n", " crystal=substrate,\n", - " termination=None, # Use default termination\n", + " termination_top=None, # Use default termination\n", " miller_indices=MILLER_INDICES,\n", " number_of_layers=SLAB_THICKNESS,\n", " vacuum=VACUUM,\n", @@ -167,7 +166,9 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -189,23 +190,23 @@ }, { "cell_type": "code", - "execution_count": null, "id": "15bb5f2376e31ea7", "metadata": {}, - "outputs": [], "source": [ - "\n", + "from mat3ra.made.tools.build.defective_structures.two_dimensional.adatom.types import AdatomDefectDict\n", "DEFECT_DICTS = [\n", - " {\n", - " \"coordinate\": coordinate[0:2],\n", + " AdatomDefectDict(**{\n", + " \"coordinate_2d\": coordinate[0:2],\n", " \"distance_z\": DISTANCE_Z_VALUES[i],\n", " \"element\": CHEMICAL_ELEMENT,\n", " \"use_cartesian_coordinates\": USE_CARTESIAN_COORDINATES\n", " # placement method is common for all adatoms\n", - " }\n", + " })\n", " for i, coordinate in enumerate(COORDINATES)\n", "]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -217,12 +218,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e385e50ae11ed2b9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", @@ -231,7 +230,9 @@ " defect_dicts=DEFECT_DICTS,\n", " placement_method=PLACEMENT_METHOD,\n", ")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -245,19 +246,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n", " viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -271,18 +272,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials([slab_with_adatom])\n", "download_content_to_file(slab_with_adatom.to_json(), \"MoS2_Pt_island.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index 6a86aa8e..090bd035 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -37,12 +37,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9d8b1890b34d850a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "MATERIAL_NAME = \"SnO\"\n", "SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 2]]\n", @@ -61,7 +59,9 @@ " \"placement_method\": \"voronoi_site\"\n", " }\n", "]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -76,12 +76,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ef664b14457530fd", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -93,7 +91,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -107,18 +107,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "be38fdda1984c654", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -132,19 +132,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e2d24109d3068c9e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -156,22 +156,51 @@ "## 2. Create the Defects" ] }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.1. Prepare defect dictionaries and validate them", + "id": "234014d6805389dc" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", + "\n", + "defect_dicts = [PointDefectDict(**{\n", + " \"type\": defect_config[\"type\"],\n", + " \"coordinate\": defect_config[\"coordinate\"],\n", + " \"element\": defect_config.get(\"element\", None),\n", + " \"placement_method\": defect_config[\"placement_method\"]\n", + "}) for defect_config in DEFECT_CONFIGS]" + ], + "id": "ec41ec63522add17", + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.2. Create the defects", + "id": "1fa23225ececfb54" + }, { "cell_type": "code", - "execution_count": null, "id": "a990fa35742d7269", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defect = create_multiple_defects(\n", " supercell,\n", - " defect_dicts=DEFECT_CONFIGS,\n", + " defect_dicts=defect_dicts,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -185,19 +214,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "509b18661a069e42", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -211,19 +240,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "61daa5afcbc078a9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "material_with_defect.name = \"Sn15 O17, Interstitial O Defect\"\n", "set_materials([material_with_defect])\n", "download_content_to_file(material_with_defect.to_json(), f\"{material_with_defect.name}.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index a4b67dec..39e4952a 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -28,10 +28,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f941f8a0bb45817f", "metadata": {}, - "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -50,7 +48,9 @@ " coordinate=[0.5, 0.5, 0.65],\n", " placement_method=\"closest_site\",\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -63,10 +63,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "e02d623e22f90fc7", "metadata": {}, - "outputs": [], "source": [ "import sys\n", "\n", @@ -78,7 +76,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -93,12 +93,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "4a6bab14f63024d1", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", @@ -106,17 +104,9 @@ "\n", "material = Material.create(Materials.get_by_name_first_match(\"GaN\"))\n", "visualize(material)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c574c219", - "metadata": {}, + ], "outputs": [], - "source": [ - "unit_cell = material\n" - ] + "execution_count": null }, { "cell_type": "markdown", @@ -130,29 +120,36 @@ }, { "cell_type": "code", - "execution_count": null, "id": "4580fda63efa927e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", "\n", - "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", + "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"-90x\")" + ], + "outputs": [], + "execution_count": null + }, + { + "cell_type": "markdown", + "id": "4391a0f444f4b64a", + "metadata": { + "collapsed": false + }, + "source": [ + "## 2. Create the Defect" ] }, { - "cell_type": "code", - "execution_count": null, - "id": "85013c49", "metadata": {}, - "outputs": [], + "cell_type": "code", "source": [ - "from mat3ra.made.tools.build.defect.pair_defect.helpers import create_pair_defect\n", + "from mat3ra.made.tools.helpers import create_defect_pair\n", "\n", - "material_with_defect = create_pair_defect(\n", + "material_with_defect = create_defect_pair(\n", " material=supercell,\n", " defect_type_1=PRIMARY_DEFECT_CONFIG.defect_type,\n", " coordinate_1=PRIMARY_DEFECT_CONFIG.coordinate,\n", @@ -163,17 +160,10 @@ " element_2=SECONDARY_DEFECT_CONFIG.element if hasattr(SECONDARY_DEFECT_CONFIG, \"element\") else None,\n", " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG, 'placement_method') else None,\n", ")\n" - ] - }, - { - "cell_type": "markdown", - "id": "4391a0f444f4b64a", - "metadata": { - "collapsed": false - }, - "source": [ - "## 2. Create the Defect" - ] + ], + "id": "85013c49", + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -187,19 +177,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "951f0cffe9389d5e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -213,18 +203,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "b9e1aba13faf1bf0", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"Mg substitution and vacancy in GaN.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index e5d1cb53..01a57a2b 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -141,7 +141,7 @@ "\n", "slab = create_slab(\n", " crystal=material,\n", - " termination=None, # Use default termination\n", + " termination_top=None, # Use default termination\n", " miller_indices=SLAB_PARAMETERS[\"miller_indices\"],\n", " number_of_layers=SLAB_PARAMETERS[\"thickness\"],\n", " vacuum=SLAB_PARAMETERS[\"vacuum\"],\n", From 097488cf824a4f49aeba81093f5ba07dd29ea3e9 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 11:52:09 -0700 Subject: [PATCH 14/26] update: fix other nbs 3 --- .../defect_point_substitution_graphene.ipynb | 68 ++++++---- .../defect_point_vacancy_boron_nitride.ipynb | 46 +++---- .../defect_surface_adatom_graphene.ipynb | 46 +++---- ...fect_surface_island_titanium_nitride.ipynb | 6 +- ...terface_2d_2d_boron_nitride_graphene.ipynb | 17 +-- ...rface_2d_3d_graphene_silicon_dioxide.ipynb | 8 +- .../interface_3d_3d_copper_cristobalite.ipynb | 7 +- ...surate_lattices_molybdenum_disulfide.ipynb | 42 +++--- ...er_twisted_nanoribbons_boron_nitride.ipynb | 124 ++++++++++++++---- .../specific_examples/nanocluster_gold.ipynb | 14 +- ...ace_film_xy_position_graphene_nickel.ipynb | 9 +- .../passivation_edge_nanowire_silicon.ipynb | 3 +- .../passivation_surface_silicon.ipynb | 54 ++++---- 13 files changed, 263 insertions(+), 181 deletions(-) diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index 180b1303..d9504bef 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -41,12 +41,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "dff59577346dbece", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "# Element to be placed at the site (ignored for vacancy)\n", "CHEMICAL_ELEMENT = \"N\"\n", @@ -84,7 +82,9 @@ " },\n", "\n", "]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -99,12 +99,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8c6ea8b36f1a6cc", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -116,7 +114,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -131,17 +131,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "14c40630ba2974e6", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import load_material_from_folder\n", "\n", "material = load_material_from_folder(\"../uploads\", \"Graphene\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -155,19 +155,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "6d5a793dd5e45f16", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -179,22 +179,46 @@ "## 2. Create the Defects" ] }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.1. Prepare defect dictionaries and validate them", + "id": "a4be42a5a13702d4" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", + "\n", + "defect_dicts = [PointDefectDict(**defect_config) for defect_config in DEFECT_CONFIGS]" + ], + "id": "67421c7bf7351e0f", + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "### 2.2. Create the defects", + "id": "8970791792365148" + }, { "cell_type": "code", - "execution_count": null, "id": "db2d621e2fd4bbeb", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", "material_with_defect = create_multiple_defects(\n", " supercell,\n", - " defect_dicts=DEFECT_CONFIGS,\n", + " defect_dicts=defect_dicts,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -208,19 +232,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d4a1e920884b1a48", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -234,19 +258,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7dcf867f46422fa9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"N-doped Graphene\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"N-doped_Graphene.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index 201b2a94..ebc3fb7a 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -43,12 +43,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "dff59577346dbece", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "# Matrix to get the supercell of primitive hBN exactly as shown in the manuscript\n", "SUPERCELL_MATRIX = [[-6, -6, 0], [-2, 2, 0], [0, 0, 1]]\n", @@ -59,7 +57,9 @@ " \"placement_method\": \"closest_site\",\n", " \"use_cartesian_coordinates\": False\n", " }\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -74,12 +74,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8c6ea8b36f1a6cc", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -91,7 +89,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -106,18 +106,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "14c40630ba2974e6", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_and_categories(\"Boron_Nitride\", \"2D\"))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -131,12 +131,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "6d5a793dd5e45f16", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", @@ -147,7 +145,9 @@ ")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -161,22 +161,22 @@ }, { "cell_type": "code", - "execution_count": null, "id": "db2d621e2fd4bbeb", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.point.helpers import create_point_defect_vacancy\n", + "from mat3ra.made.tools.helpers import create_vacancy\n", "\n", - "material_with_defect = create_point_defect_vacancy(\n", + "material_with_defect = create_vacancy(\n", " material = nanoribbon,\n", " coordinate=DEFECT_CONFIG[\"coordinate\"],\n", " placement_method=DEFECT_CONFIG[\"placement_method\"],\n", " use_cartesian_coordinates=DEFECT_CONFIG[\"use_cartesian_coordinates\"]\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -190,19 +190,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d4a1e920884b1a48", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": nanoribbon, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": \"Material with defect\"}],\n", " viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -216,19 +216,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7dcf867f46422fa9", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"B-vacancy h-BN\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"B-vacancy_hexagonal_boron_nitride.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index 68a40908..45060c5e 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -39,12 +39,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "b5459bac655071be", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "# Name of material to find in Standata\n", "MATERIAL_NAME = \"Graphene\"\n", @@ -72,7 +70,9 @@ " {\"chemical_element\": \"Pd\", \"distance_z\": 2.21, \"position_on_surface\": BRIDGE_SITE_COORDINATE},\n", " # {\"chemical_element\": \"Au\", \"distance_z\": 2.69, \"position_on_surface\": TOP_SITE_COORDINATE},\n", "]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -87,12 +87,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "58b0da5bbc87efc6", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -104,7 +102,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -118,18 +118,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7ebdb82cd32c735c", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -143,12 +143,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "926503f431d18cad", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", @@ -158,7 +156,9 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", " )\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -172,23 +172,23 @@ }, { "cell_type": "code", - "execution_count": null, "id": "6fc8ad13e12845f", "metadata": { "collapsed": false }, - "outputs": [], "source": [ - "from mat3ra.made.tools.build.defect.adatom.helpers import create_adatom_defect\n", + "from mat3ra.made.tools.helpers import create_adatom\n", "\n", - "materials_with_adatom = [create_adatom_defect(\n", + "materials_with_adatom = [create_adatom(\n", " slab=supercell,\n", " placement_method=PLACEMENT_METHOD,\n", " element=adatom_parameters[\"chemical_element\"],\n", " distance_z=adatom_parameters[\"distance_z\"],\n", " position_on_surface=adatom_parameters[\"position_on_surface\"],\n", ") for adatom_parameters in ADATOM_PARAMETERS]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -202,19 +202,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "93a18e3e1d6e3e6e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "for material_with_defect in materials_with_adatom:\n", " title = f\"{material_with_defect.name} adatom\"\n", " visualize([{\"material\": material_with_defect, \"title\": title}], viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -228,12 +228,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "20ab1b4be207428c", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -241,7 +239,9 @@ "for material_with_defect in materials_with_adatom:\n", " download_content_to_file(material_with_defect.to_json(),\n", " f\"{material_with_defect.name}.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index 01a57a2b..f0efd198 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -171,15 +171,15 @@ }, "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import BoxCoordinateCondition\n", - "from mat3ra.made.tools.build.defect.island.helpers import create_island_defect\n", + "from mat3ra.made.tools.entities.coordinate import BoxCoordinateCondition\n", + "from mat3ra.made.tools.helpers import create_island\n", "\n", "coordinate_condition = BoxCoordinateCondition(\n", " min_coordinate=SHAPE_PARAMETERS['min_coordinate'],\n", " max_coordinate=SHAPE_PARAMETERS['max_coordinate']\n", ")\n", "\n", - "slab_with_island = create_island_defect(\n", + "slab_with_island = create_island(\n", " slab=slab,\n", " condition=coordinate_condition,\n", " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index 89155a77..894c242e 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -181,7 +181,6 @@ "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", "\n", "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination_top=termination, vacuum=0) for termination\n", " in\n", @@ -213,6 +212,8 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.made.tools.helpers import select_slab_termination\n", + "\n", "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", "substrate_termination = select_slab_termination(substrate_slab_terminations, SUBSTRATE_TERMINATION_FORMULA)" ] @@ -236,15 +237,14 @@ }, "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", " number_of_layers=SUBSTRATE_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=SUBSTRATE_TERMINATION_FORMULA,\n", + " termination_top_formula=SUBSTRATE_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -253,7 +253,7 @@ " miller_indices=FILM_MILLER_INDICES,\n", " number_of_layers=FILM_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=FILM_TERMINATION_FORMULA,\n", + " termination_top_formula=FILM_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -460,13 +460,6 @@ "for idx, shifted_interface in enumerate(shifted_interfaces):\n", " download_content_to_file(shifted_interface.to_json(), f\"interface_{idx}.json\")" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index 1a231181..a74d6e2e 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -239,15 +239,15 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", + "\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", " number_of_layers=SUBSTRATE_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=SUBSTRATE_TERMINATION_FORMULA,\n", + " termination_top_formula=SUBSTRATE_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -256,7 +256,7 @@ " miller_indices=FILM_MILLER_INDICES,\n", " number_of_layers=FILM_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=FILM_TERMINATION_FORMULA,\n", + " termination_bottom_formula=FILM_TERMINATION_FORMULA, # film termination is on the bottom\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index 058ee802..c2e44438 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -240,15 +240,14 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", " number_of_layers=SUBSTRATE_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=SUBSTRATE_TERMINATION_FORMULA,\n", + " termination_top_formula=SUBSTRATE_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -257,7 +256,7 @@ " miller_indices=FILM_MILLER_INDICES,\n", " number_of_layers=FILM_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=FILM_TERMINATION_FORMULA,\n", + " termination_bottom_formula=FILM_TERMINATION_FORMULA, # film termination is on the bottom\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 54267d1f..4046d784 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -36,10 +36,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "81f392a7dbdd0acb", "metadata": {}, - "outputs": [], "source": [ "# Uncomment lines to reproduce specific cases from the article\n", "INTERFACE_PARAMETERS = [\n", @@ -65,7 +63,9 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [3, 3, 1]" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -80,12 +80,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9f851434739f468a", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -97,7 +95,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -112,10 +112,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a8d47cc0e54bca82", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -130,7 +128,9 @@ "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -143,10 +143,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "dcf5e2daa1d04a62", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", @@ -162,7 +160,9 @@ "slab = translate_to_z_level(slab, \"center\")\n", "\n", "visualize_materials(slab, rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -174,10 +174,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "ec61eca814b922f5", "metadata": {}, - "outputs": [], "source": [ "interfaces = []\n", "for parameters in INTERFACE_PARAMETERS:\n", @@ -193,7 +191,9 @@ " )\n", " interfaces.append(interface)\n", " print(f\"Created interface with twist angle {parameters['angle']}° and {len(interface.basis.elements.ids)} atoms\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -207,16 +207,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "65811e9ed95eb5db", "metadata": {}, - "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "for interface in interfaces:\n", " visualize_materials(interface, viewer=\"wave\")\n" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -228,10 +228,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d548c123372d9205", "metadata": {}, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -239,7 +237,9 @@ "\n", "for idx, interface in enumerate(interfaces):\n", " download_content_to_file(interface.to_json(), f\"twisted_interface_{idx}.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index 0e4b59fd..dd2f6e40 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -42,12 +42,14 @@ }, { "cell_type": "code", - "execution_count": null, "id": "47af0a587ce80b91", "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2025-08-08T18:33:23.640918Z", + "start_time": "2025-08-08T18:33:23.636417Z" + } }, - "outputs": [], "source": [ "# Material and structure parameters\n", "TWIST_ANGLE_A = 2.64 # Twist angle in degrees for A material\n", @@ -66,7 +68,9 @@ "# Visualization settings\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [1, 1, 1]" - ] + ], + "outputs": [], + "execution_count": 1 }, { "cell_type": "markdown", @@ -80,12 +84,14 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f67b53c0f60f257c", "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2025-08-08T18:33:23.799128Z", + "start_time": "2025-08-08T18:33:23.797045Z" + } }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -97,7 +103,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ] + ], + "outputs": [], + "execution_count": 2 }, { "cell_type": "markdown", @@ -112,12 +120,14 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f1c2ac4b7553961b", "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2025-08-08T18:33:26.321935Z", + "start_time": "2025-08-08T18:33:23.811737Z" + } }, - "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -132,7 +142,35 @@ "\n", "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial material properties:\n", + "Formula: None\n", + "Number of atoms: 2\n", + "Lattice vectors:\n", + "[[2.508995, 0.0, 1.5363163479133569e-16], [-1.2544979999999997, 2.1728542739935413, 1.5363169602367562e-16], [0.0, 0.0, 20.0]]\n" + ] + }, + { + "data": { + "text/plain": [ + "GridBox(children=(VBox(children=(Label(value='BN - Material - rotation: 0x,0y,0z', layout=Layout(align_self='c…" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "05052c20d08742c29b4f9a0e2f33f59c" + } + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 3 }, { "cell_type": "markdown", @@ -147,12 +185,14 @@ }, { "cell_type": "code", - "execution_count": null, "id": "80ac5dd96d8622b7", "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2025-08-08T18:33:32.457521Z", + "start_time": "2025-08-08T18:33:26.366172Z" + } }, - "outputs": [], "source": [ "\n", "from mat3ra.made.tools.helpers import create_nanoribbon\n", @@ -164,7 +204,26 @@ " vacuum_length=VACUUM_PADDING,\n", " vacuum_width=VACUUM_PADDING,\n", ")\n" - ] + ], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['wyckoffs']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['equivalent_atoms']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['rotations']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n" + ] + } + ], + "execution_count": 4 }, { "cell_type": "markdown", @@ -178,14 +237,19 @@ }, { "cell_type": "code", - "execution_count": null, "id": "2293065288b4308c", - "metadata": {}, - "outputs": [], + "metadata": { + "jupyter": { + "is_executing": true + }, + "ExecuteTime": { + "start_time": "2025-08-08T18:33:32.500618Z" + } + }, "source": [ - "from mat3ra.made.tools.build.interface.helpers import create_twisted_interface\n", + "from mat3ra.made.tools.helpers import create_interface_twisted\n", "\n", - "interface_a = create_twisted_interface(\n", + "interface_a = create_interface_twisted(\n", " material1=nanoribbon,\n", " material2=nanoribbon,\n", " angle=TWIST_ANGLE_A,\n", @@ -194,7 +258,7 @@ " vacuum_y=VACUUM_PADDING,\n", ")\n", "\n", - "interface_b = create_twisted_interface(\n", + "interface_b = create_interface_twisted(\n", " material1=nanoribbon,\n", " material2=nanoribbon,\n", " angle=TWIST_ANGLE_B,\n", @@ -202,7 +266,9 @@ " vacuum_x=VACUUM_PADDING,\n", " vacuum_y=VACUUM_PADDING,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -216,16 +282,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "c4049a69b2dcbaa1", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS)\n", "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -239,12 +305,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "a64a81bb1ab4d47d", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "interface_a.name += f\" ({TWIST_ANGLE_A} degrees)\"\n", @@ -252,7 +316,9 @@ "set_materials([interface_a, interface_b])\n", "download_content_to_file(interface_a.to_json(), \"twisted_bilayer_h-BN_A.json\")\n", "download_content_to_file(interface_b.to_json(), \"twisted_bilayer_h-BN_B.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index cbde960b..cdf94dcf 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -86,8 +86,8 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.made.tools.build.pristine_structures.zero_dimensional.nanoparticle import NanoparticleShapesEnum\n", "from types import SimpleNamespace\n", - "from mat3ra.made.tools.build.nanoparticle.enums import NanoparticleShapesEnum as Shapes\n", "\n", "ELEMENT = \"Au\" # Chemical symbol of the element to create nanoparticles from\n", "\n", @@ -99,40 +99,40 @@ "\n", "NANOPARTICLE_CONFIGS = [\n", " SimpleNamespace(\n", - " shape=Shapes.OCTAHEDRON,\n", + " shape=NanoparticleShapesEnum.OCTAHEDRON,\n", " parameters=SimpleNamespace(\n", " length=length(2),\n", " cutoff=2,\n", " )\n", " ),\n", " SimpleNamespace(\n", - " shape=Shapes.OCTAHEDRON,\n", + " shape=NanoparticleShapesEnum.OCTAHEDRON,\n", " parameters=SimpleNamespace(\n", " length=length(3),\n", " cutoff=3,\n", " )\n", " ),\n", " SimpleNamespace(\n", - " shape=Shapes.OCTAHEDRON,\n", + " shape=NanoparticleShapesEnum.OCTAHEDRON,\n", " parameters=SimpleNamespace(\n", " length=length(4),\n", " cutoff=4,\n", " )\n", " ),\n", " SimpleNamespace(\n", - " shape=Shapes.ICOSAHEDRON,\n", + " shape=NanoparticleShapesEnum.ICOSAHEDRON,\n", " parameters=SimpleNamespace(\n", " noshells=3,\n", " )\n", " ),\n", " SimpleNamespace(\n", - " shape=Shapes.ICOSAHEDRON,\n", + " shape=NanoparticleShapesEnum.ICOSAHEDRON,\n", " parameters=SimpleNamespace(\n", " noshells=4,\n", " )\n", " ),\n", " SimpleNamespace(\n", - " shape=Shapes.ICOSAHEDRON,\n", + " shape=NanoparticleShapesEnum.ICOSAHEDRON,\n", " parameters=SimpleNamespace(\n", " noshells=5,\n", " )\n", diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index f814aa84..d4aea282 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -157,15 +157,14 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", + "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", "substrate_slab_config = SlabConfiguration.from_parameters(\n", " material_or_dict=substrate,\n", " miller_indices=SUBSTRATE_MILLER_INDICES,\n", " number_of_layers=SUBSTRATE_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=SUBSTRATE_TERMINATION_FORMULA,\n", + " termination_top_formula=SUBSTRATE_TERMINATION_FORMULA,\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -174,7 +173,7 @@ " miller_indices=FILM_MILLER_INDICES,\n", " number_of_layers=FILM_THICKNESS,\n", " vacuum=0.0,\n", - " termination_formula=FILM_TERMINATION_FORMULA,\n", + " termination_bottom_formula=FILM_TERMINATION_FORMULA, # Termination for the bottom of the film slab\n", " use_conventional_cell=USE_CONVENTIONAL_CELL\n", ")\n", "\n", @@ -243,7 +242,7 @@ }, "outputs": [], "source": [ - "from mat3ra.made.tools.build.interface import get_optimal_film_displacement\n", + "from mat3ra.made.tools.helpers import get_optimal_film_displacement\n", "from mat3ra.made.tools.modify import interface_displace_part\n", "from mat3ra.made.tools.optimize import evaluate_calculator_on_xy_grid\n", "from mat3ra.made.tools.calculate.calculators import InterfaceMaterialCalculator\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index b52901a1..5398d5e5 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -134,7 +134,8 @@ }, "outputs": [], "source": [ - "from mat3ra.made.tools.modify import rotate, filter_by_box, add_vacuum_sides, translate_to_center\n", + "from mat3ra.made.tools.operations.core.unary import rotate\n", + "from mat3ra.made.tools.modify import filter_by_box, add_vacuum_sides, translate_to_center\n", "from mat3ra.made.tools.helpers import create_slab\n", "\n", "silicon_slab = create_slab(\n", diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index 888854f8..803179b3 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -37,10 +37,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "8d5e0a40537f4bdc", "metadata": {}, - "outputs": [], "source": [ "# Material selection\n", "MATERIAL_NAME = \"Silicon.*100.*reconstructed\" # Name (regex) of the material to import from Standata\n", @@ -57,7 +55,9 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -72,12 +72,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "d1eb85a3125e3839", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -89,7 +87,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -103,18 +103,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f71a66a67f9ae8e6", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "slab = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -129,12 +129,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "83efe492d92bf80c", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -142,7 +140,9 @@ " print(\"Initial slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -156,10 +156,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "36744eb087509500", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "# Find coordinates of the Si atoms, list in descending order, and change the second one from the top\n", @@ -178,7 +176,9 @@ "new_coordinates[index_to_adjust] = adjusted_coordinate\n", "slab.set_coordinates(new_coordinates)\n", "slab = translate_to_z_level(slab, \"center\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -190,16 +190,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "9f86e4cc49f97922", "metadata": {}, - "outputs": [], "source": [ "if SHOW_INTERMEDIATE_STEPS:\n", " print(\"Adjusted slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -213,10 +213,8 @@ }, { "cell_type": "code", - "execution_count": null, "id": "12ddeb6233df033d", "metadata": {}, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_surface\n", "\n", @@ -234,7 +232,9 @@ "print(f\"Bond length: {BOND_LENGTH} Å\")\n", "print(f\"Surfaces passivated: {SURFACE}\")\n", "print(f\"Number of atoms: {len(passivated_slab.basis.elements.ids)}\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -248,16 +248,16 @@ }, { "cell_type": "code", - "execution_count": null, "id": "4680f4f7906f6f2c", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", "visualize_materials(passivated_slab, viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -271,18 +271,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "b3c536f6ca85e403", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(passivated_slab)\n", "download_content_to_file(passivated_slab.to_json(), f\"{slab.name}_passivated.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { From 53cefd96865f65204c3e270becd7668a98ada41b Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 12:48:19 -0700 Subject: [PATCH 15/26] update: made --- config.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index e20c6c02..5e8f552e 100644 --- a/config.yml +++ b/config.yml @@ -31,7 +31,7 @@ default: - uncertainties==3.1.6 - jinja2 - pymatgen-analysis-defects<=2024.4.23 - - https://exabyte-io.github.io/made/mat3ra_made-0.1.dev1+g5326929-py3-none-any.whl # mat3ra-made==2025.8.1.post1 + - https://exabyte-io.github.io/made/mat3ra_made-0.1.dev1+gc4e8849-py3-none-any.whl # mat3ra-made==2025.8.1.post1 - mat3ra-code - mat3ra-esse notebooks: diff --git a/pyproject.toml b/pyproject.toml index 2b9b8a99..80460a59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "matplotlib>=3.4.1", "pandas>=1.5.3", "pymatgen==2024.4.13", - "mat3ra-made @ git+https://github.com/Exabyte-io/made.git@82bb88c824e51d667580f300a4f8e3ed94c9d640", + "mat3ra-made @ git+https://github.com/Exabyte-io/made.git@c4e8849fe38fb6fca4c3585038a48f9e1d0e0e74", "mat3ra-utils>=2024.6.11.post0", ] From f8bf0d40943f681cda09bd98cd5b3e11301fdde7 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 16:32:15 -0700 Subject: [PATCH 16/26] fix: improts --- .../create_adatom_defect.ipynb | 2 +- .../create_point_defect.ipynb | 2 +- .../passivation_edge_nanowire_silicon.ipynb | 60 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index fa4b44af..f928193c 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -190,7 +190,7 @@ "metadata": {}, "cell_type": "code", "source": [ - "from mat3ra.made.tools import AdatomDefectDict\n", + "from mat3ra.made.tools.helpers import AdatomDefectDict\n", "\n", "defect_dicts = [AdatomDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]" ], diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index f21b562b..32f3a1af 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -165,7 +165,7 @@ "metadata": {}, "cell_type": "code", "source": [ - "from mat3ra.made.tools import PointDefectDict\n", + "from mat3ra.made.tools.helpers import PointDefectDict\n", "defect_dicts = [PointDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]\n", "\n", "print(\"Defect configurations:\")\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 5398d5e5..73ccc0a7 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -38,12 +38,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f704e7abe8fbe895", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "# Enable interactive selection of coordination threshold\n", "IS_COORDINATION_SELECTION_INTERACTIVE = False\n", @@ -53,7 +51,9 @@ "COORDINATION_SEARCH_RADIUS = 2.5 # in Angstroms (sphere in which to search for neighbors)\n", "COORDINATION_THRESHOLD = 3 # Coordination number below which to passivate\n", "MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -68,12 +68,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "37904650f2478a1d", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "import sys\n", "\n", @@ -85,7 +83,9 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -101,18 +101,18 @@ }, { "cell_type": "code", - "execution_count": null, "id": "6d48372afc12056e", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "silicon = Material.create(Materials.get_by_name_first_match('Silicon'))" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -127,12 +127,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "f8431fd833f6ed", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.operations.core.unary import rotate\n", "from mat3ra.made.tools.modify import filter_by_box, add_vacuum_sides, translate_to_center\n", @@ -155,7 +153,9 @@ "# visualize_materials([{\"material\": rotated_slab},{\"material\": silicon_nanowire}, {\"material\": silicon_nanowire, \"rotation\": \"-90x\"}])\n", "nanowire_xy_pbc = rotate(silicon_nanowire, \"z\", 90+angle)\n", "nanowire_xy_pbc = add_vacuum_sides(nanowire_xy_pbc, 10.0, on_x=True, on_y=True)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -169,17 +169,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "76a4b4b6318d2549", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([{\"material\": nanowire_xy_pbc}, {\"material\": nanowire_xy_pbc, \"rotation\": \"-90x\"}])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -193,17 +193,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "bb206aac50a38bb6", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.plot import plot_rdf\n", "\n", "plot_rdf(nanowire_xy_pbc, cutoff=10.0)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -218,12 +218,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "7b80ee26896bbbfb", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from utils.io import select_coordination_threshold\n", "from mat3ra.made.tools.helpers import get_unique_coordination_numbers\n", @@ -235,7 +233,9 @@ "coordination_threshold = COORDINATION_THRESHOLD\n", "if IS_COORDINATION_SELECTION_INTERACTIVE:\n", " coordination_threshold = await select_coordination_threshold(coordination_numbers, COORDINATION_THRESHOLD)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -249,12 +249,10 @@ }, { "cell_type": "code", - "execution_count": null, "id": "398b2dedef23e0fc", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_dangling_bonds\n", "\n", @@ -266,7 +264,9 @@ " coordination_threshold=coordination_threshold,\n", " number_of_bonds_to_passivate=MAX_BONDS_TO_SATURATE,\n", ")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -280,15 +280,15 @@ }, { "cell_type": "code", - "execution_count": null, "id": "cb85e7e42c0944f2", "metadata": { "collapsed": false }, - "outputs": [], "source": [ "visualize_materials(passivated_nanowire, viewer=\"wave\")" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -302,17 +302,17 @@ }, { "cell_type": "code", - "execution_count": null, "id": "51a4fc8cbadfb526", "metadata": {}, - "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "passivated_nanowire.name = \"H-Passivated Silicon Nanowire\"\n", "set_materials(passivated_nanowire)\n", "download_content_to_file(passivated_nanowire.to_json(), \"passivated_nanowire.json\")" - ] + ], + "outputs": [], + "execution_count": null } ], "metadata": { From 5d3a9e6e25d564801fd7e8423cd413c1ddb56a53 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 16:50:54 -0700 Subject: [PATCH 17/26] update: cleanup --- other/materials_designer/create_cluster_custom_shape.ipynb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index ac2c4422..0599b1ee 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -84,7 +84,7 @@ "collapsed": false }, "source": [ - "RADIUS = 5.3 # in crystal units\n", + "RADIUS = 5.3 # in Angstroms\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster\n", "USE_CARTESIAN_COORDINATES = True\n", @@ -185,11 +185,9 @@ "collapsed": false }, "source": [ - "from mat3ra.made.tools.modify import wrap_to_unit_cell\n", "from mat3ra.made.tools.helpers import create_nanoparticle_from_material\n", "material = materials[0]\n", - "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)\n", - "cluster = wrap_to_unit_cell(cluster)" + "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" ], "outputs": [], "execution_count": null From 537610e29148cf83e16b31bb753a1ed95fa2880c Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 17:05:04 -0700 Subject: [PATCH 18/26] chore: strip outputs --- ...ate_interface_with_relaxation_alignn.ipynb | 14 +- ...te_interface_with_relaxation_ase_emt.ipynb | 16 +- ...un_job_using_material_from_jarvis_db.ipynb | 329 ++++++++---------- .../create_cluster_specific_shape.ipynb | 120 +++---- .../create_cluster_sphere.ipynb | 150 +++----- .../create_cutout_box.ipynb | 102 ++---- .../create_cutout_custom_shape.ipynb | 104 ++---- .../create_grain_boundary_film.ipynb | 90 ++--- .../create_heterostructure_example.ipynb | 246 +++++-------- ...create_interface_with_min_strain_zsl.ipynb | 71 +--- ...te_interface_with_no_strain_matching.ipynb | 43 +-- ...te_interface_with_relaxation_ase_emt.ipynb | 123 +++---- .../create_nanoribbon.ipynb | 132 +++---- .../materials_designer/create_nanowire.ipynb | 102 ++---- .../create_nanowire_custom_shape.ipynb | 108 ++---- .../create_perturbation.ipynb | 90 ++--- .../create_perturbation_custom.ipynb | 108 ++---- .../create_point_defect.ipynb | 140 ++++---- other/materials_designer/create_slab.ipynb | 150 +++----- .../materials_designer/create_supercell.ipynb | 90 ++--- ...interface_with_commensurate_lattices.ipynb | 102 ++---- ...e_twisted_interface_with_nanoribbons.ipynb | 66 ++-- .../custom_transformation.ipynb | 122 +++---- .../import_materials_from_standata.ipynb | 108 +++--- other/materials_designer/passivate_edge.ipynb | 112 ++---- other/materials_designer/passivate_slab.ipynb | 90 ++--- ..._grain_boundary_3d_fcc_metals_copper.ipynb | 184 ++++------ ...island_molybdenum_disulfide_platinum.ipynb | 140 +++----- .../defect_point_interstitial_tin_oxide.ipynb | 158 ++++----- .../defect_point_pair_gallium_nitride.ipynb | 118 +++---- .../defect_point_substitution_graphene.ipynb | 158 ++++----- ...fect_surface_island_titanium_nitride.ipynb | 86 ++--- .../defect_surface_step_platinum.ipynb | 122 +++---- ...rface_2d_3d_graphene_silicon_dioxide.ipynb | 51 +-- .../interface_3d_3d_copper_cristobalite.ipynb | 51 +-- ...surate_lattices_molybdenum_disulfide.ipynb | 96 +++-- ...er_twisted_nanoribbons_boron_nitride.ipynb | 190 +++------- .../specific_examples/nanocluster_gold.ipynb | 80 ++--- ...ace_film_xy_position_graphene_nickel.ipynb | 80 ++--- .../passivation_surface_silicon.ipynb | 148 ++++---- other/materials_designer/under_the_hood.ipynb | 10 +- 41 files changed, 1672 insertions(+), 2928 deletions(-) diff --git a/other/experiments/create_interface_with_relaxation_alignn.ipynb b/other/experiments/create_interface_with_relaxation_alignn.ipynb index b1a3fb19..1b349581 100644 --- a/other/experiments/create_interface_with_relaxation_alignn.ipynb +++ b/other/experiments/create_interface_with_relaxation_alignn.ipynb @@ -142,8 +142,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [], - "trusted": true + "tags": [] }, "outputs": [], "source": [ @@ -605,9 +604,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## References\n", "\n", @@ -633,13 +630,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/experiments/create_interface_with_relaxation_ase_emt.ipynb b/other/experiments/create_interface_with_relaxation_ase_emt.ipynb index 63df0389..b9054ad6 100644 --- a/other/experiments/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/experiments/create_interface_with_relaxation_ase_emt.ipynb @@ -141,8 +141,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [], - "trusted": true + "tags": [] }, "outputs": [], "source": [ @@ -607,11 +606,9 @@ }, { "cell_type": "code", + "metadata": {}, "outputs": [], - "source": [], - "metadata": { - "collapsed": false - } + "source": [] } ], "metadata": { @@ -631,13 +628,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/jarvis/run_job_using_material_from_jarvis_db.ipynb b/other/jarvis/run_job_using_material_from_jarvis_db.ipynb index bd1153a3..c6a8f63d 100644 --- a/other/jarvis/run_job_using_material_from_jarvis_db.ipynb +++ b/other/jarvis/run_job_using_material_from_jarvis_db.ipynb @@ -2,53 +2,47 @@ "cells": [ { "cell_type": "markdown", + "id": "0", + "metadata": {}, "source": [ "\n", "\"Open\n", "" - ], - "metadata": { - "collapsed": false - }, - "id": "3c567b6400249971" + ] }, { "cell_type": "markdown", + "id": "1", + "metadata": {}, "source": [ "## Install Packages\n", "First, install `express-py` which includes `jarvis-tools` as dependency." - ], - "metadata": { - "collapsed": false - }, - "id": "8b00ab6854f2263b" + ] }, { "cell_type": "code", "execution_count": null, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "!pip install express-py==2024.1.25.post7" - ], - "metadata": { - "collapsed": false - }, - "id": "b1288bc79ee2c828" + ] }, { "cell_type": "markdown", + "id": "3", + "metadata": {}, "source": [ "## Get Materials Data From JARVIS\n", "Then, let\"s get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." - ], - "metadata": { - "collapsed": false - }, - "id": "f418c51a7f794f9f" + ] }, { "cell_type": "code", "execution_count": null, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", @@ -56,27 +50,27 @@ "\n", "dft_2d = data(\"dft_2d\")\n", "df = pd.DataFrame(dft_2d)" - ], - "metadata": { - "collapsed": false - }, - "id": "b1ee775d1476f884" + ] }, { "cell_type": "markdown", + "id": "5", + "metadata": {}, "source": [ "## Create a simple heterostructure\n", "\n", "We use two material ids and place them one above another." - ], - "metadata": { - "collapsed": false - }, - "id": "9035ff20f1483b33" + ] }, { "cell_type": "code", "execution_count": null, + "id": "6", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "from jarvis.core.atoms import Atoms\n", @@ -97,31 +91,29 @@ "heterostructure_atoms = interface_atoms_dict[\"interface\"].center_around_origin()\n", "\n", "print (jid1,jid2,atoms1.composition.reduced_formula,atoms2.composition.reduced_formula, heterostructure_atoms)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "1b3e7d016f30b61" + ] }, { "cell_type": "markdown", - "source": [ - "## Extract the film and substrate" - ], + "id": "7", "metadata": { - "collapsed": false, "pycharm": { "name": "#%% md\n" } }, - "id": "4d59e226b39bbf41" + "source": [ + "## Extract the film and substrate" + ] }, { "cell_type": "code", "execution_count": null, + "id": "8", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "# Using the fractional coordinate Z level of 0.5 to separate top/bottom\n", @@ -147,29 +139,22 @@ " heterostructure_atoms_copy = heterostructure_atoms_copy.remove_site_by_index(ind - i)\n", " print(\"removed\", ind, heterostructure_atoms_copy.props)\n", "film_atoms = Atoms.from_dict(heterostructure_atoms_copy.to_dict())" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "c60f1cdeca83df6a" + ] }, { "cell_type": "markdown", + "id": "9", + "metadata": {}, "source": [ "## Extract Structure and Convert to ESSE\n", "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." - ], - "metadata": { - "collapsed": false - }, - "id": "15fe5f9de299c935" + ] }, { "cell_type": "code", "execution_count": null, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "import json\n", @@ -194,26 +179,26 @@ "\n", "# To preview resulting JSON data\n", "print(json.dumps(material_heterostructure, indent=4))" - ], - "metadata": { - "collapsed": false - }, - "id": "c41fb68c6d25fe48" + ] }, { "cell_type": "markdown", + "id": "11", + "metadata": {}, "source": [ "## Setup the API credentials\n", "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." - ], - "metadata": { - "collapsed": false - }, - "id": "a4a48479c7ea090f" + ] }, { "cell_type": "code", "execution_count": null, + "id": "12", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "# @title Authorization Form\n", @@ -236,31 +221,29 @@ " )\n", "\n", " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "5b2ae68afcacc16" + ] }, { "cell_type": "markdown", - "source": [ - "## Initialize the API Endpoints" - ], + "id": "13", "metadata": { - "collapsed": false, "pycharm": { "name": "#%% md\n" } }, - "id": "deac6f9f10d31b19" + "source": [ + "## Initialize the API Endpoints" + ] }, { "cell_type": "code", "execution_count": null, + "id": "14", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", @@ -278,31 +261,29 @@ "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "979e35d5e828f794" + ] }, { "cell_type": "markdown", - "source": [ - "## Create Material in the platform" - ], + "id": "15", "metadata": { - "collapsed": false, "pycharm": { "name": "#%% md\n" } }, - "id": "6ea47ba011947ad5" + "source": [ + "## Create Material in the platform" + ] }, { "cell_type": "code", "execution_count": null, + "id": "16", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "material_heterostructure[\"name\"] = f\"Heterostructure - {jid1} with {jid2}\"\n", @@ -313,61 +294,56 @@ "\n", "material_substrate[\"name\"] = f\"Substrate - {jid2}\"\n", "material_substrate_in_the_platform = material_endpoints.create(material_substrate)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "84b4ae0786b716cc" + ] }, { "cell_type": "markdown", - "source": [ - "## Create a workflow if it does not exist yet\n", - "\n", - "Here we utilize the id of the Valence Band bank workflow from \"curators\" account `kXJ9j9piJTddX9FHz` and import it if it does not exist in the account collection." - ], + "id": "17", "metadata": { - "collapsed": false, "pycharm": { "name": "#%% md\n" } }, - "id": "ca5e8436bab6f5bd" + "source": [ + "## Create a workflow if it does not exist yet\n", + "\n", + "Here we utilize the id of the Valence Band bank workflow from \"curators\" account `kXJ9j9piJTddX9FHz` and import it if it does not exist in the account collection." + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "BANK_ID = \"kXJ9j9piJTddX9FHz\"\n", - "workflow_in_the_platform = bank_workflow_endpoints.copy(BANK_ID, ACCOUNT_ID)" - ], + "id": "18", "metadata": { - "collapsed": false, "pycharm": { "name": "#%%\n" } }, - "id": "443484aaa75ac2ff" + "outputs": [], + "source": [ + "BANK_ID = \"kXJ9j9piJTddX9FHz\"\n", + "workflow_in_the_platform = bank_workflow_endpoints.copy(BANK_ID, ACCOUNT_ID)" + ] }, { "cell_type": "markdown", + "id": "19", + "metadata": {}, "source": [ "## Create and Run a Job\n", "\n", "Create Job config" - ], - "metadata": { - "collapsed": false - }, - "id": "da418324b250a490" + ] }, { "cell_type": "code", "execution_count": null, + "id": "20", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "PPN = \"4\"\n", @@ -393,108 +369,97 @@ " \"name\": f\"Valence Band - {material_heterostructure['name']}\",\n", " \"compute\": compute,\n", "}" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "b4354c90697ee8de" + ] }, { "cell_type": "markdown", + "id": "21", + "metadata": {}, "source": [ "Then create a job" - ], - "metadata": { - "collapsed": false - }, - "id": "c907fce6c3a3f59e" + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "job = job_endpoints.create(config)" - ], + "id": "22", "metadata": { - "collapsed": false, "pycharm": { "name": "#%%\n" } }, - "id": "d6537b79de46978a" + "outputs": [], + "source": [ + "job = job_endpoints.create(config)" + ] }, { "cell_type": "markdown", - "source": [ - "then run it" - ], + "id": "23", "metadata": { - "collapsed": false, "pycharm": { "name": "#%% md\n" } }, - "id": "f4b7b12d8cd5019e" + "source": [ + "then run it" + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "job_endpoints.submit(job[\"_id\"])" - ], + "id": "24", "metadata": { - "collapsed": false, "pycharm": { "name": "#%%\n" } }, - "id": "cc878e6674215ecc" + "outputs": [], + "source": [ + "job_endpoints.submit(job[\"_id\"])" + ] }, { "cell_type": "markdown", + "id": "25", + "metadata": {}, "source": [ "and wait for it to finish" - ], - "metadata": { - "collapsed": false - }, - "id": "2ef0dfa179949972" + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", - "job_id = job[\"_id\"]\n", - "wait_for_jobs_to_finish(job_endpoints, [job_id])" - ], + "id": "26", "metadata": { - "collapsed": false, "pycharm": { "name": "#%%\n" } }, - "id": "436d477f7245ea02" + "outputs": [], + "source": [ + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", + "job_id = job[\"_id\"]\n", + "wait_for_jobs_to_finish(job_endpoints, [job_id])" + ] }, { "cell_type": "markdown", + "id": "27", + "metadata": {}, "source": [ "Then get job files:" - ], - "metadata": { - "collapsed": false - }, - "id": "2a2cc84332f6d98b" + ] }, { "cell_type": "code", "execution_count": null, + "id": "28", + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "files = job_endpoints.list_files(job_id)\n", @@ -514,40 +479,30 @@ "\n", "with open(output_file_metadata[\"name\"], \"w\") as file_descriptor:\n", " file_descriptor.write(output_file)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - }, - "id": "3199c5b7ecf347ef" + ] }, { "cell_type": "markdown", + "id": "29", + "metadata": {}, "source": [ "and get job properties using the index of a subworkflow in workflow and the index of unit in subworkflow (0, 0) below" - ], - "metadata": { - "collapsed": false - }, - "id": "d155c1096b7499f5" + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "pressure = get_property_by_subworkflow_and_unit_indicies(property_endpoints, \"pressure\", job, 0, 0)\n", - "print(pressure[\"data\"][\"value\"])" - ], + "id": "30", "metadata": { - "collapsed": false, "pycharm": { "name": "#%%\n" } }, - "id": "651c91cebd378528" + "outputs": [], + "source": [ + "pressure = get_property_by_subworkflow_and_unit_indicies(property_endpoints, \"pressure\", job, 0, 0)\n", + "print(pressure[\"data\"][\"value\"])" + ] } ], "metadata": { diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 54f459d0..6b5c922a 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a nanocluster with a specific shape.\n", "\n", @@ -27,20 +25,16 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n" ] }, { "cell_type": "markdown", - "id": "9adf37a8d2620dc4", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -48,10 +42,10 @@ }, { "cell_type": "code", - "id": "d9e6be14343d00a1", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -63,16 +57,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "26066db067a41c93", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set up cluster parameters\n", "Parameters for the cuboctahedron and icosahedron shapes can be found at [ASE Clusters](https://wiki.fysik.dtu.dk/ase/ase/cluster/cluster.html#ase.cluster.Cluster)." @@ -80,10 +70,10 @@ }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.pristine_structures.zero_dimensional.nanoparticle import NanoparticleShapesEnum\n", "\n", @@ -92,40 +82,32 @@ " \"length\": 5,\n", " \"cutoff\": 2\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "7", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "## 2. Create the Target Material\n", "\n" @@ -133,10 +115,10 @@ }, { "cell_type": "code", - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_nanoparticle_by_shape\n", "\n", @@ -145,58 +127,48 @@ " shape=shape,\n", " parameters=parameters\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}],viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {shape.name.capitalize()} cluster\"\n", "set_materials(cluster)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index 1aa3285d..d3de41f6 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a cluster from a bulk material\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up cluster parameters" @@ -38,24 +34,20 @@ }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "RADIUS = 4.5 # in Angstroms\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." @@ -63,10 +55,10 @@ }, { "cell_type": "code", - "id": "ef664b14457530fd", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -78,50 +70,42 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create a slab of sufficient size" ] }, { "cell_type": "code", - "id": "7fcb1e02e84c5f35", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", @@ -152,16 +136,12 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Target Material\n", "### 2.1. Create spherical cluster\n" @@ -169,36 +149,32 @@ }, { "cell_type": "code", - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_sphere, add_vacuum, add_vacuum_sides\n", "\n", "cluster = filter_by_sphere(material=slab, center_coordinate=[0.5, 0.5, 0.5], radius=RADIUS)\n", "cluster = add_vacuum(cluster, VACUUM, to_bottom=True, on_top=True)\n", "cluster = add_vacuum_sides(cluster, VACUUM, on_x=True, on_y=True)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a01018588e6e55fc", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Set lattice to Cubic" ] }, { "cell_type": "code", - "id": "4f78c4743b370c3b", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.lattice import Lattice\n", "\n", @@ -207,60 +183,50 @@ "cubic_vector_2 = [0, current_vector_2[1], 0]\n", "cubic_vector_3 = [0, 0, current_vector_3[2]]\n", "cluster.lattice = Lattice.from_vectors_array([cubic_vector_1, cubic_vector_2, cubic_vector_3], type=\"CUB\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}])\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\"}], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} Cluster R={RADIUS}A\"\n", "set_materials(cluster)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cutout_box.ipynb b/other/materials_designer/create_cutout_box.ipynb index 408c27b8..07fe7f47 100644 --- a/other/materials_designer/create_cutout_box.ipynb +++ b/other/materials_designer/create_cutout_box.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create slab with box cutout\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up cluster parameters\n", @@ -42,10 +38,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Box cutout parameters\n", @@ -65,10 +59,8 @@ }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." @@ -77,10 +69,8 @@ { "cell_type": "code", "execution_count": null, - "id": "ef664b14457530fd", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -97,10 +87,8 @@ }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material" ] @@ -108,10 +96,8 @@ { "cell_type": "code", "execution_count": null, - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -121,10 +107,8 @@ }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create a slab if the input material is not a slab" ] @@ -132,10 +116,8 @@ { "cell_type": "code", "execution_count": null, - "id": "bfce9928ba2d0c7e", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -153,10 +135,8 @@ }, { "cell_type": "markdown", - "id": "580036d8d11b8bed", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 1.5. Visualize the slab" ] @@ -164,10 +144,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7fcb1e02e84c5f35", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -178,10 +156,8 @@ }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 2. Create the Target Material\n", "### 2.1. Create a cutout" @@ -190,10 +166,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_box\n", @@ -209,10 +183,8 @@ }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] @@ -220,10 +192,8 @@ { "cell_type": "code", "execution_count": null, - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", @@ -235,10 +205,8 @@ }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -246,10 +214,8 @@ { "cell_type": "code", "execution_count": null, - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index 835339d9..2884bdcd 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a custom-shape cutout\n", "\n", @@ -28,10 +26,8 @@ }, { "cell_type": "markdown", - "id": "98aa134f51746218", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Install Packages\n", @@ -41,10 +37,8 @@ { "cell_type": "code", "execution_count": null, - "id": "280f9794a876678b", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -61,10 +55,8 @@ }, { "cell_type": "markdown", - "id": "b3d4d3ea7b589f89", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Set up structure parameters " ] @@ -72,10 +64,8 @@ { "cell_type": "code", "execution_count": null, - "id": "5177e239254e3601", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "# Slab parameters\n", @@ -97,19 +87,18 @@ }, { "cell_type": "markdown", - "id": "361c291aaf3feb2a", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Create a condition on coordinates\n" ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from typing import List\n", "\n", @@ -175,15 +164,12 @@ " channel_top_z=CHANNEL_TOP_Z,\n", " cavity_top_z=CAVITY_TOP_Z,\n", ").condition" - ], - "id": "322ca726a11952d5" + ] }, { "cell_type": "markdown", - "id": "91724db55eddad60", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -191,10 +177,8 @@ { "cell_type": "code", "execution_count": null, - "id": "ceebf2a5229da67c", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -205,10 +189,8 @@ }, { "cell_type": "markdown", - "id": "13964644436b4156", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -216,10 +198,8 @@ { "cell_type": "code", "execution_count": null, - "id": "45f0c424ece00186", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -230,10 +210,8 @@ }, { "cell_type": "markdown", - "id": "615800437b2ef7a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 2. Create target material\n", "### 2.1. Create a slab and apply the cutout condition" @@ -242,10 +220,8 @@ { "cell_type": "code", "execution_count": null, - "id": "422815d29aa347a1", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.modify import filter_by_condition_on_coordinates, add_vacuum\n", @@ -273,10 +249,8 @@ }, { "cell_type": "markdown", - "id": "57cc38ec0df3c1f7", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -284,10 +258,8 @@ { "cell_type": "code", "execution_count": null, - "id": "2a9627cd4a261067", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "visualize(resulting_material, repetitions=[1, 1, 1], rotation=\"0x\")\n", @@ -297,10 +269,8 @@ }, { "cell_type": "markdown", - "id": "c67e6f5363e80942", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -308,10 +278,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cbee60d4b936e5cb", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_grain_boundary_film.ipynb b/other/materials_designer/create_grain_boundary_film.ipynb index 801c27d5..0fdc8034 100644 --- a/other/materials_designer/create_grain_boundary_film.ipynb +++ b/other/materials_designer/create_grain_boundary_film.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "415ed707e27a6c8e", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a 2D Surface Grain Boundary in a film\n", "\n", @@ -31,10 +29,8 @@ }, { "cell_type": "markdown", - "id": "a080006df3785cc5", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -49,10 +45,8 @@ { "cell_type": "code", "execution_count": null, - "id": "338ee3c51155e086", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Material selection\n", @@ -86,10 +80,8 @@ }, { "cell_type": "markdown", - "id": "6463f9bbcd3be7c7", - "metadata": { - "collapsed": false - }, + "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`." @@ -98,10 +90,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7e22d1f4da825575", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -118,10 +108,8 @@ }, { "cell_type": "markdown", - "id": "4a1cfe15caa44c3e", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load and preview input material" ] @@ -129,10 +117,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a1635c31132962f6", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -142,10 +128,8 @@ }, { "cell_type": "markdown", - "id": "32b3ad775543b06f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "## 2. Prepare Material\n", "### 2.1. Select and visualize initial material" @@ -154,10 +138,8 @@ { "cell_type": "code", "execution_count": null, - "id": "61f0870d8104cd21", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -170,10 +152,8 @@ }, { "cell_type": "markdown", - "id": "34d6c7a337f1e40b", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 3. Generate Surface Grain Boundary\n" ] @@ -181,10 +161,8 @@ { "cell_type": "code", "execution_count": null, - "id": "33a2c8a9be436745", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", @@ -205,10 +183,8 @@ }, { "cell_type": "markdown", - "id": "8b2f0574a20089a5", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 4. Preview grain boundary" ] @@ -216,10 +192,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7f558a8e9d417cef", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "actual_angle = grain_boundary.metadata.build[-1].configuration.get(\"actual_angle\")\n", @@ -234,10 +208,8 @@ }, { "cell_type": "markdown", - "id": "afcc004c5878b56f", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "### 5. Pass data to the outside runtime\n" ] @@ -245,10 +217,8 @@ { "cell_type": "code", "execution_count": null, - "id": "20e46167358d63", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index 61882fba..598600d5 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "ad0a4601cb4095ad", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create Heterostructure Example with Three Materials\n", "\n", @@ -34,10 +32,8 @@ }, { "cell_type": "markdown", - "id": "a0b4736f3dffa189", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the Notebook\n", @@ -48,10 +44,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9e90252bcef065c9", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Enable interactive selection of terminations via UI prompt\n", @@ -97,10 +91,8 @@ }, { "cell_type": "markdown", - "id": "e460756f40327e78", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Install Packages\n", "\n", @@ -110,10 +102,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a4d99b5b40274810", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -128,10 +118,8 @@ }, { "cell_type": "markdown", - "id": "c4b29abaa6160a66", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get Input Materials and Assign `material0`, `material1`, and `material2`\n", "\n", @@ -141,10 +129,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e90d5bf2655f5e0f", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -168,10 +154,8 @@ }, { "cell_type": "markdown", - "id": "1ffc1f88eedbc9a4", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview Original Materials\n", "\n", @@ -181,10 +165,8 @@ { "cell_type": "code", "execution_count": null, - "id": "6253034909a0fef9", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -194,10 +176,8 @@ }, { "cell_type": "markdown", - "id": "574327eaccdd52f0", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create First Interface (Material 0 + Material 1)\n", "\n", @@ -209,10 +189,8 @@ { "cell_type": "code", "execution_count": null, - "id": "de4fe773ee9c8a61", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_slab_terminations\n", @@ -260,10 +238,8 @@ }, { "cell_type": "markdown", - "id": "e4aea26afab84e0c", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Print and Select Termination Pair for First Interface\n" ] @@ -271,10 +247,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4e467693b61f0125", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from itertools import product\n", @@ -287,10 +261,8 @@ }, { "cell_type": "markdown", - "id": "e70e2a4ef133c9f", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "### 2.3. Select Termination Pair for First Interface\n" ] @@ -298,10 +270,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c99cb2e5bbcd24df", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", @@ -332,10 +302,8 @@ }, { "cell_type": "markdown", - "id": "7621d2178a91c691", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 2.4. Initialize Interface Configuration for First Interface\n" ] @@ -343,10 +311,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9e87ca9779cee593", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", @@ -380,10 +346,8 @@ }, { "cell_type": "markdown", - "id": "afab24f1d8cf9ad7", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "### 2.5. Set Strain Matching Parameters and Generate First Interface\n" ] @@ -391,10 +355,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9b72198198a18278", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", @@ -415,10 +377,8 @@ }, { "cell_type": "markdown", - "id": "4989c48b4ed6a33d", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "source": [ "### 2.6. Plot and Select First Interface\n" ] @@ -426,10 +386,8 @@ { "cell_type": "code", "execution_count": null, - "id": "32e05e63fea1b5a3", - "metadata": { - "collapsed": false - }, + "id": "20", + "metadata": {}, "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", @@ -461,10 +419,8 @@ }, { "cell_type": "markdown", - "id": "342d6261ae79122", - "metadata": { - "collapsed": false - }, + "id": "21", + "metadata": {}, "source": [ "### 2.7. Preview the First Interface\n" ] @@ -472,10 +428,8 @@ { "cell_type": "code", "execution_count": null, - "id": "1148759314be11cc", - "metadata": { - "collapsed": false - }, + "id": "22", + "metadata": {}, "outputs": [], "source": [ "visualize(selected_interfaces_01, repetitions=[3, 3, 1])\n", @@ -484,10 +438,8 @@ }, { "cell_type": "markdown", - "id": "df770aba2dbc2df0", - "metadata": { - "collapsed": false - }, + "id": "23", + "metadata": {}, "source": [ "## 3. Create Second Interface (First Interface + Material 2)\n", "\n", @@ -499,10 +451,8 @@ { "cell_type": "code", "execution_count": null, - "id": "636e0e4c45b02925", - "metadata": { - "collapsed": false - }, + "id": "24", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", @@ -529,10 +479,8 @@ }, { "cell_type": "markdown", - "id": "ac68ed5b9219b0dc", - "metadata": { - "collapsed": false - }, + "id": "25", + "metadata": {}, "source": [ "### 3.2. Print and Select Termination Pair for Second Interface\n" ] @@ -540,10 +488,8 @@ { "cell_type": "code", "execution_count": null, - "id": "41b3d541c1ebfe5a", - "metadata": { - "collapsed": false - }, + "id": "26", + "metadata": {}, "outputs": [], "source": [ "termination_pairs_12 = list(product(material2_slab_terminations, substrate_second_slab_terminations)) \n", @@ -554,10 +500,8 @@ }, { "cell_type": "markdown", - "id": "822c79480c3d7965", - "metadata": { - "collapsed": false - }, + "id": "27", + "metadata": {}, "source": [ "### 3.3. Select Termination Pair for Second Interface\n" ] @@ -565,10 +509,8 @@ { "cell_type": "code", "execution_count": null, - "id": "f9d2b5429447338e", - "metadata": { - "collapsed": false - }, + "id": "28", + "metadata": {}, "outputs": [], "source": [ "# Select terminations for Material 2 and the substrate using the newer approach\n", @@ -596,10 +538,8 @@ }, { "cell_type": "markdown", - "id": "796e3604d6bd4c60", - "metadata": { - "collapsed": false - }, + "id": "29", + "metadata": {}, "source": [ "### 3.4. Initialize Interface Configuration for Second Interface\n" ] @@ -607,10 +547,8 @@ { "cell_type": "code", "execution_count": null, - "id": "fa7e6b937d2b78a0", - "metadata": { - "collapsed": false - }, + "id": "30", + "metadata": {}, "outputs": [], "source": [ "# Create slab configurations and slabs for the second interface using the newer approach\n", @@ -634,10 +572,8 @@ }, { "cell_type": "markdown", - "id": "3816e1b290f7e5d0", - "metadata": { - "collapsed": false - }, + "id": "31", + "metadata": {}, "source": [ "### 3.5. Set Strain Matching Parameters and Generate Second Interface\n" ] @@ -645,10 +581,8 @@ { "cell_type": "code", "execution_count": null, - "id": "6f30c6961f7abbfe", - "metadata": { - "collapsed": false - }, + "id": "32", + "metadata": {}, "outputs": [], "source": [ "# Set up ZSL Interface Analyzer for the second interface\n", @@ -677,10 +611,8 @@ }, { "cell_type": "markdown", - "id": "32ded9bdae6ef429", - "metadata": { - "collapsed": false - }, + "id": "33", + "metadata": {}, "source": [ "### 3.6. Plot and Select Second Interface\n" ] @@ -688,10 +620,8 @@ { "cell_type": "code", "execution_count": null, - "id": "43f233403393eb2a", - "metadata": { - "collapsed": false - }, + "id": "34", + "metadata": {}, "outputs": [], "source": [ "plot_strain_vs_area(matches_12, PLOT_SETTINGS)\n", @@ -714,10 +644,8 @@ }, { "cell_type": "markdown", - "id": "ed109941d5e29522", - "metadata": { - "collapsed": false - }, + "id": "35", + "metadata": {}, "source": [ "### 3.7. Preview the Second Interface (Final Heterostructure)\n" ] @@ -725,10 +653,8 @@ { "cell_type": "code", "execution_count": null, - "id": "fffbf9243911a98", - "metadata": { - "collapsed": false - }, + "id": "36", + "metadata": {}, "outputs": [], "source": [ "visualize(selected_interfaces_12, repetitions=[3, 3, 1])\n", @@ -737,10 +663,8 @@ }, { "cell_type": "markdown", - "id": "e98176e806c4aace", - "metadata": { - "collapsed": false - }, + "id": "37", + "metadata": {}, "source": [ "## 4. Preview the Final Heterostructure\n" ] @@ -748,10 +672,8 @@ { "cell_type": "code", "execution_count": null, - "id": "47f9a1aa1578c37", - "metadata": { - "collapsed": false - }, + "id": "38", + "metadata": {}, "outputs": [], "source": [ "visualize(selected_interfaces_12, repetitions=[3, 3, 1], title=\"Final Heterostructure (First Interface + Material2)\")\n", @@ -760,10 +682,8 @@ }, { "cell_type": "markdown", - "id": "946d5a41156bc1e1", - "metadata": { - "collapsed": false - }, + "id": "39", + "metadata": {}, "source": [ "## 5. Pass the Final Heterostructure to the Outside Runtime\n", "\n", @@ -773,10 +693,8 @@ { "cell_type": "code", "execution_count": null, - "id": "1b466c32b0d82431", - "metadata": { - "collapsed": false - }, + "id": "40", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", 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 d6ddca31..9c23fd1c 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -34,9 +34,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -87,19 +85,17 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "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))." ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -124,9 +120,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -142,9 +136,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.4. Preview Substrate and Film" ] @@ -152,9 +144,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -179,9 +169,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_slab_terminations\n", @@ -200,10 +188,10 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", @@ -254,10 +242,10 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", "\n", @@ -312,9 +300,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 3.3. Generate interfaces with strain matcher\n", "Interfaces are sorted by size and strain." @@ -331,9 +317,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 3.4. Plot interfaces by size and strain\n" ] @@ -341,9 +325,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", @@ -369,9 +351,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "selected_index = 0" @@ -389,9 +369,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "\n", @@ -411,9 +389,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 4. Preview the selected material" ] @@ -421,9 +397,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "visualize(interface, repetitions=[1, 1, 1])\n", @@ -466,13 +440,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, 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 5f2cc384..b068cd3c 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -28,9 +28,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 1. Prepare Environment\n", "### 1.1. Set notebook parameters" @@ -71,9 +69,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "\n", "### 1.2. Install Packages\n", @@ -83,9 +79,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -100,9 +94,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.3. Get input materials and assign `substrate` and `film`\n", "Materials are loaded with `get_data()`. The first material is assigned as substrate and the second as film." @@ -111,9 +103,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -129,9 +119,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.4. Preview Substrate and Film" ] @@ -139,9 +127,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -185,9 +171,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -237,10 +221,10 @@ ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "\n", @@ -342,13 +326,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb index 357c4dde..8bc85535 100644 --- a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb @@ -30,39 +30,36 @@ }, { "cell_type": "markdown", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the relaxation parameter\n" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "MATERIAL_INDEX = 0 # Index of the material in the list of materials, should be an interface\n", "# Maximum force tolerance for the relaxation to stop, in eV/Å\n", "FMAX = 0.05" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "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))." - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -72,66 +69,58 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "### 1.3. Get input interface material\n", "Materials are loaded with `get_data()`." - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "interface = materials[MATERIAL_INDEX]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "### 1.4. Preview Interface" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize(interface, repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "## 2. Perform Relaxation\n", "### 2.1. Set the optimization parameters" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from ase.optimize import BFGS\n", "from ase.calculators.emt import EMT\n", @@ -142,24 +131,20 @@ "OPTIMIZATION_PARAMETERS = {\n", " \"FMAX\": FMAX\n", "}" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "### 2.2. Optimize atomic coordinates of the interface and view energy/step plot" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.utils.jupyterlite.plot import create_realtime_plot, create_update_callback\n", "from mat3ra.made.tools.convert import from_ase\n", @@ -197,12 +182,7 @@ "\n", "ase_final_interface = ase_interface\n", "final_interface = Material.create(from_ase(ase_final_interface))" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -213,12 +193,12 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "visualize([{\"material\": interface, \"title\": \"original\"}, {\"material\":final_interface, \"title\":\"relaxed\"}], rotation= \"-90x\", repetitions=[3, 3, 1])\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -230,7 +210,9 @@ }, { "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.calculate import calculate_total_energy, calculate_interfacial_energy\n", "\n", @@ -242,31 +224,25 @@ "print(f\"Starting interface energy: {original_energy:.4f} eV\")\n", "print(f\"Relaxed interface energy: {relaxed_energy:.4f} eV\")\n", "print(f\"Interfacial energy: {interfacial_energy:.4f} eV\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "## 3. Pass data to the outside runtime" - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "final_interface.name = f\"{interface.name}, Relaxed with EMT\" if \"Relaxed\" not in interface.name else interface.name\n", "set_materials(final_interface)" - ], - "metadata": { - "collapsed": false - }, - "outputs": [], - "execution_count": null + ] } ], "metadata": { @@ -286,13 +262,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index d1f26944..925e2dfb 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "367a698b29e22bd7", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Nanoribbon of a 2D material\n", "\n", @@ -30,10 +28,8 @@ }, { "cell_type": "markdown", - "id": "193a4e6a78fd5bd7", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up nanoribbon parameters " @@ -41,10 +37,10 @@ }, { "cell_type": "code", - "id": "a40d7b697c413113", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", @@ -55,16 +51,12 @@ "VACUUM_WIDTH = 10.0 # in Angstroms\n", "VACUUM_LENGTH = 10.0 # in Angstroms\n", "EDGE_TYPE = \"zigzag\" # \"zigzag\" or \"armchair\"" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "49c9f5022d50517e", - "metadata": { - "collapsed": false - }, + "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))." @@ -72,10 +64,10 @@ }, { "cell_type": "code", - "id": "c6d9f8e57bef2f91", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -85,16 +77,12 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "edf02101e27a2742", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials\n", "Materials are loaded with `get_materials()`." @@ -102,58 +90,50 @@ }, { "cell_type": "code", - "id": "e0c53233ce728cc1", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "cf29b7f6fe114d8f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview Material" ] }, { "cell_type": "code", - "id": "897ba7aa4e402d24", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "material = materials[MATERIAL_INDEX]\n", "visualize(material, repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "39a93c4635762a83", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Nanoribbon\n" ] }, { "cell_type": "code", - "id": "1991efeeebe39db4", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import EdgeTypesEnum\n", "from mat3ra.made.tools.helpers import create_nanoribbon\n", @@ -168,55 +148,45 @@ " use_rectangular_lattice=True,\n", " edge_type=EdgeTypesEnum.zigzag if EDGE_TYPE == \"zigzag\" else EdgeTypesEnum.armchair\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "eecd561cd92fb18a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize the Nanoribbon" ] }, { "cell_type": "code", - "id": "1ee393a7f2ec3bc8", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize([{\"material\": nanoribbon, \"title\": \"Nanoribbon\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "9e0b241366592109", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "29dfa0a329cca2fa", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "set_materials(nanoribbon)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_nanowire.ipynb b/other/materials_designer/create_nanowire.ipynb index cffe0007..2559caff 100644 --- a/other/materials_designer/create_nanowire.ipynb +++ b/other/materials_designer/create_nanowire.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "c9f342d4ac1988c6", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a nanowire\n", "\n", @@ -21,10 +19,8 @@ }, { "cell_type": "markdown", - "id": "cbcd112c418fcaa4", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up nanowire parameters" @@ -33,10 +29,8 @@ { "cell_type": "code", "execution_count": null, - "id": "2269749714d81b93", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "MILLER_INDICES= (0,0,1) # Miller indices of the nanowire direction\n", @@ -48,10 +42,8 @@ }, { "cell_type": "markdown", - "id": "65c906791f69bac9", - "metadata": { - "collapsed": false - }, + "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))." @@ -60,10 +52,8 @@ { "cell_type": "code", "execution_count": null, - "id": "6dac92b719d539ec", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -79,10 +69,8 @@ }, { "cell_type": "markdown", - "id": "2fe1d71e1b02aed9", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -90,10 +78,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b95701d7a0e593fe", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -104,10 +90,8 @@ }, { "cell_type": "markdown", - "id": "a8ebe61794b2e803", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -115,10 +99,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c98ec170f3ee6d24", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -128,10 +110,8 @@ }, { "cell_type": "markdown", - "id": "38ecf94e650e268d", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create nanowire\n", "### 2.1. Create a slab and cut a cylinder" @@ -140,10 +120,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c4b34b3287960dcc", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "import math\n", @@ -169,10 +147,8 @@ }, { "cell_type": "markdown", - "id": "ae940638396f93a6", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Rotate to align along X axis (optional)" ] @@ -180,10 +156,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7401ab24726bf4e5", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", @@ -193,10 +167,8 @@ }, { "cell_type": "markdown", - "id": "d8f41816d0b48edc", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -204,10 +176,8 @@ { "cell_type": "code", "execution_count": null, - "id": "aea078560283ca95", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", @@ -217,10 +187,8 @@ }, { "cell_type": "markdown", - "id": "a212abe25bf59b4f", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -228,10 +196,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cdaf612bc6198546", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_nanowire_custom_shape.ipynb b/other/materials_designer/create_nanowire_custom_shape.ipynb index 23200288..b043e82f 100644 --- a/other/materials_designer/create_nanowire_custom_shape.ipynb +++ b/other/materials_designer/create_nanowire_custom_shape.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "bfcbf5c3f9adb668", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a nanowire with a custom cross-section shape\n", "\n", @@ -21,20 +19,16 @@ }, { "cell_type": "markdown", - "id": "e3702ff2a5270ce6", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment" ] }, { "cell_type": "markdown", - "id": "e4fdd50d405fcd11", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -43,10 +37,8 @@ { "cell_type": "code", "execution_count": null, - "id": "bd0fdddfd8880b40", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -62,10 +54,8 @@ }, { "cell_type": "markdown", - "id": "dcf793dd6eecabb8", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set up transformation parameters " ] @@ -73,10 +63,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e93f72e7c37dea10", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "from typing import List\n", @@ -114,10 +102,8 @@ }, { "cell_type": "markdown", - "id": "f348991bf39a14e7", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -125,10 +111,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b72580121ca40d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -139,10 +123,8 @@ }, { "cell_type": "markdown", - "id": "aa183a2ac1a6993", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -150,10 +132,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d3cba46f185c1a1b", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -163,10 +143,8 @@ }, { "cell_type": "markdown", - "id": "ba9e20ebe63ffda7", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 2. Create nanowire\n", "### 2.1. Create a slab and cut a cylinder" @@ -175,10 +153,8 @@ { "cell_type": "code", "execution_count": null, - "id": "2795d5bdbbaafbe6", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", @@ -200,10 +176,8 @@ }, { "cell_type": "markdown", - "id": "751d9531a5e5bf86", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "### 2.2. Rotate the nanowire to align along X axis" ] @@ -211,10 +185,8 @@ { "cell_type": "code", "execution_count": null, - "id": "87534e47ecdb9dc6", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "rotate_90_degree_matrix = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n", @@ -224,10 +196,8 @@ }, { "cell_type": "markdown", - "id": "d8f41816d0b48edc", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -235,10 +205,8 @@ { "cell_type": "code", "execution_count": null, - "id": "aea078560283ca95", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "outputs": [], "source": [ "visualize(nanowire, repetitions=[1, 1, 1], rotation=\"0x\")\n", @@ -248,10 +216,8 @@ }, { "cell_type": "markdown", - "id": "a212abe25bf59b4f", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -259,10 +225,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cdaf612bc6198546", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_perturbation.ipynb b/other/materials_designer/create_perturbation.ipynb index e8f00862..b45b7637 100644 --- a/other/materials_designer/create_perturbation.ipynb +++ b/other/materials_designer/create_perturbation.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "367a698b29e22bd7", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Perturbation in a Material\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "193a4e6a78fd5bd7", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up perturbation parameters" @@ -38,10 +34,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a40d7b697c413113", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# string representation of the perturbation function, function of x, y, z variables\n", @@ -56,10 +50,8 @@ }, { "cell_type": "markdown", - "id": "49c9f5022d50517e", - "metadata": { - "collapsed": false - }, + "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))." @@ -68,10 +60,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c6d9f8e57bef2f91", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -88,10 +78,8 @@ }, { "cell_type": "markdown", - "id": "edf02101e27a2742", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials\n", "Materials are loaded with `get_materials()`." @@ -100,10 +88,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e0c53233ce728cc1", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -113,10 +99,8 @@ }, { "cell_type": "markdown", - "id": "cf29b7f6fe114d8f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] @@ -124,10 +108,8 @@ { "cell_type": "code", "execution_count": null, - "id": "897ba7aa4e402d24", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -140,10 +122,8 @@ }, { "cell_type": "markdown", - "id": "39a93c4635762a83", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the SineWave Perturbation\n", "### 2.1. Set sine wave perturbation parameters\n", @@ -153,10 +133,8 @@ { "cell_type": "code", "execution_count": null, - "id": "1991efeeebe39db4", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_perturbation\n", @@ -171,10 +149,8 @@ }, { "cell_type": "markdown", - "id": "eecd561cd92fb18a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 3. Visualize the Result" ] @@ -182,10 +158,8 @@ { "cell_type": "code", "execution_count": null, - "id": "1ee393a7f2ec3bc8", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -198,10 +172,8 @@ }, { "cell_type": "markdown", - "id": "9e0b241366592109", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -209,10 +181,8 @@ { "cell_type": "code", "execution_count": null, - "id": "29dfa0a329cca2fa", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_perturbation_custom.ipynb b/other/materials_designer/create_perturbation_custom.ipynb index 9a1533e4..5087821e 100644 --- a/other/materials_designer/create_perturbation_custom.ipynb +++ b/other/materials_designer/create_perturbation_custom.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "367a698b29e22bd7", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Custom Perturbation in a Material\n", "\n", @@ -27,20 +25,16 @@ }, { "cell_type": "markdown", - "id": "193a4e6a78fd5bd7", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment" ] }, { "cell_type": "markdown", - "id": "f38b2711726e5859", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -49,10 +43,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7a6e28cfae1a7b46", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -69,10 +61,8 @@ }, { "cell_type": "markdown", - "id": "11db992e02891067", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set Generic Perturbation Parameters" ] @@ -80,10 +70,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a40d7b697c413113", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "# Set whether to preserve geodesic distance and scale the cell accordingly to match PBC\n", @@ -98,10 +86,8 @@ }, { "cell_type": "markdown", - "id": "e6a19c741406eafe", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Define Custom Perturbation Function\n", "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." @@ -110,10 +96,8 @@ { "cell_type": "code", "execution_count": null, - "id": "203911c2413c7447", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -134,10 +118,8 @@ }, { "cell_type": "markdown", - "id": "edf02101e27a2742", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "### 1.4. Get input materials\n", "Materials are loaded with `get_materials()`." @@ -146,10 +128,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e0c53233ce728cc1", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -159,10 +139,8 @@ }, { "cell_type": "markdown", - "id": "cf29b7f6fe114d8f", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "### 1.5. Create and preview Supercell" ] @@ -170,10 +148,8 @@ { "cell_type": "code", "execution_count": null, - "id": "897ba7aa4e402d24", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -186,10 +162,8 @@ }, { "cell_type": "markdown", - "id": "6d4adf0d580e0340", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 2. Create a target material\n", "### 2.1. Set custom perturbation parameters\n" @@ -198,10 +172,8 @@ { "cell_type": "code", "execution_count": null, - "id": "8d90932312c418ee", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_perturbation\n", @@ -217,10 +189,8 @@ }, { "cell_type": "markdown", - "id": "10e7ca8950839991", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "### 3. Visualize the Material" ] @@ -228,10 +198,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cbfe0878a16f6c83", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "outputs": [], "source": [ "visualize([\n", @@ -242,10 +210,8 @@ }, { "cell_type": "markdown", - "id": "9e0b241366592109", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -253,10 +219,8 @@ { "cell_type": "code", "execution_count": null, - "id": "29dfa0a329cca2fa", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index 32f3a1af..dc381187 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create Multiple Point Defects in a Bulk Material\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -37,8 +33,11 @@ ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Selected material will be used as a unit cell to create a supercell first.\n", "SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 3]]\n", @@ -64,25 +63,23 @@ " \"placement_method\": \"voronoi_site\",\n", " },\n", "]" - ], - "id": "5381fc1b249aec6a", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -94,51 +91,42 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "id": "cff4001d6747796e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "e2d24109d3068c9e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", @@ -146,24 +134,23 @@ "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5da5b0380583c952", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create Multiple Defects\n", "### 2.1. Prepare defect dictionaries and validate them" ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import PointDefectDict\n", "defect_dicts = [PointDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]\n", @@ -177,20 +164,22 @@ " print(f\" - Element: {defect_dict['element']}\")\n", " \n", "print(f\"\\nTotal defects to create: {len(DEFECT_CONFIGS)}\")" - ], - "id": "26cb7d7e372468ee", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Create multiple defects using the newer approach", - "id": "70515db37f45bb66" + "id": "11", + "metadata": {}, + "source": [ + "### 2.2. Create multiple defects using the newer approach" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", @@ -201,27 +190,22 @@ "\n", "print(f\"Original atoms: {len(supercell.basis.elements.ids)}\")\n", "print(f\"Final atoms: {len(material_with_defects.basis.elements.ids)}\")" - ], - "id": "dfeddc9c3c0954a1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -230,33 +214,29 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defects, \"title\": f\"Material with defects\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "bd4fa88a015b0dd4", + "execution_count": null, + "id": "16", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "# Set the material name and pass to outside runtime\n", "material_with_defects.name = f\"{unit_cell.name} with {len(DEFECT_CONFIGS)} defects\"\n", "set_materials([material_with_defects])" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index 0d786a92..44fb301a 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "95a274d80df28ccd", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a slab with specified termination\n", "\n", @@ -29,10 +27,8 @@ }, { "cell_type": "markdown", - "id": "d55eaee8bc55bffd", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " @@ -41,10 +37,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b64735060047bec", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Enable interactive selection of terminations via UI prompt\n", @@ -65,10 +59,8 @@ }, { "cell_type": "markdown", - "id": "5e0ce05f6f031b3f", - "metadata": { - "collapsed": false - }, + "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))." @@ -77,10 +69,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b457673560550933", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -96,10 +86,8 @@ }, { "cell_type": "markdown", - "id": "1659a8e9afe434fb", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -107,10 +95,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b588ccfe51967a86", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -121,10 +107,8 @@ }, { "cell_type": "markdown", - "id": "8c13970a869adfa9", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -132,10 +116,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c4f6e2697f97965f", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -145,10 +127,8 @@ }, { "cell_type": "markdown", - "id": "6634dae92a6c07b9", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Configure slab and select termination\n", "\n", @@ -159,10 +139,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3ad6765249610aa4", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", @@ -172,10 +150,8 @@ }, { "cell_type": "markdown", - "id": "afb4c9bb89c8690b", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Get possible terminations for the slabs" ] @@ -183,10 +159,8 @@ { "cell_type": "code", "execution_count": null, - "id": "70bec9d69d58b28a", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "slab_terminations = analyzer.terminations" @@ -194,10 +168,8 @@ }, { "cell_type": "markdown", - "id": "c6e2e18452972b21", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "### 2.3. Visualize slabs for all possible terminations" ] @@ -205,10 +177,8 @@ { "cell_type": "code", "execution_count": null, - "id": "246cb1f0437dbde0", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "\n", @@ -219,10 +189,8 @@ }, { "cell_type": "markdown", - "id": "c06cd779e3b76a5f", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 2.4. Print terminations for the Slab" ] @@ -230,10 +198,8 @@ { "cell_type": "code", "execution_count": null, - "id": "92bdfc42a0d8e0c", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "print(\"Terminations\")\n", @@ -243,10 +209,8 @@ }, { "cell_type": "markdown", - "id": "51e59fdb80b92b2d", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "### 2.5. Select termination for the Slab" ] @@ -254,10 +218,8 @@ { "cell_type": "code", "execution_count": null, - "id": "905e116e59b3e16e", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import select_slab_termination\n", @@ -278,10 +240,8 @@ }, { "cell_type": "markdown", - "id": "143bc82b430b37d5", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "source": [ "## 3. Create the slab with selected termination\n", "\n", @@ -291,10 +251,8 @@ { "cell_type": "code", "execution_count": null, - "id": "aeeac03a236fe058", - "metadata": { - "collapsed": false - }, + "id": "20", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -312,10 +270,8 @@ }, { "cell_type": "markdown", - "id": "301dd99ed1425f62", - "metadata": { - "collapsed": false - }, + "id": "21", + "metadata": {}, "source": [ "## 4. Visualize the resulting slab" ] @@ -323,10 +279,8 @@ { "cell_type": "code", "execution_count": null, - "id": "19b8867953bc3f1b", - "metadata": { - "collapsed": false - }, + "id": "22", + "metadata": {}, "outputs": [], "source": [ "visualize(slab, repetitions=[1, 1, 1], rotation=\"0x\")" @@ -334,10 +288,8 @@ }, { "cell_type": "markdown", - "id": "d667623ad5f2e061", - "metadata": { - "collapsed": false - }, + "id": "23", + "metadata": {}, "source": [ "# 5. Pass material to the outside runtime" ] @@ -345,10 +297,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3705115f04ac0010", - "metadata": { - "collapsed": false - }, + "id": "24", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_supercell.ipynb b/other/materials_designer/create_supercell.ipynb index 9446b2d2..a56be503 100644 --- a/other/materials_designer/create_supercell.ipynb +++ b/other/materials_designer/create_supercell.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "bfcbf5c3f9adb668", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a supercell\n", "\n", @@ -21,10 +19,8 @@ }, { "cell_type": "markdown", - "id": "e3702ff2a5270ce6", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up transformation parameters " @@ -33,10 +29,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e93f72e7c37dea10", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "SUPERCELL_MATRIX = [\n", @@ -51,10 +45,8 @@ }, { "cell_type": "markdown", - "id": "9f3ffe460d75942f", - "metadata": { - "collapsed": false - }, + "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))." @@ -63,10 +55,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9eb0650f7183279c", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -82,10 +72,8 @@ }, { "cell_type": "markdown", - "id": "f348991bf39a14e7", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -93,10 +81,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b72580121ca40d0", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -107,10 +93,8 @@ }, { "cell_type": "markdown", - "id": "aa183a2ac1a6993", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -118,10 +102,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d3cba46f185c1a1b", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -132,10 +114,8 @@ }, { "cell_type": "markdown", - "id": "ba9e20ebe63ffda7", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create supercell" ] @@ -143,10 +123,8 @@ { "cell_type": "code", "execution_count": null, - "id": "2795d5bdbbaafbe6", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", @@ -159,10 +137,8 @@ }, { "cell_type": "markdown", - "id": "d8f41816d0b48edc", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -170,10 +146,8 @@ { "cell_type": "code", "execution_count": null, - "id": "aea078560283ca95", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")\n", @@ -182,10 +156,8 @@ }, { "cell_type": "markdown", - "id": "a212abe25bf59b4f", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -193,10 +165,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cdaf612bc6198546", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb index ccde4fe6..847c952a 100644 --- a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb +++ b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "536d623ca076bbdd", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ " # Create a Twisted Interface with Commensurate Lattices\n", "\n", @@ -39,10 +37,8 @@ }, { "cell_type": "markdown", - "id": "cc65bd914eecf844", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -52,10 +48,8 @@ { "cell_type": "code", "execution_count": null, - "id": "be4987fdf0286ebb", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Material selection and basic parameters\n", @@ -87,10 +81,8 @@ }, { "cell_type": "markdown", - "id": "5ffda79fd5cad69", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Install packages\n", "Explanation is [here](under_the_hood.ipynb#1.2.-Install-packages)." @@ -99,10 +91,8 @@ { "cell_type": "code", "execution_count": null, - "id": "9f851434739f468a", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -118,10 +108,8 @@ }, { "cell_type": "markdown", - "id": "111e138010f911c", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load and preview input materials\n", "Explanation is [here](under_the_hood.ipynb#2.-Data-Exchange)." @@ -130,10 +118,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d3a815612098f191", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -143,10 +129,8 @@ }, { "cell_type": "markdown", - "id": "8a01e2ba7092ecbe", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ " ## 2. Prepare Materials\n", " ### 2.1. Select and visualize initial materials" @@ -155,10 +139,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c920d29700ada27a", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -174,10 +156,8 @@ }, { "cell_type": "markdown", - "id": "ce38ef341148321", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 3. Create Twisted Interface\n", "### 3.1. Create slab and commensurate interface\n" @@ -186,10 +166,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d48726a8e99c5590", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", @@ -222,10 +200,8 @@ }, { "cell_type": "markdown", - "id": "211084a2225f5e98", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 3.2. Interface creation results\n" ] @@ -233,10 +209,8 @@ { "cell_type": "code", "execution_count": null, - "id": "51acc60bf57a26d5", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "# The interface was created above using create_commensurate_interface\n", @@ -255,10 +229,8 @@ }, { "cell_type": "markdown", - "id": "370d3acc33cb8907", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Preview the selected material\n", "By default, the first interface is selected. You can change the selection by changing the `selected_interface` index." @@ -267,10 +239,8 @@ { "cell_type": "code", "execution_count": null, - "id": "8fa34c8952f76602", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "# The interface is already created above, so just display final results\n", @@ -290,10 +260,8 @@ }, { "cell_type": "markdown", - "id": "87b8655d47b47019", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 5. Pass data to the outside runtime\n" ] @@ -301,10 +269,8 @@ { "cell_type": "code", "execution_count": null, - "id": "28bebacd2e299c2c", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb index 8f7292c1..771bdd37 100644 --- a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb +++ b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "66b6951c7a25247c", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Twisted Interface between Nanoribbons\n", "\n", @@ -34,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "edec1dd3f8ff0782", + "id": "1", "metadata": {}, "source": [ "## 1. Prepare the Environment\n", @@ -45,10 +43,8 @@ { "cell_type": "code", "execution_count": null, - "id": "746db0506f54aeb1", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Material selection and basic parameters\n", @@ -75,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "7e386d88600feb21", + "id": "3", "metadata": {}, "source": [ "### 1.2. Install packages\n", @@ -85,10 +81,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e5ab0c9b90ba9901", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -104,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "b38044cae8eca705", + "id": "5", "metadata": {}, "source": [ "### 1.3. Load and preview input materials\n", @@ -114,10 +108,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d117934379d38f08", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -127,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "90d5d8e7cf4f4378", + "id": "7", "metadata": {}, "source": [ " ## 2. Prepare Materials\n", @@ -137,10 +129,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d934062047d9cef", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -156,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "7dc8fddf36069105", + "id": "9", "metadata": {}, "source": [ "## 3. Generate Twisted Interface\n", @@ -166,10 +156,8 @@ { "cell_type": "code", "execution_count": null, - "id": "28ed39605a8b29e", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_interface_twisted\n", @@ -206,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "53ced0bb45a414d5", + "id": "11", "metadata": {}, "source": [ "### 3.2. Generate and analyze interfaces\n" @@ -215,10 +203,8 @@ { "cell_type": "code", "execution_count": null, - "id": "5b234db939623503", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "# The interface was already created above using the manual approach\n", @@ -238,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "3deba4978643a165", + "id": "13", "metadata": {}, "source": [ "## 4. Preview the selected material\n", @@ -247,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "b1d073366e81aeaf", + "id": "14", "metadata": {}, "source": [ "### 5. Pass data to the outside runtime\n" @@ -256,10 +242,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4660ac6aad47b522", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", @@ -270,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b231dde70694dd41", + "id": "16", "metadata": {}, "outputs": [], "source": [] diff --git a/other/materials_designer/custom_transformation.ipynb b/other/materials_designer/custom_transformation.ipynb index fd09417a..462441e4 100644 --- a/other/materials_designer/custom_transformation.ipynb +++ b/other/materials_designer/custom_transformation.ipynb @@ -2,24 +2,22 @@ "cells": [ { "cell_type": "markdown", + "id": "0", + "metadata": {}, "source": [ "# Development Notebook\n", "\n", "This notebook enables loading materials and performing custom transformations with Python. The transformed materials can then be passed to the Materials Designer or saved to a folder. Necessary packages are installed and imported below.\n", "## 1. Setup Notebook\n", "### 1.1 Install packages" - ], - "metadata": { - "collapsed": false - }, - "id": "36708f17f40b64cb" + ] }, { "cell_type": "code", - "id": "initial_id", - "metadata": { - "collapsed": true - }, + "execution_count": null, + "id": "1", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -31,108 +29,102 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "2", + "metadata": {}, "source": [ "### 1.2 Import necessary packages" - ], - "metadata": { - "collapsed": false - }, - "id": "8185aca94726dc8f" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "# Material class to hold structural data\n", "from mat3ra.made.material import Material\n", "# Materials class with JSONs of selected materials\n", "from mat3ra.standata.materials import Materials" - ], - "metadata": { - "collapsed": false - }, - "id": "b2fa69b96b195d30", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "4", + "metadata": {}, "source": [ "## 2. Load materials\n", "From the Materials Designer list, \"uploads\" folder, or Standata." - ], - "metadata": { - "collapsed": false - }, - "id": "c783d38d94a627e4" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", - "materials = get_materials(globals()) or [Material(Materials.get_by_name_first_match(\"Graphene\"))]" - ], - "metadata": { - "collapsed": false - }, - "id": "54e68de6c6cc3e03", - "outputs": [], - "execution_count": null + "materials = get_materials(globals()) or [Material.create(Materials.get_by_name_first_match(\"Graphene\"))]" + ] }, { "cell_type": "markdown", + "id": "6", + "metadata": {}, "source": [ "## 3. Transform materials" - ], - "metadata": { - "collapsed": false - }, - "id": "6ca73dec2609be4a" + ] }, { "cell_type": "code", - "source": "new_material = materials[0]", - "metadata": { - "collapsed": false - }, - "id": "91069f5712a65dbb", + "execution_count": null, + "id": "7", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "new_material = materials[0]" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 4. Preview transformed materials", - "id": "eab6d997ef1eafd4" + "id": "8", + "metadata": {}, + "source": [ + "## 4. Preview transformed materials" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials(new_material, viewer=\"wave\")" - ], - "id": "1029505318aa3656", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "source": "## 5. Save transformed materials", - "metadata": { - "collapsed": false - }, - "id": "296f89e8dde270ed" + "id": "10", + "metadata": {}, + "source": [ + "## 5. Save transformed materials" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", @@ -140,13 +132,7 @@ "set_materials(new_material)\n", "# for idx, material in enumerate(new_materials):\n", "# download_content_to_file(new_materials, f\"new_material_{idx}.json\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7973f7ee67bdc42a", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/import_materials_from_standata.ipynb b/other/materials_designer/import_materials_from_standata.ipynb index 05cdbcf8..a09dc434 100644 --- a/other/materials_designer/import_materials_from_standata.ipynb +++ b/other/materials_designer/import_materials_from_standata.ipynb @@ -2,6 +2,8 @@ "cells": [ { "cell_type": "markdown", + "id": "0", + "metadata": {}, "source": [ "# Import materials from Standata\n", "\n", @@ -13,24 +15,22 @@ "2. Run the second cell to get the list of available materials.\n", "3. Run the third cell to select a material by name.\n", "4. Run the fourth cell to select materials by categories\n" - ], - "metadata": { - "collapsed": false - }, - "id": "ffad30f04755fde0" + ] }, { "cell_type": "markdown", + "id": "1", + "metadata": {}, "source": [ "## 1. Install the required libraries" - ], - "metadata": { - "collapsed": false - }, - "id": "3a21510793fa71f1" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -43,52 +43,44 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "7a8c49f4612498a6", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "3", + "metadata": {}, "source": [ "## 2. Get materials\n", "### 2.1. List the names of available materials" - ], - "metadata": { - "collapsed": false - }, - "id": "bd6a3ff0c7b23744" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "\n", "Materials.get_names()" - ], - "metadata": { - "collapsed": false - }, - "id": "494aa9dceabed0e1", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "5", + "metadata": {}, "source": [ "### 2.2. Select a material by name\n", "A partial name match can be used to select a material." - ], - "metadata": { - "collapsed": false - }, - "id": "c29a8101462297ad" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from utils.visualize import visualize_materials\n", @@ -98,26 +90,22 @@ "material_by_name = Material.create(Materials.get_by_name(\"Graphene\")[0])\n", "material_by_name_first_match = Material.create(Materials.get_by_name_first_match(\"Graphene\"))\n", "visualize_materials([material_by_name, material_by_name_first_match], viewer=\"wave\")" - ], - "metadata": { - "collapsed": false - }, - "id": "a570e2668e86dfab", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "7", + "metadata": {}, "source": [ "### 2.3. Select materials by categories" - ], - "metadata": { - "collapsed": false - }, - "id": "456456a81a911d66" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "materials_2d_jsons = Materials.get_by_categories(\"2D\")\n", "materials_2d = [Material.create(material_json) for material_json in materials_2d_jsons]\n", @@ -127,37 +115,27 @@ "\n", "visualize_materials(materials_2d)\n", "visualize_materials(materials_3d_insulator)" - ], - "metadata": { - "collapsed": false - }, - "id": "5f192496ce7776af", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "9", + "metadata": {}, "source": [ "## 3. Pass data to the outside runtime" - ], - "metadata": { - "collapsed": false - }, - "id": "937e08e1120711f0" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(materials_2d + materials_3d_insulator)" - ], - "metadata": { - "collapsed": false - }, - "id": "dcb45a2daead9d55", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/passivate_edge.ipynb b/other/materials_designer/passivate_edge.ipynb index 8dbd2e23..903e9151 100644 --- a/other/materials_designer/passivate_edge.ipynb +++ b/other/materials_designer/passivate_edge.ipynb @@ -2,18 +2,14 @@ "cells": [ { "cell_type": "markdown", - "id": "759c70b8d39addc3", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [] }, { "cell_type": "markdown", - "id": "4f5cab1ebbbe954", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "# Create Edge Passivation\n", "Passivate material edges by detecting and adding passivants to undercoordinated atoms (atoms with fewer neighbors than bulk).\n", @@ -35,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "f63b28f159207878", + "id": "2", "metadata": {}, "source": [ "## 1. Prepare the Environment\n", @@ -49,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e8d8696bb1035e5", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -77,10 +73,8 @@ }, { "cell_type": "markdown", - "id": "975da798561ccde8", - "metadata": { - "collapsed": false - }, + "id": "4", + "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`.\n" @@ -89,10 +83,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b010bef5b031158", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -109,10 +101,8 @@ }, { "cell_type": "markdown", - "id": "7df321ca07e11daa", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Load and preview input material\n" ] @@ -120,10 +110,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3a53ff74253cb09a", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -140,10 +128,8 @@ }, { "cell_type": "markdown", - "id": "b5940fc50c11c7b8", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "## 2. Analyze Coordination Numbers and Select Threshold\n", "### 2.1. Plot RDF to estimate coordination search radius" @@ -152,10 +138,8 @@ { "cell_type": "code", "execution_count": null, - "id": "575e8fba623c06e4", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from utils.plot import plot_rdf\n", @@ -165,10 +149,8 @@ }, { "cell_type": "markdown", - "id": "b89dc754926f1ce4", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "### 2.2. Get coordination numbers and set coordination threshold" ] @@ -176,10 +158,8 @@ { "cell_type": "code", "execution_count": null, - "id": "54c265d8ca9408af", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from utils.io import select_coordination_threshold\n", @@ -213,10 +193,8 @@ }, { "cell_type": "markdown", - "id": "b873d2cb6eaa2bdb", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 3. Create Passivated Material\n", "### 3.1. Set up passivation parameters\n" @@ -225,10 +203,8 @@ { "cell_type": "code", "execution_count": null, - "id": "aca1c76a52e5376a", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "passivation_params = {\n", @@ -247,10 +223,8 @@ }, { "cell_type": "markdown", - "id": "e40b5f67ef5b54aa", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "### 3.2. Generate passivated structure\n" ] @@ -258,10 +232,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3c36dc3654f544c1", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_dangling_bonds\n", @@ -283,10 +255,8 @@ }, { "cell_type": "markdown", - "id": "ad96b86aef8b28f5", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Visualize the result" ] @@ -294,10 +264,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d08ff21e3650ba5d", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", @@ -307,10 +275,8 @@ }, { "cell_type": "markdown", - "id": "7151e48eae3b1886", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "source": [ "## 5. Pass data to the outside runtime\n" ] @@ -318,10 +284,8 @@ { "cell_type": "code", "execution_count": null, - "id": "2d69736d0c71858c", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index 3310136f..26da3ada 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "7d00c63281a63fa0", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Passivate Slab Surface\n", "\n", @@ -28,10 +26,8 @@ }, { "cell_type": "markdown", - "id": "d80280b47f767281", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -45,10 +41,8 @@ { "cell_type": "code", "execution_count": null, - "id": "92b3518bebdcf547", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Material selection\n", @@ -81,10 +75,8 @@ }, { "cell_type": "markdown", - "id": "11bd9b5fca1510fc", - "metadata": { - "collapsed": false - }, + "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`." @@ -93,10 +85,8 @@ { "cell_type": "code", "execution_count": null, - "id": "42863fe84bfab53c", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -114,10 +104,8 @@ }, { "cell_type": "markdown", - "id": "6983ab284dff18c0", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load and preview input material" ] @@ -125,10 +113,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a51551f4af6456c7", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -139,10 +125,8 @@ }, { "cell_type": "markdown", - "id": "6b929ffec7c4876e", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create a slab if the input material is not a slab" ] @@ -150,10 +134,8 @@ { "cell_type": "code", "execution_count": null, - "id": "ad71f877f76f0550", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration\n", @@ -179,10 +161,8 @@ }, { "cell_type": "markdown", - "id": "cee250785246811a", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create target material\n", "### 2.1. Passivate the slab surface\n" @@ -191,10 +171,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a4ed473eb2129ac4", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_surface\n", @@ -218,10 +196,8 @@ }, { "cell_type": "markdown", - "id": "56ec05c6ed2f91cd", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -229,10 +205,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c4b5e1e0ec0ab02a", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", @@ -242,10 +216,8 @@ }, { "cell_type": "markdown", - "id": "eab7e14d2c7880a5", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "### 4. Pass data to the outside runtime\n" ] @@ -253,10 +225,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d66a15a29d27c6ea", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index 7229e93a..063a7ca8 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "aa0a426af23f6def", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Grain Boundary 3D FCC Metals (Copper)\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "bff2f2c26b1fa6ba", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -39,10 +35,10 @@ }, { "cell_type": "code", - "id": "45730b0f5384262b", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "MATERIAL_NAME = \"Cu\"\n", "\n", @@ -60,16 +56,12 @@ "\n", "# Maximum area for the superlattice search algorithm\n", "MAX_AREA = 200 # in Angstrom^2\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "2460242f9e7d86f1", - "metadata": { - "collapsed": false - }, + "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`." @@ -77,10 +69,10 @@ }, { "cell_type": "code", - "id": "bae18ae87d3cc5ba", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -92,65 +84,53 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_grain_boundary.ipynb\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "97eb71c0c9e31d2a", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "950e5bef61bbd84a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "\n", "material = MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "c4eb191c2e23b464", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview Material" ] }, { "cell_type": "code", - "id": "4ebde830102b0b94", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([material], repetitions=[3, 3, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "916ab91fcc23c7df", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create grain boundary\n", "\n", @@ -160,20 +140,18 @@ }, { "cell_type": "markdown", - "id": "9e507e0b1534c0c5", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "### 2.2. Get possible terminations for the slabs" ] }, { "cell_type": "code", - "id": "5bdc0e37e3ec9891", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_slab_terminations\n", "\n", @@ -186,26 +164,22 @@ "print(f\"Phase 2 Terminations:\")\n", "for idx, termination in enumerate(phase_2_terminations):\n", " print(f\" {idx}: {termination}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "aebec268223b617c", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "### 2.3. Visualize slabs for all possible terminations" ] }, { "cell_type": "code", - "id": "f75092312b399f84", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "\n", @@ -218,13 +192,11 @@ " repetitions=[3, 3, 1], rotation=\"-90x\")\n", "visualize([{\"material\": slab, \"title\": slab.name} for slab in phase_2_slabs],\n", " repetitions=[3, 3, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "df2fe7c010c0e4d2", + "id": "14", "metadata": {}, "source": [ "### 2.4. Create slabs with specified Miller indices and thickness" @@ -232,8 +204,10 @@ }, { "cell_type": "code", - "id": "29dd6499", + "execution_count": null, + "id": "15", "metadata": {}, + "outputs": [], "source": [ "# Create phase 1 slab\n", "phase_1_slab = create_slab(\n", @@ -258,26 +232,22 @@ "# Visualize the phase slabs\n", "visualize([{\"material\": phase_1_slab, \"title\": \"Phase 1 Slab\"}, {\"material\": phase_2_slab, \"title\": \"Phase 2 Slab\"}],\n", " repetitions=[2, 2, 1], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8d87cbbb0d1ac1ab", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "### 2.5. Create Grain Boundary" ] }, { "cell_type": "code", - "id": "40b6c8662d071f18", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_grain_boundary_planar\n", "\n", @@ -294,57 +264,47 @@ " max_length_tol = 0.05,\n", " max_angle_tol = 0.02,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "3c6187f70eb5beac", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "source": [ "## 3. Visualize the Material" ] }, { "cell_type": "code", - "id": "892c0e7c932cd725", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "19", + "metadata": {}, + "outputs": [], "source": [ "visualize([grain_boundary], repetitions=[1, 1, 1], viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "479d26e4a9e77d44", - "metadata": { - "collapsed": false - }, + "id": "20", + "metadata": {}, "source": [ "## 4. Save the final material" ] }, { "cell_type": "code", - "id": "503eff0dd5c1a160", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "21", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(grain_boundary)\n", "download_content_to_file(grain_boundary.to_json(),\n", " f\"{MATERIAL_NAME}-{PHASE_1_MILLER_INDICES}-{PHASE_2_MILLER_INDICES}_grain_boundary.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index 79e844d7..1e58b1a5 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Pt Adatoms Island on MoS2\n", "\n", @@ -25,10 +23,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " @@ -36,10 +32,10 @@ }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "\n", "# Slab parameters\n", @@ -70,16 +66,12 @@ " [5 / 9, 7 / 9, 0], # 3rd atom, next clockwise atop Mo\n", " [4 / 9, 5 / 9, 0], # 4th topmost atom, atop S\n", "]\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." @@ -87,10 +79,10 @@ }, { "cell_type": "code", - "id": "ef664b14457530fd", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -103,16 +95,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material\n", "Materials are loaded with `get_materials()`." @@ -120,10 +108,10 @@ }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.standata.materials import Materials\n", @@ -134,24 +122,22 @@ "# Preview materials\n", "visualize_materials([substrate])\n", "visualize_materials([substrate], rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Slab" ] }, { "cell_type": "code", - "id": "f174b6be", + "execution_count": null, + "id": "8", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", @@ -166,23 +152,19 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5da5b0380583c952", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defects" ] }, { "cell_type": "markdown", - "id": "174048812b11801e", + "id": "10", "metadata": {}, "source": [ "#### 2.1. Create the defct dictionaries" @@ -190,8 +172,10 @@ }, { "cell_type": "code", - "id": "15bb5f2376e31ea7", + "execution_count": null, + "id": "11", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defective_structures.two_dimensional.adatom.types import AdatomDefectDict\n", "DEFECT_DICTS = [\n", @@ -204,13 +188,11 @@ " })\n", " for i, coordinate in enumerate(COORDINATES)\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "f31763784a1abb19", + "id": "12", "metadata": {}, "source": [ "### 2.2. Create the defects" @@ -218,10 +200,10 @@ }, { "cell_type": "code", - "id": "e385e50ae11ed2b9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", @@ -230,60 +212,50 @@ " defect_dicts=DEFECT_DICTS,\n", " placement_method=PLACEMENT_METHOD,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 3. Visualize the Slabs with Adatom" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "set_materials([slab_with_adatom])\n", "download_content_to_file(slab_with_adatom.to_json(), \"MoS2_Pt_island.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index 090bd035..4659a529 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Oxygen interstitial Defect(s) in SnO.\n", "\n", @@ -25,10 +23,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -37,10 +33,10 @@ }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "MATERIAL_NAME = \"SnO\"\n", "SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 2]]\n", @@ -59,16 +55,12 @@ " \"placement_method\": \"voronoi_site\"\n", " }\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." @@ -76,10 +68,10 @@ }, { "cell_type": "code", - "id": "ef664b14457530fd", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -91,80 +83,73 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "e2d24109d3068c9e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5da5b0380583c952", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defects" ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.1. Prepare defect dictionaries and validate them", - "id": "234014d6805389dc" + "id": "10", + "metadata": {}, + "source": [ + "### 2.1. Prepare defect dictionaries and validate them" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", "\n", @@ -174,23 +159,22 @@ " \"element\": defect_config.get(\"element\", None),\n", " \"placement_method\": defect_config[\"placement_method\"]\n", "}) for defect_config in DEFECT_CONFIGS]" - ], - "id": "ec41ec63522add17", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Create the defects", - "id": "1fa23225ececfb54" + "id": "12", + "metadata": {}, + "source": [ + "### 2.2. Create the defects" + ] }, { "cell_type": "code", - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", @@ -198,61 +182,51 @@ " supercell,\n", " defect_dicts=defect_dicts,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", "\n", "material_with_defect.name = \"Sn15 O17, Interstitial O Defect\"\n", "set_materials([material_with_defect])\n", "download_content_to_file(material_with_defect.to_json(), f\"{material_with_defect.name}.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index 39e4952a..3dac12c4 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "4f901763903359e6", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Vacancy and Substitutional defect pair in GaN\n", "\n", @@ -16,10 +14,8 @@ }, { "cell_type": "markdown", - "id": "7863267c827cfbc2", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -28,8 +24,10 @@ }, { "cell_type": "code", - "id": "f941f8a0bb45817f", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -48,13 +46,11 @@ " coordinate=[0.5, 0.5, 0.65],\n", " placement_method=\"closest_site\",\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "808283dd8fe53a58", + "id": "3", "metadata": {}, "source": [ "### 1.2. Install Packages\n", @@ -63,8 +59,10 @@ }, { "cell_type": "code", - "id": "e02d623e22f90fc7", + "execution_count": null, + "id": "4", "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -76,16 +74,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "683ce558645b4465", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials\n", "Materials are loaded with `get_materials()`." @@ -93,10 +87,10 @@ }, { "cell_type": "code", - "id": "4a6bab14f63024d1", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", @@ -104,48 +98,43 @@ "\n", "material = Material.create(Materials.get_by_name_first_match(\"GaN\"))\n", "visualize(material)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "acfef1aa207eb977", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "4580fda63efa927e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "4391a0f444f4b64a", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defect" ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_defect_pair\n", "\n", @@ -160,61 +149,50 @@ " element_2=SECONDARY_DEFECT_CONFIG.element if hasattr(SECONDARY_DEFECT_CONFIG, \"element\") else None,\n", " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG, 'placement_method') else None,\n", ")\n" - ], - "id": "85013c49", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "f99753a31e0123a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "951f0cffe9389d5e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "1c5d8e66b5b105ee", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "b9e1aba13faf1bf0", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"Mg substitution and vacancy in GaN.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index d9504bef..c905b4a7 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f0ccd3190ce70a68", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Substitutional Point Defects in Graphene\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "aae97744e3023a1b", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -41,10 +37,10 @@ }, { "cell_type": "code", - "id": "dff59577346dbece", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Element to be placed at the site (ignored for vacancy)\n", "CHEMICAL_ELEMENT = \"N\"\n", @@ -82,16 +78,12 @@ " },\n", "\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "14d161d4b61ca219", - "metadata": { - "collapsed": false - }, + "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))." @@ -99,10 +91,10 @@ }, { "cell_type": "code", - "id": "8c6ea8b36f1a6cc", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -114,16 +106,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "da6733a515019677", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load input material\n", "In this notebook we will use the material from the `uploads` folder that has a few pre-set materials." @@ -131,84 +119,80 @@ }, { "cell_type": "code", - "id": "14c40630ba2974e6", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import load_material_from_folder\n", "\n", "material = load_material_from_folder(\"../uploads\", \"Graphene\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "9fcc51573071c301", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "6d5a793dd5e45f16", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", "\n", "supercell = create_supercell(material, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "e41cf1646620915d", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defects" ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.1. Prepare defect dictionaries and validate them", - "id": "a4be42a5a13702d4" + "id": "10", + "metadata": {}, + "source": [ + "### 2.1. Prepare defect dictionaries and validate them" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.defective_structures.zero_dimensional.point_defect.types import PointDefectDict\n", "\n", "defect_dicts = [PointDefectDict(**defect_config) for defect_config in DEFECT_CONFIGS]" - ], - "id": "67421c7bf7351e0f", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Create the defects", - "id": "8970791792365148" + "id": "12", + "metadata": {}, + "source": [ + "### 2.2. Create the defects" + ] }, { "cell_type": "code", - "id": "db2d621e2fd4bbeb", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_defects\n", "\n", @@ -216,61 +200,51 @@ " supercell,\n", " defect_dicts=defect_dicts,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "2b58b5e76bd167d8", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "d4a1e920884b1a48", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "865c3b666e06fd10", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Write resulting material to the folder" ] }, { "cell_type": "code", - "id": "7dcf867f46422fa9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"N-doped Graphene\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"N-doped_Graphene.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index f0efd198..1222f1f6 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f0ccd3190ce70a68", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Island Surface Defect Formation on TiN(001) Surface\n", "\n", @@ -24,10 +22,8 @@ }, { "cell_type": "markdown", - "id": "aae97744e3023a1b", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -37,10 +33,8 @@ { "cell_type": "code", "execution_count": null, - "id": "139422d7e6c3cb3e", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "NUMBER_OF_ADDED_LAYERS = 0.5\n", @@ -62,10 +56,8 @@ }, { "cell_type": "markdown", - "id": "bede1fdd496fb639", - "metadata": { - "collapsed": false - }, + "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))." @@ -74,10 +66,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a457db594c9e2b24", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -95,10 +85,8 @@ }, { "cell_type": "markdown", - "id": "7d419807867fb1c9", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material\n", "In this notebook we will use materials from Standata." @@ -107,10 +95,8 @@ { "cell_type": "code", "execution_count": null, - "id": "ba2d38ba55128111", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.material import Material\n", @@ -121,10 +107,8 @@ }, { "cell_type": "markdown", - "id": "3230f242ef26d70f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview Slab or create a new one" ] @@ -132,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df4c56a0", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -154,10 +138,8 @@ }, { "cell_type": "markdown", - "id": "1098e7479b4ddbe", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Target Material" ] @@ -165,10 +147,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c1dfcb6ba96a8856", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.entities.coordinate import BoxCoordinateCondition\n", @@ -189,10 +169,8 @@ }, { "cell_type": "markdown", - "id": "163254119be36953", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] @@ -200,10 +178,8 @@ { "cell_type": "code", "execution_count": null, - "id": "70d32719704d9ef2", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "visualize_materials([{\"material\": slab, \"title\": \"Original material\", \"rotation\": \"-45x\"},\n", @@ -215,10 +191,8 @@ }, { "cell_type": "markdown", - "id": "6ac5c59b901acf80", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -226,10 +200,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3ec05765edc89d01", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", diff --git a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb index 5ca9c39f..95b179ae 100644 --- a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "95a274d80df28ccd", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Step on a Platinum (211) surface\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "d55eaee8bc55bffd", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " @@ -39,10 +35,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b64735060047bec", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "MATERIAL_NAME = \"Pt\"\n", @@ -58,10 +52,8 @@ }, { "cell_type": "markdown", - "id": "5e0ce05f6f031b3f", - "metadata": { - "collapsed": false - }, + "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))." @@ -70,10 +62,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b457673560550933", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -90,10 +80,8 @@ }, { "cell_type": "markdown", - "id": "1659a8e9afe434fb", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -101,10 +89,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b588ccfe51967a86", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", @@ -115,10 +101,8 @@ }, { "cell_type": "markdown", - "id": "8c13970a869adfa9", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -126,10 +110,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c4f6e2697f97965f", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -140,10 +122,8 @@ }, { "cell_type": "markdown", - "id": "6634dae92a6c07b9", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create a step with a slab\n", "\n", @@ -154,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9d81088", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -173,10 +153,8 @@ }, { "cell_type": "markdown", - "id": "c6e2e18452972b21", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Visualize the slab" ] @@ -184,10 +162,8 @@ { "cell_type": "code", "execution_count": null, - "id": "246cb1f0437dbde0", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "visualize(slab_211, repetitions=VISUALIZATION_REPETITIONS, rotation=\"0x\")\n", @@ -196,10 +172,8 @@ }, { "cell_type": "markdown", - "id": "c9ded02269a09c24", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Create a step with terrace builder\n", "### 3.1. Setup terrace parameters" @@ -208,10 +182,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d6d9b6b5600a4eef", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from types import SimpleNamespace\n", @@ -249,10 +221,8 @@ }, { "cell_type": "markdown", - "id": "12a15e84ec43f4f3", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 3.2. Configure a terrace defect" ] @@ -260,10 +230,8 @@ { "cell_type": "code", "execution_count": null, - "id": "f838761790cb392c", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_terrace\n", @@ -289,10 +257,8 @@ }, { "cell_type": "markdown", - "id": "847971b9e20420ec", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "### 3.3. Visualize the terrace defect" ] @@ -300,10 +266,8 @@ { "cell_type": "code", "execution_count": null, - "id": "138a639f8a2b16bb", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "outputs": [], "source": [ "visualize(terrace_slab, viewer=\"wave\")" @@ -311,10 +275,8 @@ }, { "cell_type": "markdown", - "id": "d667623ad5f2e061", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "source": [ "## 4. Download materials" ] @@ -322,10 +284,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3705115f04ac0010", - "metadata": { - "collapsed": false - }, + "id": "20", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index a74d6e2e..bf683c54 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -25,9 +25,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -38,9 +36,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "FILM_MILLER_INDICES = (0, 0, 1)\n", @@ -72,9 +68,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "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))." @@ -83,9 +77,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -110,9 +102,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", @@ -124,9 +114,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.4. Preview Substrate and Film" ] @@ -134,9 +122,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -169,9 +155,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.2. Visualize slabs for all possible terminations" ] @@ -179,9 +163,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", @@ -205,9 +187,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.3. Select terminations for the Slabs" ] @@ -215,9 +195,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", @@ -427,13 +405,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index c2e44438..99426e42 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -25,9 +25,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -38,9 +36,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "FILM_MILLER_INDICES = (0, 0, 1)\n", @@ -72,9 +68,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "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))." @@ -83,9 +77,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -111,9 +103,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", @@ -125,9 +115,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.4. Preview Substrate and Film" ] @@ -135,9 +123,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -170,9 +156,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.2. Visualize slabs for all possible terminations" ] @@ -180,9 +164,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab, select_slab_termination\n", @@ -206,9 +188,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.3. Select terminations for the Slabs" ] @@ -216,9 +196,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "film_termination = select_slab_termination(film_slab_terminations, FILM_TERMINATION_FORMULA)\n", @@ -420,13 +398,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 4046d784..13ff63ff 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "536d623ca076bbdd", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Twisted Molybdenum Disulfide bilayers at various angles.\n", "\n", @@ -24,10 +22,8 @@ }, { "cell_type": "markdown", - "id": "cc65bd914eecf844", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -36,8 +32,10 @@ }, { "cell_type": "code", - "id": "81f392a7dbdd0acb", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "# Uncomment lines to reproduce specific cases from the article\n", "INTERFACE_PARAMETERS = [\n", @@ -63,16 +61,12 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [3, 3, 1]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5ffda79fd5cad69", - "metadata": { - "collapsed": false - }, + "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))." @@ -80,10 +74,10 @@ }, { "cell_type": "code", - "id": "9f851434739f468a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -95,16 +89,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "111e138010f911c", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material\n", "We'll use the MoS2 material from Standata.\n" @@ -112,8 +102,10 @@ }, { "cell_type": "code", - "id": "a8d47cc0e54bca82", + "execution_count": null, + "id": "6", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -128,13 +120,11 @@ "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "fe47bcbd429ee0d5", + "id": "7", "metadata": {}, "source": [ " ## 3. Generate Twisted Interface\n", @@ -143,8 +133,10 @@ }, { "cell_type": "code", - "id": "dcf5e2daa1d04a62", + "execution_count": null, + "id": "8", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", @@ -160,13 +152,11 @@ "slab = translate_to_z_level(slab, \"center\")\n", "\n", "visualize_materials(slab, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8c4c87d9ff529b17", + "id": "9", "metadata": {}, "source": [ "### 3.2. Create twisted interfaces" @@ -174,8 +164,10 @@ }, { "cell_type": "code", - "id": "ec61eca814b922f5", + "execution_count": null, + "id": "10", "metadata": {}, + "outputs": [], "source": [ "interfaces = []\n", "for parameters in INTERFACE_PARAMETERS:\n", @@ -191,36 +183,32 @@ " )\n", " interfaces.append(interface)\n", " print(f\"Created interface with twist angle {parameters['angle']}° and {len(interface.basis.elements.ids)} atoms\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "370d3acc33cb8907", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 4. Preview the materials\n" ] }, { "cell_type": "code", - "id": "65811e9ed95eb5db", + "execution_count": null, + "id": "12", "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "for interface in interfaces:\n", " visualize_materials(interface, viewer=\"wave\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "c395226b74ee0ea1", + "id": "13", "metadata": {}, "source": [ "## 5. Download materials\n" @@ -228,8 +216,10 @@ }, { "cell_type": "code", - "id": "d548c123372d9205", + "execution_count": null, + "id": "14", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -237,9 +227,7 @@ "\n", "for idx, interface in enumerate(interfaces):\n", " download_content_to_file(interface.to_json(), f\"twisted_interface_{idx}.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index dd2f6e40..9d83289c 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "6b26b3bd88c951b3", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Twisted bilayer Boron Nitride (TBBN).\n", "\n", @@ -31,10 +29,8 @@ }, { "cell_type": "markdown", - "id": "21f76cc671b0e835", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up structure parameters\n" @@ -42,14 +38,10 @@ }, { "cell_type": "code", - "id": "47af0a587ce80b91", - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2025-08-08T18:33:23.640918Z", - "start_time": "2025-08-08T18:33:23.636417Z" - } - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Material and structure parameters\n", "TWIST_ANGLE_A = 2.64 # Twist angle in degrees for A material\n", @@ -68,30 +60,22 @@ "# Visualization settings\n", "SHOW_INTERMEDIATE_STEPS = True\n", "VISUALIZE_REPETITIONS = [1, 1, 1]" - ], - "outputs": [], - "execution_count": 1 + ] }, { "cell_type": "markdown", - "id": "4b91848e28033a8b", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Install Packages\n" ] }, { "cell_type": "code", - "id": "f67b53c0f60f257c", - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2025-08-08T18:33:23.799128Z", - "start_time": "2025-08-08T18:33:23.797045Z" - } - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -103,16 +87,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": 2 + ] }, { "cell_type": "markdown", - "id": "c4370f1ce85b6507", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material\n", "We'll use hexagonal boron nitride (h-BN) as our starting material.\n" @@ -120,14 +100,10 @@ }, { "cell_type": "code", - "id": "f1c2ac4b7553961b", - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2025-08-08T18:33:26.321935Z", - "start_time": "2025-08-08T18:33:23.811737Z" - } - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", @@ -142,42 +118,12 @@ "\n", "if SHOW_INTERMEDIATE_STEPS:\n", " visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n" - ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Initial material properties:\n", - "Formula: None\n", - "Number of atoms: 2\n", - "Lattice vectors:\n", - "[[2.508995, 0.0, 1.5363163479133569e-16], [-1.2544979999999997, 2.1728542739935413, 1.5363169602367562e-16], [0.0, 0.0, 20.0]]\n" - ] - }, - { - "data": { - "text/plain": [ - "GridBox(children=(VBox(children=(Label(value='BN - Material - rotation: 0x,0y,0z', layout=Layout(align_self='c…" - ], - "application/vnd.jupyter.widget-view+json": { - "version_major": 2, - "version_minor": 0, - "model_id": "05052c20d08742c29b4f9a0e2f33f59c" - } - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "execution_count": 3 + ] }, { "cell_type": "markdown", - "id": "26064d36be06507f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "## 2. Create Twisted Bilayer Structure\n", "### 2.1. Create nanoribbon\n" @@ -185,14 +131,10 @@ }, { "cell_type": "code", - "id": "80ac5dd96d8622b7", - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2025-08-08T18:33:32.457521Z", - "start_time": "2025-08-08T18:33:26.366172Z" - } - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "\n", "from mat3ra.made.tools.helpers import create_nanoribbon\n", @@ -204,48 +146,26 @@ " vacuum_length=VACUUM_PADDING,\n", " vacuum_width=VACUUM_PADDING,\n", ")\n" - ], - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", - " warnings.warn(\n", - "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['wyckoffs']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", - " warnings.warn(\n", - "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['equivalent_atoms']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", - " warnings.warn(\n", - "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['rotations']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", - " warnings.warn(\n", - "/Users/mat3ra/code/GREEN/api-examples/.venv-3.11.2/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", - " warnings.warn(\n" - ] - } - ], - "execution_count": 4 + ] }, { "cell_type": "markdown", - "id": "f3019591d1ab5506", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 2.2. Generate and analyze interfaces\n" ] }, { "cell_type": "code", - "id": "2293065288b4308c", + "execution_count": null, + "id": "10", "metadata": { "jupyter": { "is_executing": true - }, - "ExecuteTime": { - "start_time": "2025-08-08T18:33:32.500618Z" } }, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_interface_twisted\n", "\n", @@ -266,49 +186,41 @@ " vacuum_x=VACUUM_PADDING,\n", " vacuum_y=VACUUM_PADDING,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "fe5b798439e5b43a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.3. Select and visualize the best interface\n" ] }, { "cell_type": "code", - "id": "c4049a69b2dcbaa1", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS)\n", "visualize_materials([interface_a, interface_b], repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d58a1e4ada9d1a74", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 5. Download the Materials\n" ] }, { "cell_type": "code", - "id": "a64a81bb1ab4d47d", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "interface_a.name += f\" ({TWIST_ANGLE_A} degrees)\"\n", @@ -316,9 +228,7 @@ "set_materials([interface_a, interface_b])\n", "download_content_to_file(interface_a.to_json(), \"twisted_bilayer_h-BN_A.json\")\n", "download_content_to_file(interface_b.to_json(), \"twisted_bilayer_h-BN_B.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index cdf94dcf..82850939 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Nanoclusters of Gold\n", "\n", @@ -28,20 +26,16 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n" ] }, { "cell_type": "markdown", - "id": "9adf37a8d2620dc4", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -50,10 +44,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d9e6be14343d00a1", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -70,10 +62,8 @@ }, { "cell_type": "markdown", - "id": "26066db067a41c93", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set up cluster parameters\n", "Parameters for the cuboctahedron and icosahedron shapes can be found at [ASE Clusters](https://wiki.fysik.dtu.dk/ase/ase/cluster/cluster.html#ase.cluster.Cluster)." @@ -82,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56b9bd10", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -142,10 +132,8 @@ }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Get input material" ] @@ -153,10 +141,8 @@ { "cell_type": "code", "execution_count": null, - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", @@ -167,10 +153,8 @@ }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "## 2. Create the Target Material(s)" ] @@ -178,10 +162,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_nanoparticle_by_shape\n", @@ -195,10 +177,8 @@ }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] @@ -206,10 +186,8 @@ { "cell_type": "code", "execution_count": null, - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -222,10 +200,8 @@ }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -233,10 +209,8 @@ { "cell_type": "code", "execution_count": null, - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials, download_content_to_file\n", diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index d4aea282..63140503 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "567b1b812acb1718", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Optimize Interface Film Position in Gr/Ni(111) Interface\n", "\n", @@ -31,10 +29,8 @@ { "cell_type": "code", "execution_count": null, - "id": "6cc535057854a4d1", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -51,10 +47,8 @@ }, { "cell_type": "markdown", - "id": "63d36e1a062ae33a", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.2. Set Parameters\n" ] @@ -62,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2b35c2f3e3b092a", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -111,10 +105,8 @@ }, { "cell_type": "markdown", - "id": "d4ee2a1c17a07fa7", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "## 2. Create Interface Material\n", "### 2.1. Load Materials\n" @@ -123,10 +115,8 @@ { "cell_type": "code", "execution_count": null, - "id": "f1047ca2cc30b87a", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -142,10 +132,8 @@ }, { "cell_type": "markdown", - "id": "14c4e4f9aa6721a", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 2.2. Create Slabs" ] @@ -153,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4943dcc4a793f623", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "a09ee4efe7c65600", + "id": "8", "metadata": {}, "source": [ "### 2.3. Create Interface\n" @@ -196,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e64b278750d997f0", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -224,10 +212,8 @@ }, { "cell_type": "markdown", - "id": "8b20dc13f57cfce7", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 3. Optimize Interface Position\n", "### 3.1. Calculate Energy Landscape\n" @@ -236,10 +222,8 @@ { "cell_type": "code", "execution_count": null, - "id": "3dd3a069a69b4be1", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_optimal_film_displacement\n", @@ -274,10 +258,8 @@ }, { "cell_type": "markdown", - "id": "4028cb9ac8d438f0", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "### 3.2. Visualize Energy Landscape\n" ] @@ -285,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "291e197f524e12d2", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "ee1f1248729697af", + "id": "14", "metadata": {}, "source": [ "### 3.3. Visualize Material\n" @@ -322,7 +304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa330d1c1a0b249e", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -339,10 +321,8 @@ }, { "cell_type": "markdown", - "id": "78304054eca1564e", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "# 4. Save optimized material" ] @@ -350,10 +330,8 @@ { "cell_type": "code", "execution_count": null, - "id": "fb3a1781c32f144f", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index 803179b3..8ce0fe64 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "81aa051ca1ca2e05", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Passivation of Silicon (001) Surface\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "af879d0489a86849", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the environment\n", "### 1.1. Set up the notebook" @@ -37,8 +33,10 @@ }, { "cell_type": "code", - "id": "8d5e0a40537f4bdc", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "# Material selection\n", "MATERIAL_NAME = \"Silicon.*100.*reconstructed\" # Name (regex) of the material to import from Standata\n", @@ -55,16 +53,12 @@ "# Visualization parameters\n", "SHOW_INTERMEDIATE_STEPS = True\n", "CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "f6106dbafce082a1", - "metadata": { - "collapsed": false - }, + "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`." @@ -72,10 +66,10 @@ }, { "cell_type": "code", - "id": "d1eb85a3125e3839", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -87,41 +81,33 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "43ee49c4858d165f", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load and preview input material" ] }, { "cell_type": "code", - "id": "f71a66a67f9ae8e6", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "slab = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "51bb05eecc1f3abe", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "## 2. Prepare the material\n", "### 2.1. Visualize original material" @@ -129,10 +115,10 @@ }, { "cell_type": "code", - "id": "83efe492d92bf80c", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", @@ -140,24 +126,22 @@ " print(\"Initial slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "e14ecd35964002f3", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 2.2. Adjust structure to match the one from the manuscript" ] }, { "cell_type": "code", - "id": "36744eb087509500", + "execution_count": null, + "id": "10", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.modify import translate_to_z_level\n", "# Find coordinates of the Si atoms, list in descending order, and change the second one from the top\n", @@ -176,13 +160,11 @@ "new_coordinates[index_to_adjust] = adjusted_coordinate\n", "slab.set_coordinates(new_coordinates)\n", "slab = translate_to_z_level(slab, \"center\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "b0f46550198b1b9d", + "id": "11", "metadata": {}, "source": [ "### 2.3. Visualize adjusted material" @@ -190,31 +172,31 @@ }, { "cell_type": "code", - "id": "9f86e4cc49f97922", + "execution_count": null, + "id": "12", "metadata": {}, + "outputs": [], "source": [ "if SHOW_INTERMEDIATE_STEPS:\n", " print(\"Adjusted slab structure:\")\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION)\n", " visualize_materials(slab, repetitions=CELL_REPETITIONS_FOR_VISUALIZATION, rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "751ab019a379e07e", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Create passivated material\n" ] }, { "cell_type": "code", - "id": "12ddeb6233df033d", + "execution_count": null, + "id": "14", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_surface\n", "\n", @@ -232,57 +214,47 @@ "print(f\"Bond length: {BOND_LENGTH} Å\")\n", "print(f\"Surfaces passivated: {SURFACE}\")\n", "print(f\"Number of atoms: {len(passivated_slab.basis.elements.ids)}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "e2118b4c4bcf322f", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 4. Visualize the result" ] }, { "cell_type": "code", - "id": "4680f4f7906f6f2c", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], "source": [ "print(\"Final passivated structure:\")\n", "visualize_materials(passivated_slab, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bde2ccf31660d4fd", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "### 5. Pass data to the outside runtime\n" ] }, { "cell_type": "code", - "id": "b3c536f6ca85e403", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "18", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "set_materials(passivated_slab)\n", "download_content_to_file(passivated_slab.to_json(), f\"{slab.name}_passivated.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/under_the_hood.ipynb b/other/materials_designer/under_the_hood.ipynb index 2bc17e91..ad7d9a84 100644 --- a/other/materials_designer/under_the_hood.ipynb +++ b/other/materials_designer/under_the_hood.ipynb @@ -76,13 +76,13 @@ } ], "metadata": { - "language_info": { - "name": "python" - }, "kernelspec": { - "name": "python3", + "display_name": "Python 3 (ipykernel)", "language": "python", - "display_name": "Python 3 (ipykernel)" + "name": "python3" + }, + "language_info": { + "name": "python" } }, "nbformat": 4, From e9a79df821b6182a1d982c647f948cada2e4bdcd Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 17:09:22 -0700 Subject: [PATCH 19/26] update: strip out[uts --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4d932fe..4405ae81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,8 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace + # to strip notebook outputs + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout From 279b18ea61a65d0db23891e7d0634425df3af6f4 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 17:11:56 -0700 Subject: [PATCH 20/26] update: cleanup 2 --- README.ipynb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.ipynb b/README.ipynb index d8268b2f..80fc3f9e 100644 --- a/README.ipynb +++ b/README.ipynb @@ -2,6 +2,8 @@ "cells": [ { "cell_type": "markdown", + "id": "0", + "metadata": {}, "source": [ "# Mat3ra API Examples\n", "\n", @@ -115,11 +117,7 @@ "2. Jupyter.org, official website: [link](https://jupyter.org/)\n", "3. Git Large File Storage, official website: [link](https://git-lfs.github.com/)\n", "4. GitHub Standard Fork & Pull Request Workflow, online explanation: [link](https://gist.github.com/Chaser324/ce0505fbed06b947d962)\n" - ], - "metadata": { - "collapsed": false - }, - "id": "ca988675356058" + ] } ], "metadata": { From 3a496cbda3f4ec46c4180cd706c9234c2f64a556 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 17:36:35 -0700 Subject: [PATCH 21/26] update: strip outputs --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4405ae81..160d0e09 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: ^((examples|other)\/.*\/.*\.(py|poscar|csv)) repos: - repo: https://github.com/Exabyte-io/pre-commit-hooks - rev: 2023.6.28 + rev: 2023.9.13 hooks: - id: ruff - id: black @@ -18,3 +18,4 @@ repos: rev: 0.7.1 hooks: - id: nbstripout + files: ^other\/materials_designer\/.*\.ipynb$ From 1e9009bf3229e6e391d1a7a57e0b9b3c9446f681 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 17:55:25 -0700 Subject: [PATCH 22/26] update: cleanups --- .../create_heterostructure_example.ipynb | 675 ++++-------------- .../create_point_defect.ipynb | 18 +- 2 files changed, 153 insertions(+), 540 deletions(-) diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index 598600d5..210e048c 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -5,23 +5,32 @@ "id": "0", "metadata": {}, "source": [ - "# Create Heterostructure Example with Three Materials\n", + "# Create Heterostructure Example (Simplified)\n", "\n", - "This notebook demonstrates how to create a heterostructure involving three different materials using a sequential interface creation approach. We first create an interface between **Material 0** and **Material 1**, and then use that interface as a substrate to add a film of **Material 2**.\n", + "This notebook demonstrates how to create a heterostructure with any number of materials using the **new simplified `create_heterostructure` function**.\n", + "\n", + "This approach replaces the complex multi-step interface creation with a single function call that automatically handles strain matching and layer stacking.\n", "\n", "

Usage

\n", "\n", "1. **Set up the notebook and install packages**\n", - "2. **Import materials from Standata**\n", - "3. **Select and preview materials for the heterostructure**\n", - "4. **Build the heterostructure layer by layer with ZSL interface builder**\n", + "2. **Configure structure parameters for any number of materials**\n", + "3. **Import materials from Standata or user uploads**\n", + "4. **Create heterostructure with a single function call**\n", "\n", "## Summary\n", "\n", - "1. **Prepare the Environment:** Set up the notebook and install packages, preview the input materials.\n", - "2. **Create Interfaces:** Sequentially create interfaces between the materials.\n", - "3. **Visualize:** Preview the materials and resulting interfaces.\n", - "4. **Pass to Runtime:** Pass the final heterostructure to the external runtime.\n", + "1. **Prepare the Environment:** Set up the notebook and install packages\n", + "2. **Configure Materials:** Define parameters for each layer in the stack\n", + "3. **Create Stack:** Use simplified `create_heterostructure()` function\n", + "4. **Visualize:** Preview the resulting heterostructure\n", + "5. **Pass to Runtime:** Pass the final heterostructure to the external runtime\n", + "\n", + "## Key Improvements:\n", + "- **Simplified Configuration**: Replace complex multi-step setup with simple parameter lists\n", + "- **Single Function Call**: Use `create_heterostructure()` instead of manual interface creation\n", + "- **Automatic Optimization**: Built-in strain matching and supercell optimization\n", + "- **Flexible Stacking**: Supports any number of materials in the stack\n", "\n", "## Notes\n", "\n", @@ -35,10 +44,9 @@ "id": "1", "metadata": {}, "source": [ - "## 1. Prepare the Environment\n", - "### 1.1. Set up the Notebook\n", + "## 1. Configuration Parameters\n", "\n", - "Set the following flags to control the notebook behavior.\n" + "Configure the heterostructure parameters including materials, layer thicknesses, and gaps.\n" ] }, { @@ -48,45 +56,47 @@ "metadata": {}, "outputs": [], "source": [ - "# Enable interactive selection of terminations via UI prompt\n", - "IS_TERMINATIONS_SELECTION_INTERACTIVE = False \n", - "\n", - "# Indices and configurations for the three materials\n", - "MATERIAL_0_INDEX = 0\n", - "MATERIAL_1_INDEX = 1\n", - "MATERIAL_2_INDEX = 2\n", - "\n", - "# Interface parameters\n", - "MAX_AREA_01 = 50 # search area for the first interface\n", - "MAX_AREA_12 = 200 # search area for the second interface\n", - "INTERFACE_01_DISTANCE = 3.0 # in Angstrom\n", - "INTERFACE_12_DISTANCE = 3.0 # in Angstrom\n", - "FINAL_INTERFACE_VACUUM = 20.0 # in Angstrom\n", - "\n", - "# Configuration for Material 0 (Substrate)\n", - "MATERIAL_0_MILLER_INDICES = (0, 0, 1)\n", - "MATERIAL_0_THICKNESS = 3 # in atomic layers\n", - "MATERIAL_0_VACUUM = 3 # in Angstroms\n", - "MATERIAL_0_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", - "MATERIAL_0_USE_ORTHOGONAL_C = True\n", - "\n", - "# Configuration for Material 1 (Film 1)\n", - "MATERIAL_1_MILLER_INDICES = (0, 0, 1)\n", - "MATERIAL_1_THICKNESS = 1 # in atomic layers\n", - "MATERIAL_1_VACUUM = 0 # in Angstroms\n", - "MATERIAL_1_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", - "MATERIAL_1_USE_ORTHOGONAL_C = True\n", - "\n", - "# Configuration for Material 2 (Film 2)\n", - "MATERIAL_2_MILLER_INDICES = (0, 0, 1)\n", - "MATERIAL_2_THICKNESS = 1 # in atomic layers\n", - "MATERIAL_2_VACUUM = 1 # in Angstroms\n", - "MATERIAL_2_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n", - "MATERIAL_2_USE_ORTHOGONAL_C = True\n", - "\n", - "# Set termination pair indices for both interfaces\n", - "TERMINATION_PAIR_INDEX_01 = 0\n", - "TERMINATION_PAIR_INDEX_12 = 0\n" + "from types import SimpleNamespace\n", + "\n", + "# Structure parameters for each layer - add or remove layers as needed\n", + "STRUCTURE_PARAMS = [\n", + " SimpleNamespace(\n", + " # First material (substrate)\n", + " name=\"Silicon\", # Material name from Standata or upload\n", + " slab_params=SimpleNamespace(\n", + " miller_indices=(0, 0, 1),\n", + " thickness=3, # atomic layers\n", + " xy_supercell_matrix=[[1, 0], [0, 1]],\n", + " ),\n", + " termination_formula=None, # Use default termination\n", + " ),\n", + " SimpleNamespace(\n", + " # Second material\n", + " name=\"SiO2\", # Material name from Standata or upload \n", + " slab_params=SimpleNamespace(\n", + " miller_indices=(1, 1, 1),\n", + " thickness=3, # atomic layers\n", + " ),\n", + " termination_formula=None, # Use default termination\n", + " ),\n", + " SimpleNamespace(\n", + " # Third material\n", + " name=\"HfO2.*MCL\", # Material name from Standata or upload\n", + " slab_params=SimpleNamespace(\n", + " miller_indices=(0, 0, 1), \n", + " thickness=1, # atomic layers\n", + " ),\n", + " termination_formula=None, # Use default termination\n", + " ),\n", + " # Add more materials here as needed...\n", + "]\n", + "\n", + "# Gap distances between layers (in Angstroms)\n", + "# Length should be one less than number of materials\n", + "GAPS = [3.0, 3.0] # Gaps between materials\n", + "\n", + "# Final vacuum above the heterostructure (in Angstroms)\n", + "VACUUM = 20.0\n" ] }, { @@ -94,7 +104,7 @@ "id": "3", "metadata": {}, "source": [ - "### 1.2. Install Packages\n", + "## 2. Install Packages\n", "\n", "The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install` (see [README](../../README.ipynb)).\n" ] @@ -110,10 +120,12 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", + "\n", " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", - " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n" + "\n", + " await install_packages(\"specific_examples\")\n" ] }, { @@ -121,9 +133,9 @@ "id": "5", "metadata": {}, "source": [ - "### 1.3. Get Input Materials and Assign `material0`, `material1`, and `material2`\n", + "## 3. Get Input Materials\n", "\n", - "Materials are loaded with `get_materials()`. The first material is assigned as **Material 0**, the second as **Material 1**, and the third as **Material 2**.\n" + "Materials are loaded from Standata using the names specified in `STRUCTURE_PARAMS` or from user uploads via `get_materials()`.\n" ] }, { @@ -133,23 +145,31 @@ "metadata": {}, "outputs": [], "source": [ + "from mat3ra.standata.materials import Materials\n", + "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "from utils.jupyterlite import get_materials\n", "\n", - "materials = get_materials(globals())\n", - "\n", - "material0 = materials[MATERIAL_0_INDEX]\n", - "\n", - "try: \n", - " material1 = materials[MATERIAL_1_INDEX]\n", - "except IndexError:\n", - " print(\"Please select Material 1. Material 1 is set to Material 0.\")\n", - " material1 = material0\n", - "\n", - "try:\n", - " material2 = materials[MATERIAL_2_INDEX]\n", - "except IndexError:\n", - " print(\"Please select Material 2. Material 2 is set to Material 0.\")\n", - " material2 = material0\n" + "# Try to get materials from Standata first, then fallback to uploads\n", + "crystals = []\n", + "uploaded_materials = get_materials(globals()) if get_materials else []\n", + "\n", + "for i, structure_param in enumerate(STRUCTURE_PARAMS):\n", + " try:\n", + " # Try to get from Standata\n", + " standata_material = Materials.get_by_name_first_match(structure_param.name)\n", + " crystal = MaterialWithBuildMetadata.create(standata_material)\n", + " print(f\"Found '{structure_param.name}' in Standata\")\n", + " except:\n", + " # Fallback to uploaded materials\n", + " if i < len(uploaded_materials):\n", + " crystal = MaterialWithBuildMetadata.create(uploaded_materials[i])\n", + " print(f\"Using uploaded material {i} for '{structure_param.name}'\")\n", + " else:\n", + " # Use first uploaded material as fallback\n", + " crystal = MaterialWithBuildMetadata.create(uploaded_materials[0] if uploaded_materials else Materials.get_by_name_first_match(\"Silicon\"))\n", + " print(f\"Using fallback material for '{structure_param.name}'\")\n", + " \n", + " crystals.append(crystal)\n" ] }, { @@ -157,9 +177,9 @@ "id": "7", "metadata": {}, "source": [ - "### 1.4. Preview Original Materials\n", + "## 4. Preview Original Materials\n", "\n", - "Visualize the three original materials.\n" + "Visualize the loaded materials before creating the heterostructure.\n" ] }, { @@ -171,7 +191,13 @@ "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", - "visualize([material0, material1, material2], repetitions=[3, 3, 1], rotation=\"0x\")\n" + "# Create materials with titles for visualization\n", + "materials_with_titles = [\n", + " {\"material\": crystal, \"title\": f\"Layer {i}: {STRUCTURE_PARAMS[i].name}\"} \n", + " for i, crystal in enumerate(crystals)\n", + "]\n", + "\n", + "visualize(materials_with_titles, repetitions=[3, 3, 1], rotation=\"0x\")\n" ] }, { @@ -179,11 +205,10 @@ "id": "9", "metadata": {}, "source": [ - "## 2. Create First Interface (Material 0 + Material 1)\n", - "\n", - "### 2.1. Configure Slabs and Select Termination Pair\n", + "## 5. Create the Heterostructure\n", + "### 5.1. Create Stack Component Dictionaries\n", "\n", - "Set up slab configurations for **Material 0** and **Material 1**, then select terminations for the first interface.\n" + "Create a list of dictionaries for each layer's parameters using the simplified approach.\n" ] }, { @@ -193,47 +218,21 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.helpers import get_slab_terminations\n", - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", - "\n", - "# Slab Configuration for Material 1 (Film) - using correct parameters like ZSL notebook\n", - "material1_slab_configuration = SlabConfiguration.from_parameters(\n", - " material_or_dict=material1,\n", - " miller_indices=MATERIAL_1_MILLER_INDICES,\n", - " number_of_layers=MATERIAL_1_THICKNESS, # in atomic layers\n", - " vacuum=MATERIAL_1_VACUUM, # in Angstroms\n", - " termination_formula=None, # if None, the first termination will be used\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "# Slab Configuration for Material 0 (Substrate) - using correct parameters like ZSL notebook\n", - "material0_slab_configuration = SlabConfiguration.from_parameters(\n", - " material_or_dict=material0,\n", - " miller_indices=MATERIAL_0_MILLER_INDICES,\n", - " number_of_layers=MATERIAL_0_THICKNESS, # in atomic layers\n", - " vacuum=MATERIAL_0_VACUUM, # in Angstroms\n", - " termination_formula=None, # if None, the first termination will be used\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "# Get possible terminations for the slabs\n", - "material1_slab_terminations = get_slab_terminations(material=material1, miller_indices=MATERIAL_1_MILLER_INDICES)\n", - "material0_slab_terminations = get_slab_terminations(material=material0, miller_indices=MATERIAL_0_MILLER_INDICES)\n", - "\n", - "# Visualize all possible terminations using analyzer approach\n", - "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", + "from mat3ra.made.tools.helpers import StackComponentDict\n", "\n", - "material1_analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material1, miller_indices=MATERIAL_1_MILLER_INDICES)\n", - "material1_slabs = [material1_analyzer.get_material_with_termination_without_vacuum(termination) for termination in material1_slab_terminations]\n", + "stack_component_dicts = [\n", + " StackComponentDict(\n", + " crystal=crystals[i],\n", + " miller_indices=structure_param.slab_params.miller_indices,\n", + " thickness=structure_param.slab_params.thickness,\n", + " xy_supercell_matrix=structure_param.slab_params.xy_supercell_matrix if hasattr(structure_param.slab_params, 'xy_supercell_matrix') else None,\n", + " termination_top_formula=structure_param.termination_formula,\n", + " ) for i, structure_param in enumerate(STRUCTURE_PARAMS)\n", + "]\n", "\n", - "material0_analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material0, miller_indices=MATERIAL_0_MILLER_INDICES)\n", - "material0_slabs = [material0_analyzer.get_material_with_termination_without_vacuum(termination) for termination in material0_slab_terminations]\n", - "\n", - "material1_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in zip(material1_slabs, material1_slab_terminations)]\n", - "material0_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in zip(material0_slabs, material0_slab_terminations)]\n", - "\n", - "visualize(material1_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", - "visualize(material0_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n" + "print(f\"Created {len(stack_component_dicts)} stack components:\")\n", + "for i, component in enumerate(stack_component_dicts):\n", + " print(f\" Layer {i}: {STRUCTURE_PARAMS[i].name} - Miller: {component.miller_indices}, Thickness: {component.thickness}\")\n" ] }, { @@ -241,7 +240,9 @@ "id": "11", "metadata": {}, "source": [ - "### 2.2. Print and Select Termination Pair for First Interface\n" + "### 5.2. Create the Heterostructure\n", + "\n", + "Using the `create_heterostructure` function with automatic strain matching and optimization.\n" ] }, { @@ -251,12 +252,18 @@ "metadata": {}, "outputs": [], "source": [ - "from itertools import product\n", + "from mat3ra.made.tools.helpers import create_heterostructure\n", "\n", - "termination_pairs_01 = list(product(material1_slab_terminations, material0_slab_terminations)) \n", - "print(\"Termination Pairs for First Interface (Material1, Material0)\")\n", - "for idx, termination_pair in enumerate(termination_pairs_01):\n", - " print(f\" {idx}: {termination_pair}\")\n" + "heterostructure = create_heterostructure(\n", + " stack_component_dicts=stack_component_dicts,\n", + " gaps=GAPS,\n", + " vacuum=VACUUM,\n", + " use_conventional_cell=True,\n", + " optimize_layer_supercells=True,\n", + ")\n", + "\n", + "print(f\"Successfully created heterostructure with {len(crystals)} materials\")\n", + "print(f\"Final structure has {heterostructure.basis.number_of_atoms} atoms\")\n" ] }, { @@ -264,7 +271,7 @@ "id": "13", "metadata": {}, "source": [ - "### 2.3. Select Termination Pair for First Interface\n" + "## 6. Visualize the Heterostructure\n" ] }, { @@ -274,30 +281,12 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n", - "from utils.io import ui_prompt_select_array_element_by_index, ui_prompt_select_array_element_by_index_pyodide\n", - "\n", - "# Select terminations for each material using the newer approach\n", - "material1_termination = select_slab_termination(material1_slab_terminations, None) # None means use first termination\n", - "material0_termination = select_slab_termination(material0_slab_terminations, None) # None means use first termination\n", - "\n", - "# Create termination pair\n", - "termination_pair_first = (material1_termination, material0_termination)\n", - "\n", - "# Allow for interactive selection if enabled\n", - "if IS_TERMINATIONS_SELECTION_INTERACTIVE:\n", - " termination_pair_index_01 = TERMINATION_PAIR_INDEX_01\n", - " termination_pair_first = termination_pairs_01[termination_pair_index_01]\n", - " if sys.platform == \"emscripten\":\n", - " termination_pair_first = await ui_prompt_select_array_element_by_index_pyodide(\n", - " termination_pairs_01,\n", - " element_name=\"Material1/Material0 termination pair\"\n", - " )\n", - " else:\n", - " termination_pair_first = ui_prompt_select_array_element_by_index(\n", - " termination_pairs_01,\n", - " element_name=\"Material1/Material0 termination pair\"\n", - " )\n" + "visualize(\n", + " heterostructure,\n", + " repetitions=[1, 1, 1],\n", + " viewer=\"wave\",\n", + " rotation='0x'\n", + ")" ] }, { @@ -305,7 +294,8 @@ "id": "15", "metadata": {}, "source": [ - "### 2.4. Initialize Interface Configuration for First Interface\n" + "## 7. Save the Heterostructure\n", + "\n" ] }, { @@ -314,395 +304,14 @@ "id": "16", "metadata": {}, "outputs": [], - "source": [ - "from mat3ra.made.tools.build.slab.builders import SlabBuilder\n", - "\n", - "# Create actual slabs using the newer approach\n", - "material1_termination, material0_termination = termination_pair_first\n", - "\n", - "# Update configurations with selected terminations - using correct parameters like ZSL notebook\n", - "material1_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=material1,\n", - " miller_indices=MATERIAL_1_MILLER_INDICES,\n", - " number_of_layers=MATERIAL_1_THICKNESS,\n", - " vacuum=0.0, # Set vacuum to 0 for interface creation\n", - " termination_formula=None, # Will use selected termination\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "material0_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=material0,\n", - " miller_indices=MATERIAL_0_MILLER_INDICES,\n", - " number_of_layers=MATERIAL_0_THICKNESS,\n", - " vacuum=0.0, # Set vacuum to 0 for interface creation\n", - " termination_formula=None, # Will use selected termination\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "# Build the actual slabs\n", - "material1_slab = SlabBuilder().get_material(material1_slab_config)\n", - "material0_slab = SlabBuilder().get_material(material0_slab_config)\n" - ] - }, - { - "cell_type": "markdown", - "id": "17", - "metadata": {}, - "source": [ - "### 2.5. Set Strain Matching Parameters and Generate First Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "18", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", - "\n", - "# Set up ZSL Interface Analyzer with the newer approach\n", - "zsl_analyzer_01 = ZSLInterfaceAnalyzer(\n", - " substrate_slab_configuration=material0_slab_config,\n", - " film_slab_configuration=material1_slab_config,\n", - " max_area=MAX_AREA_01,\n", - " max_area_ratio_tol=0.09, # Default tolerance\n", - " max_angle_tol=0.03, # Default tolerance\n", - " max_length_tol=0.03 # Default tolerance\n", - ")\n", - "\n", - "# Get ZSL matches\n", - "matches_01 = zsl_analyzer_01.zsl_match_holders\n" - ] - }, - { - "cell_type": "markdown", - "id": "19", - "metadata": {}, - "source": [ - "### 2.6. Plot and Select First Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "20", - "metadata": {}, - "outputs": [], - "source": [ - "from utils.plot import plot_strain_vs_area\n", - "from mat3ra.made.tools.helpers import create_interface_zsl_between_slabs as create_zsl_interface_between_slabs\n", - "\n", - "PLOT_SETTINGS = {\n", - " \"HEIGHT\": 600,\n", - " \"X_SCALE\": \"log\", # or linear\n", - " \"Y_SCALE\": \"log\", # or linear\n", - "}\n", - "\n", - "plot_strain_vs_area(matches_01, PLOT_SETTINGS)\n", - "\n", - "# Select the interface with the lowest strain and smallest number of atoms\n", - "selected_index_01 = 0\n", - "\n", - "# Create the first interface using the newer approach\n", - "interface_01 = create_zsl_interface_between_slabs(\n", - " substrate_slab=material0_slab,\n", - " film_slab=material1_slab,\n", - " gap=INTERFACE_01_DISTANCE,\n", - " vacuum=FINAL_INTERFACE_VACUUM,\n", - " match_id=selected_index_01,\n", - " max_area=MAX_AREA_01,\n", - ")\n", - "\n", - "selected_interfaces_01 = [interface_01]\n" - ] - }, - { - "cell_type": "markdown", - "id": "21", - "metadata": {}, - "source": [ - "### 2.7. Preview the First Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "22", - "metadata": {}, - "outputs": [], - "source": [ - "visualize(selected_interfaces_01, repetitions=[3, 3, 1])\n", - "visualize(selected_interfaces_01, repetitions=[3, 3, 1], rotation=\"-90x\")" - ] - }, - { - "cell_type": "markdown", - "id": "23", - "metadata": {}, - "source": [ - "## 3. Create Second Interface (First Interface + Material 2)\n", - "\n", - "### 3.1. Configure Slabs and Select Termination Pair for Second Interface\n", - "\n", - "Now, use the first interface as the substrate to add **Material 2**.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "24", - "metadata": {}, - "outputs": [], - "source": [ - "from mat3ra.made.tools.modify import translate_to_z_level\n", - "\n", - "# Update substrate to be the first interface\n", - "substrate_second = translate_to_z_level(selected_interfaces_01[0], \"top\")\n", - "\n", - "# Get possible terminations for Material 2 and the substrate (first interface)\n", - "material2_slab_terminations = get_slab_terminations(material=material2, miller_indices=MATERIAL_2_MILLER_INDICES)\n", - "# For the substrate (first interface), we'll use a simple approach since it's already an interface\n", - "substrate_second_slab_terminations = [\"top\"] # Simple termination for the interface substrate\n", - "\n", - "# Visualize Material 2 terminations using analyzer approach\n", - "material2_analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material2, miller_indices=MATERIAL_2_MILLER_INDICES)\n", - "material2_slabs = [material2_analyzer.get_material_with_termination_without_vacuum(termination) for termination in material2_slab_terminations]\n", - "\n", - "material2_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in zip(material2_slabs, material2_slab_terminations)]\n", - "\n", - "visualize(material2_slabs_with_titles, repetitions=[3, 3, 1], rotation=\"-90x\")\n", - "\n", - "# Visualize the substrate (first interface)\n", - "visualize([{\"material\": substrate_second, \"title\": \"First Interface (Substrate)\"}], repetitions=[3, 3, 1], rotation=\"-90x\")" - ] - }, - { - "cell_type": "markdown", - "id": "25", - "metadata": {}, - "source": [ - "### 3.2. Print and Select Termination Pair for Second Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "26", - "metadata": {}, - "outputs": [], - "source": [ - "termination_pairs_12 = list(product(material2_slab_terminations, substrate_second_slab_terminations)) \n", - "print(\"Termination Pairs for Second Interface (Material2, First Interface Substrate)\")\n", - "for idx, termination_pair in enumerate(termination_pairs_12):\n", - " print(f\" {idx}: {termination_pair}\")" - ] - }, - { - "cell_type": "markdown", - "id": "27", - "metadata": {}, - "source": [ - "### 3.3. Select Termination Pair for Second Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "28", - "metadata": {}, - "outputs": [], - "source": [ - "# Select terminations for Material 2 and the substrate using the newer approach\n", - "material2_termination = select_slab_termination(material2_slab_terminations, None) # None means use first termination\n", - "substrate_second_termination = substrate_second_slab_terminations[0] # Use the first (and only) termination\n", - "\n", - "# Create termination pair\n", - "termination_pair_second = (material2_termination, substrate_second_termination)\n", - "\n", - "# Allow for interactive selection if enabled\n", - "if IS_TERMINATIONS_SELECTION_INTERACTIVE:\n", - " termination_pair_index_12 = TERMINATION_PAIR_INDEX_12\n", - " termination_pair_second = termination_pairs_12[termination_pair_index_12]\n", - " if sys.platform == \"emscripten\":\n", - " termination_pair_second = await ui_prompt_select_array_element_by_index_pyodide(\n", - " termination_pairs_12,\n", - " element_name=\"Material2/First Interface termination pair\"\n", - " )\n", - " else:\n", - " termination_pair_second = ui_prompt_select_array_element_by_index(\n", - " termination_pairs_12,\n", - " element_name=\"Material2/First Interface termination pair\"\n", - " )" - ] - }, - { - "cell_type": "markdown", - "id": "29", - "metadata": {}, - "source": [ - "### 3.4. Initialize Interface Configuration for Second Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "30", - "metadata": {}, - "outputs": [], - "source": [ - "# Create slab configurations and slabs for the second interface using the newer approach\n", - "material2_termination, substrate_second_termination = termination_pair_second\n", - "\n", - "# Slab configuration for Material 2 - using correct parameters like ZSL notebook\n", - "material2_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=material2,\n", - " miller_indices=MATERIAL_2_MILLER_INDICES,\n", - " number_of_layers=MATERIAL_2_THICKNESS,\n", - " vacuum=0.0, # Set vacuum to 0 for interface creation\n", - " termination_formula=None, # Will use selected termination\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "# Build the Material 2 slab\n", - "material2_slab = SlabBuilder().get_material(material2_slab_config)\n", - "\n", - "# For the substrate (first interface), we'll use it as-is since it's already built" - ] - }, - { - "cell_type": "markdown", - "id": "31", - "metadata": {}, - "source": [ - "### 3.5. Set Strain Matching Parameters and Generate Second Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "32", - "metadata": {}, - "outputs": [], - "source": [ - "# Set up ZSL Interface Analyzer for the second interface\n", - "# Note: For the second interface, we need to create a slab configuration for the substrate (first interface)\n", - "substrate_second_slab_config = SlabConfiguration.from_parameters(\n", - " material_or_dict=substrate_second,\n", - " miller_indices=(0, 0, 1), # Z-orientation for the first interface\n", - " number_of_layers=1, # One unit cell thick\n", - " vacuum=0.0,\n", - " termination_formula=None,\n", - " use_conventional_cell=True\n", - ")\n", - "\n", - "zsl_analyzer_12 = ZSLInterfaceAnalyzer(\n", - " substrate_slab_configuration=substrate_second_slab_config,\n", - " film_slab_configuration=material2_slab_config,\n", - " max_area=MAX_AREA_12,\n", - " max_area_ratio_tol=0.09, # Default tolerance\n", - " max_angle_tol=0.03, # Default tolerance\n", - " max_length_tol=0.03 # Default tolerance\n", - ")\n", - "\n", - "# Get ZSL matches for the second interface\n", - "matches_12 = zsl_analyzer_12.zsl_match_holders" - ] - }, - { - "cell_type": "markdown", - "id": "33", - "metadata": {}, - "source": [ - "### 3.6. Plot and Select Second Interface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "34", - "metadata": {}, - "outputs": [], - "source": [ - "plot_strain_vs_area(matches_12, PLOT_SETTINGS)\n", - "\n", - "# Select the interface with the lowest strain and smallest number of atoms\n", - "selected_index_12 = 0\n", - "\n", - "# Create the second interface using the newer approach\n", - "interface_12 = create_zsl_interface_between_slabs(\n", - " substrate_slab=substrate_second,\n", - " film_slab=material2_slab,\n", - " gap=INTERFACE_12_DISTANCE,\n", - " vacuum=FINAL_INTERFACE_VACUUM,\n", - " match_id=selected_index_12,\n", - " max_area=MAX_AREA_12,\n", - ")\n", - "\n", - "selected_interfaces_12 = [interface_12]" - ] - }, - { - "cell_type": "markdown", - "id": "35", - "metadata": {}, - "source": [ - "### 3.7. Preview the Second Interface (Final Heterostructure)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "36", - "metadata": {}, - "outputs": [], - "source": [ - "visualize(selected_interfaces_12, repetitions=[3, 3, 1])\n", - "visualize(selected_interfaces_12, repetitions=[3, 3, 1], rotation=\"-90x\")" - ] - }, - { - "cell_type": "markdown", - "id": "37", - "metadata": {}, - "source": [ - "## 4. Preview the Final Heterostructure\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "38", - "metadata": {}, - "outputs": [], - "source": [ - "visualize(selected_interfaces_12, repetitions=[3, 3, 1], title=\"Final Heterostructure (First Interface + Material2)\")\n", - "visualize(selected_interfaces_12, repetitions=[3, 3, 1], rotation=\"-90x\", title=\"Final Heterostructure (First Interface + Material2) Rotated\")" - ] - }, - { - "cell_type": "markdown", - "id": "39", - "metadata": {}, - "source": [ - "## 5. Pass the Final Heterostructure to the Outside Runtime\n", - "\n", - "Pass the resulting heterostructure with an adjusted name to `set_materials()`.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "40", - "metadata": {}, - "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", - "final_heterostructure = selected_interfaces_12[0]\n", - "final_heterostructure.name = f\"{material0.name} - {material1.name} - {material2.name} - Heterostructure\"\n", + "# Set heterostructure name based on all materials\n", + "material_names = [param.name for param in STRUCTURE_PARAMS]\n", + "# heterostructure.name = \" - \".join(material_names) + \" Heterostructure\"\n", "\n", - "set_materials(final_heterostructure)" + "set_materials(heterostructure)" ] } ], diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index dc381187..ba8f36b0 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -39,6 +39,8 @@ "metadata": {}, "outputs": [], "source": [ + "from types import SimpleNamespace\n", + "\n", "# Selected material will be used as a unit cell to create a supercell first.\n", "SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 3]]\n", "\n", @@ -62,7 +64,9 @@ " \"element\": \"N\",\n", " \"placement_method\": \"voronoi_site\",\n", " },\n", - "]" + "]\n", + "\n", + "DEFECT_CONFIGS = [SimpleNamespace(**defect_config) for defect_config in DEFECT_CONFIGS]" ] }, { @@ -153,15 +157,15 @@ "outputs": [], "source": [ "from mat3ra.made.tools.helpers import PointDefectDict\n", - "defect_dicts = [PointDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]\n", + "defect_dicts = [PointDefectDict(**defect_dict.__dict__) for defect_dict in DEFECT_CONFIGS]\n", "\n", "print(\"Defect configurations:\")\n", "for i, defect_dict in enumerate(DEFECT_CONFIGS):\n", - " print(f\"\\n{i+1}. {defect_dict['type'].upper()}:\")\n", - " print(f\" - Coordinate: {defect_dict['coordinate']}\")\n", - " print(f\" - Resolution method: {defect_dict['placement_method']}\")\n", - " if \"element\" in defect_dict:\n", - " print(f\" - Element: {defect_dict['element']}\")\n", + " print(f\"\\n{i+1}. {defect_dict.type.capitalize()} defect:\")\n", + " print(f\" - Coordinate: {defect_dict.coordinate}\")\n", + " print(f\" - Resolution method: {defect_dict.placement_method}\")\n", + " if hasattr(defect_dict, \"element\"):\n", + " print(f\" - Element: {defect_dict.element}\")\n", " \n", "print(f\"\\nTotal defects to create: {len(DEFECT_CONFIGS)}\")" ] From 53c1e3d7ab8f0a4908adadd880d29f0d640955a0 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 18:24:21 -0700 Subject: [PATCH 23/26] update: fix heterostructure nb --- ...ide_hafnium_dioxide_titanium_nitride.ipynb | 148 +++++++++--------- 1 file changed, 70 insertions(+), 78 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 4e66e2af..bf066172 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 @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "3ae4cc7db0846f04", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create High-k Metal Gate Stack Tutorial (Simplified)\n", "\n", @@ -25,19 +23,21 @@ }, { "cell_type": "markdown", - "id": "f1db6e522c6716dc", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Configuration Parameters\n" ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", + "\n", "# Structure parameters for each layer\n", "STRUCTURE_PARAMS = [\n", " SimpleNamespace(\n", @@ -45,8 +45,8 @@ " name = \"Silicon\",\n", " slab_params=SimpleNamespace(\n", " miller_indices=(0, 0, 1),\n", - " thickness=4, # atomic layers\n", - " xy_supercell_matrix=[[2, 0], [0, 2]],\n", + " thickness=3, # atomic layers\n", + " # xy_supercell_matrix=[[2, 0], [0, 2]],\n", " ),\n", " termination_formula=None, # Use default termination for substrate\n", " ),\n", @@ -55,13 +55,13 @@ " name = \"SiO2\",\n", " slab_params=SimpleNamespace(\n", " miller_indices=(1, 1, 1),\n", - " thickness=5,\n", + " thickness=4,\n", " ),\n", " termination_formula=None, # Use default termination for SiO2\n", " ),\n", " SimpleNamespace(\n", " # HfO2 layer\n", - " name = \"HfO2.*MCL\",\n", + " name = \"Hafnium.*MCL\",\n", " slab_params=SimpleNamespace(\n", " miller_indices=(0, 0, 1),\n", " thickness=2,\n", @@ -79,20 +79,17 @@ " )\n", "]\n", "\n", - "GAPS = [1.0, 1.0, 1.0] # Gaps between layers\n", + "# Gaps between layers, in Angstroms\n", + "GAPS = [1.0, 1.0, 1.0]\n", "\n", - "VACUUM = 10.0 # Vacuum thickness over the heterostructure" - ], - "id": "d437c36db077a11c", - "outputs": [], - "execution_count": null + "# Vacuum thickness over the heterostructure, in Angstroms\n", + "VACUUM = 10.0" + ] }, { "cell_type": "markdown", - "id": "a671bb0a66616061", - "metadata": { - "collapsed": false - }, + "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))." @@ -100,10 +97,10 @@ }, { "cell_type": "code", - "id": "c11956a7712639b9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -115,53 +112,47 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "15599efa4b241366", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material\n", "In this notebook we will use materials from Standata." ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.tools.build import MaterialWithBuildMetadata\n", "from mat3ra.made.tools.helpers import StackComponentDict\n", "\n", "# Get materials from Standata\n", - "crystals = [\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[0].name)),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[1].name)),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[2].name)),\n", - " MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(STRUCTURE_PARAMS[3].name))\n", - "]" - ], - "id": "1ef3c5ae52672e83", - "outputs": [], - "execution_count": null + "crystals = [MaterialWithBuildMetadata.create(Materials.get_by_name_first_match(params.name)) for params in STRUCTURE_PARAMS]" + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "7", + "metadata": {}, "source": [ "## 2. Create the heterostructure\n", " ### 2.1. Create a list of dictionaries for each layer's parameters" - ], - "id": "988a23f9a0675323" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "stack_component_dicts = [\n", " StackComponentDict(\n", @@ -171,23 +162,23 @@ " xy_supercell_matrix=dict.slab_params.xy_supercell_matrix if hasattr(dict.slab_params, 'xy_supercell_matrix') else None,\n", " ) for i, dict in enumerate(STRUCTURE_PARAMS)\n", "]" - ], - "id": "a038f7e04d307710", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "9", + "metadata": {}, "source": [ "### 2.1. Create the heterostructure\n", "Using the `create_heterostructure` function, then flipping to match the example." - ], - "id": "3da2b64a397a1c1e" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.operations.core.unary import rotate\n", "from mat3ra.made.tools.helpers import create_heterostructure\n", @@ -200,21 +191,23 @@ " optimize_layer_supercells=True,\n", ")\n", "\n", - "flipped_heterostructure = rotate(heterostructure, angle=90, axis=[1,0,0])" - ], - "id": "d534ad4b1b1be01c", - "outputs": [], - "execution_count": null + "flipped_heterostructure = rotate(heterostructure, angle=180, axis=[1,0,0])" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 3. Visualize the material\n", - "id": "1e7b3bbe711cd26" + "id": "11", + "metadata": {}, + "source": [ + "## 3. Visualize the material\n" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -224,30 +217,29 @@ " viewer=\"wave\",\n", " rotation='-90x'\n", ")\n" - ], - "id": "a5bf257d138dfbaa", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "## 4. Save the material", - "id": "1886c9e81c03d2ef" + "id": "13", + "metadata": {}, + "source": [ + "## 4. Save the material" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "flipped_heterostructure.name = \"Si-SiO2-HfO2-TiN Heterostructure\"\n", "set_materials(flipped_heterostructure)\n", "download_content_to_file(flipped_heterostructure.to_json(), \"heterostructure_high_k_metal_gate.json\")\n" - ], - "id": "5a245b0917b5c527", - "outputs": [], - "execution_count": null + ] } ], "metadata": { From f2dd5be5eac8f37768e03885dcb4c3f88e11615f Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 18:34:09 -0700 Subject: [PATCH 24/26] chore: strip outputs --- other/materials_designer/Introduction.ipynb | 18 +- .../create_adatom_defect.ipynb | 130 ++++++------- .../create_cluster_custom_shape.ipynb | 138 +++++-------- .../create_grain_boundary_crystal.ipynb | 120 ++++-------- .../create_island_defect.ipynb | 154 ++++++--------- .../create_island_defect_custom.ipynb | 106 ++++------ .../materials_designer/create_monolayer.ipynb | 88 +++------ .../create_point_defect_pair.ipynb | 108 +++++------ .../create_terrace_defect.ipynb | 90 +++------ ...import_material_from_jarvis_db_entry.ipynb | 103 +++++----- .../import_materials_from_files.ipynb | 107 +++++----- .../optimize_film_position.ipynb | 160 ++++++--------- .../custom_cutout_etched_silicon.ipynb | 82 +++----- ...anar_grain_boundary_2d_boron_nitride.ipynb | 102 ++++------ .../defect_point_vacancy_boron_nitride.ipynb | 132 +++++-------- .../defect_surface_adatom_graphene.ipynb | 132 +++++-------- ...terface_2d_2d_boron_nitride_graphene.ipynb | 75 ++------ .../passivation_edge_nanowire_silicon.ipynb | 182 +++++++----------- .../perturbation_ripple_graphene.ipynb | 120 ++++-------- .../slab_strontium_titanate.ipynb | 74 +++---- 20 files changed, 842 insertions(+), 1379 deletions(-) diff --git a/other/materials_designer/Introduction.ipynb b/other/materials_designer/Introduction.ipynb index 7dbb48ee..8ac1b87a 100644 --- a/other/materials_designer/Introduction.ipynb +++ b/other/materials_designer/Introduction.ipynb @@ -114,22 +114,20 @@ }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], - "source": [], - "metadata": { - "collapsed": false - }, - "execution_count": null + "source": [] } ], "metadata": { - "language_info": { - "name": "python" - }, "kernelspec": { - "name": "python3", + "display_name": "Python 3 (ipykernel)", "language": "python", - "display_name": "Python 3 (ipykernel)" + "name": "python3" + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index f928193c..b9fe4a55 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create adatom defects in a slab material\n", "\n", @@ -37,18 +35,19 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Index in the list of materials, to access as materials[MATERIAL_INDEX]\n", "MATERIAL_INDEX = 0\n", @@ -74,25 +73,23 @@ "VACUUM = 5.0 # Vacuum thickness in Angstrom\n", "XY_SUPERCELL_MATRIX = [[2, 0], [0, 2]] # Supercell matrix for the slab\n", "TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used." - ], - "id": "79de96979d6a5b5e", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -105,14 +102,11 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "id": "9eeac88f287b5c19", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "c7ca14890a9205db", + "id": "5", "metadata": {}, "source": [ "### 1.3. Get input material" @@ -120,30 +114,30 @@ }, { "cell_type": "code", - "id": "540dc3a04b706af6", + "execution_count": null, + "id": "6", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Slab" ] }, { "cell_type": "code", - "id": "426b290f92c6bc26", + "execution_count": null, + "id": "8", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", "from mat3ra.made.tools.helpers import create_slab, get_slab_terminations, select_slab_termination\n", @@ -168,45 +162,50 @@ " use_conventional_cell=True\n", ")\n", "visualize([{\"material\": slab, \"rotation\": \"0x\"}, {\"material\": slab, \"rotation\": \"-90x\"}], repetitions=[1, 1, 1])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "b386c06587b2f843", + "id": "9", "metadata": {}, "source": [ "## 2. Create the Defect" ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.1. Validate defect dictionaries and prepare them", - "id": "fcea7b8a14938125" + "id": "10", + "metadata": {}, + "source": [ + "### 2.1. Validate defect dictionaries and prepare them" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import AdatomDefectDict\n", "\n", "defect_dicts = [AdatomDefectDict(**defect_dict) for defect_dict in DEFECT_CONFIGS]" - ], - "id": "2bcabf1e719bc9ec", - "outputs": [], - "execution_count": null + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### 2.2. Create the adatom defect", - "id": "63872a6268960590" + "id": "12", + "metadata": {}, + "source": [ + "### 2.2. Create the adatom defect" + ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_multiple_adatom_defects\n", "\n", @@ -215,25 +214,22 @@ " defect_dicts=defect_dicts,\n", " placement_method=PLACEMENT_METHOD,\n", ")" - ], - "id": "da2f772cc8d6ad4", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 3. Visualize the Slab with Adatom" ] }, { "cell_type": "code", - "id": "256b07fb2dd39ae2", + "execution_count": null, + "id": "15", "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -243,31 +239,27 @@ "],\n", " viewer=\"wave\"\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { - "metadata": {}, "cell_type": "code", + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials([slab_with_adatom])" - ], - "id": "1335b6828e00116d", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index 0599b1ee..c0a882e8 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a cluster of custom shape from a bulk material\n", "\n", @@ -27,20 +25,16 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n" ] }, { "cell_type": "markdown", - "id": "9adf37a8d2620dc4", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -48,10 +42,10 @@ }, { "cell_type": "code", - "id": "d9e6be14343d00a1", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -63,52 +57,44 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "26066db067a41c93", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set up cluster parameters" ] }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], "source": [ "RADIUS = 5.3 # in Angstroms\n", "VACUUM = 10.0 # in Angstroms on each side\n", "Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster\n", "USE_CARTESIAN_COORDINATES = True\n", "NAME = \"Icosahedron\" # Name of the cluster" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "3aae932e71fa71a9", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Set coordinates condition" ] }, { "cell_type": "code", - "id": "8e382d5ab459e2d", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "7", + "metadata": {}, + "outputs": [], "source": [ "import numpy as np\n", "from scipy.spatial import ConvexHull\n", @@ -139,40 +125,32 @@ "\n", " \n", "condition = CustomCoordinateCondition(radius=RADIUS)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 2. Create the Target Material\n", "### 2.1. Set the cluster configuration\n" @@ -180,66 +158,56 @@ }, { "cell_type": "code", - "id": "8fbe260fa14db47a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_nanoparticle_from_material\n", "material = materials[0]\n", "cluster = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "visualize([{\"material\": cluster, \"title\": f\"Cluster\"},\n", " {\"material\": cluster, \"title\": f\"Cluster\", \"rotation\": \"-90x\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "cluster.name = f\"{materials[0].name} {NAME}\"\n", "set_materials(cluster)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 2462ddac..18ca9449 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -2,18 +2,14 @@ "cells": [ { "cell_type": "markdown", - "id": "ba979b741d79bad2", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [] }, { "cell_type": "markdown", - "id": "64cac14fa1273938", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "# Create a Grain Boundary with Strain Matching\n", "\n", @@ -43,10 +39,8 @@ }, { "cell_type": "markdown", - "id": "31ef78017669ea95", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -57,10 +51,8 @@ { "cell_type": "code", "execution_count": null, - "id": "38eac66e44951f88", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "outputs": [], "source": [ "# Parameters for Phase 1\n", @@ -87,10 +79,8 @@ }, { "cell_type": "markdown", - "id": "63f9747e4a43c49d", - "metadata": { - "collapsed": false - }, + "id": "4", + "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`." @@ -99,10 +89,8 @@ { "cell_type": "code", "execution_count": null, - "id": "26c1a6af762eda56", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -119,10 +107,8 @@ }, { "cell_type": "markdown", - "id": "1e2caebbe15a0e06", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Get input material" ] @@ -130,10 +116,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c269a9fe44c400be", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -144,10 +128,8 @@ }, { "cell_type": "markdown", - "id": "91b2b7a5a2996487", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "### 1.4. Preview Material" ] @@ -155,10 +137,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4fb3d10f24145759", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -168,10 +148,8 @@ }, { "cell_type": "markdown", - "id": "ed7b0a774220a297", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "## 2. Configure slabs and select termination pair\n", "\n", @@ -182,10 +160,8 @@ { "cell_type": "code", "execution_count": null, - "id": "70ce21f35a487b63", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import get_slab_terminations\n", @@ -203,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "d233c1437eb21960", + "id": "12", "metadata": {}, "source": [ "### 2.3. Visualize slabs for all possible terminations" @@ -212,10 +188,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cd8e53c68e1c7569", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -237,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "5fd99a07e51380b0", + "id": "14", "metadata": {}, "source": [ "### 2.4. Select terminations for the grain boundary phases" @@ -246,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9109ac095608d82a", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -257,10 +231,8 @@ }, { "cell_type": "markdown", - "id": "20186205803e07d9", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "## 3. Create grain boundary" ] @@ -268,10 +240,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e9977c17f97f0035", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_grain_boundary_planar\n", @@ -292,10 +262,8 @@ }, { "cell_type": "markdown", - "id": "aa55348911eb6679", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "source": [ "## 4. Preview the grain boundary" ] @@ -303,10 +271,8 @@ { "cell_type": "code", "execution_count": null, - "id": "abd081a986bdca0", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "outputs": [], "source": [ "visualize([grain_boundary], repetitions=[1, 1, 1])\n", @@ -315,10 +281,8 @@ }, { "cell_type": "markdown", - "id": "bde2ea26c96543f5", - "metadata": { - "collapsed": false - }, + "id": "20", + "metadata": {}, "source": [ "## 5. Pass data to the outside runtime" ] @@ -326,10 +290,8 @@ { "cell_type": "code", "execution_count": null, - "id": "76469e88bd21a25d", - "metadata": { - "collapsed": false - }, + "id": "21", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index 86ea3f18..9d18a354 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create island defect on a slab\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " @@ -38,10 +34,10 @@ }, { "cell_type": "code", - "id": "9d8b1890b34d850a", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "\n", "# Shape-specific parameters\n", @@ -78,13 +74,13 @@ "# 'shape': 'sphere',\n", "# 'radius': 0.25\n", "# }\n", - "# \n", + "#\n", "# SHAPE_PARAMETERS = {\n", "# 'shape': 'box',\n", "# 'min_coordinate': [0.25, 0.25, 0],\n", "# 'max_coordinate': [0.75, 0.75, 1]\n", "# }\n", - "# \n", + "#\n", "# SHAPE_PARAMETERS = {\n", "# 'shape': 'triangular_prism',\n", "# 'position_on_surface_1': [0.25, 0.25],\n", @@ -94,16 +90,12 @@ "# 'max_z': 1\n", "# }\n", "\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "bb64de5ff32649f8", - "metadata": { - "collapsed": false - }, + "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))." @@ -111,10 +103,10 @@ }, { "cell_type": "code", - "id": "ef664b14457530fd", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -124,49 +116,41 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input material" ] }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview Slab or create a new one" ] }, { "cell_type": "code", - "id": "7fcb1e02e84c5f35", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", @@ -187,16 +171,12 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}])\n", "visualize([{\"material\": slab, \"title\": \"Original material\"}], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Target Material\n", "### 2.1. Initialize the defect conditions" @@ -204,10 +184,10 @@ }, { "cell_type": "code", - "id": "e2d24109d3068c9e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.entities.coordinate import CylinderCoordinateCondition\n", "\n", @@ -215,26 +195,22 @@ " center_position=CENTER_POSITION,\n", " radius=SHAPE_PARAMETERS['radius'],\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "489b51f0ee122c48", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.2. Create the island" ] }, { "cell_type": "code", - "id": "a990fa35742d7269", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_island\n", "\n", @@ -244,26 +220,22 @@ " use_cartesian_coordinates=USE_CARTESIAN_COORDINATES,\n", " number_of_added_layers=NUMBER_OF_ADDED_LAYERS,\n", ")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] }, { "cell_type": "code", - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}] ,\n", @@ -271,33 +243,27 @@ "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(slab_with_island)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_island_defect_custom.ipynb b/other/materials_designer/create_island_defect_custom.ipynb index 23eef0ec..7e7ec8d6 100644 --- a/other/materials_designer/create_island_defect_custom.ipynb +++ b/other/materials_designer/create_island_defect_custom.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create Custom Shape Island Defect on a Slab\n", "\n", @@ -28,10 +26,8 @@ }, { "cell_type": "markdown", - "id": "e82522518cb8724c", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Install Packages\n", @@ -41,10 +37,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b1216c665d6cf493", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -61,10 +55,8 @@ }, { "cell_type": "markdown", - "id": "c360bd0ea9a5f262", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Create custom Coordinate Conditions" ] @@ -72,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55f4289a6545c504", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -96,10 +88,8 @@ }, { "cell_type": "markdown", - "id": "535bbac2c3f2832b", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Set the parameters\n" ] @@ -107,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f6c437b81325730", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -131,10 +121,8 @@ }, { "cell_type": "markdown", - "id": "8ab363bab5c5f7cc", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Initialize the Coordinate Condition" ] @@ -142,10 +130,8 @@ { "cell_type": "code", "execution_count": null, - "id": "87c3850f6c7178b2", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "coordinate_condition = CustomCoordinateCondition(\n", @@ -157,10 +143,8 @@ }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 1.5. Get input material" ] @@ -168,10 +152,8 @@ { "cell_type": "code", "execution_count": null, - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -180,10 +162,8 @@ }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 1.6. Preview Slab or create a new one" ] @@ -191,10 +171,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7fcb1e02e84c5f35", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -218,10 +196,8 @@ }, { "cell_type": "markdown", - "id": "690241d87e7bbbe0", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 2. Create the Target Material" ] @@ -229,10 +205,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e2d24109d3068c9e", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_island\n", @@ -247,10 +221,8 @@ }, { "cell_type": "markdown", - "id": "462549d016073446", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 3. Visualize the Result(s)" ] @@ -258,10 +230,8 @@ { "cell_type": "code", "execution_count": null, - "id": "509b18661a069e42", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", @@ -274,10 +244,8 @@ }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -285,10 +253,8 @@ { "cell_type": "code", "execution_count": null, - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_monolayer.ipynb b/other/materials_designer/create_monolayer.ipynb index 186d996e..84db385c 100644 --- a/other/materials_designer/create_monolayer.ipynb +++ b/other/materials_designer/create_monolayer.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "a79609c9bc772c5c", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Monolayer\n", "\n", @@ -21,10 +19,8 @@ }, { "cell_type": "markdown", - "id": "47d31d9834478007", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up transformation parameters " @@ -33,10 +29,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a2c8922a4e627887", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "XY_SUPERCELL_MATRIX = [\n", @@ -49,10 +43,8 @@ }, { "cell_type": "markdown", - "id": "6fab076ea1d7a223", - "metadata": { - "collapsed": false - }, + "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))." @@ -61,10 +53,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b0c332f1c1f451fd", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -81,10 +71,8 @@ }, { "cell_type": "markdown", - "id": "3e9934b458d6cb4", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -92,10 +80,8 @@ { "cell_type": "code", "execution_count": null, - "id": "74cd0d5a3881ab47", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", @@ -106,10 +92,8 @@ }, { "cell_type": "markdown", - "id": "d4535caf6debb8d4", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -117,10 +101,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d6bea39864c23ab5", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -131,20 +113,16 @@ }, { "cell_type": "markdown", - "id": "5473c36cd254aa89", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create Monolayer" ] }, { "cell_type": "markdown", - "id": "ee17958872d03410", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "### 2.1. Create a monolayer unit cell" ] @@ -152,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f05c4872edfef910", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "372400a5610d7247", + "id": "12", "metadata": {}, "source": [ "### 2.2 Create a supercell" @@ -175,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25d6681d5c1bfb0", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "82f9dfac4c711634", + "id": "14", "metadata": {}, "source": [ "## 3. Visualize the result" @@ -197,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab5c2f5ee249525c", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -207,10 +185,8 @@ }, { "cell_type": "markdown", - "id": "6ce5f7dd9a919a08", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -218,10 +194,8 @@ { "cell_type": "code", "execution_count": null, - "id": "865c71d008d87beb", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index 161dfdee..e910e953 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a point defect pair in a bulk material\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "5e43ff288847b784", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -38,8 +34,10 @@ }, { "cell_type": "code", - "id": "71f275fbc0163e6f", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "from types import SimpleNamespace\n", "\n", @@ -62,13 +60,11 @@ " # \"site_id\": 0, # Index of the atom in the host material\n", " # \"coordinate\": None, # Exact position (override the approximate coordinate)\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "709d92aa693bd65f", + "id": "3", "metadata": {}, "source": [ "### 1.2. Install Packages\n", @@ -77,8 +73,10 @@ }, { "cell_type": "code", - "id": "d499bc9a7f6855f7", + "execution_count": null, + "id": "4", "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -90,16 +88,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "919ad7af8dceeedd", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials\n", "Materials are loaded with `get_materials()`." @@ -107,34 +101,30 @@ }, { "cell_type": "code", - "id": "be38fdda1984c654", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a132fe0ef8bbf0d0", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "e2d24109d3068c9e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", @@ -142,16 +132,12 @@ "unit_cell = materials[0]\n", "supercell = create_supercell(unit_cell, supercell_matrix=SUPERCELL_MATRIX)\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5da5b0380583c952", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defect\n", "### 2.1. Initialize Configuration and Builder parameters" @@ -159,8 +145,10 @@ }, { "cell_type": "code", - "id": "c4f50fb621da6474", + "execution_count": null, + "id": "10", "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_defect_pair\n", "\n", @@ -178,13 +166,11 @@ " placement_method_2=SECONDARY_DEFECT_CONFIG.placement_method if hasattr(SECONDARY_DEFECT_CONFIG,\n", " 'placement_method') else None,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "ae5f5d5e9be9113", + "id": "11", "metadata": {}, "source": [ "## 3. Visualize Result(s)" @@ -192,8 +178,10 @@ }, { "cell_type": "code", - "id": "8308ef3260816859", + "execution_count": null, + "id": "12", "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", @@ -202,33 +190,27 @@ " rotation=\"-90x\")\n", "visualize([{\"material\": supercell, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": f\"Material with defect\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d381df29a6bbdd82", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] }, { "cell_type": "code", - "id": "61daa5afcbc078a9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials([material_with_defect])" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index a17fe0d2..8d0cd78e 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f5ca6879c3872454", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a Terrace Defect on a Slab\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "ff0f33c4e6ac1303", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -41,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "581cb3ccf2a95f8a", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -71,10 +67,8 @@ }, { "cell_type": "markdown", - "id": "ac4ec25db74d75f4", - "metadata": { - "collapsed": false - }, + "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`." @@ -83,10 +77,8 @@ { "cell_type": "code", "execution_count": null, - "id": "38574beae9a769cd", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -103,10 +95,8 @@ }, { "cell_type": "markdown", - "id": "c0eab57550f40708", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load input material" ] @@ -114,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2eed23af0ec63634", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "2c0d3e29ca42f099", + "id": "7", "metadata": {}, "source": [ "### 1.4. Create a slab if the input material is not a slab" @@ -135,7 +125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92ad17e2b0032fda", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -154,10 +144,8 @@ }, { "cell_type": "markdown", - "id": "916c8b16e01f86ff", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 1.5. Visualize slab" ] @@ -165,10 +153,8 @@ { "cell_type": "code", "execution_count": null, - "id": "16bb968a93de4b9", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -181,10 +167,8 @@ }, { "cell_type": "markdown", - "id": "9edaa3afb28ee0ad", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 2. Create target material\n", "### 2.1. Set up terrace configuration and builder\n" @@ -193,10 +177,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c318fd03c7e667df", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_terrace\n", @@ -213,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "8547862478ab0c7f", + "id": "13", "metadata": {}, "source": [ "## 2.2. Print the parameters of the created terrace defect" @@ -222,10 +204,8 @@ { "cell_type": "code", "execution_count": null, - "id": "256bc04ff0aa1810", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "\n", @@ -238,10 +218,8 @@ }, { "cell_type": "markdown", - "id": "9bee7a912a90e33c", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -249,10 +227,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4ffdd8589b02de16", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "print(\"Final structure with terrace:\")\n", @@ -262,10 +238,8 @@ }, { "cell_type": "markdown", - "id": "d65865cbab99478", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime\n" ] @@ -273,7 +247,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a57ecc6fe9c89ceb", + "id": "18", "metadata": {}, "outputs": [], "source": [ diff --git a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb index 90755f79..5c784475 100644 --- a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +++ b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "826fcc4c", + "id": "0", "metadata": {}, "source": [ "# Import 2D material from JARVIS database\n", @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "4299768d", + "id": "1", "metadata": {}, "source": [ "## 1. Set Parameters" @@ -35,21 +35,21 @@ }, { "cell_type": "code", - "id": "9c1f4e9e", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "# Note: JVASP-670 is an entry for MoTe2 and JVASP-6838 is an entry for GaTe\n", "JARVIS_IDS = [\n", " \"JVASP-670\",\n", " \"JVASP-6838\",\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8b00ab6854f2263b", + "id": "3", "metadata": {}, "source": [ "## 2. Install Packages" @@ -57,10 +57,10 @@ }, { "cell_type": "code", - "id": "ef2b38a5-de7e-419e-b605-110e9e0095f5", - "metadata": { - "trusted": true - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -72,13 +72,11 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"import_material_from_jarvis_db_entry.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "f418c51a7f794f9f", + "id": "5", "metadata": {}, "source": [ "## 3. Data Processing\n", @@ -88,11 +86,10 @@ }, { "cell_type": "code", - "id": "b1ee775d1476f884", - "metadata": { - "collapsed": false, - "trusted": true - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "import pandas as pd\n", "from jarvis.db.figshare import data\n", @@ -102,13 +99,11 @@ "dataframe_2d = pd.DataFrame(dft_2d)\n", "dataframe_3d = pd.DataFrame(dft_3d)\n", "dataframe = pd.concat([dataframe_2d, dataframe_3d])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "57b0d358", + "id": "7", "metadata": {}, "source": [ "### 3.2. Preview the dataframe" @@ -116,17 +111,17 @@ }, { "cell_type": "code", - "id": "0e34472a", + "execution_count": null, + "id": "8", "metadata": {}, + "outputs": [], "source": [ "dataframe" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "15fe5f9de299c935", + "id": "9", "metadata": {}, "source": [ "### 3.3. Filter data" @@ -134,8 +129,10 @@ }, { "cell_type": "code", - "id": "a771a36a", + "execution_count": null, + "id": "10", "metadata": {}, + "outputs": [], "source": [ "import json\n", "from express import ExPrESS\n", @@ -143,13 +140,11 @@ "dataframe_entries_for_jarvis_ids = dataframe[(dataframe[\"jid\"].isin(JARVIS_IDS))]\n", "dataframe_entries_as_json = dataframe_entries_for_jarvis_ids.to_json(orient=\"records\")\n", "jarvis_db_entries = json.loads(dataframe_entries_as_json)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "ef5f9e9d", + "id": "11", "metadata": {}, "source": [ "### 3.4. Convert to ESSE format" @@ -157,11 +152,10 @@ }, { "cell_type": "code", - "id": "c41fb68c6d25fe48", - "metadata": { - "collapsed": false, - "trusted": true - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "def convert_jarvis_entry_to_esse(jarvis_db_entry):\n", " jarvis_db_entry_json = json.dumps(jarvis_db_entry)\n", @@ -178,13 +172,11 @@ "\n", "esse_entries = list(map(lambda e: convert_jarvis_entry_to_esse(e)[0], jarvis_db_entries))\n", "poscars = list(map(lambda e: convert_jarvis_entry_to_esse(e)[1], jarvis_db_entries))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8770ec48", + "id": "13", "metadata": {}, "source": [ "### 3.5. Preview the data" @@ -192,8 +184,10 @@ }, { "cell_type": "code", - "id": "860b5c1b", + "execution_count": null, + "id": "14", "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.made.tools.convert import from_poscar\n", @@ -205,13 +199,11 @@ "materials = [Material.create(from_poscar(poscar)) for poscar in poscars]\n", "\n", "visualize_materials(materials)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a4a48479c7ea090f", + "id": "15", "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" @@ -219,15 +211,15 @@ }, { "cell_type": "code", - "id": "00b187ab", + "execution_count": null, + "id": "16", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(materials)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { @@ -247,13 +239,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/import_materials_from_files.ipynb b/other/materials_designer/import_materials_from_files.ipynb index 53a20c37..36c60af0 100644 --- a/other/materials_designer/import_materials_from_files.ipynb +++ b/other/materials_designer/import_materials_from_files.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "826fcc4c", + "id": "0", "metadata": {}, "source": [ "# Import materials from files in multiple formats (CIF, POSCAR, etc.)\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "4299768d", + "id": "1", "metadata": {}, "source": [ "## 1. Set Parameters" @@ -37,8 +37,10 @@ }, { "cell_type": "code", - "id": "9c1f4e9e", + "execution_count": null, + "id": "2", "metadata": {}, + "outputs": [], "source": [ "# Upload files to this folder\n", "FOLDER_PATH = \"./uploads\"\n", @@ -52,13 +54,11 @@ "\n", "# If set to true, the supported formats and required extensions will be printed below\n", "SHOW_SUPPORTED_FORMATS = False" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8b00ab6854f2263b", + "id": "3", "metadata": {}, "source": [ "## 2. Install Packages" @@ -66,10 +66,10 @@ }, { "cell_type": "code", - "id": "ef2b38a5-de7e-419e-b605-110e9e0095f5", - "metadata": { - "trusted": true - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "if sys.platform == \"emscripten\":\n", @@ -78,13 +78,11 @@ " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"import_materials_from_files.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "f418c51a7f794f9f", + "id": "5", "metadata": {}, "source": [ "## 3. Data Processing\n", @@ -94,11 +92,10 @@ }, { "cell_type": "code", - "id": "b1ee775d1476f884", - "metadata": { - "collapsed": false, - "trusted": true - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "import os\n", "from pathlib import Path\n", @@ -124,30 +121,30 @@ " else:\n", " unreadable_file_names.append(file_name)\n", " print(\"Failed to read:\", file_name)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "57b0d358", + "id": "7", "metadata": {}, - "source": "### 3.2. List imported the data" + "source": [ + "### 3.2. List imported the data" + ] }, { "cell_type": "code", - "id": "0e34472a", + "execution_count": null, + "id": "8", "metadata": {}, + "outputs": [], "source": [ "print(f\"Successfully read {len(ase_atoms)} files: {readable_file_names}. \")\n", "print(f\"Unreadable files: {unreadable_file_names}. \")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "15fe5f9de299c935", + "id": "9", "metadata": {}, "source": [ "### 3.3. Troubleshoot data" @@ -155,8 +152,10 @@ }, { "cell_type": "code", - "id": "a771a36a", + "execution_count": null, + "id": "10", "metadata": {}, + "outputs": [], "source": [ "from ase.io.formats import ioformats\n", "import pandas as pd\n", @@ -166,13 +165,11 @@ " data = [[frmt.name, frmt.extensions, frmt.description] for frmt in ioformats.values()]\n", " dataframe = pd.DataFrame(data, columns=[\"Format Name\", \"File Extensions\", \"Description\"])\n", " print(dataframe.to_markdown())" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "ef5f9e9d", + "id": "11", "metadata": {}, "source": [ "### 3.4. Convert to ESSE format" @@ -180,11 +177,10 @@ }, { "cell_type": "code", - "id": "c41fb68c6d25fe48", - "metadata": { - "collapsed": false, - "trusted": true - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "import io\n", "from ase import Atoms\n", @@ -226,13 +222,11 @@ " return None\n", "\n", "esse_entries = [entry for entry in map(convert_ase_entry_to_esse, ase_atoms) if entry is not None]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8770ec48", + "id": "13", "metadata": {}, "source": [ "### 3.5. Preview the data" @@ -240,8 +234,10 @@ }, { "cell_type": "code", - "id": "860b5c1b", + "execution_count": null, + "id": "14", "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "from mat3ra.made.material import Material\n", @@ -249,13 +245,11 @@ "materials = [Material(esse_entry) for esse_entry in esse_entries]\n", "\n", "visualize_materials(materials, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a4a48479c7ea090f", + "id": "15", "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" @@ -263,15 +257,15 @@ }, { "cell_type": "code", - "id": "00b187ab", + "execution_count": null, + "id": "16", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "set_materials(materials)" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { @@ -291,13 +285,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/optimize_film_position.ipynb b/other/materials_designer/optimize_film_position.ipynb index 6dfcbd61..544956d7 100644 --- a/other/materials_designer/optimize_film_position.ipynb +++ b/other/materials_designer/optimize_film_position.ipynb @@ -2,6 +2,8 @@ "cells": [ { "cell_type": "markdown", + "id": "0", + "metadata": {}, "source": [ "# Optimize Interface Film Position\n", "\n", @@ -23,14 +25,14 @@ "\n", "## 1. Prepare the Environment\n", "### 1.1. Install Packages\n" - ], - "metadata": { - "collapsed": false - }, - "id": "4dc7b2ed495d66e0" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "1", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -42,26 +44,22 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"\")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "dd86bee2985f1b50", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "2", + "metadata": {}, "source": [ "### 1.2. Set optimization parameters\n" - ], - "metadata": { - "collapsed": false - }, - "id": "cca70ab27ef1d01d" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "MATERIAL_INDEX = 0 # Index of the material to optimize\n", "# Grid parameters\n", @@ -73,77 +71,65 @@ "# Visualization parameters\n", "SHOW_3D_LANDSCAPE = False # Whether to show 3D energy landscape\n", "STRUCTURE_REPETITIONS = [3, 3, 1] # Repetitions for structure visualization\n" - ], - "metadata": { - "collapsed": false - }, - "id": "12878fd61f5a6b13", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "4", + "metadata": {}, "source": [ "## 3. Load Material\n", "### 3.1. Make sure that loaded material is an interface material (atoms must have labels \"0\" for the substrate and \"1\" for the film)" - ], - "metadata": { - "collapsed": false - }, - "id": "463af646361cd982" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import get_materials\n", "\n", "materials = get_materials(globals())\n", "interface_material = materials[MATERIAL_INDEX]\n" - ], - "metadata": { - "collapsed": false - }, - "id": "3d982a1ca641f0d8", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "6", + "metadata": {}, "source": [ "### 3.2. Visualize the Material\n" - ], - "metadata": { - "collapsed": false - }, - "id": "e920a6dd4906d8e8" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "7", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([interface_material], repetitions=STRUCTURE_REPETITIONS)\n", "visualize_materials([interface_material], repetitions=STRUCTURE_REPETITIONS, rotation='-90x')" - ], - "metadata": { - "collapsed": false - }, - "id": "5f4afdb7ac0c865b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "8", + "metadata": {}, "source": [ "### 3.3. Optimize Film Position" - ], - "metadata": { - "collapsed": false - }, - "id": "90255d774f62d1da" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.build.interface import get_optimal_film_displacement\n", "from mat3ra.made.tools.modify import interface_displace_part\n", @@ -174,27 +160,23 @@ ")\n", "\n", "print(f\"\\nOptimal displacement vector: {optimal_displacement}\")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "eb0b6e59c24dda4", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "10", + "metadata": {}, "source": [ "## 4. Visualize Results\n", "### 4.1. Plot Energy Landscape" - ], - "metadata": { - "collapsed": false - }, - "id": "2945179d3729935d" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.utils.jupyterlite.plot import plot_2d_heatmap, plot_3d_surface\n", "\n", @@ -211,26 +193,22 @@ " displacement=optimal_displacement,\n", " use_cartesian_coordinates=USE_CARTESIAN\n", ")\n" - ], - "metadata": { - "collapsed": false - }, - "id": "41ac6b383001db6b", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "12", + "metadata": {}, "source": [ "### 4.1. Visualize Original and Optimized Materials" - ], - "metadata": { - "collapsed": false - }, - "id": "82a1af573c6ca0e9" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], "source": [ "print(\"\\nVisualization of original and optimized materials:\")\n", "visualize_materials([interface_material, optimized_material],\n", @@ -238,38 +216,28 @@ "visualize_materials([interface_material, optimized_material],\n", " repetitions=STRUCTURE_REPETITIONS,\n", " rotation='-90x')\n" - ], - "metadata": { - "collapsed": false - }, - "id": "e7972543ae747b68", - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "14", + "metadata": {}, "source": [ "## 5. Save Results\n" - ], - "metadata": { - "collapsed": false - }, - "id": "b4f6308e795e4f3c" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", "\n", "optimized_material.name = f\"{interface_material.name} Optimized XY\"\n", "set_materials(optimized_material)" - ], - "metadata": { - "collapsed": false - }, - "id": "c81ec652fbb64316", - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb index 1a2918b7..edecdafb 100644 --- a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb +++ b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f2e1e795020d7b3f", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Create a custom-shape cutout (Si)\n", "\n", @@ -28,10 +26,8 @@ }, { "cell_type": "markdown", - "id": "98aa134f51746218", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Install Packages\n", @@ -41,10 +37,8 @@ { "cell_type": "code", "execution_count": null, - "id": "280f9794a876678b", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -61,10 +55,8 @@ }, { "cell_type": "markdown", - "id": "b3d4d3ea7b589f89", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "source": [ "### 1.2. Set up structure parameters " ] @@ -72,10 +64,8 @@ { "cell_type": "code", "execution_count": null, - "id": "5177e239254e3601", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "# Slab parameters\n", @@ -97,10 +87,8 @@ }, { "cell_type": "markdown", - "id": "361c291aaf3feb2a", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Create a condition on coordinates\n" ] @@ -108,10 +96,8 @@ { "cell_type": "code", "execution_count": null, - "id": "56c8227695643174", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from typing import List\n", @@ -182,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "73bcac566392be2e", + "id": "7", "metadata": {}, "source": [ "### 1.4. Get input materials" @@ -191,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db7ec34d105a7f63", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "f85547bcf667a508", + "id": "9", "metadata": {}, "source": [ "### 1.5. Preview the material" @@ -213,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f00247a517992ddf", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -225,10 +211,8 @@ }, { "cell_type": "markdown", - "id": "615800437b2ef7a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 2. Create target material\n", "### 2.1. Create a slab and visualize it" @@ -237,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8938220048670941", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "b52118b5a4fb494c", + "id": "13", "metadata": {}, "source": [ "### 2.2. Apply the cutout condition and add vacuum" @@ -267,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1a13d9490a4d5ca", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -278,10 +262,8 @@ }, { "cell_type": "markdown", - "id": "57cc38ec0df3c1f7", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "## 3. Visualize the result" ] @@ -289,7 +271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20f499a8dd2362e0", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -299,10 +281,8 @@ }, { "cell_type": "markdown", - "id": "c67e6f5363e80942", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "# 4. Pass material to the outside runtime" ] @@ -310,10 +290,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cbee60d4b936e5cb", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import set_materials\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb index e8bd10ba..5b902643 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "415ed707e27a6c8e", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# A 2D grain boundary in Boron Nitride\n", "\n", @@ -25,10 +23,8 @@ }, { "cell_type": "markdown", - "id": "a080006df3785cc5", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook\n", @@ -38,10 +34,8 @@ { "cell_type": "code", "execution_count": null, - "id": "338ee3c51155e086", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "# Material selection\n", @@ -64,10 +58,8 @@ }, { "cell_type": "markdown", - "id": "6463f9bbcd3be7c7", - "metadata": { - "collapsed": false - }, + "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`." @@ -76,10 +68,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7e22d1f4da825575", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -96,10 +86,8 @@ }, { "cell_type": "markdown", - "id": "4a1cfe15caa44c3e", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load and preview input material" ] @@ -107,10 +95,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a1635c31132962f6", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", @@ -121,10 +107,8 @@ }, { "cell_type": "markdown", - "id": "32b3ad775543b06f", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "## 2. Prepare Material\n", "### 2.1. Select and visualize initial material" @@ -133,10 +117,8 @@ { "cell_type": "code", "execution_count": null, - "id": "61f0870d8104cd21", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", @@ -147,10 +129,8 @@ }, { "cell_type": "markdown", - "id": "34d6c7a337f1e40b", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 3. Generate Surface Grain Boundary\n", "### 3.1. Set up grain boundary configuration and builder\n" @@ -159,10 +139,8 @@ { "cell_type": "code", "execution_count": null, - "id": "33a2c8a9be436745", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum\n", @@ -184,10 +162,8 @@ }, { "cell_type": "markdown", - "id": "79e9378bf5e144d4", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 3.2. Generate and analyze grain boundaries\n" ] @@ -195,10 +171,8 @@ { "cell_type": "code", "execution_count": null, - "id": "d7007fe825463e5a", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "outputs": [], "source": [ "actual_angle = grain_boundary.metadata.build[-1].configuration.get(\"actual_angle\", \"unknown\")\n", @@ -209,10 +183,8 @@ }, { "cell_type": "markdown", - "id": "8b2f0574a20089a5", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Preview the grain boundary" ] @@ -220,10 +192,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7f558a8e9d417cef", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "outputs": [], "source": [ "visualize_materials(grain_boundary, title=\"Grain Boundary\", viewer=\"wave\")" @@ -231,10 +201,8 @@ }, { "cell_type": "markdown", - "id": "afcc004c5878b56f", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 5. Pass data to the outside runtime\n" ] @@ -242,10 +210,8 @@ { "cell_type": "code", "execution_count": null, - "id": "20e46167358d63", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index ebc3fb7a..7ca228d1 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "f0ccd3190ce70a68", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Vacancy Point Defect in boron nitride (h-BN)\n", "\n", @@ -28,10 +26,8 @@ }, { "cell_type": "markdown", - "id": "aae97744e3023a1b", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -43,10 +39,10 @@ }, { "cell_type": "code", - "id": "dff59577346dbece", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Matrix to get the supercell of primitive hBN exactly as shown in the manuscript\n", "SUPERCELL_MATRIX = [[-6, -6, 0], [-2, 2, 0], [0, 0, 1]]\n", @@ -57,16 +53,12 @@ " \"placement_method\": \"closest_site\",\n", " \"use_cartesian_coordinates\": False\n", " }\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "14d161d4b61ca219", - "metadata": { - "collapsed": false - }, + "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))." @@ -74,10 +66,10 @@ }, { "cell_type": "code", - "id": "8c6ea8b36f1a6cc", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -89,16 +81,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "da6733a515019677", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load input material\n", "In this notebook we will use the material from the `uploads` folder that has a few pre-set materials." @@ -106,35 +94,31 @@ }, { "cell_type": "code", - "id": "14c40630ba2974e6", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.material import Material\n", "from mat3ra.standata.materials import Materials\n", "\n", "material = Material.create(Materials.get_by_name_and_categories(\"Boron_Nitride\", \"2D\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "9fcc51573071c301", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Nanoribbon" ] }, { "cell_type": "code", - "id": "6d5a793dd5e45f16", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "from mat3ra.made.tools.helpers import create_supercell\n", @@ -145,26 +129,22 @@ ")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"0x\")\n", "visualize(nanoribbon, repetitions=[1, 1, 1], rotation=\"-90x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "e41cf1646620915d", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defect\n" ] }, { "cell_type": "code", - "id": "db2d621e2fd4bbeb", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_vacancy\n", "\n", @@ -174,61 +154,51 @@ " placement_method=DEFECT_CONFIG[\"placement_method\"],\n", " use_cartesian_coordinates=DEFECT_CONFIG[\"use_cartesian_coordinates\"]\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "2b58b5e76bd167d8", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "d4a1e920884b1a48", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "visualize([{\"material\": nanoribbon, \"title\": \"Original material\"},\n", " {\"material\": material_with_defect, \"title\": \"Material with defect\"}],\n", " viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "865c3b666e06fd10", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Write resulting material to the folder" ] }, { "cell_type": "code", - "id": "7dcf867f46422fa9", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "material_with_defect.name = \"B-vacancy h-BN\"\n", "set_materials(material_with_defect)\n", "download_content_to_file(material_with_defect.to_json(), \"B-vacancy_hexagonal_boron_nitride.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index 45060c5e..49c61505 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "c62d2c5007947f56", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Adatom Defect on Graphene surface\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "4d0772a456c9952c", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defects parameters \n", @@ -39,10 +35,10 @@ }, { "cell_type": "code", - "id": "b5459bac655071be", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Name of material to find in Standata\n", "MATERIAL_NAME = \"Graphene\"\n", @@ -70,16 +66,12 @@ " {\"chemical_element\": \"Pd\", \"distance_z\": 2.21, \"position_on_surface\": BRIDGE_SITE_COORDINATE},\n", " # {\"chemical_element\": \"Au\", \"distance_z\": 2.69, \"position_on_surface\": TOP_SITE_COORDINATE},\n", "]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "d572e8697122fef5", - "metadata": { - "collapsed": false - }, + "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))." @@ -87,10 +79,10 @@ }, { "cell_type": "code", - "id": "58b0da5bbc87efc6", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -102,51 +94,43 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples|create_point_defect.ipynb\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "b342c025f3e369d4", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Load input material" ] }, { "cell_type": "code", - "id": "7ebdb82cd32c735c", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "material = Material.create(Materials.get_by_name_first_match(MATERIAL_NAME))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "8f459296488702b1", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Create and preview Supercell" ] }, { "cell_type": "code", - "id": "926503f431d18cad", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", "from utils.visualize import visualize_materials as visualize\n", @@ -156,26 +140,22 @@ " xy_supercell_matrix=XY_SUPERCELL_MATRIX\n", " )\n", "visualize(supercell, repetitions=[1, 1, 1], rotation=\"0x\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "2de6554d42e97c9d", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Create the Defect" ] }, { "cell_type": "code", - "id": "6fc8ad13e12845f", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_adatom\n", "\n", @@ -186,52 +166,44 @@ " distance_z=adatom_parameters[\"distance_z\"],\n", " position_on_surface=adatom_parameters[\"position_on_surface\"],\n", ") for adatom_parameters in ADATOM_PARAMETERS]" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5ebf2d6bb1a82b9a", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Visualize Result(s)" ] }, { "cell_type": "code", - "id": "93a18e3e1d6e3e6e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", "\n", "for material_with_defect in materials_with_adatom:\n", " title = f\"{material_with_defect.name} adatom\"\n", " visualize([{\"material\": material_with_defect, \"title\": title}], viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "61176790d8d979e0", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 4. Download the Results" ] }, { "cell_type": "code", - "id": "20ab1b4be207428c", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", @@ -239,9 +211,7 @@ "for material_with_defect in materials_with_adatom:\n", " download_content_to_file(material_with_defect.to_json(),\n", " f\"{material_with_defect.name}.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index 894c242e..0ca25541 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -24,9 +24,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up the notebook \n", @@ -69,9 +67,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "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))." @@ -80,9 +76,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -120,9 +114,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 1.4. Preview Substrate and Film" ] @@ -130,9 +122,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -165,9 +155,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.2. Visualize slabs for all possible terminations" ] @@ -175,9 +163,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_slab\n", @@ -220,9 +206,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 2.4. Create Substrate and Film Slabs\n", "Slab Configuration lets define the slab thickness, vacuum, and the Miller indices of the interfacial plane and get the slabs with possible terminations.\n", @@ -232,9 +216,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab import SlabConfiguration, SlabBuilder\n", @@ -263,9 +245,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "## 3. Analyze possible interfaces with ZSL Analyzer\n", "### 3.1. Initialize ZSL Analyzer\n", @@ -275,9 +255,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n", @@ -295,9 +273,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 3.2. Generate matches with strain analyzer\n", "Matches are sorted by size and strain." @@ -306,9 +282,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "matches = zsl_analyzer.zsl_match_holders" @@ -316,9 +290,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 3.3. Plot matches by area and strain" ] @@ -326,9 +298,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "from utils.plot import plot_strain_vs_area\n", @@ -344,9 +314,7 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ "### 3.4. Select the interface\n", "\n", @@ -356,9 +324,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "selected_index = 0\n", @@ -479,13 +445,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } } }, "nbformat": 4, diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 73ccc0a7..8b5c6017 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "81aa051ca1ca2e05", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Passivation of Silicon Nanowire\n", "\n", @@ -27,10 +25,8 @@ }, { "cell_type": "markdown", - "id": "af879d0489a86849", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the environment\n", "### 1.1. Set up the notebook" @@ -38,10 +34,10 @@ }, { "cell_type": "code", - "id": "f704e7abe8fbe895", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], "source": [ "# Enable interactive selection of coordination threshold\n", "IS_COORDINATION_SELECTION_INTERACTIVE = False\n", @@ -51,16 +47,12 @@ "COORDINATION_SEARCH_RADIUS = 2.5 # in Angstroms (sphere in which to search for neighbors)\n", "COORDINATION_THRESHOLD = 3 # Coordination number below which to passivate\n", "MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "aca8179cd83de117", - "metadata": { - "collapsed": false - }, + "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))." @@ -68,10 +60,10 @@ }, { "cell_type": "code", - "id": "37904650f2478a1d", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], "source": [ "import sys\n", "\n", @@ -83,16 +75,12 @@ " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", " await install_packages(\"specific_examples\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "25ed776c9802142e", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "## 2. Create the Silicon Nanowire\n", "### 2.1. Get input material\n", @@ -101,25 +89,21 @@ }, { "cell_type": "code", - "id": "6d48372afc12056e", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "6", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", "from mat3ra.made.material import Material\n", "\n", "silicon = Material.create(Materials.get_by_name_first_match('Silicon'))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "602e2ef359ef1b83", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 2.2. Create a silicon nanowire\n", "Nanowire is cut from a slab of Silicon with a box filter, crystal is rotated at an angle to allow for precise cut." @@ -127,10 +111,10 @@ }, { "cell_type": "code", - "id": "f8431fd833f6ed", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.operations.core.unary import rotate\n", "from mat3ra.made.tools.modify import filter_by_box, add_vacuum_sides, translate_to_center\n", @@ -153,64 +137,52 @@ "# visualize_materials([{\"material\": rotated_slab},{\"material\": silicon_nanowire}, {\"material\": silicon_nanowire, \"rotation\": \"-90x\"}])\n", "nanowire_xy_pbc = rotate(silicon_nanowire, \"z\", 90+angle)\n", "nanowire_xy_pbc = add_vacuum_sides(nanowire_xy_pbc, 10.0, on_x=True, on_y=True)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "ea153d126ac5695d", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "### 2.3. Visualize the Material" ] }, { "cell_type": "code", - "id": "76a4b4b6318d2549", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [ "from utils.visualize import visualize_materials\n", "\n", "visualize_materials([{\"material\": nanowire_xy_pbc}, {\"material\": nanowire_xy_pbc, \"rotation\": \"-90x\"}])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "4eb261774078348f", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "### 2.4. Compute the radial distribution function (RDF) of the Material" ] }, { "cell_type": "code", - "id": "bb206aac50a38bb6", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], "source": [ "from utils.plot import plot_rdf\n", "\n", "plot_rdf(nanowire_xy_pbc, cutoff=10.0)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "a79faa88a33c8fdb", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "source": [ "## 3. Create passivated material\n", "### 3.1. Set the passivation parameters including the coordination threshold" @@ -218,10 +190,10 @@ }, { "cell_type": "code", - "id": "7b80ee26896bbbfb", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], "source": [ "from utils.io import select_coordination_threshold\n", "from mat3ra.made.tools.helpers import get_unique_coordination_numbers\n", @@ -233,26 +205,22 @@ "coordination_threshold = COORDINATION_THRESHOLD\n", "if IS_COORDINATION_SELECTION_INTERACTIVE:\n", " coordination_threshold = await select_coordination_threshold(coordination_numbers, COORDINATION_THRESHOLD)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "47744926ab328a82", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "source": [ "### 3.2. Create the passivated material" ] }, { "cell_type": "code", - "id": "398b2dedef23e0fc", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], "source": [ "from mat3ra.made.tools.helpers import passivate_dangling_bonds\n", "\n", @@ -264,55 +232,47 @@ " coordination_threshold=coordination_threshold,\n", " number_of_bonds_to_passivate=MAX_BONDS_TO_SATURATE,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "2b1a300ab807ce6d", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "source": [ "## 4. Preview the Material" ] }, { "cell_type": "code", - "id": "cb85e7e42c0944f2", - "metadata": { - "collapsed": false - }, + "execution_count": null, + "id": "18", + "metadata": {}, + "outputs": [], "source": [ "visualize_materials(passivated_nanowire, viewer=\"wave\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", - "id": "5d7fa9201651fa72", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "source": [ "## 5. Download the Material" ] }, { "cell_type": "code", - "id": "51a4fc8cbadfb526", + "execution_count": null, + "id": "20", "metadata": {}, + "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", "\n", "passivated_nanowire.name = \"H-Passivated Silicon Nanowire\"\n", "set_materials(passivated_nanowire)\n", "download_content_to_file(passivated_nanowire.to_json(), \"passivated_nanowire.json\")" - ], - "outputs": [], - "execution_count": null + ] } ], "metadata": { diff --git a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb index a3f09c24..010f76c0 100644 --- a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb +++ b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "367a698b29e22bd7", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Ripple perturbation of a graphene sheet.\n", "\n", @@ -26,20 +24,16 @@ }, { "cell_type": "markdown", - "id": "193a4e6a78fd5bd7", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment" ] }, { "cell_type": "markdown", - "id": "f38b2711726e5859", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "source": [ "### 1.1. 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))." @@ -48,10 +42,8 @@ { "cell_type": "code", "execution_count": null, - "id": "7a6e28cfae1a7b46", - "metadata": { - "collapsed": false - }, + "id": "3", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -68,10 +60,8 @@ }, { "cell_type": "markdown", - "id": "11db992e02891067", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "source": [ "### 1.2. Set Nanoribbon and Perturbation Parameters" ] @@ -79,10 +69,8 @@ { "cell_type": "code", "execution_count": null, - "id": "a40d7b697c413113", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "outputs": [], "source": [ "# Set whether to preserve geodesic distance and scale the cell accordingly to match PBC\n", @@ -99,10 +87,8 @@ }, { "cell_type": "markdown", - "id": "e6a19c741406eafe", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "source": [ "### 1.3. Define Custom Perturbation Function\n", "Provide a [SymPy](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) expression for the perturbation function. The expression should be a function of `x`, `y` and `z` variables." @@ -111,10 +97,8 @@ { "cell_type": "code", "execution_count": null, - "id": "203911c2413c7447", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -153,10 +137,8 @@ }, { "cell_type": "markdown", - "id": "edf02101e27a2742", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "source": [ "### 1.4. Get input materials" ] @@ -164,10 +146,8 @@ { "cell_type": "code", "execution_count": null, - "id": "e0c53233ce728cc1", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.standata.materials import Materials\n", @@ -178,10 +158,8 @@ }, { "cell_type": "markdown", - "id": "cf29b7f6fe114d8f", - "metadata": { - "collapsed": false - }, + "id": "10", + "metadata": {}, "source": [ "### 1.5. Create and preview Nanoribbon" ] @@ -189,10 +167,8 @@ { "cell_type": "code", "execution_count": null, - "id": "897ba7aa4e402d24", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_nanoribbon\n", @@ -210,10 +186,8 @@ }, { "cell_type": "markdown", - "id": "6d4adf0d580e0340", - "metadata": { - "collapsed": false - }, + "id": "12", + "metadata": {}, "source": [ "## 2. Create a target material\n", "### 2.1. Set custom perturbation parameters\n" @@ -222,10 +196,8 @@ { "cell_type": "code", "execution_count": null, - "id": "8d90932312c418ee", - "metadata": { - "collapsed": false - }, + "id": "13", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import PerturbationFunctionHolder\n", @@ -240,10 +212,8 @@ }, { "cell_type": "markdown", - "id": "7695d5d1df6be2e3", - "metadata": { - "collapsed": false - }, + "id": "14", + "metadata": {}, "source": [ "### 2.2. Apply perturbation to the material" ] @@ -251,10 +221,8 @@ { "cell_type": "code", "execution_count": null, - "id": "69ccc90b8c5c1191", - "metadata": { - "collapsed": false - }, + "id": "15", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.tools.helpers import create_perturbation\n", @@ -265,10 +233,8 @@ }, { "cell_type": "markdown", - "id": "10e7ca8950839991", - "metadata": { - "collapsed": false - }, + "id": "16", + "metadata": {}, "source": [ "### 3. Visualize the Material" ] @@ -276,10 +242,8 @@ { "cell_type": "code", "execution_count": null, - "id": "cbfe0878a16f6c83", - "metadata": { - "collapsed": false - }, + "id": "17", + "metadata": {}, "outputs": [], "source": [ "visualize(material_with_custom_perturbation, viewer=\"wave\")" @@ -287,10 +251,8 @@ }, { "cell_type": "markdown", - "id": "9e0b241366592109", - "metadata": { - "collapsed": false - }, + "id": "18", + "metadata": {}, "source": [ "## 4. Pass data to the outside runtime" ] @@ -298,10 +260,8 @@ { "cell_type": "code", "execution_count": null, - "id": "29dfa0a329cca2fa", - "metadata": { - "collapsed": false - }, + "id": "19", + "metadata": {}, "outputs": [], "source": [ "from utils.jupyterlite import download_content_to_file, set_materials\n", diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index a9b2245a..c3f5c9fd 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -2,10 +2,8 @@ "cells": [ { "cell_type": "markdown", - "id": "95a274d80df28ccd", - "metadata": { - "collapsed": false - }, + "id": "0", + "metadata": {}, "source": [ "# Slabs of SrTiO3(011) with specified terminations\n", "\n", @@ -26,10 +24,8 @@ }, { "cell_type": "markdown", - "id": "d55eaee8bc55bffd", - "metadata": { - "collapsed": false - }, + "id": "1", + "metadata": {}, "source": [ "## 1. Prepare the Environment\n", "### 1.1. Set up defect parameters " @@ -38,10 +34,8 @@ { "cell_type": "code", "execution_count": null, - "id": "4b64735060047bec", - "metadata": { - "collapsed": false - }, + "id": "2", + "metadata": {}, "outputs": [], "source": [ "MILLER_INDICES = (0, 1, 1)\n", @@ -54,10 +48,8 @@ }, { "cell_type": "markdown", - "id": "5e0ce05f6f031b3f", - "metadata": { - "collapsed": false - }, + "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))." @@ -66,10 +58,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b457673560550933", - "metadata": { - "collapsed": false - }, + "id": "4", + "metadata": {}, "outputs": [], "source": [ "import sys\n", @@ -86,10 +76,8 @@ }, { "cell_type": "markdown", - "id": "1659a8e9afe434fb", - "metadata": { - "collapsed": false - }, + "id": "5", + "metadata": {}, "source": [ "### 1.3. Get input materials" ] @@ -97,10 +85,8 @@ { "cell_type": "code", "execution_count": null, - "id": "b588ccfe51967a86", - "metadata": { - "collapsed": false - }, + "id": "6", + "metadata": {}, "outputs": [], "source": [ "from mat3ra.made.material import Material\n", @@ -111,10 +97,8 @@ }, { "cell_type": "markdown", - "id": "8c13970a869adfa9", - "metadata": { - "collapsed": false - }, + "id": "7", + "metadata": {}, "source": [ "### 1.4. Preview the material" ] @@ -122,10 +106,8 @@ { "cell_type": "code", "execution_count": null, - "id": "c4f6e2697f97965f", - "metadata": { - "collapsed": false - }, + "id": "8", + "metadata": {}, "outputs": [], "source": [ "from utils.visualize import visualize_materials as visualize\n", @@ -136,10 +118,8 @@ }, { "cell_type": "markdown", - "id": "6634dae92a6c07b9", - "metadata": { - "collapsed": false - }, + "id": "9", + "metadata": {}, "source": [ "## 2. Get possible terminations for the slab\n" ] @@ -147,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "730569ace3c4024", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -161,10 +141,8 @@ }, { "cell_type": "markdown", - "id": "c6e2e18452972b21", - "metadata": { - "collapsed": false - }, + "id": "11", + "metadata": {}, "source": [ "## 3. Create and visualize slabs" ] @@ -172,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "958bccf0c45b902b", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "63ceec59586339f0", + "id": "13", "metadata": {}, "source": [ "## 4. Download materials" @@ -203,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7d16e2a84a9dbb", + "id": "14", "metadata": {}, "outputs": [], "source": [ From 5f420e9f1857c927fdc56f34bd609388bc701648 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 19:36:38 -0700 Subject: [PATCH 25/26] update: validate shape params --- .../create_island_defect.ipynb | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index 9d18a354..be672084 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -39,6 +39,7 @@ "metadata": {}, "outputs": [], "source": [ + "from types import SimpleNamespace\n", "\n", "# Shape-specific parameters\n", "# Choose the island shape: 'cylinder', 'sphere', 'box', or 'triangular_prism'\n", @@ -89,7 +90,8 @@ "# 'min_z': 0,\n", "# 'max_z': 1\n", "# }\n", - "\n" + "\n", + "SHAPE_PARAMETERS = SimpleNamespace(**SHAPE_PARAMETERS)" ] }, { @@ -189,12 +191,34 @@ "metadata": {}, "outputs": [], "source": [ - "from mat3ra.made.tools.entities.coordinate import CylinderCoordinateCondition\n", + "from mat3ra.made.tools.entities.coordinate import CylinderCoordinateCondition, \\\n", + " SphereCoordinateCondition, BoxCoordinateCondition, TriangularPrismCoordinateCondition\n", + "\n", + "condition = None\n", "\n", - "condition = CylinderCoordinateCondition(\n", - " center_position=CENTER_POSITION,\n", - " radius=SHAPE_PARAMETERS['radius'],\n", - ")" + "if SHAPE_PARAMETERS.shape == 'cylinder':\n", + " condition = CylinderCoordinateCondition(\n", + " center_position=CENTER_POSITION,\n", + " radius=SHAPE_PARAMETERS.radius,\n", + " min_z=SHAPE_PARAMETERS.min_z,\n", + " max_z=SHAPE_PARAMETERS.max_z)\n", + "elif SHAPE_PARAMETERS.shape == 'sphere':\n", + " condition = SphereCoordinateCondition(\n", + " center_coordinate=CENTER_POSITION,\n", + " radius=SHAPE_PARAMETERS.radius)\n", + "elif SHAPE_PARAMETERS.shape == 'box':\n", + " condition = BoxCoordinateCondition(\n", + " min_coordinate=SHAPE_PARAMETERS.min_coordinate,\n", + " max_coordinate=SHAPE_PARAMETERS.max_coordinate)\n", + "elif SHAPE_PARAMETERS.shape == 'triangular_prism':\n", + " condition = TriangularPrismCoordinateCondition(\n", + " position_on_surface_1=SHAPE_PARAMETERS.position_on_surface_1,\n", + " position_on_surface_2=SHAPE_PARAMETERS.position_on_surface_2,\n", + " position_on_surface_3=SHAPE_PARAMETERS.position_on_surface_3,\n", + " min_z=SHAPE_PARAMETERS.min_z,\n", + " max_z=SHAPE_PARAMETERS.max_z)\n", + "else:\n", + " raise ValueError(f\"Unknown shape: {SHAPE_PARAMETERS.shape}\")\n" ] }, { @@ -238,11 +262,11 @@ "outputs": [], "source": [ "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", - " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}] ,\n", + " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS.shape})\"}] ,\n", "rotation=\"-90x\")\n", "\n", "visualize([{\"material\": slab, \"title\": \"Original material\"},\n", - " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS['shape']})\"}], rotation=\"-90x\")" + " {\"material\": slab_with_island, \"title\": f\"Material with Island Defect ({SHAPE_PARAMETERS.shape})\"}], rotation=\"-90x\")" ] }, { From 0af326ad1dfd698a485d57b7785b257e181f1530 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Fri, 8 Aug 2025 21:32:27 -0700 Subject: [PATCH 26/26] update: import made ax from pypi --- config.yml | 7 ++++--- other/materials_designer/create_adatom_defect.ipynb | 2 +- other/materials_designer/create_cluster_custom_shape.ipynb | 2 +- .../materials_designer/create_cluster_specific_shape.ipynb | 2 +- other/materials_designer/create_cluster_sphere.ipynb | 2 +- other/materials_designer/create_cutout_box.ipynb | 2 +- other/materials_designer/create_cutout_custom_shape.ipynb | 2 +- .../materials_designer/create_grain_boundary_crystal.ipynb | 2 +- other/materials_designer/create_grain_boundary_film.ipynb | 2 +- .../create_heterostructure_example.ipynb | 2 +- .../create_interface_with_min_strain_zsl.ipynb | 2 +- .../create_interface_with_no_strain_matching.ipynb | 2 +- .../create_interface_with_relaxation_ase_emt.ipynb | 2 +- other/materials_designer/create_island_defect.ipynb | 2 +- other/materials_designer/create_island_defect_custom.ipynb | 2 +- other/materials_designer/create_monolayer.ipynb | 2 +- other/materials_designer/create_nanoribbon.ipynb | 2 +- other/materials_designer/create_nanowire.ipynb | 2 +- .../materials_designer/create_nanowire_custom_shape.ipynb | 2 +- other/materials_designer/create_perturbation.ipynb | 2 +- other/materials_designer/create_perturbation_custom.ipynb | 2 +- other/materials_designer/create_point_defect.ipynb | 2 +- other/materials_designer/create_point_defect_pair.ipynb | 2 +- other/materials_designer/create_slab.ipynb | 2 +- other/materials_designer/create_supercell.ipynb | 2 +- other/materials_designer/create_terrace_defect.ipynb | 2 +- ...eate_twisted_interface_with_commensurate_lattices.ipynb | 2 +- .../create_twisted_interface_with_nanoribbons.ipynb | 2 +- other/materials_designer/custom_transformation.ipynb | 2 +- .../import_material_from_jarvis_db_entry.ipynb | 2 +- other/materials_designer/import_materials_from_files.ipynb | 2 +- .../import_materials_from_standata.ipynb | 2 +- other/materials_designer/optimize_film_position.ipynb | 2 +- other/materials_designer/passivate_edge.ipynb | 2 +- other/materials_designer/passivate_slab.ipynb | 2 +- .../specific_examples/custom_cutout_etched_silicon.ipynb | 2 +- .../defect_planar_grain_boundary_2d_boron_nitride.ipynb | 2 +- ...defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb | 2 +- ...point_adatom_island_molybdenum_disulfide_platinum.ipynb | 2 +- .../defect_point_interstitial_tin_oxide.ipynb | 2 +- .../defect_point_pair_gallium_nitride.ipynb | 2 +- .../defect_point_substitution_graphene.ipynb | 2 +- .../defect_point_vacancy_boron_nitride.ipynb | 2 +- .../specific_examples/defect_surface_adatom_graphene.ipynb | 2 +- .../defect_surface_island_titanium_nitride.ipynb | 2 +- .../specific_examples/defect_surface_step_platinum.ipynb | 2 +- ..._silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb | 2 +- .../interface_2d_2d_boron_nitride_graphene.ipynb | 2 +- .../interface_2d_3d_graphene_silicon_dioxide.ipynb | 2 +- .../interface_3d_3d_copper_cristobalite.ipynb | 2 +- ...wisted_commensurate_lattices_molybdenum_disulfide.ipynb | 2 +- ...terface_bilayer_twisted_nanoribbons_boron_nitride.ipynb | 2 +- .../specific_examples/nanocluster_gold.ipynb | 2 +- ...zation_interface_film_xy_position_graphene_nickel.ipynb | 2 +- .../passivation_edge_nanowire_silicon.ipynb | 2 +- .../specific_examples/passivation_surface_silicon.ipynb | 2 +- .../specific_examples/perturbation_ripple_graphene.ipynb | 2 +- .../specific_examples/slab_strontium_titanate.ipynb | 2 +- other/materials_designer/under_the_hood.ipynb | 2 +- other/materialsproject/api_interoperability_showcase.ipynb | 2 +- pyproject.toml | 2 +- 61 files changed, 64 insertions(+), 63 deletions(-) diff --git a/config.yml b/config.yml index 5e8f552e..8794d38e 100644 --- a/config.yml +++ b/config.yml @@ -31,9 +31,10 @@ default: - uncertainties==3.1.6 - jinja2 - pymatgen-analysis-defects<=2024.4.23 - - https://exabyte-io.github.io/made/mat3ra_made-0.1.dev1+gc4e8849-py3-none-any.whl # mat3ra-made==2025.8.1.post1 - - mat3ra-code - - mat3ra-esse + - mat3ra-made==2025.8.9.post0 +# packages below are used when made is installed from GH wheel +# - mat3ra-code +# - mat3ra-esse notebooks: - name: create_interface_with_min_strain_zsl.ipynb packages_common: diff --git a/other/materials_designer/create_adatom_defect.ipynb b/other/materials_designer/create_adatom_defect.ipynb index b9fe4a55..ebbce1ee 100644 --- a/other/materials_designer/create_adatom_defect.ipynb +++ b/other/materials_designer/create_adatom_defect.ipynb @@ -96,7 +96,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils', deps=False)\n", "\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", diff --git a/other/materials_designer/create_cluster_custom_shape.ipynb b/other/materials_designer/create_cluster_custom_shape.ipynb index c0a882e8..0257e5ae 100644 --- a/other/materials_designer/create_cluster_custom_shape.ipynb +++ b/other/materials_designer/create_cluster_custom_shape.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_specific_shape.ipynb b/other/materials_designer/create_cluster_specific_shape.ipynb index 6b5c922a..bd3f33dd 100644 --- a/other/materials_designer/create_cluster_specific_shape.ipynb +++ b/other/materials_designer/create_cluster_specific_shape.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cluster_sphere.ipynb b/other/materials_designer/create_cluster_sphere.ipynb index d3de41f6..8aef80aa 100644 --- a/other/materials_designer/create_cluster_sphere.ipynb +++ b/other/materials_designer/create_cluster_sphere.ipynb @@ -65,7 +65,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_box.ipynb b/other/materials_designer/create_cutout_box.ipynb index 07fe7f47..66b2fc5f 100644 --- a/other/materials_designer/create_cutout_box.ipynb +++ b/other/materials_designer/create_cutout_box.ipynb @@ -78,7 +78,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_cutout_custom_shape.ipynb b/other/materials_designer/create_cutout_custom_shape.ipynb index 2884bdcd..c49acc3b 100644 --- a/other/materials_designer/create_cutout_custom_shape.ipynb +++ b/other/materials_designer/create_cutout_custom_shape.ipynb @@ -46,7 +46,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_crystal.ipynb b/other/materials_designer/create_grain_boundary_crystal.ipynb index 18ca9449..218d5917 100644 --- a/other/materials_designer/create_grain_boundary_crystal.ipynb +++ b/other/materials_designer/create_grain_boundary_crystal.ipynb @@ -98,7 +98,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_grain_boundary_film.ipynb b/other/materials_designer/create_grain_boundary_film.ipynb index 0fdc8034..ccba448b 100644 --- a/other/materials_designer/create_grain_boundary_film.ipynb +++ b/other/materials_designer/create_grain_boundary_film.ipynb @@ -99,7 +99,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_heterostructure_example.ipynb b/other/materials_designer/create_heterostructure_example.ipynb index 210e048c..4d549967 100644 --- a/other/materials_designer/create_heterostructure_example.ipynb +++ b/other/materials_designer/create_heterostructure_example.ipynb @@ -121,7 +121,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 9c23fd1c..116ba943 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -102,7 +102,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 b068cd3c..89cfc30e 100644 --- a/other/materials_designer/create_interface_with_no_strain_matching.ipynb +++ b/other/materials_designer/create_interface_with_no_strain_matching.ipynb @@ -86,7 +86,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb index 8bc85535..150af9bb 100644 --- a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb @@ -65,7 +65,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" diff --git a/other/materials_designer/create_island_defect.ipynb b/other/materials_designer/create_island_defect.ipynb index be672084..2d10d11a 100644 --- a/other/materials_designer/create_island_defect.ipynb +++ b/other/materials_designer/create_island_defect.ipynb @@ -114,7 +114,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_island_defect_custom.ipynb b/other/materials_designer/create_island_defect_custom.ipynb index 7e7ec8d6..d1b4df64 100644 --- a/other/materials_designer/create_island_defect_custom.ipynb +++ b/other/materials_designer/create_island_defect_custom.ipynb @@ -47,7 +47,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_monolayer.ipynb b/other/materials_designer/create_monolayer.ipynb index 84db385c..5f2cc7d7 100644 --- a/other/materials_designer/create_monolayer.ipynb +++ b/other/materials_designer/create_monolayer.ipynb @@ -62,7 +62,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_nanoribbon.ipynb b/other/materials_designer/create_nanoribbon.ipynb index 925e2dfb..aa24761d 100644 --- a/other/materials_designer/create_nanoribbon.ipynb +++ b/other/materials_designer/create_nanoribbon.ipynb @@ -73,7 +73,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire.ipynb b/other/materials_designer/create_nanowire.ipynb index 2559caff..c673e7a5 100644 --- a/other/materials_designer/create_nanowire.ipynb +++ b/other/materials_designer/create_nanowire.ipynb @@ -61,7 +61,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_nanowire_custom_shape.ipynb b/other/materials_designer/create_nanowire_custom_shape.ipynb index b043e82f..571f3484 100644 --- a/other/materials_designer/create_nanowire_custom_shape.ipynb +++ b/other/materials_designer/create_nanowire_custom_shape.ipynb @@ -46,7 +46,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_perturbation.ipynb b/other/materials_designer/create_perturbation.ipynb index b45b7637..2672c096 100644 --- a/other/materials_designer/create_perturbation.ipynb +++ b/other/materials_designer/create_perturbation.ipynb @@ -69,7 +69,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_perturbation_custom.ipynb b/other/materials_designer/create_perturbation_custom.ipynb index 5087821e..7d6befe5 100644 --- a/other/materials_designer/create_perturbation_custom.ipynb +++ b/other/materials_designer/create_perturbation_custom.ipynb @@ -52,7 +52,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_point_defect.ipynb b/other/materials_designer/create_point_defect.ipynb index ba8f36b0..0fc08a16 100644 --- a/other/materials_designer/create_point_defect.ipynb +++ b/other/materials_designer/create_point_defect.ipynb @@ -90,7 +90,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_point_defect_pair.ipynb b/other/materials_designer/create_point_defect_pair.ipynb index e910e953..c4c2fab7 100644 --- a/other/materials_designer/create_point_defect_pair.ipynb +++ b/other/materials_designer/create_point_defect_pair.ipynb @@ -83,7 +83,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_slab.ipynb b/other/materials_designer/create_slab.ipynb index 44fb301a..6a3df931 100644 --- a/other/materials_designer/create_slab.ipynb +++ b/other/materials_designer/create_slab.ipynb @@ -78,7 +78,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_supercell.ipynb b/other/materials_designer/create_supercell.ipynb index a56be503..38522078 100644 --- a/other/materials_designer/create_supercell.ipynb +++ b/other/materials_designer/create_supercell.ipynb @@ -64,7 +64,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", " \n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_terrace_defect.ipynb b/other/materials_designer/create_terrace_defect.ipynb index 8d0cd78e..61f60afd 100644 --- a/other/materials_designer/create_terrace_defect.ipynb +++ b/other/materials_designer/create_terrace_defect.ipynb @@ -86,7 +86,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb index 847c952a..e40871aa 100644 --- a/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb +++ b/other/materials_designer/create_twisted_interface_with_commensurate_lattices.ipynb @@ -100,7 +100,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb index 771bdd37..74e9bb0b 100644 --- a/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb +++ b/other/materials_designer/create_twisted_interface_with_nanoribbons.ipynb @@ -90,7 +90,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"\")" diff --git a/other/materials_designer/custom_transformation.ipynb b/other/materials_designer/custom_transformation.ipynb index 462441e4..b57f3b39 100644 --- a/other/materials_designer/custom_transformation.ipynb +++ b/other/materials_designer/custom_transformation.ipynb @@ -24,7 +24,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb index 5c784475..29296911 100644 --- a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +++ b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb @@ -67,7 +67,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/import_materials_from_files.ipynb b/other/materials_designer/import_materials_from_files.ipynb index 36c60af0..61f57625 100644 --- a/other/materials_designer/import_materials_from_files.ipynb +++ b/other/materials_designer/import_materials_from_files.ipynb @@ -74,7 +74,7 @@ "import sys\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"import_materials_from_files.ipynb\")" diff --git a/other/materials_designer/import_materials_from_standata.ipynb b/other/materials_designer/import_materials_from_standata.ipynb index a09dc434..7ad990f1 100644 --- a/other/materials_designer/import_materials_from_standata.ipynb +++ b/other/materials_designer/import_materials_from_standata.ipynb @@ -37,7 +37,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " await micropip.install('mat3ra-standata', deps=False)\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", diff --git a/other/materials_designer/optimize_film_position.ipynb b/other/materials_designer/optimize_film_position.ipynb index 544956d7..0c7346bb 100644 --- a/other/materials_designer/optimize_film_position.ipynb +++ b/other/materials_designer/optimize_film_position.ipynb @@ -39,7 +39,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_edge.ipynb b/other/materials_designer/passivate_edge.ipynb index 903e9151..b8fd15d8 100644 --- a/other/materials_designer/passivate_edge.ipynb +++ b/other/materials_designer/passivate_edge.ipynb @@ -92,7 +92,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/passivate_slab.ipynb b/other/materials_designer/passivate_slab.ipynb index 26da3ada..7d19de4a 100644 --- a/other/materials_designer/passivate_slab.ipynb +++ b/other/materials_designer/passivate_slab.ipynb @@ -95,7 +95,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " \"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb index edecdafb..5da95500 100644 --- a/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb +++ b/other/materials_designer/specific_examples/custom_cutout_etched_silicon.ipynb @@ -46,7 +46,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb index 5b902643..b895ff09 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb @@ -77,7 +77,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb index 063a7ca8..bb033d75 100644 --- a/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb +++ b/other/materials_designer/specific_examples/defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb @@ -79,7 +79,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb index 1e58b1a5..17e6bf3e 100644 --- a/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb @@ -90,7 +90,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " \"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb index 4659a529..25c68833 100644 --- a/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb +++ b/other/materials_designer/specific_examples/defect_point_interstitial_tin_oxide.ipynb @@ -78,7 +78,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb index 3dac12c4..c8f54c42 100644 --- a/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_pair_gallium_nitride.ipynb @@ -69,7 +69,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb index c905b4a7..27ce5140 100644 --- a/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_point_substitution_graphene.ipynb @@ -101,7 +101,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb index 7ca228d1..5abc5af0 100644 --- a/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_point_vacancy_boron_nitride.ipynb @@ -76,7 +76,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb index 49c61505..dd3dca32 100644 --- a/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_adatom_graphene.ipynb @@ -89,7 +89,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb index 1222f1f6..eba601a7 100644 --- a/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_island_titanium_nitride.ipynb @@ -76,7 +76,7 @@ " import micropip\n", "\n", " await micropip.install(\n", - " \"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " \"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb index 95b179ae..d8a3178c 100644 --- a/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb +++ b/other/materials_designer/specific_examples/defect_surface_step_platinum.ipynb @@ -71,7 +71,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", 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 bf066172..d4fa6211 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 @@ -107,7 +107,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb index 0ca25541..14771a0b 100644 --- a/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_2d_boron_nitride_graphene.ipynb @@ -84,7 +84,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb index bf683c54..33c7f689 100644 --- a/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb +++ b/other/materials_designer/specific_examples/interface_2d_3d_graphene_silicon_dioxide.ipynb @@ -85,7 +85,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb index 99426e42..1179cb32 100644 --- a/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb +++ b/other/materials_designer/specific_examples/interface_3d_3d_copper_cristobalite.ipynb @@ -85,7 +85,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb index 13ff63ff..f35c7559 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb @@ -84,7 +84,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb index 9d83289c..eb26c7cb 100644 --- a/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb +++ b/other/materials_designer/specific_examples/interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb @@ -82,7 +82,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/nanocluster_gold.ipynb b/other/materials_designer/specific_examples/nanocluster_gold.ipynb index 82850939..efb8e372 100644 --- a/other/materials_designer/specific_examples/nanocluster_gold.ipynb +++ b/other/materials_designer/specific_examples/nanocluster_gold.ipynb @@ -53,7 +53,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb index 63140503..0b26e417 100644 --- a/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb +++ b/other/materials_designer/specific_examples/optimization_interface_film_xy_position_graphene_nickel.ipynb @@ -38,7 +38,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb index 8b5c6017..f68a0fa3 100644 --- a/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_edge_nanowire_silicon.ipynb @@ -70,7 +70,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb index 8ce0fe64..92cbece0 100644 --- a/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb +++ b/other/materials_designer/specific_examples/passivation_surface_silicon.ipynb @@ -76,7 +76,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb index 010f76c0..24ec9ea5 100644 --- a/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb +++ b/other/materials_designer/specific_examples/perturbation_ripple_graphene.ipynb @@ -51,7 +51,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb index c3f5c9fd..21d35d2f 100644 --- a/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb +++ b/other/materials_designer/specific_examples/slab_strontium_titanate.ipynb @@ -67,7 +67,7 @@ "if sys.platform == \"emscripten\":\n", " import micropip\n", "\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", "\n", diff --git a/other/materials_designer/under_the_hood.ipynb b/other/materials_designer/under_the_hood.ipynb index ad7d9a84..c217c30a 100644 --- a/other/materials_designer/under_the_hood.ipynb +++ b/other/materials_designer/under_the_hood.ipynb @@ -27,7 +27,7 @@ "\n", "if sys.platform == \"emscripten\":\n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install('mat3ra-utils')\n", " from mat3ra.utils.jupyterlite.packages import install_packages\n", " await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")\n", diff --git a/other/materialsproject/api_interoperability_showcase.ipynb b/other/materialsproject/api_interoperability_showcase.ipynb index bb84af2d..0c595d96 100644 --- a/other/materialsproject/api_interoperability_showcase.ipynb +++ b/other/materialsproject/api_interoperability_showcase.ipynb @@ -95,7 +95,7 @@ " )\n", " \n", " import micropip\n", - " await micropip.install(\"https://exabyte-io.github.io/api-examples/mat3ra_api_examples-0.1.dev1+g03efa43-py3-none-any.whl\", deps=False)\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", " await micropip.install(\"exabyte-api-client\")\n", " from utils.jupyterlite import install_packages\n", " await install_packages(\"api_interoperability_showcase.ipynb\",\"../../config.yml\")" diff --git a/pyproject.toml b/pyproject.toml index 80460a59..7636bcf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "matplotlib>=3.4.1", "pandas>=1.5.3", "pymatgen==2024.4.13", - "mat3ra-made @ git+https://github.com/Exabyte-io/made.git@c4e8849fe38fb6fca4c3585038a48f9e1d0e0e74", + "mat3ra-made==2025.8.9.post0", "mat3ra-utils>=2024.6.11.post0", ]