Skip to content

Create a Twisted Interface with Commensurate Lattices

1. Introduction

Create a twisted bilayer of one material, with the two layers rotated by an angle close to the target twist angle at which their lattices are commensurate.

2. Open the notebook

In JupyterLite, the notebook is made/create_twisted_interface_with_commensurate_lattices.ipynb, entry 2.1.4 "Twisted Interface with Commensurate Lattices" 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
# Material selection and basic parameters
FILM_INDEX = 0  # Index in the list of materials, to access as materials[FILM_INDEX]
SUBSTRATE_INDEX = None  # Can be None to use same material as film

# Twisted interface parameters
TARGET_TWIST_ANGLE = 17.9  # in degrees
INTERFACE_DISTANCE = 3.0  # in Angstroms
INTERFACE_VACUUM = 20.0  # in Angstroms

# Commensurate interface parameters (following the test pattern)
ANGLE_TOLERANCE = 2.5  # in degrees
MAX_SUPERCELL_MATRIX_INT = 6  # Maximum supercell matrix element value
RETURN_FIRST_MATCH = True  # If True, returns first solution within tolerance

# Slab creation parameters
MILLER_INDICES = (0, 0, 1)  # Miller indices for slab creation
NUMBER_OF_LAYERS = 1  # Number of layers in the slab
USE_CONVENTIONAL_CELL = True
USE_ORTHOGONAL_C = True

STACKING_DIRECTION = "z" # Stacking direction for the slab, can be "x", "y", or "z"

# Visualization parameters
SHOW_INTERMEDIATE_STEPS = True
VISUALIZE_REPETITIONS = [3, 3, 1]

FILM_INDEX picks the input material both layers are made of.

MAX_SUPERCELL_MATRIX_INT is the largest element of the supercell matrices the search tries, and STACKING_DIRECTION the axis the layers are stacked along. The overview explains TARGET_TWIST_ANGLE, ANGLE_TOLERANCE, RETURN_FIRST_MATCH, INTERFACE_DISTANCE and the slab of each layer: MILLER_INDICES, NUMBER_OF_LAYERS, USE_CONVENTIONAL_CELL and USE_ORTHOGONAL_C.

4. Run and read the result

Run the notebook with Run > Run All. The notebook prints the number of atoms, the name and the cell vectors of the interface, shows it from the top and from the side and passes it back with set_materials, as in Structure Notebooks.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for creating a twisted interface with commensurate lattices can be accessed below.