Skip to content

Plugin CP2K Input Generator

Hiromichi Yokoyama edited this page Nov 14, 2026 · 8 revisions

Plugin: CP2K Input Generator

CP2K Input Generator creates input files for the Quickstep electronic structure module of CP2K from molecules or periodic systems, featuring automatic basis set and GTH potential pairings, dual SCF strategies, and real-time input preview.

Repository moleditpy_cp2k_input_generator
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 File ▸ Export ▸ CP2K Input (Quickstep)...
Extra dependencies None (uses NumPy, PyVista, RDKit from the MoleditPy environment)

See Official Plugins for the full catalogue.


1. Structure sources

The plugin supports three structure inputs:

  1. Current Molecule: The molecule open in MoleditPy, wrapped in an orthorhombic simulation box with configurable vacuum padding. Ghost and dummy atoms (Bq, H: NICS probes, *) are left out and counted in a warning: the plane-wave codes have no ghost atoms, and writing them would add real atoms. Charge and multiplicity read from the molecule apply only to this source; a crystal from a CIF is written neutral and closed-shell. Setting PERIODIC NONE or XY also writes a matching &POISSON section with PSOLVER MT, so the electrostatics follow the cell.
  2. CIF File: Load crystal structures from disk with automatic space-group symmetry expansion.
  3. CIF Viewer Panel: Directly import geometry from the active CIF Viewer plugin panel without reloading files.

Supports supercell multiplication ($a \times b \times c$) and axis-specific vacuum padding for surface slab models prepared with Slab Builder.


2. Run types

Configures standard &GLOBAL run types:

  • ENERGY_FORCE: Single-point energy and nuclear force calculation.
  • GEO_OPT: Geometry optimization of atomic coordinates (&MOTION section included).
  • CELL_OPT: Full optimization of both atomic coordinates and cell parameters.
  • MD: Born-Oppenheimer molecular dynamics (&MD subsection with thermostat).

The &MOTION section is omitted automatically for single-point calculations.


3. DFT and Quickstep configuration

Basis sets and GTH potentials

  • MOLOPT basis sets: Pre-configured standard Gaussian basis sets (DZVP-MOLOPT-SR-GTH, TZVP-MOLOPT-GTH, etc.).
  • Matching GTH pseudopotentials: Automatically pairs basis sets with Goedecker-Teter-Hutter (GTH) pseudopotentials matching the selected exchange-correlation functional (e.g. GTH-PBE, GTH-BLYP, GTH-PADE).
  • Plane-wave multigrid (&MGRID): Sets cutoff (CUTOFF) and relative cutoff (REL_CUTOFF) for plane-wave expansion of charge density.
  • Quickstep precision (&QS): Configures EPS_DEFAULT for integral screening.

Exchange-correlation functionals

  • Supported XC functionals: PBE, BLYP, BP86, PADE (LDA), PBE0, B3LYP. For the hybrids the truncated-Coulomb CUTOFF_RADIUS is capped at half the shortest face-to-face width of the cell (not half the shortest cell vector, which is too long for a skewed cell).
  • Dispersion corrections: Grimme DFT-D2, DFT-D3 zero damping, and DFT-D3(BJ) configured via &PAIR_POTENTIAL.
  • Spin and charge: Total system charge and spin multiplicity with automatic Unrestricted Kohn-Sham (UKS) activation for open-shell systems.

4. Two SCF strategies

The plugin provides tailored SCF approaches depending on the electronic characteristics of the system:

  1. Orbital Transformation (&OT):
    • Highly efficient, guaranteed-convergence minimization using preconditioned conjugate gradients.
    • Combined with &OUTER_SCF for difficult cases.
    • Ideal for large insulating systems, semiconductor surfaces, and closed-shell molecules.
  2. Traditional Diagonalization:
    • Diagonalization with Fermi-Dirac smearing (&SMEAR), extra molecular orbitals (ADDED_MOS), and Broyden or DIIS mixing.
    • Essential for metals and zero-bandgap systems where OT cannot be applied due to fractional occupations.

5. Periodic boundary conditions and &KPOINTS

  • Gamma-only calculations: For large periodic cells or isolated clusters, the &KPOINTS section is omitted, executing efficient $\Gamma$-point Quickstep algorithms.
  • Monkhorst-Pack k-mesh: Full k-point sampling (&KPOINTS section) for small metallic or semiconducting unit cells.
  • Reciprocal spacing target: Automatically computes mesh subdivisions from target reciprocal space spacing ($\mathrm{\AA}^{-1}$). The spacing is given without the $2\pi$ factor, $n_i = \lceil |\mathbf{b}_i| / \Delta k \rceil$; VASP's KSPACING and pymatgen include $2\pi$, so their 0.2 corresponds to about 0.032 here.

Usage notes

For reduced periodicity, the Poisson solver is MT for NONE or XY, and ANALYTIC for other reduced-periodicity choices. Smearing requires nonzero ADDED_MOS. Export checks electrostatic boundaries and SCF/state compatibility.

With Job Manager installed, Submit to Cluster... appears beside Save. It saves the input file (asking for a name only when it has not been saved yet or the settings have changed since), hands it to Job Manager under the file's name, then closes the dialog. Without Job Manager the button is not shown.


6. See also


This page documents CP2K Input Generator v0.12.0, and was last updated on 2026-11-14. See REGISTRY/plugins.json for the current version.

Clone this wiki locally