|
50 | 50 | "source": [
|
51 | 51 | "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n",
|
52 | 52 | "\n",
|
53 |
| - "\n", |
54 | 53 | "# Enable interactive selection of terminations via UI prompt\n",
|
55 | 54 | "IS_TERMINATIONS_SELECTION_INTERACTIVE = False\n",
|
56 | 55 | "\n",
|
|
70 | 69 | "SUBSTRATE_XY_SUPERCELL_MATRIX = [[1, 0], [0, 1]]\n",
|
71 | 70 | "SUBSTRATE_USE_ORTHOGONAL_C = True\n",
|
72 | 71 | "\n",
|
| 72 | + "INTERFACE_DISTANCE = 3.0 # Gap between substrate and film, in Angstrom\n", |
| 73 | + "INTERFACE_VACUUM = 10.0 # Vacuum over film, in Angstrom\n", |
| 74 | + "\n", |
73 | 75 | "# Whether to convert materials to conventional cells before creating slabs.\n",
|
74 | 76 | "# To create interfaces with smaller cells, set this flag to False. (and pass already conventional cells as input)\n",
|
75 | 77 | "USE_CONVENTIONAL_CELL = True\n",
|
76 | 78 | "\n",
|
77 |
| - "# Maximum area for the superlattice search algorithm\n", |
78 |
| - "MAX_AREA = 50 # in Angstrom^2\n", |
| 79 | + "# Maximum area for the superlattice search algorithm (the final interface area will be smaller)\n", |
| 80 | + "MAX_AREA = 150 # in Angstrom^2\n", |
79 | 81 | "# Additional fine-tuning parameters (increase values to get more strained matches):\n",
|
80 | 82 | "MAX_AREA_TOLERANCE = 0.09 # in Angstrom^2\n",
|
81 |
| - "MAX_ANGLE_TOLERANCE = 0.03\n", |
82 |
| - "MAX_LENGTH_TOLERANCE = 0.03\n", |
| 83 | + "MAX_LENGTH_TOLERANCE = 0.05\n", |
| 84 | + "MAX_ANGLE_TOLERANCE = 0.02\n", |
83 | 85 | "\n",
|
84 |
| - "INTERFACE_DISTANCE = 3.0 # in Angstrom\n", |
85 |
| - "INTERFACE_VACUUM = 20.0 # in Angstrom" |
| 86 | + "# Whether to reduce the resulting interface cell to the primitive cell after the interface creation.\n", |
| 87 | + "# If the reduction causes unexpected results, try increasing the `MAX_AREA` for search.\n", |
| 88 | + "REDUCE_RESULT_CELL_TO_PRIMITIVE = True" |
86 | 89 | ],
|
87 | 90 | "outputs": [],
|
88 | 91 | "execution_count": null
|
|
203 | 206 | },
|
204 | 207 | "cell_type": "code",
|
205 | 208 | "source": [
|
206 |
| - "from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n", |
| 209 | + "from mat3ra.made.tools.build.slab.helpers import create_slab\n", |
207 | 210 | "from mat3ra.made.tools.build.interface.helpers import create_zsl_interface_between_slabs\n",
|
208 | 211 | "from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n",
|
209 | 212 | "\n",
|
210 |
| - "film_analyzer = CrystalLatticePlanesMaterialAnalyzer(material=film, miller_indices=FILM_MILLER_INDICES)\n", |
211 |
| - "film_slabs = [film_analyzer.get_material_with_termination_without_vacuum(termination) for termination in\n", |
| 213 | + "film_slabs = [create_slab(film, miller_indices=FILM_MILLER_INDICES, termination=termination, vacuum=0) for termination\n", |
| 214 | + " in\n", |
212 | 215 | " film_slab_terminations]\n",
|
213 | 216 | "\n",
|
214 |
| - "substrate_analyzer = CrystalLatticePlanesMaterialAnalyzer(material=substrate, miller_indices=SUBSTRATE_MILLER_INDICES)\n", |
215 |
| - "substrate_slabs = [substrate_analyzer.get_material_with_termination_without_vacuum(termination) for termination in\n", |
| 217 | + "substrate_slabs = [create_slab(substrate, miller_indices=SUBSTRATE_MILLER_INDICES, termination=termination, vacuum=0)\n", |
| 218 | + " for termination in\n", |
216 | 219 | " substrate_slab_terminations]\n",
|
217 | 220 | "\n",
|
218 | 221 | "film_slabs_with_titles = [{\"material\": slab, \"title\": str(termination)} for slab, termination in\n",
|
|
293 | 296 | "cell_type": "code",
|
294 | 297 | "source": [
|
295 | 298 | "from mat3ra.made.tools.analyze.interface import ZSLInterfaceAnalyzer\n",
|
296 |
| - "from mat3ra.made.tools.build.slab.configurations import SlabConfiguration\n", |
297 | 299 | "\n",
|
298 | 300 | "zsl_analyzer = ZSLInterfaceAnalyzer(\n",
|
299 | 301 | " substrate_slab_configuration=substrate_slab_config,\n",
|
300 | 302 | " film_slab_configuration=film_slab_config,\n",
|
301 | 303 | " max_area=MAX_AREA,\n",
|
302 | 304 | " max_area_ratio_tol=MAX_AREA_TOLERANCE,\n",
|
| 305 | + " max_length_tol=MAX_LENGTH_TOLERANCE,\n", |
303 | 306 | " max_angle_tol=MAX_ANGLE_TOLERANCE,\n",
|
304 |
| - " max_length_tol=MAX_LENGTH_TOLERANCE\n", |
| 307 | + " reduce_result_cell=False # Reduces supercell matrices in analyzer\n", |
305 | 308 | ")"
|
306 | 309 | ],
|
307 | 310 | "outputs": [],
|
|
393 | 396 | " vacuum=INTERFACE_VACUUM,\n",
|
394 | 397 | " match_id=selected_index,\n",
|
395 | 398 | " max_area=MAX_AREA,\n",
|
| 399 | + " max_area_ratio_tol=MAX_AREA_TOLERANCE,\n", |
| 400 | + " max_length_tol=MAX_LENGTH_TOLERANCE,\n", |
| 401 | + " max_angle_tol=MAX_ANGLE_TOLERANCE,\n", |
| 402 | + " reduce_result_cell_to_primitive=REDUCE_RESULT_CELL_TO_PRIMITIVE,\n", |
396 | 403 | ")"
|
397 | 404 | ],
|
398 | 405 | "outputs": [],
|
|
410 | 417 | {
|
411 | 418 | "cell_type": "code",
|
412 | 419 | "source": [
|
413 |
| - "visualize(interface, repetitions=[3, 3, 1])\n", |
414 |
| - "visualize(interface, repetitions=[3, 3, 1], rotation=\"-90x\")" |
| 420 | + "visualize(interface, repetitions=[1, 1, 1])\n", |
| 421 | + "visualize(interface, repetitions=[1, 1, 1], rotation=\"-90x\")" |
415 | 422 | ],
|
416 | 423 | "metadata": {
|
417 | 424 | "collapsed": false
|
|
0 commit comments