Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2439d46
SOF-8085: periodic twisted bilayer h-BN at 7.34° (Xian et al. 2019) —…
VsevolodX Oct 17, 2026
a8534a9
SOF-8085: review - flat-set band count beside the width, no Fig. 1f i…
VsevolodX Oct 17, 2026
066dd58
SOF-8085: review - structure notebook intro describes the search the …
VsevolodX Oct 17, 2026
a605d70
SOF-8085: structure notebook builds configurations α and β at 7.34°, …
VsevolodX Oct 23, 2026
e9cebd4
SOF-8085: simulation notebook takes a list of materials, each with th…
VsevolodX Oct 23, 2026
687e351
SOF-8085: simulation notebook's materials comment carries no run timing
VsevolodX Oct 23, 2026
29f30e3
SOF-8085: review - α and β previews titled by name; paper widths name…
VsevolodX Oct 23, 2026
5c0ea1b
SOF-8085: 2.64° α and β as commented entries in both notebooks; made …
VsevolodX Oct 24, 2026
519f94d
SOF-8085: made pinned to ed20fa13
VsevolodX Oct 24, 2026
628ef24
SOF-8085: pin made to the readable coincidence-lattice search (30df30…
VsevolodX Oct 24, 2026
068b47c
SOF-8085: the h-BN monolayer (Fig. 1d) saved and computed beside the …
VsevolodX Oct 24, 2026
ac9e0f9
SOF-8085: the monolayer's bands on a denser Γ–K–M path (61 points); t…
VsevolodX Oct 24, 2026
7f22965
SOF-8085: review - each material carries its own band path beside its…
VsevolodX Oct 25, 2026
dda8a54
SOF-8085: pin made to 3ae2f1ce (docstrings); unpin on release
VsevolodX Oct 29, 2026
96852df
SOF-8085: pin made to 10689847 (docstring linter); unpin on release
VsevolodX Oct 29, 2026
ca07057
SOF-8085: pin made to 8ac39d4f (direct names); unpin on release
VsevolodX Oct 30, 2026
b23f1f6
SOF-8085: pin made to 26c6f8f2 (readability); unpin on release
VsevolodX Oct 31, 2026
0bbab10
SOF-8085: the builder returns the 120° cell, so the structure noteboo…
VsevolodX Nov 2, 2026
67c2940
SOF-8085: pin made to 0801160e (one size limit); unpin on release
VsevolodX Nov 3, 2026
43c553d
SOF-8085: pin made to 702ca7cf; unpin on release
VsevolodX Nov 3, 2026
bcbc25e
SOF-8085: unpin mat3ra-made (made #302 merged)
VsevolodX Nov 3, 2026
936759e
Merge remote-tracking branch 'origin/main' into feature/SOF-8085
VsevolodX Nov 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"| `C-2D-INT-Z` | Interface ZSL | [Graphene/Ni Interface Film XY Position Optimization](optimization_interface_film_xy_position_graphene_nickel.ipynb) | [Gr/Ni(111) Registry and Work of Adhesion](optimization_interface_film_xy_position_graphene_nickel_SIMULATION.ipynb) | [[7]](#ref7) |\n",
"| `C-2D-INT-T` | Interface Twisted | *To be added* | — | — |\n",
"| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate MoS₂ Bilayer](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb) | [Twisted MoS₂ Bilayer Band Structure](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide_SIMULATION.ipynb) | [[8]](#ref8) |\n",
"| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate h-BN Bilayer](interface_bilayer_twisted_commensurate_lattices_boron_nitride.ipynb) | [Twisted h-BN Bilayer Flat Bands](interface_bilayer_twisted_commensurate_lattices_boron_nitride_SIMULATION.ipynb) | [[9]](#ref9) |\n",
"| `C-2D-MLT` | Multi-Layer | *To be added* | — | — |\n",
"| `C-0D-INT-R` | Nanoribbons Interface Rotation | [Twisted BN Nanoribbon Bilayer](interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb) | *To be added* | [[9]](#ref9) |\n",
"| `D-3D-AMO` | Amorphous | *To be added* | — | — |\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Twisted bilayer Boron Nitride at 7.34° on a commensurate lattice.\n",
"\n",
"## 0. Introduction.\n",
"\n",
"This notebook demonstrates how to generate a twisted interface between two materials using commensurate lattices. The example uses hexagonal boron nitride (h-BN) as both the film and substrate materials and builds the periodic moiré cells of configurations α and β that the paper computes, at 7.34° (244 atoms) by default. The notebook uses the `create_interface_commensurate` function which first creates a slab from the material and then performs commensurate lattice matching to find valid supercells for the target twist angle. The algorithm searches for the supercell matrices that give the target twist angle. The generated interfaces are visualized and analyzed to determine the number of atoms and the interlayer distance.\n",
"\n",
"> **Lede Xian, Dante M. Kennes, Nicolas Tancogne-Dejean, Massimo Altarelli, and Angel Rubio**\n",
"> Multiflat Bands and Strong Correlations in Twisted Bilayer Boron Nitride: Doping-Induced Correlated Insulator and Superconductor. Nano Letters, 19, 4934. 2019.\n",
"> [https://doi.org/10.1021/acs.nanolett.9b00986](https://doi.org/10.1021/acs.nanolett.9b00986)\n",
"\n",
"The twisted h-BN bilayer is shown in the following Figure 1 from the article: configurations α (a) and β (b), and the width of the top valence flat bands against twist angle (g).\n",
"\n",
"<img src=\"https://github.com/Exabyte-io/documentation/raw/12617167278ae3523adc028583b21ea4e8ebd197/images/tutorials/materials/interfaces/twisted-bilayer-boron-nitride/tbbn-paper-image.png\" alt=\"Twisted bilayer h-BN\" width=\"800\"/>"
]
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"## 1. Prepare the Environment\n",
"### 1.1. Configurations from the article\n",
"\n",
"The twist angles and the interlayer distance below are the ones of the article's band-width series: flat layers,\n",
"3.23 Å apart, the optimized interlayer distance of the untwisted bilayer. The article's two configurations, α and β,\n",
"share one moiré cell and differ in twist by 60°: in α the B-over-B and N-over-N regions sit at different sites of the\n",
"cell, in β at the same site.\n",
"\n",
"The names below are how the [band structure notebook](interface_bilayer_twisted_commensurate_lattices_boron_nitride_SIMULATION.ipynb)\n",
"finds the materials created here, so changing one means changing it there too."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
"# Uncomment a line to build that configuration as well: α is twisted by 60° + θ, β by θ. The angles are those of\n",
"# Xian et al. 2019 Fig. 1g; smaller angles have larger cells (6.01°: 364 atoms, 5.08°: 508, 3.89°: 868, 2.64°: 1876).\n",
"INTERFACE_PARAMETERS = [\n",
" {\"name\": \"h-BN bilayer 7.34deg alpha d3.23\", \"angle\": 60 + 7.34},\n",
" {\"name\": \"h-BN bilayer 7.34deg beta d3.23\", \"angle\": 7.34},\n",
" # {\"name\": \"h-BN bilayer 6.01deg alpha d3.23\", \"angle\": 60 + 6.01},\n",
" # {\"name\": \"h-BN bilayer 6.01deg beta d3.23\", \"angle\": 6.01},\n",
" # {\"name\": \"h-BN bilayer 5.08deg alpha d3.23\", \"angle\": 60 + 5.08},\n",
" # {\"name\": \"h-BN bilayer 5.08deg beta d3.23\", \"angle\": 5.08},\n",
" # {\"name\": \"h-BN bilayer 3.89deg alpha d3.23\", \"angle\": 60 + 3.89},\n",
" # {\"name\": \"h-BN bilayer 3.89deg beta d3.23\", \"angle\": 3.89},\n",
" # {\"name\": \"h-BN bilayer 2.64deg alpha d3.23\", \"angle\": 60 + 2.64},\n",
" # {\"name\": \"h-BN bilayer 2.64deg beta d3.23\", \"angle\": 2.64},\n",
"]\n",
"INTERFACE_DISTANCE = 3.23 # Å, the article's\n",
"MONOLAYER_NAME = \"h-BN monolayer\" # the Standata monolayer, saved as is (Fig. 1d)"
]
},
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
"source": [
"### 1.2. Set interface creation and visualization parameters"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"VACUUM = 20.0 # Å of empty space above the top layer; paper: not stated\n",
"\n",
"# Visualization parameters\n",
"SHOW_INTERMEDIATE_STEPS = True\n",
"VISUALIZE_REPETITIONS = [3, 3, 1]"
]
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"### 1.3. Install packages\n",
"The step executes only in Pyodide environment. For other environments, the packages should be installed via `pip install` (see [README](../../README.ipynb))."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"from mat3ra.notebooks_utils.packages import install_packages\n",
"\n",
"await install_packages(\"made|specific_examples\")"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"### 1.4. Get input material\n",
"We'll use the h-BN monolayer from Standata.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"from mat3ra.made.material import Material\n",
"from mat3ra.standata.materials import Materials\n",
"from mat3ra.notebooks_utils.ipython.entity.material.visualize import visualize_materials\n",
"\n",
"# paper: a = 2.512 Å; ours Standata's h-BN monolayer as is\n",
"material = Material.create(Materials.get_by_name_and_categories(\"BN\", \"2D\"))\n",
"print(f\"{material.name}: {material.basis.number_of_atoms} atoms, a = {material.lattice.a:.3f} Å\")\n",
"\n",
"if SHOW_INTERMEDIATE_STEPS:\n",
" visualize_materials(material, repetitions=VISUALIZE_REPETITIONS)\n",
" visualize_materials(material, repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")"
]
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"## 2. Generate the Twisted Interfaces"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": [
"from mat3ra.made.tools.analyze.other import get_average_interlayer_distance\n",
"from mat3ra.made.tools.convert import to_ase\n",
"from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum\n",
"from mat3ra.made.tools.helpers import create_interface_commensurate\n",
"\n",
"interfaces = []\n",
"for parameters in INTERFACE_PARAMETERS:\n",
" interface = create_interface_commensurate(\n",
" material=material,\n",
" target_angle=parameters[\"angle\"],\n",
" gap=INTERFACE_DISTANCE,\n",
" # the builder adds the gap above the top layer as well\n",
" vacuum=VACUUM - INTERFACE_DISTANCE,\n",
" )\n",
" # Naming the hexagonal lattice is what lets the symbolic K point of the band path resolve.\n",
" interface.lattice.type = \"HEX\"\n",
" interface.name = parameters[\"name\"]\n",
" interfaces.append(interface)\n",
"\n",
" interlayer_distance = get_average_interlayer_distance(\n",
" interface, InterfacePartsEnum.SUBSTRATE.value, InterfacePartsEnum.FILM.value)\n",
" print(f\"{interface.name}: {interface.basis.number_of_atoms} atoms ({to_ase(interface).get_chemical_formula()}), \"\n",
" f\"a = {interface.lattice.a:.3f} Å, gamma = {interface.lattice.gamma:.1f}°, \"\n",
" f\"interlayer distance {interlayer_distance:.3f} Å, target twist {parameters['angle']:.2f}°\")"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"## 3. Preview the materials"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [],
"source": [
"titled_interfaces = [{\"material\": interface, \"title\": interface.name} for interface in interfaces]\n",
"visualize_materials(titled_interfaces, repetitions=VISUALIZE_REPETITIONS)\n",
"visualize_materials(titled_interfaces, repetitions=VISUALIZE_REPETITIONS, rotation=\"-90x\")"
]
},
{
"cell_type": "markdown",
"id": "13",
"metadata": {},
"source": [
"## 4. Save the materials\n",
"\n",
"Each material is written to the `uploads` folder under its name, which is how the\n",
"[band structure notebook](interface_bilayer_twisted_commensurate_lattices_boron_nitride_SIMULATION.ipynb)\n",
"picks it up."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"metadata": {},
"outputs": [],
"source": [
"from mat3ra.notebooks_utils.io import download_content_to_file\n",
"from mat3ra.notebooks_utils.material import set_materials\n",
"\n",
"material.name = MONOLAYER_NAME\n",
"materials_to_save = [*interfaces, material]\n",
"set_materials(materials_to_save)\n",
"for material_to_save in materials_to_save:\n",
" download_content_to_file(material_to_save.to_json(), f\"{material_to_save.name}.json\")"
]
},
{
"cell_type": "markdown",
"id": "15",
"metadata": {},
"source": [
"## References\n",
"\n",
"[1] L. Xian, D. M. Kennes, N. Tancogne-Dejean, M. Altarelli and A. Rubio, \"Multiflat Bands and Strong Correlations in Twisted Bilayer Boron Nitride: Doping-Induced Correlated Insulator and Superconductor\", Nano Lett. 19, 4934 (2019). https://doi.org/10.1021/acs.nanolett.9b00986"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading