name: vasp-input-preparation description: Use this skill for preparing canonical VASP relax/static/frequency/DOS/MD input sets, choosing the correct regime and preset, handling INCAR patch-policy edge cases, explicit slab-frequency setup, and producing execution-ready folder layouts before dispatch.
vasp-input-preparation
Overview
Use this skill to produce execution-ready VASP input trees without fighting tool-enforced defaults.
Quick Start
- Use
vasp_preparewith the rightpreset:relax,static,freq,dos, ormd. - Set
regimecorrectly:bulk,slab, orgas. - Put one preparation campaign under one clean
output_root. - Use
patch_policy="safe"by default. - For
dosandmd, treat the preset as a starter template and do job-specific tuning throughuser_incar_patchin the same call. - If a later DOS/band branch should reuse
CHGCAR, make that an explicit upstream requirement and preserve the file in the self-consistent stage. - If comparison-sensitive toggles matter (
use_d3,use_dft_plus_u,enable_dipole, spin/MAGMOM, smearing, or reference-state choices), set them explicitly in the first preparation call and report them. - Use
vasp_band_prepareinstead ofvasp_preparewhen the job is a line-mode band-structure calculation with an explicit bandKPOINTS.
Allowed tools
fix_atoms_by_indicesvasp_preparevasp_band_preparegenerate_kpath
Workflow
INCAR patching
- Use
user_incar_patchfor targeted job-specific INCAR controls. - For DOS jobs,
dos_charge_density_pathcopies a CHGCAR into the output root, enablesICHARG=11, and applies the recommendedLMAXMIXbaseline when absent. - For DOS or MD presets,
user_incar_patchis the main hook for controls such asNEDOS,ISMEAR,TEBEG,TEEND,POTIM,NSW,SMASS, orMDALGO. MAGMOM,LDAUU, andLDAUJmust be element-value maps such as{"Fe": 2.2}.- Use
nullinuser_incar_patchto request removal of a key from the final INCAR. - Keep
patch_policy="safe"by default; useforceonly when intentionally overriding canonical defaults. - In safe mode, tune run-control and method knobs directly when they do not change the job identity:
NSW, staticISIF, frequencyPOTIM/NFREE, and relax optimizerIBRION=1/2/3are allowed. Safe still blocks cross-mode changes such as static/frequency/dimer/MDIBRION, relax/dimer cell-relaxationISIF, gas/frequencyISYM, and fixed-density DOSICHARG.
1. Pick the right canonical preset
- Confirm the input path exists before preparing a VASP tree.
vasp_prepare(preset="relax", ...)is for ionic relaxation jobs.vasp_prepare(preset="static", ...)is for static jobs and enforcesNSW=1,IBRION=-1.vasp_prepare(preset="freq", ...)is for finite-difference vibrational jobs and enforces the frequency-specific overrides.vasp_prepare(preset="dos", ...)is for DOS/PDOS-style jobs. The tool starts from a bulk-leaning tetrahedron-style template withISMEAR=-5,NEDOS=2001,LORBIT=11, and ifdos_charge_density_pathis provided it copiesCHGCAR, setsICHARG=11, and auto-fills a recommendedLMAXMIXbaseline when absent.vasp_prepare(preset="md", ...)is for molecular dynamics. The tool starts from a Nose-Hoover NVT-style template withIBRION=0,MDALGO=2,NSW=1000,POTIM=1.0,TEBEG=300,TEEND=300, andSMASS=0.
2. Choose the correct regime
bulk: periodic bulk models;relax_cell=Trueis allowed only withpreset="relax"and switchesISIF=3.slab: surface slabs;ISIF=2, KPOINTS z forced to 1,relax_cell=Trueis invalid.gas: molecules or gas references; forced1x1x1KPOINTS andrelax_cell=Trueis invalid.
3. Respect built-in defaults
- The tool already owns the main preset, including pseudopotential family,
ENCUT,EDIFF, smearing defaults, and relax-vs-SP mode settings. compute_dos,use_d3,use_dft_plus_u, andenable_dipoleare the toggles worth surfacing when they matter.- Project house default for
k_productis35for production slab work unless the task explicitly provides a convergence-backed value. - For DOS jobs, the preset is a recommended starting point, not a claim that one DOS INCAR works for every material class.
- For MD jobs, the preset is a recommended thermostat/template start, not a full replacement for system-specific choices of timestep, temperature schedule, thermostat mass, or ensemble controls.
4. Add a system-aware starting point
- The tool's canonical defaults are safe starters, but VASP Wiki guidance is more system-aware than a single global default. If the material class is known, surface the system-specific occupancy choice explicitly through
user_incar_patch. - Good start for unknown / high-throughput / gap-uncertain systems:
ISMEAR=0,SIGMA=0.05-0.1; for clearly gapped or unknown-gap cases, considerEFERMI=MIDGAP. - Good start for metallic relaxations or metallic force-sensitive work:
ISMEAR=1,SIGMA=0.2; check that the entropy term is acceptably small before treating the setup as converged. - Good start for adsorbate slab calculations:
ISMEAR=0,SIGMA=0.1. - Good start for semiconductors or insulators in bulk static or DOS-like post-processing:
ISMEAR=-5on a sufficiently denseGamma-centered mesh. - Good start for slab/gas/low-dimensional or tetrahedron-ineligible DOS work: do not assume tetrahedron is safe; fall back to
ISMEAR=0with smallSIGMA, typically0.03-0.1. - Good start for gas references: keep
ISYM=0,ISMEAR=0,SIGMA=0.01, and1x1x1KPOINTS. - Treat these as explicit starting recipes, not convergence proofs. Once the system class is known, the starting recipe should be stated in the task packet instead of left implicit.
5. Override carefully
user_incar_patchis for targeted overrides. Fordosandmd, it is also the preferred path for one-call tuning of method knobs.- For DOS tuning, the common explicit overrides are
ISMEAR,SIGMA,EFERMI,NEDOS,EMIN,EMAX, and occasionallyLMAXMIX. MAGMOM,LDAUU, andLDAUJmust be element maps.patch_policy="safe"rejects overrides only for the small protected set of preset/regime-bound keys. Fordosandmd, safe intentionally leaves most method controls overrideable so the model can changeNEDOS,ISMEAR,NSW,POTIM,TEBEG,TEEND,SMASS,MDALGO, and similar knobs without switching toforce.- For ordinary relax jobs, changing
NSWand choosing a standard relaxation optimizer (IBRION=1,2, or3) is a safe method adjustment, not a reason to switch toforce. - For static jobs,
ISIFcan be adjusted in safe mode because it does not turn the job into an ionic or cell relaxation. - For finite-difference frequency jobs,
POTIMandNFREEcan be adjusted in safe mode because they tune the displacement/stencil, whileIBRIONandISYMremain protected. patch_policy="force"applies the patch after canonical defaults, including explicit removal withnull.- Only use
forcewhen you are intentionally breaking the preset identity itself, for example replacingIBRIONwith a non-matching job type or tearing down other protected invariants.
6. Keep output layout clean
- Single structure input writes to
output_root/<stem>/. - Directory input preserves relative layout and appends
<stem>/per structure. - Do not mix unrelated relax and SP campaigns in the same ambiguous tree.
7. Add explicit band-path or phonon handoffs
- Use
generate_kpathonly after a relaxed bulk baseline is accepted; it emits the band-pathKPOINTS, not a full calc directory. - Use
vasp_band_preparewhen that line-modeKPOINTSshould become a dedicated band-structure job root. - For phonon workflows, keep displacement generation outside
vasp_prepare; the prepare tool should only own the force-job input deck after the displacement set already exists.
8. Prepare frequency jobs explicitly if requested
- Do not treat vibrational thermochemistry jobs as ordinary relax or SP jobs. Prepare them as a separate stage after the relevant relaxed structure is finalized.
- For finite-difference frequency runs, use
IBRION=5,POTIM=0.015,NFREE=2, andISYM=0. - For slab adsorbate frequency jobs, do not blindly preserve the relax-stage selective-dynamics mask. A relaxed adsorbate-slab structure may still have mobile surface atoms, which is not acceptable for adsorbate-only vibrational thermochemistry. If the target is adsorbate-only slab thermochemistry and
ads_indicesare available, explicitly runfix_atoms_by_indices(indices=ads_indices, reverse=true)on the relaxed adsorbate-slab structure before writing the frequency input. - Treat this explicit refixing step as mandatory unless the task explicitly requests a broader vibrational model.
- Keep the frequency job on the same scientifically relevant electronic-structure footing as the corresponding energy campaign: same
ENCUT,EDIFF, smearing policy, spin treatment,DFT+U,D3, dipole correction, and other reference-sensitive toggles.
Method-critical defaults
- Do not silently rely on defaults for
use_d3,use_dft_plus_u,enable_dipole, spin treatment, or reference-state-sensitive INCAR toggles when they affect comparison. - Keep clean slab, gas-phase reference, adsorbed structures, and downstream static calculations scientifically comparable.
- When the system class is known, prefer a VASP-Wiki-style explicit smearing recipe over silent inheritance of the tool baseline.
- For unknown systems,
ISMEAR=0with smallSIGMAis the safer generic starting point than jumping directly to Methfessel-Paxton. - For metallic relaxations, a practical first explicit recipe is
ISMEAR=1,SIGMA=0.2, then check the entropy term before treating it as production-worthy. - For adsorbate slab calculations,
ISMEAR=0,SIGMA=0.1is the project-default explicit starting recipe. - For slab adsorption studies, do not set
relax_cell=trueunless the task explicitly requires a variable-cell study and the system is not in slab mode. - For slab work, use
k*a ~= 35 Åas the initial project default unless convergence evidence justifies something else. - Do not force bulk references to obey the slab default. Bulk
k_productshould be chosen from the bulk convergence requirement, not copied mechanically from slab policy. - For DOS / projected-DOS / finer electronic-structure jobs, it is acceptable to increase
k_productto around50when the extra sampling is part of the stated objective. - For DOS, keep in mind the VASP-recommended pattern: relax first, then do a DOS-oriented static stage; do not rely on relax-stage
DOSCARas the final result. - The default DOS preset is VASP-Wiki-aligned for bulk tetrahedron DOS, not a universal recommendation for slab/gas/low-dimensional meshes. If the mesh cannot support tetrahedra or the system class is uncertain, override to
ISMEAR=0with smallSIGMA(0.03-0.1). - For semiconducting or insulating bulk post-processing,
ISMEAR=-5is a good explicit start only when the mesh is dense enough andGamma-centered. - For clearly gapped or unknown-gap systems using Gaussian fallback, consider surfacing
EFERMI=MIDGAP. - For tetrahedron DOS, keep the mesh Gamma-centered and dense enough to justify interpolation.
- If reusing a converged
CHGCAR, surface that explicitly withdos_charge_density_path, and make sure the upstream self-consistent stage actually keptCHGCAR(for example by settingLCHARG=Truethere). - For fixed-density DOS/band reuse (
ICHARG=11), VASP Wiki recommendsLMAXMIX=2/4/6for s,p / d / f dominated systems; the tool now auto-fills a baseline when absent, but deliberate overrides should still be reported. - Tune
NEDOStogether withEMIN/EMAXwhen narrow peaks or edge resolution matter; VASP Wiki recommends checking the integrated DOS to confirm the grid is fine enough. - For MD, explicitly state whether you are keeping the default Nose-Hoover template or overriding thermostat/integration controls through
user_incar_patch. - Always report any non-default toggles that materially affect interpretation.
- When frequency-derived thermochemistry is the target, do not silently reuse generic relax or SP INCARs; surface the frequency-specific overrides explicitly.
Output Contract
Return:
output_root_rel- representative prepared directory
- selected
presetandregime - generated
k_grid - any non-default method toggles or overrides that materially affect execution
References
- Inspect the tool schema/source when edge cases around
k_product, DFT+U, or INCAR normalization matter. - Use
band-and-dos-analysisorphonon-displacement-workflowwhen the task goes beyond pure input preparation. - Hand off band/DOS follow-up to
band-and-dos-analysis, strain grids toelastic-property-workup, displacement sets tophonon-displacement-workflow, and MD trajectories tomd-diffusion-analysis.