diff --git a/lang/en/docs/tutorials/materials/specific/defect-planar-grain-boundary-2d-boron-nitride.md b/lang/en/docs/tutorials/materials/specific/defect-planar-grain-boundary-2d-boron-nitride.md index 80eca168..def6efaa 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-planar-grain-boundary-2d-boron-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/defect-planar-grain-boundary-2d-boron-nitride.md @@ -54,21 +54,33 @@ Find and open `create_grain_boundary_film.ipynb`. Edit the grain boundary parame `EDGE_INCLUSION_TOLERANCE = 0.0` -- Edge inclusion parameter, in Angstroms. Controls the overlap of the second phase onto the first phase. ```python +# Material selection +MATERIAL_INDEX = 0 # Index in the list of materials + # Grain boundary parameters TARGET_TWIST_ANGLE = 9.0 # in degrees -BOUNDARY_GAP = 0.0 # Gap between orientations in X direction -XY_SUPERCELL_MATRIX = [[1, 0], [0, 2]] +BOUNDARY_GAP = 0.0 # Gap between two orientations in X direction, in Angstroms +XY_SUPERCELL_MATRIX = [[1, 0], [0, 2]] # Supercell matrix to be applied to each of the orientations before matching +MILLER_INDICES = (0, 0, 1) # Miller indices for the supercell matching +VACUUM = 10.0 # Vacuum thickness in Angstroms, added to the top and bottom of the grain boundary # Search algorithm parameters -MAX_REPETITION = None +MAX_REPETITION = None # Maximum supercell matrix element value ANGLE_TOLERANCE = 0.5 # in degrees -RETURN_FIRST_MATCH = True +RETURN_FIRST_MATCH = True # If True, returns first solution within tolerance -# Distance tolerance for atom merging +# Distance tolerance for two atoms to be considered too close. +# Used when merging two orientations to remove the atoms of the first one. +# Should be less than the expected bond length DISTANCE_TOLERANCE = 1.43 # in Angstroms -# Edge inclusion parameter +# How much to expand inclusion of the edge atoms for both orientations and fill in the gap region. +# A fine-tuning parameter EDGE_INCLUSION_TOLERANCE = 0.0 # in Angstroms + +# Visualization parameters +SHOW_INTERMEDIATE_STEPS = True +CELL_REPETITIONS_FOR_VISUALIZATION = [3, 3, 1] ``` ![Notebook Setup](../../../images/tutorials/materials/defects/defect_planar_grain_boundary_2d_boron_nitride/2-jl-setup-nb-gb.webp "Notebook Setup") @@ -95,21 +107,16 @@ Open JupyterLite Session and find `create_point_defect.ipynb` notebook. Select the h-BN grain boundary structure as input material and configure the adatom defect parameters in the "1.1. Set Notebook Parameters" section: ```python -DEFECT_TYPE = "interstitial" # (e.g. "vacancy", "substitution", "interstitial") -SITE_ID = None # Site index of the defect -COORDINATE = [0.5, 0.45, 0.5] # Position of the defect in crystal coordinates -APPROXIMATE_COORDINATE = None # Approximate coordinates of the defect in crystal coordinates -CHEMICAL_ELEMENT = "N" # Element to be placed at the site (ignored for vacancy) - +# Selected material will be used as a unit cell to create a supercell first. SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] -# List of dictionaries with defect parameters DEFECT_CONFIGS = [ { - "defect_type": DEFECT_TYPE, - "coordinate": COORDINATE, - "chemical_element": CHEMICAL_ELEMENT, - } + "type": "interstitial", + "coordinate": [0.5, 0.45, 0.5], # Crystal coordinates + "element": "N", + "placement_method": "closest_site", + }, ] ``` diff --git a/lang/en/docs/tutorials/materials/specific/defect-point-adatom-island-molybdenum-disulfide-platinum.md b/lang/en/docs/tutorials/materials/specific/defect-point-adatom-island-molybdenum-disulfide-platinum.md index 0d005056..3ef94727 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-point-adatom-island-molybdenum-disulfide-platinum.md +++ b/lang/en/docs/tutorials/materials/specific/defect-point-adatom-island-molybdenum-disulfide-platinum.md @@ -53,47 +53,48 @@ Find and open the `create_adatom_defect.ipynb` notebook. Select MoS2 as input ma Set up the slab and defect parameters in the notebook: ```python -# Slab parameters -MILLER_INDICES = (0, 0, 1) # MoS2 basal plane -SLAB_THICKNESS = 1 # Single layer -VACUUM = 10.0 # in Angstrom -SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 1]] # 3x3 supercell +# Index in the list of materials, to access as materials[MATERIAL_INDEX] +MATERIAL_INDEX = 0 +ELEMENT = "Pt" # Chemical element of the adatom -# Defect configurations for all Pt atoms +# Dictionaries are validated and converted to AdatomDefectDict objects below DEFECT_CONFIGS = [ { - "defect_type": "adatom", - "placement_method": "coordinate", - "chemical_element": "Pt", - "position_on_surface": [5/9, 4/9], # First Pt: atop central Mo - "distance_z": 1.2, # Distance from surface S atoms - "use_cartesian_coordinates": False + "type": "adatom", + "coordinate_2d": [5/9, 4/9], # Crystal coordinates on the surface (x, y) + "distance_z": 1.2, # Method to place the adatom + "element": ELEMENT, }, { - "defect_type": "adatom", - "placement_method": "coordinate", - "chemical_element": "Pt", - "position_on_surface": [2/9, 4/9], # Second Pt: next clockwise atop Mo - "distance_z": 1.2, # Distance from surface S atoms - "use_cartesian_coordinates": False + "type": "adatom", + "coordinate_2d": [2/9, 4/9], # Crystal coordinates on the surface (x, y) + "distance_z": 1.2, # Method to place the adatom + "element": ELEMENT, }, { - "defect_type": "adatom", - "placement_method": "coordinate", - "chemical_element": "Pt", - "position_on_surface": [5/9, 7/9], # Third Pt: next clockwise atop Mo - "distance_z": 1.2, # Distance from surface S atoms - "use_cartesian_coordinates": False + "type": "adatom", + "coordinate_2d": [5/9, 7/9], # Crystal coordinates on the surface (x, y) + "distance_z": 1.2, # Method to place the adatom + "element": ELEMENT, }, { - "defect_type": "adatom", - "placement_method": "coordinate", - "chemical_element": "Pt", - "position_on_surface": [4/9, 5/9], # Fourth Pt: centered atop S - "distance_z": 1.6, # Distance between Pt atom layers, in Angstrom - "use_cartesian_coordinates": False - } + "type": "adatom", + "coordinate_2d": [4/9, 5/9], # Crystal coordinates on the surface (x, y) + "distance_z": 1.6, # Method to place the adatom + "element": ELEMENT, + }, ] + + +PLACEMENT_METHOD = "new_crystal_site" # Method to place the adatom, e.g., "new_crystal_site", "exact_coordinate", "equidistant" + + +# Slab parameters +MILLER_INDICES = (0, 0, 1) # Miller indices of the surface +SLAB_THICKNESS = 1 # Thickness of the slab in unit cells +VACUUM = 10.0 # Vacuum thickness in Angstrom +XY_SUPERCELL_MATRIX = [[3, 0], [0, 3]] # Supercell matrix for the slab +TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used. ``` Key parameters explained: diff --git a/lang/en/docs/tutorials/materials/specific/defect-point-interstitial-tin-oxide.md b/lang/en/docs/tutorials/materials/specific/defect-point-interstitial-tin-oxide.md index 28aad98f..c1c9fe56 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-point-interstitial-tin-oxide.md +++ b/lang/en/docs/tutorials/materials/specific/defect-point-interstitial-tin-oxide.md @@ -54,23 +54,21 @@ We'll modify its parameters to create the Sn-vacancy O-interstitial defects acco Replace the default parameters in section 1.1 with: ```python -# Supercell parameters. +# Selected material will be used as a unit cell to create a supercell first. SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 2]] -# Defect parameters. DEFECT_CONFIGS = [ { - "defect_type": "vacancy", - # Coordiante will be resolved to nearest atom. - "approximate_coordinate": [0.0, 0.25, 0.525], + "type": "vacancy", + "coordinate": [0.0, 0.25, 0.525], # Crystal coordinates + "placement_method": "closest_site", }, { - "defect_type": "interstitial", - # Coordiante will be resolved to nearest Voronoi site. - "coordinate": [0.0, 0.25, 0.35], - "chemical_element": "O", - "placement_method": "voronoi_site" - } + "type": "interstitial", + "coordinate": [0.0, 0.25, 0.35], # Crystal coordinates + "element": "O", + "placement_method": "voronoi_site", + }, ] ``` ![Defect Parameters](../../../images/tutorials/materials/defects/defect_point_interstitial_tin_oxide/3-jl-setup-nb.webp "Defect parameters for O-interstitial in SnO") diff --git a/lang/en/docs/tutorials/materials/specific/defect-point-pair-gallium-nitride.md b/lang/en/docs/tutorials/materials/specific/defect-point-pair-gallium-nitride.md index 290748d4..91200b29 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-point-pair-gallium-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/defect-point-pair-gallium-nitride.md @@ -82,21 +82,28 @@ Next, edit `create_point_defect_pair.ipynb` notebook to modify the parameters by Copy the below content and edit the "1.1. Set up defect parameters" cell in the notebook as follows: ```python +from types import SimpleNamespace + +# Selected material will be used as a unit cell to create a supercell first. SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] # List of dictionaries with defect parameters -PRIMARY_DEFECT_CONFIG = { - "defect_type": "substitution", - "approximate_coordinate": [1.608, 4.642, 5.240], - "chemical_element": "Mg", - "use_cartesian_coordinates": True, -} - -SECONDARY_DEFECT_CONFIG = { - "defect_type": "vacancy", - "approximate_coordinate": [1.608, 4.642, 7.210], - "use_cartesian_coordinates": True, -} +PRIMARY_DEFECT_CONFIG = SimpleNamespace( + defect_type="substitution", + coordinate=[1.608, 4.642, 5.240], # Approx. coord that will be resolved to the closest site + use_cartesian_coordinates=True, # Use cartesian or crystal coordinates + chemical_element="Mg", + # "site_id": 0, # Index of the atom in the host material + # "coordinate": None, # Exact position (override the approximate coordinate) +) + +SECONDARY_DEFECT_CONFIG = SimpleNamespace( + defect_type="vacancy", + approximate_coordinate=[1.608, 4.642, 7.210], # Approx. coord that will be resolved to the closest site + use_cartesian_coordinates=True, + # "site_id": 0, # Index of the atom in the host material + # "coordinate": None, # Exact position (override the approximate coordinate) +) ``` Here's the visual of the updated content: diff --git a/lang/en/docs/tutorials/materials/specific/defect-point-substitution-graphene.md b/lang/en/docs/tutorials/materials/specific/defect-point-substitution-graphene.md index 124456f3..d54ebe34 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-point-substitution-graphene.md +++ b/lang/en/docs/tutorials/materials/specific/defect-point-substitution-graphene.md @@ -73,39 +73,38 @@ Next, edit `create_point_defect.ipynb` notebook to modify the parameters by addi Copy the below content and edit the "1.1. Set up defect parameters" cell in the notebook as follows: ```python -DEFECT_TYPE = "substitution" -SITE_ID = None # `from_site_id` method will be ignored -COORDINATE = None # default method will be ignored -APPROXIMATE_COORDINATE = None -CHEMICAL_ELEMENT = "N" +# Selected material will be used as a unit cell to create a supercell first. SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] -USE_CARTESIAN_COORDINATES = True DEFECT_CONFIGS = [ { - "defect_type": "substitution", - "approximate_coordinate": [4.9, 2.85, 10], - "chemical_element": CHEMICAL_ELEMENT, - "use_cartesian_coordinates": USE_CARTESIAN_COORDINATES + "type": "substitution", + "coordinate": [4.9, 2.85, 10], + "element": "N", + "placement_method": "closest_site", + "use_cartesian_coordinates": True }, { - "defect_type": "substitution", - "approximate_coordinate": [3.7, 4.9, 10], - "chemical_element": CHEMICAL_ELEMENT, - "use_cartesian_coordinates": USE_CARTESIAN_COORDINATES + "type": "substitution", + "coordinate": [3.7, 4.9, 10], + "element": "N", + "placement_method": "closest_site", + "use_cartesian_coordinates": True }, { - "defect_type": "substitution", - "approximate_coordinate": [2.45, 2.85, 10], - "chemical_element": CHEMICAL_ELEMENT, - "use_cartesian_coordinates": USE_CARTESIAN_COORDINATES + "type": "substitution", + "coordinate": [2.45, 2.85, 10], + "element": "N", + "placement_method": "closest_site", + "use_cartesian_coordinates": True }, { - "defect_type": "vacancy", - "approximate_coordinate": [3.7, 3.55, 10], - "use_cartesian_coordinates": USE_CARTESIAN_COORDINATES + "type": "vacancy", + "coordinate": [3.7, 3.55, 10], + "placement_method": "closest_site", + "use_cartesian_coordinates": True }, -] +] ``` Here's the visual of the updated content: diff --git a/lang/en/docs/tutorials/materials/specific/defect-point-vacancy-boron-nitride.md b/lang/en/docs/tutorials/materials/specific/defect-point-vacancy-boron-nitride.md index fac37694..465eaedc 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-point-vacancy-boron-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/defect-point-vacancy-boron-nitride.md @@ -59,11 +59,15 @@ Select the "Advanced > [JupyterLite Transformation](../../../materials-designer/ Find and open `create_nanoribbon.ipynb` in the list of notebooks. Edit the nanoribbon parameters in section 1.1 of the notebook: ```python -WIDTH = 3 # in number of unit cells -LENGTH = 6 # in number of unit cells -VACUUM_WIDTH = 0 # in number of unit cells -VACUUM_LENGTH = 0 # in number of unit cells -EDGE_TYPE = "zigzag" # "zigzag" or "armchair" +# Index in the list of materials, to access as materials[MATERIAL_INDEX] +MATERIAL_INDEX = 0 + +# Widths and lengths are in number of unit cells +WIDTH = 3 # in unit cells +LENGTH = 6 # in unit cells +VACUUM_WIDTH = 0 # in Angstroms +VACUUM_LENGTH = 0 # in Angstroms +EDGE_TYPE = "zigzag" # "zigzag" or "armchair" ``` ![Nanoribbon Parameters](../../../images/tutorials/materials/defects/defect_point_vacancy_boron_nitride/2-jl-nb-setup-nanoribbon.webp "Nanoribbon Parameters") @@ -92,11 +96,14 @@ After creating the nanoribbon, we'll introduce the vacancy defect using the poin Open `create_point_defect.ipynb` and modify the defect configuration parameters: ```python +# Selected material will be used as a unit cell to create a supercell first. SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] + DEFECT_CONFIGS = [ { - "defect_type": "vacancy", - "approximate_coordinate": [0.5, 0.5, 0.5], + "type": "vacancy", + "coordinate": [0.5, 0.5, 0.5], + "placement_method": "closest_site", "use_cartesian_coordinates": False } ] diff --git a/lang/en/docs/tutorials/materials/specific/defect-surface-adatom-graphene.md b/lang/en/docs/tutorials/materials/specific/defect-surface-adatom-graphene.md index 263a55da..663e810a 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-surface-adatom-graphene.md +++ b/lang/en/docs/tutorials/materials/specific/defect-surface-adatom-graphene.md @@ -64,18 +64,30 @@ Next, edit `create_adatom_defect.ipynb` notebook to modify the parameters by cha Copy the content below and adjust the "1.1. Set up slab parameters" cell in the notebook: ```python -DEFECT_TYPE = "adatom" -PLACEMENT_METHOD = "equidistant" -CHEMICAL_ELEMENT = "Li" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] -USE_CARTESIAN_COORDINATES = False -DISTANCE_Z = 1.71 +# Index in the list of materials, to access as materials[MATERIAL_INDEX] +MATERIAL_INDEX = 0 +ELEMENT = "Li" # Chemical element of the adatom + +# Dictionaries are validated and converted to AdatomDefectDict objects below +DEFECT_CONFIGS = [ + { + "type": "adatom", + "coordinate_2d": [0.5, 0.5], # Crystal coordinates on the surface (x, y) + "distance_z": 1.71, # Method to place the adatom + "element": ELEMENT, + } +] + + +PLACEMENT_METHOD = "equidistant" # Method to place the adatom, e.g., "new_crystal_site", "exact_coordinate", "equidistant" + # Slab parameters -MILLER_INDICES = (0, 0, 1) -SLAB_THICKNESS = 1 -VACUUM = 6 -SUPERCELL_MATRIX = [[4, 0, 0], [0, 4, 0], [0, 0, 1]] +MILLER_INDICES = (0, 0, 1) # Miller indices of the surface +SLAB_THICKNESS = 1 # Thickness of the slab in unit cells +VACUUM = 6.0 # Vacuum thickness in Angstrom +XY_SUPERCELL_MATRIX = [[4, 0], [0, 4]] # Supercell matrix for the slab +TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used. ``` ### 2.3. Run the notebook. @@ -111,7 +123,7 @@ For example, to create a Graphene structure with a Na adatom, adjust the paramet ```python CHEMICAL_ELEMENT = "Na" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.28 ``` @@ -120,7 +132,7 @@ DISTANCE_Z = 2.28 For K adatom on hollow site: ```python CHEMICAL_ELEMENT = "K" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.60 ``` @@ -130,7 +142,7 @@ DISTANCE_Z = 2.60 For Ca adatom on hollow site: ```python CHEMICAL_ELEMENT = "Ca" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.29 ``` @@ -140,7 +152,7 @@ DISTANCE_Z = 2.29 For Al adatom on hollow site: ```python CHEMICAL_ELEMENT = "Al" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.13 ``` @@ -150,7 +162,7 @@ DISTANCE_Z = 2.13 For Ga adatom on hollow site: ```python CHEMICAL_ELEMENT = "Ga" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.20 ``` @@ -160,7 +172,7 @@ DISTANCE_Z = 2.20 For In adatom on hollow site: ```python CHEMICAL_ELEMENT = "In" -APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] +COORDINATE_2D = [0.5, 0.5] DISTANCE_Z = 2.45 ``` @@ -170,7 +182,7 @@ DISTANCE_Z = 2.45 For Sn adatom on top site: ```python CHEMICAL_ELEMENT = "Sn" -APPROXIMATE_POSITION_ON_SURFACE = [7/12, 5/12] +COORDINATE_2D = [7/12, 5/12] DISTANCE_Z = 2.82 ``` diff --git a/lang/en/docs/tutorials/materials/specific/defect-surface-island-titanium-nitride.md b/lang/en/docs/tutorials/materials/specific/defect-surface-island-titanium-nitride.md index 1119fa8e..5a4a3b9f 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-surface-island-titanium-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/defect-surface-island-titanium-nitride.md @@ -63,10 +63,12 @@ MILLER_INDICES = (0, 0, 1) THICKNESS = 3 # in atomic layers VACUUM = 10.0 # in angstroms XY_SUPERCELL_MATRIX = [[10, 0], [0, 10]] -USE_ORTHOGONAL_Z = True +USE_ORTHOGONAL_C = True USE_CONVENTIONAL_CELL = True -# Index of the termination pair to be selected +# Stoichiometric formula of the slab termination to be used. +SLAB_TERMINATION_FORMULA = None +# if None, the index of all possible terminations will be used TERMINATION_INDEX = 0 ``` @@ -125,25 +127,32 @@ Notice, that we did not create the slab yet, so it is necessary to provide slab Copy the below content and edit the "1.1. Set up defect parameters" cell in the notebook as follows: ```python -ISLAND_SHAPE = 'box' -AUTO_ADD_VACUUM = True -VACUUM_THICKNESS = 10.0 -NUMBER_OF_ADDED_LAYERS = 0.5 - -BOX_PARAMETERS = { +# Shape-specific parameters +# Choose the island shape: 'cylinder', 'sphere', 'box', or 'triangular_prism' +# and the corresponding parameters +SHAPE_PARAMETERS = { + 'shape': 'box', 'min_coordinate': [0.25, 0.2, 0], - 'max_coordinate': [0.65, 0.6, 1], - "use_cartesian_coordinates": False + 'max_coordinate': [0.65, 0.6, 1] } +# Common parameters +CENTER_POSITION = [0.5, 0.5, 0.5] # Center of the island +USE_CARTESIAN_COORDINATES = False # Use Cartesian coordinates for the island +NUMBER_OF_ADDED_LAYERS = 0.5 # Number of layers to add to the island + +# Vacuum parameters for builder +AUTO_ADD_VACUUM = True # Automatically add vacuum to the slab +VACUUM_THICKNESS = 10.0 # Thickness of the vacuum + +# Slab parameters for creating a new slab if provided material is not a slab DEFAULT_SLAB_PARAMETERS = { "miller_indices": (0,0,1), "thickness": 3, "vacuum": 0.0, - "use_orthogonal_z": True, + "use_orthogonal_c": True, "xy_supercell_matrix": [[10, 0], [0, 10]] } - ``` Here's the visual of the updated content: diff --git a/lang/en/docs/tutorials/materials/specific/defect-surface-step-platinum.md b/lang/en/docs/tutorials/materials/specific/defect-surface-step-platinum.md index cc205878..78a2380c 100644 --- a/lang/en/docs/tutorials/materials/specific/defect-surface-step-platinum.md +++ b/lang/en/docs/tutorials/materials/specific/defect-surface-step-platinum.md @@ -59,13 +59,19 @@ Select "Advanced > [JupyterLite Transformation](../../../materials-designer/head Open a `create_slab.ipynb` notebook and set up the slab parameters in the "1.1. Set up notebook" cell: ```python -MATERIAL_NAME = "Pt" +# Enable interactive selection of terminations via UI prompt +IS_TERMINATIONS_SELECTION_INTERACTIVE = False + MILLER_INDICES = (2, 1, 1) THICKNESS = 6 # in atomic layers VACUUM = 10.0 # in angstroms XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -USE_ORTHOGONAL_Z = True +USE_ORTHOGONAL_C = True USE_CONVENTIONAL_CELL = True + +# Stoichiometric formula of the slab termination to be used. +SLAB_TERMINATION_FORMULA = None +# if None, the index of all possible terminations will be used TERMINATION_INDEX = 0 ``` @@ -104,34 +110,27 @@ First, open `create_terrace_defect.ipynb`and select Pt as the input material. ```python # Material selection -# Which material to use from input list -MATERIAL_INDEX = 0 - -# Terrace parameters: -# Normal vector describing a plane that cuts the terrace from added layers (Miller indices) -CUT_DIRECTION = [0,1,1] -# Point the cutting plane passes through, in crystal coordinates -PIVOT_COORDINATE = [0.5, 0.5, 0.5] -# Height of terrace in atomic layers -NUMBER_OF_ADDED_LAYERS = 1 -# Use cartesian instead of crystal coordinates -USE_CARTESIAN_COORDINATES = False -# Rotate to match periodic boundary conditions -ROTATE_TO_MATCH_PBC = True +MATERIAL_INDEX = 0 # Which material to use from input list + +# Terrace parameters +CUT_DIRECTION = [0, 1, 1] # Normal vector describing a plane that cuts the terrace from added layers (Miller indices) +PIVOT_COORDINATE = [0.5, 0.5, 0.5] # Point the cutting plane passes through, in crystal coordinates +NUMBER_OF_ADDED_LAYERS = 1 # Height of terrace in atomic layers +USE_CARTESIAN_COORDINATES = False # Use cartesian instead of crystal coordinates +ROTATE_TO_MATCH_PBC = True # Rotate to match periodic boundary conditions # Slab parameters for creating a new slab if provided material is not a slab DEFAULT_SLAB_PARAMETERS = { - "miller_indices": (1,1,1), + "miller_indices": (1, 1, 1), "thickness": 6, "vacuum": 10.0, - "use_orthogonal_z": True, + "USE_ORTHOGONAL_C": True, "xy_supercell_matrix": [[2, 0], [0, 2]] } # Visualization parameters SHOW_INTERMEDIATE_STEPS = True -# Structure repeat in view -CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] +CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view ``` ![Terrace Parameters](../../../images/tutorials/materials/defects/defect_surface_step_platinum/4-jl-setup-nb-terrace.webp "Terrace Parameters") diff --git a/lang/en/docs/tutorials/materials/specific/heterostructure-silicon-silicon-dioxide-hafnium-dioxide-titanium-nitride.md b/lang/en/docs/tutorials/materials/specific/heterostructure-silicon-silicon-dioxide-hafnium-dioxide-titanium-nitride.md index 0c5012ed..72dc6bd4 100644 --- a/lang/en/docs/tutorials/materials/specific/heterostructure-silicon-silicon-dioxide-hafnium-dioxide-titanium-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/heterostructure-silicon-silicon-dioxide-hafnium-dioxide-titanium-nitride.md @@ -101,28 +101,39 @@ Run the notebook to create and pass the TiN slab to Materials Designer. Open `create_interface_with_min_strain_zsl.ipynb` and configure: ```python -MAX_AREA = 200 # Maximum area for strain matching -MAX_AREA_RATIO_TOLERANCE = 0.25 # Maximum area ratio tolerance -MAX_ANGLE_TOLERANCE = 0.15 # Maximum angle tolerance -MAX_LENGTH_TOLERANCE = 0.15 # Maximum length tolerance - FILM_INDEX = 1 # SiO2 FILM_MILLER_INDICES = (1, 0, 0) FILM_THICKNESS = 3 -FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +FILM_TERMINATION_FORMULA = None # if None, the first termination will be used FILM_VACUUM = 0.0 -FILM_USE_ORTHOGONAL_Z = True +FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +FILM_USE_ORTHOGONAL_C = True # Changed from FILM_USE_ORTHOGONAL_Z SUBSTRATE_INDEX = 0 # Si SUBSTRATE_MILLER_INDICES = (1, 0, 0) SUBSTRATE_THICKNESS = 4 -SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +SUBSTRATE_TERMINATION_FORMULA = None # if None, the first termination will be used SUBSTRATE_VACUUM = 5.0 -SUBSTRATE_USE_ORTHOGONAL_Z = True +SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +SUBSTRATE_USE_ORTHOGONAL_C = True # Changed from SUBSTRATE_USE_ORTHOGONAL_Z INTERFACE_DISTANCE = 2.5 # Angstroms INTERFACE_VACUUM = 5.0 # Angstroms -TERMINATION_PAIR_INDEX = 0 + +# Whether to convert materials to conventional cells before creating slabs. +# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input) +USE_CONVENTIONAL_CELL = True + +# Maximum area for the superlattice search algorithm (the final interface area will be smaller) +MAX_AREA = 200 # in Angstrom^2 +# Additional fine-tuning parameters (increase values to get more strained matches): +MAX_AREA_TOLERANCE = 0.25 # in Angstrom^2 +MAX_LENGTH_TOLERANCE = 0.15 +MAX_ANGLE_TOLERANCE = 0.15 + +# Whether to reduce the resulting interface cell to the primitive cell after the interface creation. +# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search. +REDUCE_RESULT_CELL_TO_PRIMITIVE = True ``` We set a higher tolerances to achieve smaller cell with higher strain of the film (SiO2). diff --git a/lang/en/docs/tutorials/materials/specific/interface-2d-2d-graphene-boron-nitride.md b/lang/en/docs/tutorials/materials/specific/interface-2d-2d-graphene-boron-nitride.md index 6aed6233..d8314c2e 100644 --- a/lang/en/docs/tutorials/materials/specific/interface-2d-2d-graphene-boron-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/interface-2d-2d-graphene-boron-nitride.md @@ -71,26 +71,39 @@ Adjust the "1.1. Set up slab parameters" cell in the notebook according to: # Enable interactive selection of terminations via UI prompt IS_TERMINATIONS_SELECTION_INTERACTIVE = False -FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX] +FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX] FILM_MILLER_INDICES = (0, 0, 1) FILM_THICKNESS = 1 # in atomic layers +FILM_TERMINATION_FORMULA = None # if None, the first termination will be used FILM_VACUUM = 0.0 # in angstroms FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -FILM_USE_ORTHOGONAL_Z = True +FILM_USE_ORTHOGONAL_C = True SUBSTRATE_INDEX = 0 SUBSTRATE_MILLER_INDICES = (0, 0, 1) SUBSTRATE_THICKNESS = 1 # in atomic layers +SUBSTRATE_TERMINATION_FORMULA = None # if None, the first termination will be used SUBSTRATE_VACUUM = 0.0 # in angstroms SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -SUBSTRATE_USE_ORTHOGONAL_Z = True - -# Maximum area for the superlattice search algorithm -MAX_AREA = 50 # in Angstrom^2 -# Set the termination pair indices -TERMINATION_PAIR_INDEX = 0 # Will be overridden in interactive selection is used -INTERFACE_DISTANCE = 3.4 # in Angstrom -INTERFACE_VACUUM = 20.0 # in Angstrom +SUBSTRATE_USE_ORTHOGONAL_C = True + +INTERFACE_DISTANCE = 3.4 # Gap between substrate and film, in Angstrom +INTERFACE_VACUUM = 20.0 # Vacuum over film, in Angstrom + +# Whether to convert materials to conventional cells before creating slabs. +# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input) +USE_CONVENTIONAL_CELL = True + +# Maximum area for the superlattice search algorithm (the final interface area will be smaller) +MAX_AREA = 50 # in Angstrom^2 +# Additional fine-tuning parameters (increase values to get more strained matches): +MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2 +MAX_LENGTH_TOLERANCE = 0.05 +MAX_ANGLE_TOLERANCE = 0.02 + +# Whether to reduce the resulting interface cell to the primitive cell after the interface creation. +# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search. +REDUCE_RESULT_CELL_TO_PRIMITIVE = True ``` ![Notebook setup](../../../images/tutorials/materials/interfaces/interface_2d_2d_graphene_boron_nitride/2-jl-setup-notebook.webp "Notebook setup") @@ -126,8 +139,8 @@ a = selected_interface.lattice.a shifted_interface = interface_displace_part( interface=selected_interface, displacement=[0, n * a / np.sqrt(3), 0], - use_cartesian_coordinates=True) - + use_cartesian_coordinates=True, +) ``` ![Shift Interface](../../../images/tutorials/materials/interfaces/interface_2d_2d_graphene_boron_nitride/4-jl-setup-shift.webp "Shift Interface") diff --git a/lang/en/docs/tutorials/materials/specific/interface-2d-3d-graphene-silicon-dioxide.md b/lang/en/docs/tutorials/materials/specific/interface-2d-3d-graphene-silicon-dioxide.md index 8c88720f..aad0330f 100644 --- a/lang/en/docs/tutorials/materials/specific/interface-2d-3d-graphene-silicon-dioxide.md +++ b/lang/en/docs/tutorials/materials/specific/interface-2d-3d-graphene-silicon-dioxide.md @@ -71,23 +71,36 @@ IS_TERMINATIONS_SELECTION_INTERACTIVE = False FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX] FILM_MILLER_INDICES = (0, 0, 1) FILM_THICKNESS = 1 # in atomic layers +FILM_TERMINATION_FORMULA = None # if None, the first termination will be used FILM_VACUUM = 0.0 # in angstroms FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -FILM_USE_ORTHOGONAL_Z = True +FILM_USE_ORTHOGONAL_C = True SUBSTRATE_INDEX = 0 SUBSTRATE_MILLER_INDICES = (0, 0, 1) SUBSTRATE_THICKNESS = 7 # in atomic layers (for 14 bilayers -- from manuscript) +SUBSTRATE_TERMINATION_FORMULA = None # if None, the first termination will be used SUBSTRATE_VACUUM = 0.0 # in angstroms SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -SUBSTRATE_USE_ORTHOGONAL_Z = True +SUBSTRATE_USE_ORTHOGONAL_C = True -# Maximum area for the superlattice search algorithm +INTERFACE_DISTANCE = 2.58 # Gap between substrate and film, in Angstrom +INTERFACE_VACUUM = 20.0 # Vacuum over film, in Angstrom + +# Whether to convert materials to conventional cells before creating slabs. +# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input) +USE_CONVENTIONAL_CELL = True + +# Maximum area for the superlattice search algorithm (the final interface area will be smaller) MAX_AREA = 150 # in Angstrom^2 -# Set the termination pair indices -TERMINATION_PAIR_INDICES = [1] # For O-terminated -INTERFACE_DISTANCE = 2.58 # in Angstrom -- from manuscript -INTERFACE_VACUUM = 20.0 # in Angstrom -- from manuscript +# Additional fine-tuning parameters (increase values to get more strained matches): +MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2 +MAX_LENGTH_TOLERANCE = 0.05 +MAX_ANGLE_TOLERANCE = 0.02 + +# Whether to reduce the resulting interface cell to the primitive cell after the interface creation. +# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search. +REDUCE_RESULT_CELL_TO_PRIMITIVE = True ``` ![Notebook Setup](../../../images/tutorials/materials/interfaces/interface_2d_3d_graphene_silicon_dioxide/2-jl-setup-notebook.webp "Notebook Setup") diff --git a/lang/en/docs/tutorials/materials/specific/interface-3d-3d-copper-silicon-dioxide.md b/lang/en/docs/tutorials/materials/specific/interface-3d-3d-copper-silicon-dioxide.md index 75723837..6445f4b9 100644 --- a/lang/en/docs/tutorials/materials/specific/interface-3d-3d-copper-silicon-dioxide.md +++ b/lang/en/docs/tutorials/materials/specific/interface-3d-3d-copper-silicon-dioxide.md @@ -74,23 +74,36 @@ IS_TERMINATIONS_SELECTION_INTERACTIVE = False FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX] FILM_MILLER_INDICES = (0, 0, 1) FILM_THICKNESS = 3 # in atomic layers +FILM_TERMINATION_FORMULA = None # if None, the first termination will be used FILM_VACUUM = 0.0 # in angstroms FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -FILM_USE_ORTHOGONAL_Z = True +FILM_USE_ORTHOGONAL_C = True SUBSTRATE_INDEX = 0 SUBSTRATE_MILLER_INDICES = (0, 0, 1) SUBSTRATE_THICKNESS = 3 # in atomic layers +SUBSTRATE_TERMINATION_FORMULA = None # if None, the first termination will be used SUBSTRATE_VACUUM = 0.0 # in angstroms SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -SUBSTRATE_USE_ORTHOGONAL_Z = True +SUBSTRATE_USE_ORTHOGONAL_C = True -# Maximum area for the superlattice search algorithm +INTERFACE_DISTANCE = 2.4 # Gap between substrate and film, in Angstrom +INTERFACE_VACUUM = 18.0 # Vacuum over film, in Angstrom + +# Whether to convert materials to conventional cells before creating slabs. +# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input) +USE_CONVENTIONAL_CELL = True + +# Maximum area for the superlattice search algorithm (the final interface area will be smaller) MAX_AREA = 150 # in Angstrom^2 -# Set the termination pair indices -TERMINATION_PAIR_INDEX = 0 -INTERFACE_DISTANCE = 2.4 # in Angstrom -INTERFACE_VACUUM = 18.0 # in Angstrom +# Additional fine-tuning parameters (increase values to get more strained matches): +MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2 +MAX_LENGTH_TOLERANCE = 0.05 +MAX_ANGLE_TOLERANCE = 0.02 + +# Whether to reduce the resulting interface cell to the primitive cell after the interface creation. +# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search. +REDUCE_RESULT_CELL_TO_PRIMITIVE = True ``` ![Notebook setup](../../../images/tutorials/materials/interfaces/interface_3d_3d_copper_cristobalite/1-jl-setup-notebook.webp "Notebook setup") diff --git a/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-commensurate-lattices-molybdenum-disulfide.md b/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-commensurate-lattices-molybdenum-disulfide.md index 6836d668..504ca060 100644 --- a/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-commensurate-lattices-molybdenum-disulfide.md +++ b/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-commensurate-lattices-molybdenum-disulfide.md @@ -59,7 +59,7 @@ Adjust the "1.1. Set up slab parameters" cell in the notebook according to: ```python # Material selection and basic parameters -FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX] +FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX] SUBSTRATE_INDEX = None # Can be None to use same material as film # Twisted interface parameters @@ -67,11 +67,19 @@ TARGET_TWIST_ANGLE = 22.0 # in degrees INTERFACE_DISTANCE = 6.5 # in Angstroms INTERFACE_VACUUM = 20.0 # in Angstroms -# Search algorithm parameters -MAX_REPETITION = 6 # Maximum supercell matrix element value +# Commensurate interface parameters (following the test pattern) ANGLE_TOLERANCE = 0.5 # in degrees +MAX_SUPERCELL_MATRIX_INT = 6 # Maximum supercell matrix element value RETURN_FIRST_MATCH = True # If True, returns first solution within tolerance +# Slab creation parameters +MILLER_INDICES = (0, 0, 1) # Miller indices for slab creation +NUMBER_OF_LAYERS = 1 # Number of layers in the slab +USE_CONVENTIONAL_CELL = True +USE_ORTHOGONAL_C = True + +STACKING_DIRECTION = "z" # Stacking direction for the slab, can be "x", "y", or "z" + # Visualization parameters SHOW_INTERMEDIATE_STEPS = True VISUALIZE_REPETITIONS = [3, 3, 1] diff --git a/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-nanoribbons-boron-nitride.md b/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-nanoribbons-boron-nitride.md index 1e6d94e5..d38a1236 100644 --- a/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-nanoribbons-boron-nitride.md +++ b/lang/en/docs/tutorials/materials/specific/interface-bilayer-twisted-nanoribbons-boron-nitride.md @@ -53,23 +53,26 @@ Next, edit `create_twisted_interface_with_nanoribbons.ipynb` notebook to modify Adjust the "1.1. Set up slab parameters" cell in the notebook according to: ```python -FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX] +# Material selection and basic parameters +FILM_INDEX = 0 # Index in the list of materials, to access as materials[FILM_INDEX] SUBSTRATE_INDEX = None # Can be None to use same material as film -# Interface parameters -TWIST_ANGLE = 2.64 # in degrees +# Twisted interface parameters +TARGET_TWIST_ANGLE = 2.64 # in degrees INTERFACE_DISTANCE = 3.23 # in Angstroms INTERFACE_VACUUM = 20.0 # in Angstroms # Nanoribbon parameters RIBBON_WIDTH = 50 # Width of the nanoribbon in unit cells RIBBON_LENGTH = 50 # Length of the nanoribbon in unit cells -VACUUM_X = 5.0 # Vacuum along x on both sides, in Angstroms -VACUUM_Y = 5.0 # Vacuum along y on both sides, in Angstroms +VACUUM_WIDTH = 15.0 # Vacuum width around ribbons in Angstroms +VACUUM_LENGTH = 15.0 # Vacuum length around ribbons in Angstroms +VACUUM_X = 2.0 # Additional vacuum along x on both sides, in Angstroms +VACUUM_Y = 2.0 # Additional vacuum along y on both sides, in Angstroms # Visualization parameters SHOW_INTERMEDIATE_STEPS = True -VISUALIZE_REPETITIONS = [1, 1, 1] +VISUALIZE_REPETITIONS = [3, 3, 1] ``` ![Notebook setup](../../../images/tutorials/materials/interfaces/twisted-bilayer-boron-nitride/jl-set-nb.png "Notebook setup") diff --git a/lang/en/docs/tutorials/materials/specific/nanocluster-gold.md b/lang/en/docs/tutorials/materials/specific/nanocluster-gold.md index bcc6f78c..237d19cf 100644 --- a/lang/en/docs/tutorials/materials/specific/nanocluster-gold.md +++ b/lang/en/docs/tutorials/materials/specific/nanocluster-gold.md @@ -57,7 +57,9 @@ Cuboctahedron shape is achieved by setting parameters of the octahedron to be in Copy the content below and adjust the "1.1. Set up slab parameters" cell in the notebook: ```python -shape = ASENanoparticleShapesEnum.OCTAHEDRON +from mat3ra.made.tools.build.pristine_structures.zero_dimensional.nanoparticle import NanoparticleShapesEnum + +shape = NanoparticleShapesEnum.OCTAHEDRON parameters = { "length": 5, "cutoff": 2 @@ -101,7 +103,7 @@ To create the rest of the structures set the `shape` and other parameters accord For Cuboctahedron with 147 atoms: ```python -shape = ASENanoparticleShapesEnum.OCTAHEDRON +shape = NanoparticleShapesEnum.OCTAHEDRON parameters = { "length": 7, "cutoff": 3 @@ -113,7 +115,7 @@ parameters = { For Cuboctahedron with 309 atoms: ```python -shape = ASENanoparticleShapesEnum.OCTAHEDRON +shape = NanoparticleShapesEnum.OCTAHEDRON parameters = { "length": 9, "cutoff": 4 diff --git a/lang/en/docs/tutorials/materials/specific/optimization-interface-film-xy-position-graphene-nickel.md b/lang/en/docs/tutorials/materials/specific/optimization-interface-film-xy-position-graphene-nickel.md index cd8e24c5..a828e20e 100644 --- a/lang/en/docs/tutorials/materials/specific/optimization-interface-film-xy-position-graphene-nickel.md +++ b/lang/en/docs/tutorials/materials/specific/optimization-interface-film-xy-position-graphene-nickel.md @@ -54,18 +54,39 @@ Edit the notebook parameters to create the Gr/Ni(111) interface: ```python # Material selection -SUBSTRATE_NAME = "Nickel" -FILM_NAME = "Graphene" +FILM_INDEX = 1 # Index in the list of materials, to access as materials[FILM_INDEX] +FILM_MILLER_INDICES = (0, 0, 1) +FILM_THICKNESS = 1 # in atomic layers +FILM_TERMINATION_FORMULA = None # if None, the first termination will be used +FILM_VACUUM = 0.0 # in angstroms +FILM_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +FILM_USE_ORTHOGONAL_C = True -# Slab parameters +SUBSTRATE_INDEX = 0 SUBSTRATE_MILLER_INDICES = (1, 1, 1) SUBSTRATE_THICKNESS = 4 # in atomic layers -FILM_THICKNESS = 1 # in atomic layers +SUBSTRATE_TERMINATION_FORMULA = None # if None, the first termination will be used +SUBSTRATE_VACUUM = 0.0 # in angstroms +SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] +SUBSTRATE_USE_ORTHOGONAL_C = True + +INTERFACE_DISTANCE = 2.58 # Gap between substrate and film, in Angstrom +INTERFACE_VACUUM = 20.0 # Vacuum over film, in Angstrom + +# Whether to convert materials to conventional cells before creating slabs. +# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input) +USE_CONVENTIONAL_CELL = True -# Interface parameters +# Maximum area for the superlattice search algorithm (the final interface area will be smaller) MAX_AREA = 50 # in Angstrom^2 -INTERFACE_DISTANCE = 2.58 # in Angstrom from literature -INTERFACE_VACUUM = 20.0 # in Angstrom +# Additional fine-tuning parameters (increase values to get more strained matches): +MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2 +MAX_LENGTH_TOLERANCE = 0.05 +MAX_ANGLE_TOLERANCE = 0.02 + +# Whether to reduce the resulting interface cell to the primitive cell after the interface creation. +# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search. +REDUCE_RESULT_CELL_TO_PRIMITIVE = True ``` ![Interface Parameters](../../../images/tutorials/materials/optimization/optimization_interface_film_xy_position_graphene_nickel/2-jl-setup-nb-interface.webp "Interface parameters for Gr/Ni(111)") @@ -89,14 +110,16 @@ Find and open the `optimize_film_position.ipynb` notebook which will help us fin Configure the optimization parameters: ```python +MATERIAL_INDEX = 0 # Index of the material to optimize # Grid parameters GRID_SIZE = (20, 20) # Resolution of the x-y grid -GRID_RANGE_X = (-0.5, 0.5) # Range in crystal coordinates -GRID_RANGE_Y = (-0.5, 0.5) -USE_CARTESIAN = False # Use crystal coordinates +GRID_RANGE_X = (-0.5, 0.5) # Range to search in x direction +GRID_RANGE_Y = (-0.5, 0.5) # Range to search in y direction +USE_CARTESIAN = False # Whether to use Cartesian coordinates # Visualization parameters -STRUCTURE_REPETITIONS = [3, 3, 1] +SHOW_3D_LANDSCAPE = False # Whether to show 3D energy landscape +STRUCTURE_REPETITIONS = [3, 3, 1] # Repetitions for structure visualization ``` Key parameters explained: diff --git a/lang/en/docs/tutorials/materials/specific/passivation-edge-nanowire-silicon.md b/lang/en/docs/tutorials/materials/specific/passivation-edge-nanowire-silicon.md index 743558b9..479afcb4 100644 --- a/lang/en/docs/tutorials/materials/specific/passivation-edge-nanowire-silicon.md +++ b/lang/en/docs/tutorials/materials/specific/passivation-edge-nanowire-silicon.md @@ -79,19 +79,21 @@ For that, edit `create_nanowire_custom_shape.ipynb` notebook to modify the param ```python from typing import List import numpy as np -from mat3ra.made.tools.utils.coordinate import CoordinateCondition -# Flag to use Cartesian coordinates for the center and radii -USE_CARTESIAN_COORDINATES = False - -# Miller indices of the nanowire direction -MILLER_INDICES= (1,1,0) -# Supercell matrix to cut the cylinder from -SUPERCELL_MATRIX = [[3, 0, 0], [0, 2, 0], [0, 0, 2]] -# Vacuum thickness on the sides in Angstroms -VACUUM = 10.0 +from mat3ra.made.tools.helpers import CoordinateCondition + +# Cross-section shape parameters +CENTER_COORDINATE = [0.5, 0.5, 0.5] # Center of the cylinder in units specified by flag below +MAJOR_RADIUS = 0.25 # Cylinder wire radius in units specified by the flag below +MINOR_RADIUS = 0.1 # Cylinder wire radius in units specified by the flag below +USE_CARTESIAN_COORDINATES = False # Flag to use Cartesian coordinates for the center and radii + +# Wire parameters +MILLER_INDICES= (1,1,0) # Miller indices of the nanowire direction +SUPERCELL_MATRIX = [[3, 0, 0], [0, 2, 0], [0, 0, 2]] # Supercell matrix to cut the cylinder from +VACUUM = 10.0 # Vacuum thickness on the sides in Angstroms ALIGN_ALONG_X = False -# Custom Coordinate Condition for +# Custom Coordinate Condition for a hollow cylinder shape class CustomCoordinateCondition(CoordinateCondition): vertices: List[List[float]] @@ -163,16 +165,20 @@ IS_COORDINATION_SELECTION_INTERACTIVE = False MATERIAL_INDEX = 0 -BOND_LENGTH = 1.46 # in Angstroms -PASSIVANT = "H" # Chemical symbol of the passivant -COORDINATION_SEARCH_RADIUS = 2.5 # in Angstroms (sphere in which to search for neighbors) -COORDINATION_THRESHOLD = 3 # Coordination number below which to passivate -MAX_BONDS_TO_SATURATE = 2 # Maximum number of bonds to saturate +# Passivation parameters +PASSIVANT = "H" # Chemical element for passivating atom +BOND_LENGTH = 1.46 # Distance from atom to passivant, in Angstroms -SYMMETRY_TOLERANCE = 0.1 +# Undercoordinated atoms search algorithm parameters +COORDINATION_THRESHOLD = 3 # Coordination threshold, below which passivation is applied to the atom +COORDINATION_SEARCH_RADIUS = 2.5 # Distance to look for neighbors for coordination, in Angstroms +NUMBER_OF_BONDS_TO_PASSIVATE = 2 # Number of bonds to passivate per undercoordinated atom +SYMMETRY_TOLERANCE = 0.1 # Tolerance for symmetry analysis of existing bonds + +# Visualization parameters SHOW_INTERMEDIATE_STEPS = True -CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] +CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view ``` Here's the visual of the updated content: diff --git a/lang/en/docs/tutorials/materials/specific/passivation-surface-silicon.md b/lang/en/docs/tutorials/materials/specific/passivation-surface-silicon.md index 7e94c262..45847c88 100644 --- a/lang/en/docs/tutorials/materials/specific/passivation-surface-silicon.md +++ b/lang/en/docs/tutorials/materials/specific/passivation-surface-silicon.md @@ -54,8 +54,8 @@ SUPERCELL_MATRIX = [ [0, 0, 1] ] -# or use the scaling factor. -SCALING_FACTOR = None # [3, 3, 1]. +# or use the scaling factor +SCALING_FACTOR = None # [3, 3, 1] ``` Also add to the "Get input materials" cell the following code to adjust the Si atom position: @@ -106,17 +106,32 @@ Find and open the `passivate_slab.ipynb` notebook to add hydrogen atoms to the s Configure the following parameters for hydrogen passivation: ```python -# Passivation parameters. -PASSIVANT = "H" # Chemical symbol for hydrogen. -BOND_LENGTH = 1.46 # Si-H bond length in Angstroms. -SURFACE = "top" # Passivate only the top surface. - -# Surface detection parameters. -SHADOWING_RADIUS = 1.8 # In Angstroms. -DEPTH = 0.5 # In Angstroms. - -# Visualization parameters. -CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] +# Material selection +MATERIAL_INDEX = 0 # Which material to use from input list + +# Passivation parameters +PASSIVANT = "H" # Chemical symbol of passivating atom +BOND_LENGTH = 1.46 # Distance from surface to passivant, in Angstroms +SURFACE = "top" # Which surface to passivate: "top", "bottom" or "both" + +# Surface detection parameters +SHADOWING_RADIUS = 1.8 # Radius to exclude subsurface atoms, in Angstroms +DEPTH = 0.5 # How deep to look for surface atoms, in Angstroms + +BYPASS_SLAB_CREATION = False # If True, will use input material directly + +# Slab parameters for creating a new slab if previous option is set to True +DEFAULT_SLAB_PARAMETERS = { + "miller_indices": (0, 0, 1), + "thickness": 3, + "vacuum": 10.0, + "USE_ORTHOGONAL_C": True, + "xy_supercell_matrix": [[3, 0], [0, 3]] +} + +# Visualization parameters +SHOW_INTERMEDIATE_STEPS = True +CELL_REPETITIONS_FOR_VISUALIZATION = [1, 1, 1] # Structure repeat in view ``` Key parameters explained: diff --git a/lang/en/docs/tutorials/materials/specific/perturbation-ripples-graphene.md b/lang/en/docs/tutorials/materials/specific/perturbation-ripples-graphene.md index d5822bb0..1ca98c0a 100644 --- a/lang/en/docs/tutorials/materials/specific/perturbation-ripples-graphene.md +++ b/lang/en/docs/tutorials/materials/specific/perturbation-ripples-graphene.md @@ -52,12 +52,15 @@ Find `create_nanoribbon.ipynb` in the list of notebooks and click/double-click t Edit notebook to set the nanoribbon parameters: ```python +# Index in the list of materials, to access as materials[MATERIAL_INDEX] +MATERIAL_INDEX = 0 + # Widths and lengths are in number of unit cells -WIDTH = 40 -VACUUM_WIDTH = 10 -LENGTH = 40 -VACUUM_LENGTH = 10 -EDGE_TYPE = "zigzag" # "zigzag" or "armchair" +WIDTH = 40 # in unit cells +LENGTH = 40 # in unit cells +VACUUM_WIDTH = 10.0 # in Angstroms +VACUUM_LENGTH = 10.0 # in Angstroms +EDGE_TYPE = "zigzag" # "zigzag" or "armchair" ``` ![Setup Nanoribbon Parameters](../../../images/tutorials/materials/defects/perturbation_ripple_graphene/2-jl-setup-nb-nanoribbon.webp "Setup Nanoribbon Parameters") @@ -81,12 +84,47 @@ Next, we need to set up the parameters for creating rippled graphene. Edit notebook in 1.2. to set generic perturbation parameters: ```python +import sympy as sp + # Set whether to preserve geodesic distance and scale the cell accordingly to match PBC PRESERVE_GEODESIC_DISTANCE = False +# Set the supercell matrix to apply to original material +SUPERCELL_MATRIX = [[40, 0, 0], [0, 40, 0], [0, 0, 1]] + # Set whether to use Cartesian coordinates for the perturbation function USE_CARTESIAN_COORDINATES = False -MATERIAL_NAME = "Graphene" + +# Variables for the perturbation function (for SymPy) +variable_names = ["x", "y", "z"] +x, y, z = sp.symbols(variable_names) + +# Set the parameters for the perturbation function +AMPLITUDE = 0.09 # Ripple amplitude +WAVELENGTH = 0.2 # Wavelength of ripples +EDGE_WIDTH = 0.25 # Width of edge effect +PHASE_X = 0.0 # Phase shift for x direction +PHASE_Y = sp.pi/2 # Phase shift for y direction + +# Create edge masks for both x and y using polynomial functions +left_edge_x = sp.Max(0, (EDGE_WIDTH - x) / EDGE_WIDTH) +right_edge_x = sp.Max(0, (x - (1 - EDGE_WIDTH)) / EDGE_WIDTH) +left_edge_y = sp.Max(0, (EDGE_WIDTH - y) / EDGE_WIDTH) +right_edge_y = sp.Max(0, (y - (1 - EDGE_WIDTH)) / EDGE_WIDTH) + +# Combine edge masks +edge_mask_x = left_edge_x + right_edge_x +edge_mask_y = left_edge_y + right_edge_y +edge_mask = edge_mask_x + edge_mask_y + +# Wave pattern +wave_pattern = ( + sp.sin(2 * sp.pi * x / WAVELENGTH + PHASE_X) * + sp.sin(2 * sp.pi * y / WAVELENGTH + PHASE_Y) +) + +# Combine waves with edge mask +custom_sympy_function = AMPLITUDE * wave_pattern * edge_mask ``` Then modify section 1.3 to define the custom perturbation function: diff --git a/lang/en/docs/tutorials/materials/specific/slab-strontium-titanate.md b/lang/en/docs/tutorials/materials/specific/slab-strontium-titanate.md index 6834cee1..7864bb0e 100644 --- a/lang/en/docs/tutorials/materials/specific/slab-strontium-titanate.md +++ b/lang/en/docs/tutorials/materials/specific/slab-strontium-titanate.md @@ -64,7 +64,6 @@ Terminations can be selected interactively by setting the `IS_TERMINATIONS_SELEC Edit notebook in 1.1. to set parameters of slab: ```python - # Enable interactive selection of terminations via UI prompt IS_TERMINATIONS_SELECTION_INTERACTIVE = False @@ -72,10 +71,12 @@ MILLER_INDICES = (0, 1, 1) THICKNESS = 3 # in atomic layers VACUUM = 10.0 # in angstroms XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]] -USE_ORTHOGONAL_Z = True +USE_ORTHOGONAL_C = True USE_CONVENTIONAL_CELL = True -# Index of the termination to be selected +# Stoichiometric formula of the slab termination to be used. +SLAB_TERMINATION_FORMULA = None +# if None, the index of all possible terminations will be used TERMINATION_INDEX = 0 ```