Skip to content

Commit f92a0fd

Browse files
authored
Merge pull request #194 from Exabyte-io/feature/SOF-7528
Feature/SOF-7528 Pt adatoms island on MoS2 NB
2 parents 11ebfda + ae5321d commit f92a0fd

2 files changed

Lines changed: 337 additions & 22 deletions

File tree

other/materials_designer/create_adatom_defect.ipynb

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@
5050
"cell_type": "code",
5151
"outputs": [],
5252
"source": [
53-
"DEFECT_TYPE = \"adatom\" \n",
54-
"PLACEMENT_METHOD = \"equidistant\" # Choose between \"equidistant\", \"crystal_site\", \"closest_site\", and \"coordinate\"\n",
55-
"CHEMICAL_ELEMENT = \"Si\" # Element to be placed at the site \n",
56-
"APPROXIMATE_POSITION_ON_SURFACE = [0.5, 0.5] # Position of the defect in crystal coordinates\n",
57-
"USE_CARTESIAN_COORDINATES = False # If True, the position is in Cartesian coordinates\n",
58-
"DISTANCE_Z = 2.0 # Distance of the defect from the surface in Angstrom\n",
59-
"\n",
53+
"DEFECT_CONFIGS = [\n",
54+
" {\n",
55+
" \"defect_type\": \"adatom\" ,\n",
56+
" \"placement_method\": \"equidistant\",\n",
57+
" \"chemical_element\": \"Si\",\n",
58+
" \"position_on_surface\": [0.5, 0.5],\n",
59+
" \"distance_z\": 2.0,\n",
60+
" \"use_cartesian_coordinates\": False\n",
61+
" }, \n",
62+
"]\n",
6063
"# Slab parameters\n",
6164
"MILLER_INDICES = (1, 1, 1) # Miller indices of the surface\n",
6265
"SLAB_THICKNESS = 3 # Thickness of the slab in unit cells\n",
6366
"VACUUM = 6 # Vacuum thickness in Angstrom\n",
64-
"SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] "
67+
"SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] # Supercell matrix for the slab"
6568
],
6669
"metadata": {
6770
"collapsed": false
@@ -101,8 +104,7 @@
101104
{
102105
"cell_type": "markdown",
103106
"source": [
104-
"### 1.3. Get input material\n",
105-
"Materials are loaded with `get_materials()`."
107+
"### 1.3. Get input material"
106108
],
107109
"metadata": {
108110
"collapsed": false
@@ -175,14 +177,17 @@
175177
"source": [
176178
"from mat3ra.made.tools.build.defect import AdatomSlabPointDefectConfiguration\n",
177179
"\n",
178-
"adatom_config = AdatomSlabPointDefectConfiguration(crystal=slab, \n",
179-
" defect_type=DEFECT_TYPE, \n",
180-
" placement_method=PLACEMENT_METHOD,\n",
181-
" chemical_element=CHEMICAL_ELEMENT, \n",
182-
" position_on_surface=APPROXIMATE_POSITION_ON_SURFACE,\n",
183-
" distance_z=DISTANCE_Z, \n",
184-
" use_cartesian_coordinates=USE_CARTESIAN_COORDINATES\n",
185-
")"
180+
"defect_configurations = [\n",
181+
" AdatomSlabPointDefectConfiguration(\n",
182+
" crystal=slab,\n",
183+
" defect_type=defect[\"defect_type\"],\n",
184+
" placement_method=defect[\"placement_method\"],\n",
185+
" chemical_element=defect[\"chemical_element\"],\n",
186+
" position_on_surface=defect[\"position_on_surface\"],\n",
187+
" distance_z=defect[\"distance_z\"],\n",
188+
" use_cartesian_coordinates=defect[\"use_cartesian_coordinates\"]\n",
189+
" ) for defect in DEFECT_CONFIGS\n",
190+
"]"
186191
],
187192
"metadata": {
188193
"collapsed": false
@@ -204,8 +209,8 @@
204209
"cell_type": "code",
205210
"outputs": [],
206211
"source": [
207-
"from mat3ra.made.tools.build.defect import create_slab_defect\n",
208-
"slab_with_adatom = create_slab_defect(adatom_config)"
212+
"from mat3ra.made.tools.build.defect import create_defects\n",
213+
"slab_with_adatom = create_defects(defect_configurations)"
209214
],
210215
"metadata": {
211216
"collapsed": false
@@ -230,11 +235,11 @@
230235
"from utils.visualize import visualize_materials as visualize\n",
231236
"\n",
232237
"visualize([{\"material\": slab, \"title\": \"Original material\"},\n",
233-
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n",
238+
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}],\n",
234239
" rotation=\"-90x\"\n",
235240
" )\n",
236241
"visualize([{\"material\": slab, \"title\": \"Original material\"},\n",
237-
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defect at {PLACEMENT_METHOD} position\"}],\n",
242+
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}],\n",
238243
")"
239244
],
240245
"metadata": {

0 commit comments

Comments
 (0)