Skip to content

Create a Slab with a Box Cutout

1. Introduction

Create a slab from a bulk material with the atoms inside a box removed. The box is set by its minimum and maximum coordinates along x, y and z.

2. Open the notebook

In JupyterLite, the notebook is made/create_cutout_box.ipynb, entry 1.4.5 "Box-cutout. Create a slab with a box cutout" of made/Introduction.ipynb.

3. Set the parameters

The notebook builds the slab from the first of the input materials.

Cell 1.1 holds the parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Box cutout parameters
MIN_COORDINATE = [0.25, 0.25, 0.5]
MAX_COORDINATE = [0.75, 0.75, 1]
USE_CARTESIAN_COORDINATES = False

# Slab parameters for creating a new slab if provided material is not a slab
DEFAULT_SLAB_PARAMETERS = {
    "miller_indices": (0, 0, 1),
    "thickness": 6,
    "vacuum": 10.0,
    "use_orthogonal_c": True,
    "xy_supercell_matrix": [[10, 0], [0, 10]]
}

MIN_COORDINATE and MAX_COORDINATE are opposite vertices of the box, in the coordinates that USE_CARTESIAN_COORDINATES selects.

DEFAULT_SLAB_PARAMETERS is the slab the box is cut from.

4. Run and read the result

Run the notebook with Run > Run All. The notebook shows the slab and the slab with the cutout from the top and from the side, appends with box cutout to the name and passes it back with set_materials, as in Structure Notebooks.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for creating a slab with a box cutout can be accessed below.