Skip to content

Plugin Slab Builder

Hiromichi Yokoyama edited this page Nov 5, 2026 · 7 revisions

Plugin: Slab Builder

Slab Builder cuts oriented surface slabs from 3D bulk crystal structures along arbitrary $(hkl)$ Miller indices and exports them as standard P1 CIF files, ready for periodic DFT calculations in VASP, Quantum ESPRESSO, or CP2K.

Repository moleditpy_slab_builder
Author HiroYokoyama
Supported OS Windows, macOS, Linux, WSL
Supported Python >=3.9, <3.15
Supported MoleditPy >=5.0.0, <6.0.0
First-party plugin license LGPL-3.0-or-later
Menu location Structure ▸ Slab Builder...
Extra dependencies None (uses NumPy, PyVista, RDKit from the MoleditPy environment)

See Official Plugins for the full catalogue.


1. Bulk crystal inputs

The plugin accepts bulk crystal inputs from two sources:

  1. CIF File: Load a .cif crystal structure file from disk with full space-group symmetry expansion into a primitive or conventional bulk cell.
  2. CIF Viewer Panel: Read the crystal currently open in the CIF Viewer plugin panel directly.

2. Surface plane selection (Miller indices)

  • Arbitrary $(hkl)$ planes: Specify any integer Miller index triplet $(h, k, l)$. The plugin constructs an oriented surface basis such that vectors $\mathbf{a}$ and $\mathbf{b}$ lie within the surface plane, and vector $\mathbf{c}$ stacks along the surface normal.
  • Hexagonal Miller-Bravais indices: Accepts four-index notation $(h, k, i, l)$ for hexagonal systems, automatically enforcing and folding the redundant index $i = -(h + k)$ into standard $(h, k, l)$.

3. Slab thickness, termination, and vacuum

  • Layer count: Set the number of surface repeat layers to control the physical thickness of the slab.
  • Constant-thickness termination shift: Slide the cut window continuously through the bulk unit cell along the surface normal to expose different atomic surface terminations. The cut window maintains a strictly constant thickness, guaranteeing that the total atom count remains invariant while scanning terminations.
  • Symmetric vacuum padding: Add vacuum spacing along the surface normal. The vacuum is split symmetrically across the top and bottom faces, centering the slab in the periodic unit cell.
  • Orthogonal normal alignment: By default, reorients $\mathbf{c}$ strictly perpendicular to the surface plane ($\alpha = \beta = 90^\circ$), ensuring an orthogonal vacuum gap for efficient DFT calculations. Straightening $\mathbf{c}$ slides the upper layers sideways, so their atoms are folded back inside the $\mathbf{a}$/$\mathbf{b}$ faces.

4. Supercells and export

  • In-plane supercells: Multiply the slab cell by integer factors ($n_a \times n_b \times n_c$) to create larger surface unit cells for adsorbate adsorption, defect studies, or surface reconstructions.
  • P1 CIF output: Save the generated slab to a CIF file or copy it to the clipboard. The generated P1 CIF geometry round-trips exactly into MoleditPy's DFT input generators (VASP, Quantum ESPRESSO, CP2K).

Usage notes

Supercell repeats are applied after slab construction. Use integer Miller indices, a positive layer count and finite vacuum/termination-shift values. Termination previews reflect the current settings. Supercells support up to 100,000 atoms.


5. See also


This page documents Slab Builder v0.8.1, and was last updated on 2026-11-05. See REGISTRY/plugins.json for the current version.

Clone this wiki locally