5. Four Worked Examples (Live Outputs)¶
This chapter walks through four representative heterostructure workflows using real commands and authentic outputs captured directly from Multiwfn. Figure 5-1 displays the actual atomic geometries (top and side views) exported by Multiwfn for all four cases.
Downloadable Example Input Files (Standard .cif Format)
All five crystal input files used below are standard .cif files readable directly by Multiwfn (as well as VESTA, OVITO, CP2K, etc.):
- MoS2.cif — Monolayer 2H-MoS2 (\(a = 3.160\text{ Å}\), 3 atoms)
- WSe2.cif — Monolayer 2H-WSe2 (\(a = 3.280\text{ Å}\), 3 atoms)
- BlackP.cif — Monolayer black phosphorus / phosphorene (\(4.380 \times 3.310\text{ Å}\), 4 atoms)
- Graphene.cif — Monolayer graphene (\(a = 2.468\text{ Å}\), 2 atoms)
- Cu_bulk.cif — Conventional FCC bulk copper (\(a = 3.615\text{ Å}\), 4 atoms)
.cif files exported by Multiwfn across all four worked examples.Example 1: 2D vdW Heterostructure — MoS2 / WSe2 (Average Strain)¶
Scenario: Monolayer MoS2 (MoS2.cif, \(a = 3.160\text{ Å}\), 3 atoms) and monolayer WSe2 (WSe2.cif, \(a = 3.280\text{ Å}\), 3 atoms) have a raw lattice mismatch of \(\approx 3.7\%\). Under the default Fix A mode, a \(1\times 1\) cell exceeds the 3.0% strain threshold. Because both layers are free-standing 2D crystals of similar stiffness, switching to Option 3 → 3 (Average lattice) halves the per-layer strain to \(\pm 1.86\%\)!
Input sequence:
(Tip: Before entering1 to build #1, you can enter -3 → 1 to inspect the full details of #1 beforehand.)
Authentic Multiwfn output:
Found 1092 unique match(es) (4 Pareto-optimal * shown first, then lowest strain):
Idx Atoms ( A+ B) Mul(A,B) Area a(A) b(A) gamma Twist RMS% Max%
1* 6 ( 3+ 3) ( 1, 1) 9.0 3.22 3.22 120.00 0.00 1.864 1.899
2* 75 ( 39+ 36) ( 13, 12) 112.1 11.38 11.38 120.00 16.10 0.137 0.138
3* 75 ( 39+ 36) ( 13, 12) 112.1 11.38 11.38 120.00 -16.10 0.137 0.138
4* 156 ( 81+ 75) ( 27, 25) 233.2 16.41 16.41 120.00 30.00 0.060 0.060
...
Heterostructure construction completed!
Total atoms: 6 Part A (bottom): atoms 1 - 3 (3 atoms, x1)
Part B (top): atoms 4 - 6 (3 atoms, x1)
Relative twist angle (B vs A): 0.000 deg Surface area: 8.979 A^2
Part A strain: RMS= 1.899%, Max= 1.899%, Principal=(+1.899%, +1.899%)
Part B strain: RMS= 1.829%, Max= 1.829%, Principal=(-1.829%, -1.829%)
Slab thicknesses: Part A= 3.120 A, Part B= 3.340 A, Interlayer= 3.000 A, Vacuum= 15.00 A
Min nearest-neighbor distance: 2.4269 A (Min A-B interfacial distance: 3.0000 A)
New cell angles: Alpha= 90.0000 Beta= 90.0000 Gamma= 120.0000 degree
Choosing Between #1* and #2*
- Pick
#1*(6 atoms, 0°, ±1.9%) when compute budget is tight or when scanning aligned \(0^\circ\) high-symmetry AA/AB and R/H (Rot180) registries. - Pick
#2*(75 atoms, 16.10°, 0.14%)—shown in Figure 5-1(a)—when you want near-zero artificial strain for high-accuracy electronic properties!
Example 2: Rectangular + Hexagonal — Black Phosphorus / Graphene (Orthogonal)¶
Scenario: Monolayer black phosphorus (BlackP.cif, \(4.380 \times 3.310\text{ Å}, \gamma = 90^\circ\), 4 atoms) is rectangular, whereas graphene (Graphene.cif, \(2.468\text{ Å}, \gamma = 120^\circ\), 2 atoms) is hexagonal. To preserve black phosphorus's orthogonal armchair/zigzag axes, we filter strictly for \(\gamma = 90^\circ\) orthogonal supercells (Option 4 → 2).
Input sequence:
Authentic Multiwfn output (finished in 29 ms):
Found 76 unique match(es) (13 Pareto-optimal * shown first, then lowest strain):
Idx Atoms ( A+ B) Mul(A,B) Area a(A) b(A) gamma Twist RMS% Max%
1* 28 ( 12+ 16) ( 3, 8) 43.5 4.38 9.93 90.00 30.00 1.791 2.463
2* 172 ( 72+ 100) ( 18, 50) 261.0 13.14 19.86 90.00 18.44 1.708 2.145
...
Heterostructure construction completed!
Total atoms: 28 Part A (bottom): atoms 1 - 12 (12 atoms, x3)
Part B (top): atoms 13 - 28 (16 atoms, x8)
Relative twist angle (B vs A): 30.000 deg Surface area: 43.493 A^2
Part A strain: RMS= 0.000%, Max= 0.000%, Principal=(+0.000%, +0.000%)
Part B strain: RMS= 1.791%, Max= 2.463%, Principal=(+2.463%, +0.588%)
Transformation matrix M_A: [[1, 0], [0, 3]] M_B: [[1, 2], [-4, 0]]
New cell vectors (in Angstrom): a = 4.38000, b = 9.93000, c = 20.10800 (90, 90, 90 deg)
Notice how Multiwfn instantaneously discovers the classic 28-atom rectangular supercell (\(\mathbf{M}_A = \mathrm{diag}(1,3)\), \(\mathbf{M}_B = \begin{pmatrix}1 & 2 \\ -4 & 0\end{pmatrix}\), \(\theta = 30^\circ\)) rendered in Figure 5-1(b)!
Example 3: End-to-End Bulk Metal → Slab → Heterostructure — Graphene / Cu(111)¶
Scenario: Starting purely from a conventional 4-atom bulk FCC Cu cell (Cu_bulk.cif), we chain Option 32 and Option 33 in one uninterrupted Multiwfn session without writing any script or intermediate slab file.
Input sequence:
(Setting max strain to4.0% lets us see both the 6-atom \(1\times 1\) approximation and the ultra-low-strain rotated supercells side by side.)
Authentic Multiwfn output:
Found 379 unique match(es) (4 Pareto-optimal * shown first, then lowest strain):
Idx Atoms ( A+ B) Mul(A,B) Area a(A) b(A) gamma Twist RMS% Max%
1* 6 ( 4+ 2) ( 1, 1) 5.7 2.56 2.56 120.00 0.00 3.573 3.573
2* 74 ( 48+ 26) ( 12, 13) 67.9 8.85 8.85 120.00 16.10 0.490 0.490
3* 74 ( 48+ 26) ( 12, 13) 67.9 8.85 8.85 120.00 -16.10 0.490 0.490
4* 154 ( 100+ 54) ( 25, 27) 141.5 12.78 12.78 120.00 30.00 0.336 0.336
The Cu(111) slab remains strictly unstrained (0.000%), while #2* (74 atoms, 16.10°)—shown in Figure 5-1(c)—reduces graphene's tensile strain from 3.57% down to just 0.49%!
Example 4: Commensurate Moiré Superlattices — Twisted Bilayer Graphene (tBLG)¶
Scenario: Load Graphene.cif as both Part A and Part B, tighten the strain cap to 0.1%, and set max atoms to 160. Multiwfn cleanly enumerates every exact zero-strain commensurate twist angle up to 160 atoms (both hexagonal and orthogonal forms) with zero oblique duplicate clutter.
Input sequence:
Authentic Multiwfn output:
Found 18 unique match(es) (1 Pareto-optimal * shown first, then lowest strain):
Idx Atoms ( A+ B) Mul(A,B) Area a(A) b(A) gamma Twist RMS% Max%
1* 4 ( 2+ 2) ( 1, 1) 5.3 2.47 2.47 120.00 0.00 0.000 0.000
2 8 ( 4+ 4) ( 2, 2) 10.5 2.47 4.27 90.00 0.00 0.000 0.000
3 28 ( 14+ 14) ( 7, 7) 36.9 6.53 6.53 120.00 21.79 0.000 0.000
4 28 ( 14+ 14) ( 7, 7) 36.9 6.53 6.53 120.00 -21.79 0.000 0.000
5 52 ( 26+ 26) ( 13, 13) 68.6 8.90 8.90 120.00 27.80 0.000 0.000
9 76 ( 38+ 38) ( 19, 19) 100.2 10.76 10.76 120.00 13.17 0.000 0.000
13 124 ( 62+ 62) ( 31, 31) 163.5 13.74 13.74 120.00 17.90 0.000 0.000
15 148 ( 74+ 74) ( 37, 37) 195.2 15.01 15.01 120.00 -9.43 0.000 0.000
Every textbook commensurate tBLG angle (\(\pm 21.79^\circ, \pm 27.80^\circ, \pm 13.17^\circ, \pm 17.90^\circ, \pm 9.43^\circ\)) appears with exact 0.000% strain; Figure 5-1(d) displays candidate #9 (76 atoms, \(-13.17^\circ\)) tiled \(2\times 2\) to reveal its characteristic moiré rosette.