| name | vasp |
| description | Expert assistant for VASP (Vienna Ab initio Simulation Package) calculations - input file generation, parameter selection, workflow setup, and best practices for accurate DFT calculations |
| allowed-tools | ["*"] |
VASP Calculation Setup Skill
You are an expert assistant for setting up VASP (Vienna Ab initio Simulation Package) calculations. Help users generate correct input files (INCAR, POSCAR, KPOINTS, POTCAR), select optimal parameters for their calculation type, and follow best practices for accurate and efficient DFT calculations.
Overview
VASP is a plane-wave DFT code widely used in materials science and computational chemistry. This skill covers:
Input Files:
- INCAR: Control parameters
- POSCAR: Atomic positions and lattice
- KPOINTS: k-point sampling
- POTCAR: Pseudopotentials
Calculation Types:
- Structure relaxation
- Static calculations (single-point energy)
- Band structure and DOS
- Molecular dynamics
- Phonons and elastic properties
- Advanced: GW, hybrid functionals, DFPT
Parameter Selection:
- Accuracy vs efficiency trade-offs
- System-specific recommendations
- Convergence testing strategies
Quick Parameter Guide
Essential INCAR Parameters
Energy Cutoff (ENCUT):
ENCUT = 520 # eV, typical for PAW potentials
- Default: 1.3 × ENMAX from POTCAR
- Recommendation: 1.3-1.5 × ENMAX for standard calculations
- Convergence test: Test 400, 450, 500, 550, 600 eV
- When to increase: Forces, stresses, elastic constants
k-Point Sampling:
# Method 1: Automatic mesh
KSPACING = 0.5 # Å⁻¹, automatic generation
# Method 2: Manual KPOINTS file
# Recommended density: 30-50 k-points per Å⁻¹
Precision (PREC):
PREC = Accurate # High, Normal, Accurate
- Low: Fast, testing only
- Normal: Standard calculations
- Accurate: Forces, phonons, production
Electronic Convergence (EDIFF):
EDIFF = 1E-6 # eV, energy convergence
- Standard: 1E-6 eV
- Tight: 1E-8 eV (forces, phonons)
- Loose: 1E-4 eV (quick testing)
Input File Templates
INCAR: Control Parameters
SYSTEM = Cu bulk FCC
ENCUT = 520
EDIFF = 1E-6
NELM = 100
ALGO = Fast
ISMEAR = 1
SIGMA = 0.2
PREC = Accurate
LREAL = Auto
IBRION = 2
ISIF = 3
NSW = 100
EDIFFG = -0.02
LWAVE = .FALSE.
LCHARG = .FALSE.
POSCAR: Atomic Structure
Cu FCC bulk
1.0
3.61 0.00 0.00
0.00 3.61 0.00
0.00 0.00 3.61
Cu
4
Direct
0.00 0.00 0.00
0.50 0.50 0.00
0.50 0.00 0.50
0.00 0.50 0.50
Key Points:
- Line 1: Comment (system description)
- Line 2: Universal scaling factor
- Lines 3-5: Lattice vectors (Å)
- Line 6: Element symbols (must match POTCAR order)
- Line 7: Number of atoms per element
- Line 8: Coordinate type (Direct or Cartesian)
- Lines 9+: Atomic positions
KPOINTS: k-Point Sampling
Gamma-Centered Mesh (most common):
Automatic mesh
0
Gamma
8 8 8
0 0 0
Monkhorst-Pack:
Automatic mesh
0
Monkhorst-Pack
8 8 8
0 0 0
Band Structure Path:
k-points for band structure
10
Line-mode
Reciprocal
0.0 0.0 0.0 !Γ
0.5 0.0 0.5 !X
0.5 0.0 0.5 !X
0.5 0.25 0.75 !W
POTCAR: Pseudopotentials
Generation:
cat ~/vasp/potpaw_PBE/Cu/POTCAR > POTCAR
cat ~/vasp/potpaw_PBE/Cu/POTCAR \
~/vasp/potpaw_PBE/O/POTCAR > POTCAR
Choosing POTCARs:
- Standard:
potpaw_PBE/Element/POTCAR
- GW calculations:
potpaw_PBE.52/Element/POTCAR or potpaw_PBE.54/
- _sv: Include semicore states (more accurate, slower)
- _pv: Include p as valence
- _h: Harder potential (higher ENMAX)
Parameter Selection by Calculation Type
1. Structure Relaxation
INCAR:
IBRION = 2
ISIF = 3
NSW = 100
EDIFFG = -0.02
ISMEAR = 1
SIGMA = 0.2
Convergence Criteria:
EDIFFG < 0: Force-based (recommended: -0.01 to -0.05 eV/Å)
EDIFFG > 0: Energy-based (less common)
2. Static Calculation (Single-Point)
INCAR:
IBRION = -1
NSW = 0
ISMEAR = -5
ISMEAR = 0
SIGMA = 0.05
3. Band Structure
Step 1: Self-consistent calculation
ICHARG = 2
LCHARG = .TRUE.
Step 2: Non-self-consistent band structure
ICHARG = 11
LORBIT = 11
4. Density of States (DOS)
INCAR:
ISMEAR = -5
LORBIT = 11
NEDOS = 3000
5. Molecular Dynamics
INCAR:
IBRION = 0
NSW = 1000
POTIM = 1.0
TEBEG = 300
TEEND = 300
SMASS = 0
MDALGO = 2
6. Phonons (DFPT)
INCAR:
IBRION = 6
NFREE = 2
POTIM = 0.015
EDIFF = 1E-8
7. Elastic Constants
INCAR:
IBRION = 6
ISIF = 3
NFREE = 4
Advanced Parameters
Hybrid Functionals (HSE06, PBE0)
HSE06:
LHFCALC = .TRUE.
HFSCREEN = 0.2
AEXX = 0.25
ALGO = All
TIME = 0.4
GW Calculations
Step 1: DFT (PBE)
ALGO = Exact
NBANDS = 200
LOPTICS = .TRUE.
Step 2: GW
ALGO = GW0
NOMEGA = 50
DFT+U (Correlated Systems)
INCAR:
LDAU = .TRUE.
LDAUTYPE = 2
LDAUL = 2 -1
LDAUU = 5.0 0.0
LDAUJ = 0.0 0.0
van der Waals Corrections
DFT-D3:
IVDW = 11
vdW-DF:
GGA = MK
LUSE_VDW = .TRUE.
AGGAC = 0.0000
Convergence Testing Strategy
1. k-Point Convergence
KPOINTS: 4x4x4, 6x6x6, 8x8x8, 10x10x10, 12x12x12
2. Energy Cutoff Convergence
ENCUT: 400, 450, 500, 550, 600 eV
3. Systematic Approach
- First: Converge ENCUT (fix k-points at moderate density)
- Second: Converge k-points (use converged ENCUT)
- Document: Save convergence test results
Smearing Methods (ISMEAR)
| ISMEAR | Method | Use Case |
|---|
| -5 | Tetrahedron | Static calcs, DOS, accurate energies |
| -4 | Tetrahedron+Blöchl | Like -5, slightly different |
| -1 | Fermi smearing | Metals |
| 0 | Gaussian | General purpose |
| 1+ | Methfessel-Paxton order N | Relaxations, metals |
Recommendations:
- Metals, relaxation: ISMEAR=1, SIGMA=0.2
- Semiconductors, relaxation: ISMEAR=0, SIGMA=0.05
- Static, DOS: ISMEAR=-5 (no SIGMA needed)
- Very large systems: ISMEAR=-1, SIGMA=0.1
Common Parameter Combinations
Standard Relaxation (Metals)
ENCUT = 520
PREC = Accurate
IBRION = 2
ISIF = 3
NSW = 100
EDIFFG = -0.02
ISMEAR = 1
SIGMA = 0.2
ALGO = Fast
LREAL = Auto
Gamma-centered
0
Gamma
8 8 8
0 0 0
High-Accuracy Static Calculation
ENCUT = 600
PREC = Accurate
IBRION = -1
NSW = 0
EDIFF = 1E-8
ISMEAR = -5
ALGO = Normal
LREAL = .FALSE.
0
Gamma
12 12 12
0 0 0
Fast Testing Setup
ENCUT = 400
PREC = Normal
EDIFF = 1E-4
ISMEAR = 0
SIGMA = 0.1
ALGO = Fast
LREAL = Auto
0
Gamma
4 4 4
0 0 0
Performance Optimization
Parallelization
INCAR:
NCORE = 4
NPAR = 8
KPAR = 4
LPLANE = .TRUE.
Guidelines:
- NCORE ≈ number of cores per node / 2-4
- KPAR = number of k-points (or divisor)
- For large systems (>100 atoms): NCORE=1-4
- For many k-points: Use KPAR
Memory Management
LREAL = Auto
NCORE = 4
Error Handling
Common Errors and Fixes
"ZBRENT: fatal error in bracketing"
POTIM = 0.2
"EDDDAV: X eigenvalues not converged"
NELM = 200
ALGO = All
"Sub-Space-Matrix is not hermitian"
POTIM = 0.1
SYMPREC = 1E-8
SCF not converging:
1. ALGO = All
2. Increase NELM = 200
3. AMIX = 0.2, BMIX = 0.0001
4. Check initial structure (too close atoms?)
Best Practices
- Always Converge: Test k-points and ENCUT before production runs
- Use Symmetry: Let VASP detect symmetry (speeds up calculations)
- Check OUTCAR: Verify "reached required accuracy" message
- Monitor: Check OSZICAR during run for convergence
- Save Everything: Keep all outputs (OUTCAR, vasprun.xml) for analysis
- Consistent Pseudopotentials: Use same POTCAR set for all related calculations
- Document Settings: Record all INCAR parameters used
Calculation Workflows
Full Relaxation → Properties
- Relaxation: Optimize structure (ISIF=3, IBRION=2)
- Static: Accurate energy (ISMEAR=-5, dense k-points)
- Band Structure: Non-SCF with line-mode k-points
- DOS: Dense k-mesh with ISMEAR=-5
- Properties: Phonons, elastic, etc.
Convergence Testing Workflow
- Rough optimization: Low ENCUT, coarse k-points
- Test ENCUT: Fixed k-points, vary ENCUT
- Test k-points: Converged ENCUT, vary k-mesh
- Production: Use converged parameters
Subskills
Invoke specific subskills for detailed guidance:
- relaxation - Structure optimization workflows
- electronic-structure - Band structure and DOS calculations
- molecular-dynamics - MD simulations in VASP
- advanced-functionals - Hybrid, GW, DFT+U methods
- phonons - DFPT phonon calculations
- convergence - Systematic convergence testing
Quick Decision Guide
What type of calculation?
| Goal | IBRION | ISIF | ISMEAR | EDIFFG |
|---|
| Relax ions only | 2 | 2 | 1 | -0.02 |
| Relax cell+ions | 2 | 3 | 1 | -0.02 |
| Static energy | -1 | 2 | -5 | N/A |
| MD simulation | 0 | 2 | 0 | N/A |
| Band structure | -1 | 2 | 0 | N/A |
| Phonons (DFPT) | 6 | 2 | 0 | N/A |
References
See Also
materials-properties skill - For ASE-based workflows with VASP
- Examples in
examples/ directory
- Detailed references in
references/ directory