Skip to content

Create an Island on a Slab

1. Introduction

Create a slab with an island on its surface: atomic layers added within a cylinder, sphere, box or triangular prism.

2. Open the notebook

In JupyterLite, the notebook is made/create_island_defect.ipynb, entry 3.1.4 "Island Defect on a Slab" of made/Introduction.ipynb.

3. Set the parameters

Cell 1.1 holds the parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from types import SimpleNamespace

# Shape-specific parameters
# Choose the island shape: 'cylinder', 'sphere', 'box', or 'triangular_prism'
# and the corresponding parameters
SHAPE_PARAMETERS = {
    'shape': 'cylinder',
    'radius': 0.25,
    'min_z': 0,
    'max_z': 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 = 3  # 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": 5.0,
    "use_orthogonal_c": True,
    "xy_supercell_matrix": [[3, 0], [0, 3]]
}


# Uncomment and set the parameters for other shapes if needed
# SHAPE_PARAMETERS = {
#     'shape': 'sphere',
#     'radius': 0.25
# }
#
# SHAPE_PARAMETERS = {
#     'shape': 'box',
#     'min_coordinate': [0.25, 0.25, 0],
#     'max_coordinate': [0.75, 0.75, 1]
# }
#
# SHAPE_PARAMETERS = {
#     'shape': 'triangular_prism',
#     'position_on_surface_1': [0.25, 0.25],
#     'position_on_surface_2': [0.75, 0.25],
#     'position_on_surface_3': [0.5, 0.75],
#     'min_z': 0,
#     'max_z': 1
# }

SHAPE_PARAMETERS = SimpleNamespace(**SHAPE_PARAMETERS)

SHAPE_PARAMETERS sets the shape of the island, 'cylinder', 'sphere', 'box' or 'triangular_prism', and its dimensions; the commented blocks below it give the parameters of each shape. CENTER_POSITION is the center of the cylinder or the sphere. The overview explains USE_CARTESIAN_COORDINATES.

NUMBER_OF_ADDED_LAYERS is the number of atomic layers the island adds.

DEFAULT_SLAB_PARAMETERS applies when the first input material is not a slab.

4. Run and read the result

Run the notebook with Run > Run All. The notebook shows the slab before and after the island is added and passes it back with set_materials, as in Structure Notebooks.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for creating an island defect can be accessed below.

The specific example Island Surface Defect in TiN uses this notebook.