Skip to content

Complete Guide to Constructing Heterostructures with Multiwfn

Tian Lu (Beijing Kein Research Center for Natural Sciences, sobereva@sina.com)
Last updated: 2026-Nov-30

Who Is This Guide For?

  • If you are new to first-principles heterostructure calculations (using CP2K, Quantum ESPRESSO, etc.) and are not yet familiar with concepts such as lattice mismatch, commensurate supercells, twisted moiré superlattices, strain distribution, interlayer distance & vacuum, or the matching algorithms involved, read sequentially starting from Chapter 1.
  • If you already know the fundamentals and simply want to learn how to use each option in Multiwfn's heterostructure interface, jump directly to Chapter 4 (Option 33 Reference) and Chapter 5 (Four Worked Examples).

Citation Reminder

If heterostructures constructed with Multiwfn are used in a published article, please cite the original Multiwfn papers displayed when the program starts.


Quick-Start Summary (Part A + Part B Heterostructure)

Step-by-Step Workflow in Multiwfn

  • Preparation: Heterostructure construction is supported starting from Multiwfn 2026.11.29, freely downloadable from the official website http://sobereva.com/multiwfn.
  • Step 1: Launch Multiwfn and load the structure of Part A (must be a periodic format with cell information supported by Multiwfn, such as .cif, CP2K .inp, .pdb with CRYST1, GROMACS .gro, POSCAR, etc.; see Section 2 of http://sobereva.com/587).
  • Step 2: Enter main function 300, then subfunction 7 (Geometry operation on the present system).
  • Step 3: If Part A is a bulk crystal, cleave a surface slab first with Option 32; if it is a large supercell, reduce it to a primitive cell first with Option 31.
  • Step 4: Enter Option 33 (Build heterostructure from two periodic structures) and load the structure file for Part B.
  • Step 5: For a 2D + 2D heterostructure, select 3 (Set strain distribution mode) → 3 (Average lattice); for a 2D + substrate system, keep the default (fix Part A).
  • Step 6: Select 0 (Start searching for matching heterostructure supercells!) to search, and choose the candidate with the best balance between atom count and strain from the starred (*) Pareto-optimal entries. (Here you can also use -3 to inspect details and -4 to fine-tune interlayer spacing, lateral shift, etc.)
  • Step 7: Review the build summary printed on screen. Afterward, use 0 (Visualize current geometry) to visually verify the 3D structure, then export .cif (or other formats) for first-principles calculations—or directly generate CP2K input files via Multiwfn's built-in CP2K input generator (see http://sobereva.com/587).

Guide Roadmap

Chapter Topic Summary
1. Heterostructure Fundamentals Core concepts Four heterostructure categories, why PBC supercell matching is hard, lattice mismatch vs. Biot principal strain, transformation matrices, twist angles, strain modes, interlayer spacing & vacuum, stacking/orientation controls, and Pareto optimality.
2. Algorithm & Key Advantages Under the hood Automatic unwrapping of boundary-split slabs, rigid tilted-\(c\) projection, canonical HNF + 2D Gauss reduction, 8-boundary \(\mathrm{SL}(2,\mathbb{Z})\) checks, analytic polar decomposition, 6-minor primitive filtering, and exact HNF coset atom population.
3. Input Preparation & Surface Cleaving Inputs & Option 32 Supported periodic formats, reducing to primitive cells (Option 31), and one-step bulk-to-slab cleaving with Option 32.
4. Option 33 Interface Reference Menu reference Detailed explanation of every Option 33 main-menu setting (-1, 0, 1–9), candidate table columns, interactive browser commands (1..N, -1 to -5), and post-build diagnostics.
5. Four Worked Examples Live examples Downloadable .cif inputs, commands, authentic Multiwfn outputs, and rendered atomic structures for MoS2/WSe2, Black-P/Graphene, Bulk Cu → Cu(111) → Graphene/Cu(111), and Twisted Bilayer Graphene (tBLG).
6. Frequently Asked Questions (FAQ) FAQ & DFT tips Troubleshooting "no match found", choosing the best candidate, building trilayer A/B/C stacks recursively, and key DFT calculation practices.