Skip to content

Commit e1b3281

Browse files
authored
Merge pull request #331 from Exabyte-io/update/SOF-7691-1
update/SOF 7691 1
2 parents 07e51ef + d7fe18d commit e1b3281

21 files changed

+433
-248
lines changed

lang/en/docs/tutorials/materials/specific/defect-planar-grain-boundary-2d-boron-nitride.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,33 @@ Find and open `create_grain_boundary_film.ipynb`. Edit the grain boundary parame
5454
`EDGE_INCLUSION_TOLERANCE = 0.0` -- Edge inclusion parameter, in Angstroms. Controls the overlap of the second phase onto the first phase.
5555

5656
```python
57+
# Material selection
58+
MATERIAL_INDEX = 0 # Index in the list of materials
59+
5760
# Grain boundary parameters
5861
TARGET_TWIST_ANGLE = 9.0 # in degrees
59-
BOUNDARY_GAP = 0.0 # Gap between orientations in X direction
60-
XY_SUPERCELL_MATRIX = [[1, 0], [0, 2]]
62+
BOUNDARY_GAP = 0.0 # Gap between two orientations in X direction, in Angstroms
63+
XY_SUPERCELL_MATRIX = [[1, 0], [0, 2]] # Supercell matrix to be applied to each of the orientations before matching
64+
MILLER_INDICES = (0, 0, 1) # Miller indices for the supercell matching
65+
VACUUM = 10.0 # Vacuum thickness in Angstroms, added to the top and bottom of the grain boundary
6166

6267
# Search algorithm parameters
63-
MAX_REPETITION = None
68+
MAX_REPETITION = None # Maximum supercell matrix element value
6469
ANGLE_TOLERANCE = 0.5 # in degrees
65-
RETURN_FIRST_MATCH = True
70+
RETURN_FIRST_MATCH = True # If True, returns first solution within tolerance
6671

67-
# Distance tolerance for atom merging
72+
# Distance tolerance for two atoms to be considered too close.
73+
# Used when merging two orientations to remove the atoms of the first one.
74+
# Should be less than the expected bond length
6875
DISTANCE_TOLERANCE = 1.43 # in Angstroms
6976

70-
# Edge inclusion parameter
77+
# How much to expand inclusion of the edge atoms for both orientations and fill in the gap region.
78+
# A fine-tuning parameter
7179
EDGE_INCLUSION_TOLERANCE = 0.0 # in Angstroms
80+
81+
# Visualization parameters
82+
SHOW_INTERMEDIATE_STEPS = True
83+
CELL_REPETITIONS_FOR_VISUALIZATION = [3, 3, 1]
7284
```
7385

7486
![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.
95107
Select the h-BN grain boundary structure as input material and configure the adatom defect parameters in the "1.1. Set Notebook Parameters" section:
96108

97109
```python
98-
DEFECT_TYPE = "interstitial" # (e.g. "vacancy", "substitution", "interstitial")
99-
SITE_ID = None # Site index of the defect
100-
COORDINATE = [0.5, 0.45, 0.5] # Position of the defect in crystal coordinates
101-
APPROXIMATE_COORDINATE = None # Approximate coordinates of the defect in crystal coordinates
102-
CHEMICAL_ELEMENT = "N" # Element to be placed at the site (ignored for vacancy)
103-
110+
# Selected material will be used as a unit cell to create a supercell first.
104111
SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
105112

106-
# List of dictionaries with defect parameters
107113
DEFECT_CONFIGS = [
108114
{
109-
"defect_type": DEFECT_TYPE,
110-
"coordinate": COORDINATE,
111-
"chemical_element": CHEMICAL_ELEMENT,
112-
}
115+
"type": "interstitial",
116+
"coordinate": [0.5, 0.45, 0.5], # Crystal coordinates
117+
"element": "N",
118+
"placement_method": "closest_site",
119+
},
113120
]
114121
```
115122

lang/en/docs/tutorials/materials/specific/defect-point-adatom-island-molybdenum-disulfide-platinum.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,47 +53,48 @@ Find and open the `create_adatom_defect.ipynb` notebook. Select MoS2 as input ma
5353
Set up the slab and defect parameters in the notebook:
5454

5555
```python
56-
# Slab parameters
57-
MILLER_INDICES = (0, 0, 1) # MoS2 basal plane
58-
SLAB_THICKNESS = 1 # Single layer
59-
VACUUM = 10.0 # in Angstrom
60-
SUPERCELL_MATRIX = [[3, 0, 0], [0, 3, 0], [0, 0, 1]] # 3x3 supercell
56+
# Index in the list of materials, to access as materials[MATERIAL_INDEX]
57+
MATERIAL_INDEX = 0
58+
ELEMENT = "Pt" # Chemical element of the adatom
6159

62-
# Defect configurations for all Pt atoms
60+
# Dictionaries are validated and converted to AdatomDefectDict objects below
6361
DEFECT_CONFIGS = [
6462
{
65-
"defect_type": "adatom",
66-
"placement_method": "coordinate",
67-
"chemical_element": "Pt",
68-
"position_on_surface": [5/9, 4/9], # First Pt: atop central Mo
69-
"distance_z": 1.2, # Distance from surface S atoms
70-
"use_cartesian_coordinates": False
63+
"type": "adatom",
64+
"coordinate_2d": [5/9, 4/9], # Crystal coordinates on the surface (x, y)
65+
"distance_z": 1.2, # Method to place the adatom
66+
"element": ELEMENT,
7167
},
7268
{
73-
"defect_type": "adatom",
74-
"placement_method": "coordinate",
75-
"chemical_element": "Pt",
76-
"position_on_surface": [2/9, 4/9], # Second Pt: next clockwise atop Mo
77-
"distance_z": 1.2, # Distance from surface S atoms
78-
"use_cartesian_coordinates": False
69+
"type": "adatom",
70+
"coordinate_2d": [2/9, 4/9], # Crystal coordinates on the surface (x, y)
71+
"distance_z": 1.2, # Method to place the adatom
72+
"element": ELEMENT,
7973
},
8074
{
81-
"defect_type": "adatom",
82-
"placement_method": "coordinate",
83-
"chemical_element": "Pt",
84-
"position_on_surface": [5/9, 7/9], # Third Pt: next clockwise atop Mo
85-
"distance_z": 1.2, # Distance from surface S atoms
86-
"use_cartesian_coordinates": False
75+
"type": "adatom",
76+
"coordinate_2d": [5/9, 7/9], # Crystal coordinates on the surface (x, y)
77+
"distance_z": 1.2, # Method to place the adatom
78+
"element": ELEMENT,
8779
},
8880
{
89-
"defect_type": "adatom",
90-
"placement_method": "coordinate",
91-
"chemical_element": "Pt",
92-
"position_on_surface": [4/9, 5/9], # Fourth Pt: centered atop S
93-
"distance_z": 1.6, # Distance between Pt atom layers, in Angstrom
94-
"use_cartesian_coordinates": False
95-
}
81+
"type": "adatom",
82+
"coordinate_2d": [4/9, 5/9], # Crystal coordinates on the surface (x, y)
83+
"distance_z": 1.6, # Method to place the adatom
84+
"element": ELEMENT,
85+
},
9686
]
87+
88+
89+
PLACEMENT_METHOD = "new_crystal_site" # Method to place the adatom, e.g., "new_crystal_site", "exact_coordinate", "equidistant"
90+
91+
92+
# Slab parameters
93+
MILLER_INDICES = (0, 0, 1) # Miller indices of the surface
94+
SLAB_THICKNESS = 1 # Thickness of the slab in unit cells
95+
VACUUM = 10.0 # Vacuum thickness in Angstrom
96+
XY_SUPERCELL_MATRIX = [[3, 0], [0, 3]] # Supercell matrix for the slab
97+
TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used.
9798
```
9899

99100
Key parameters explained:

lang/en/docs/tutorials/materials/specific/defect-point-interstitial-tin-oxide.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,21 @@ We'll modify its parameters to create the Sn-vacancy O-interstitial defects acco
5454
Replace the default parameters in section 1.1 with:
5555

5656
```python
57-
# Supercell parameters.
57+
# Selected material will be used as a unit cell to create a supercell first.
5858
SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 2]]
5959

60-
# Defect parameters.
6160
DEFECT_CONFIGS = [
6261
{
63-
"defect_type": "vacancy",
64-
# Coordiante will be resolved to nearest atom.
65-
"approximate_coordinate": [0.0, 0.25, 0.525],
62+
"type": "vacancy",
63+
"coordinate": [0.0, 0.25, 0.525], # Crystal coordinates
64+
"placement_method": "closest_site",
6665
},
6766
{
68-
"defect_type": "interstitial",
69-
# Coordiante will be resolved to nearest Voronoi site.
70-
"coordinate": [0.0, 0.25, 0.35],
71-
"chemical_element": "O",
72-
"placement_method": "voronoi_site"
73-
}
67+
"type": "interstitial",
68+
"coordinate": [0.0, 0.25, 0.35], # Crystal coordinates
69+
"element": "O",
70+
"placement_method": "voronoi_site",
71+
},
7472
]
7573
```
7674
![Defect Parameters](../../../images/tutorials/materials/defects/defect_point_interstitial_tin_oxide/3-jl-setup-nb.webp "Defect parameters for O-interstitial in SnO")

lang/en/docs/tutorials/materials/specific/defect-point-pair-gallium-nitride.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,28 @@ Next, edit `create_point_defect_pair.ipynb` notebook to modify the parameters by
8282
Copy the below content and edit the "1.1. Set up defect parameters" cell in the notebook as follows:
8383

8484
```python
85+
from types import SimpleNamespace
86+
87+
# Selected material will be used as a unit cell to create a supercell first.
8588
SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
8689

8790
# List of dictionaries with defect parameters
88-
PRIMARY_DEFECT_CONFIG = {
89-
"defect_type": "substitution",
90-
"approximate_coordinate": [1.608, 4.642, 5.240],
91-
"chemical_element": "Mg",
92-
"use_cartesian_coordinates": True,
93-
}
94-
95-
SECONDARY_DEFECT_CONFIG = {
96-
"defect_type": "vacancy",
97-
"approximate_coordinate": [1.608, 4.642, 7.210],
98-
"use_cartesian_coordinates": True,
99-
}
91+
PRIMARY_DEFECT_CONFIG = SimpleNamespace(
92+
defect_type="substitution",
93+
coordinate=[1.608, 4.642, 5.240], # Approx. coord that will be resolved to the closest site
94+
use_cartesian_coordinates=True, # Use cartesian or crystal coordinates
95+
chemical_element="Mg",
96+
# "site_id": 0, # Index of the atom in the host material
97+
# "coordinate": None, # Exact position (override the approximate coordinate)
98+
)
99+
100+
SECONDARY_DEFECT_CONFIG = SimpleNamespace(
101+
defect_type="vacancy",
102+
approximate_coordinate=[1.608, 4.642, 7.210], # Approx. coord that will be resolved to the closest site
103+
use_cartesian_coordinates=True,
104+
# "site_id": 0, # Index of the atom in the host material
105+
# "coordinate": None, # Exact position (override the approximate coordinate)
106+
)
100107
```
101108

102109
Here's the visual of the updated content:

lang/en/docs/tutorials/materials/specific/defect-point-substitution-graphene.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,39 +73,38 @@ Next, edit `create_point_defect.ipynb` notebook to modify the parameters by addi
7373
Copy the below content and edit the "1.1. Set up defect parameters" cell in the notebook as follows:
7474

7575
```python
76-
DEFECT_TYPE = "substitution"
77-
SITE_ID = None # `from_site_id` method will be ignored
78-
COORDINATE = None # default method will be ignored
79-
APPROXIMATE_COORDINATE = None
80-
CHEMICAL_ELEMENT = "N"
76+
# Selected material will be used as a unit cell to create a supercell first.
8177
SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
82-
USE_CARTESIAN_COORDINATES = True
8378

8479
DEFECT_CONFIGS = [
8580
{
86-
"defect_type": "substitution",
87-
"approximate_coordinate": [4.9, 2.85, 10],
88-
"chemical_element": CHEMICAL_ELEMENT,
89-
"use_cartesian_coordinates": USE_CARTESIAN_COORDINATES
81+
"type": "substitution",
82+
"coordinate": [4.9, 2.85, 10],
83+
"element": "N",
84+
"placement_method": "closest_site",
85+
"use_cartesian_coordinates": True
9086
},
9187
{
92-
"defect_type": "substitution",
93-
"approximate_coordinate": [3.7, 4.9, 10],
94-
"chemical_element": CHEMICAL_ELEMENT,
95-
"use_cartesian_coordinates": USE_CARTESIAN_COORDINATES
88+
"type": "substitution",
89+
"coordinate": [3.7, 4.9, 10],
90+
"element": "N",
91+
"placement_method": "closest_site",
92+
"use_cartesian_coordinates": True
9693
},
9794
{
98-
"defect_type": "substitution",
99-
"approximate_coordinate": [2.45, 2.85, 10],
100-
"chemical_element": CHEMICAL_ELEMENT,
101-
"use_cartesian_coordinates": USE_CARTESIAN_COORDINATES
95+
"type": "substitution",
96+
"coordinate": [2.45, 2.85, 10],
97+
"element": "N",
98+
"placement_method": "closest_site",
99+
"use_cartesian_coordinates": True
102100
},
103101
{
104-
"defect_type": "vacancy",
105-
"approximate_coordinate": [3.7, 3.55, 10],
106-
"use_cartesian_coordinates": USE_CARTESIAN_COORDINATES
102+
"type": "vacancy",
103+
"coordinate": [3.7, 3.55, 10],
104+
"placement_method": "closest_site",
105+
"use_cartesian_coordinates": True
107106
},
108-
]
107+
]
109108
```
110109

111110
Here's the visual of the updated content:

lang/en/docs/tutorials/materials/specific/defect-point-vacancy-boron-nitride.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ Select the "Advanced > [JupyterLite Transformation](../../../materials-designer/
5959
Find and open `create_nanoribbon.ipynb` in the list of notebooks. Edit the nanoribbon parameters in section 1.1 of the notebook:
6060

6161
```python
62-
WIDTH = 3 # in number of unit cells
63-
LENGTH = 6 # in number of unit cells
64-
VACUUM_WIDTH = 0 # in number of unit cells
65-
VACUUM_LENGTH = 0 # in number of unit cells
66-
EDGE_TYPE = "zigzag" # "zigzag" or "armchair"
62+
# Index in the list of materials, to access as materials[MATERIAL_INDEX]
63+
MATERIAL_INDEX = 0
64+
65+
# Widths and lengths are in number of unit cells
66+
WIDTH = 3 # in unit cells
67+
LENGTH = 6 # in unit cells
68+
VACUUM_WIDTH = 0 # in Angstroms
69+
VACUUM_LENGTH = 0 # in Angstroms
70+
EDGE_TYPE = "zigzag" # "zigzag" or "armchair"
6771
```
6872

6973
![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
9296
Open `create_point_defect.ipynb` and modify the defect configuration parameters:
9397

9498
```python
99+
# Selected material will be used as a unit cell to create a supercell first.
95100
SUPERCELL_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
101+
96102
DEFECT_CONFIGS = [
97103
{
98-
"defect_type": "vacancy",
99-
"approximate_coordinate": [0.5, 0.5, 0.5],
104+
"type": "vacancy",
105+
"coordinate": [0.5, 0.5, 0.5],
106+
"placement_method": "closest_site",
100107
"use_cartesian_coordinates": False
101108
}
102109
]

0 commit comments

Comments
 (0)