Skip to content

Create a Heterostructure

1. Introduction

Create a heterostructure of any number of layers from materials in Standata or the input materials: a slab of each material, with the slabs strain-matched and stacked.

2. Open the notebook

In JupyterLite, the notebook is made/create_heterostructure_example.ipynb, entry 2.1.5 "Heterostructure with multiple consecutive layers" of made/Introduction.ipynb.

3. Set the parameters

Cell 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
from types import SimpleNamespace

# Structure parameters for each layer - add or remove layers as needed
STRUCTURE_PARAMS = [
    SimpleNamespace(
        # First material (substrate)
        name="Silicon",  # Material name from Standata or upload
        slab_params=SimpleNamespace(
            miller_indices=(0, 0, 1),
            thickness=3,  # atomic layers
            xy_supercell_matrix=[[1, 0], [0, 1]],
        ),
        termination_formula=None,  # Use default termination
    ),
    SimpleNamespace(
        # Second material
        name="SiO2",  # Material name from Standata or upload
        slab_params=SimpleNamespace(
            miller_indices=(1, 1, 1),
            thickness=3,  # atomic layers
        ),
        termination_formula=None,  # Use default termination
    ),
    SimpleNamespace(
        # Third material
        name="HfO2.*MCL",  # Material name from Standata or upload
        slab_params=SimpleNamespace(
            miller_indices=(0, 0, 1),
            thickness=1,  # atomic layers
        ),
        termination_formula=None,  # Use default termination
    ),
    # Add more materials here as needed...
]

# Gap distances between layers (in Angstroms)
# Length should be one less than number of materials
GAPS = [3.0, 3.0]  # Gaps between materials

# Final vacuum above the heterostructure (in Angstroms)
VACUUM = 20.0

Each entry of STRUCTURE_PARAMS is one layer, from the bottom up, and an entry is added or removed per layer. name is looked up in Standata, and the first matching material is used. slab_params sets the orientation and thickness and, optionally, the supercell of the layer, and termination_formula its top termination.

When a name is not found in Standata, the notebook takes the input material at the same position, or the first one.

GAPS holds one gap per pair of consecutive layers, and VACUUM is the vacuum over the stack.

4. Run and read the result

Run the notebook with Run > Run All. The notebook prints the Miller indices and thickness of each layer and the number of atoms, shows the heterostructure and passes it back with set_materials, as in Structure Notebooks.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for creating a heterostructure can be accessed below.