Command Palette
Search for a command to run...
DensityTool: A post-processing tool for space and spin-resolved density of states from VASP
DensityTool: A post-processing tool for space and spin-resolved density of states from VASP
Lucas Lodeiro Tomáš Rauch
VASP Basics: Calculating Silicon Density of States and Band Structure
Abstract
The knowledge of the local electronic structure of heterogeneous solid materials is crucial for understanding their electronic, magnetic, transport, optical, and other properties. VASP, one of the mostly used packages for density-functional calculations, provides local electronic structure either by projecting the electronic wave functions on atomic spheres, or as a band-decomposed partial charge density. Here, we present a simple tool which takes the partial charge density and the energy eigenvalues calculated by VASP as input and constructs local charge and spin densities. The new data provides a much better spatial resolution than the projection on the atomic spheres. It can be visualized directly in the real space e.g. with Vesta, or averaged along planes spanned by two of the lattice vectors of the periodic unit cell. The plane-averaged local (spin) density of states can be easily plotted e.g. as color-coded data using almost any plotting program. DensityTool can be applied to manipulate, visualize, and understand the local electronic structure of any system calculated with VASP. We expect it to be useful especially for researchers concerned with inhomogeneous systems, such as interfaces, defects, surfaces, adsorbed molecules, or hybrid inorganic-organic composites.
One-sentence Summary
DensityTool is a VASP post-processing utility that constructs space- and spin-resolved local charge and spin densities from partial charge densities and energy eigenvalues, providing superior spatial resolution compared to atomic sphere projections while enabling direct real-space visualization and plane-averaged density of states plotting for inhomogeneous systems such as interfaces and defects.
Key Contributions
- DensityTool processes VASP-calculated partial charge densities and energy eigenvalues to construct local charge and spin densities for heterogeneous solid materials.
- The method provides significantly improved spatial resolution compared to atomic sphere projections and supports direct real-space visualization alongside plane-averaged local density of states plots.
- The utility enables systematic manipulation and visualization of localized electronic structures in inhomogeneous systems, including interfaces, defects, surfaces, adsorbed molecules, and hybrid inorganic-organic composites.
Introduction
Electronic structure calculations are foundational to computational materials science, with the density of states serving as a critical descriptor for predicting magnetic, catalytic, and transport properties. While VASP remains the standard engine for these simulations, extracting spatially and spin-resolved electronic distributions typically requires custom scripting or fragmented utilities, creating reproducibility bottlenecks and slowing down analysis workflows. The authors introduce DensityTool, a dedicated post-processing framework that automates the extraction and mapping of space- and spin-resolved density of states directly from VASP output files. By standardizing this extraction process, the tool eliminates manual coding overhead and enables researchers to rapidly characterize local electronic environments for advanced materials design.
Method
The authors leverage the output of VASP calculations, specifically the band- and wavevector-dependent partial charge densities Pn,k(r) and the corresponding energy eigenvalues ϵn,k, to construct the local density of states (LDOS) and local spin density of states (LSDOS). The core of the method involves integrating these quantities over the Brillouin zone to obtain spatially-resolved electronic structure information. The LDOS at a given energy E and position r is calculated as L(E,r)=(2π)3Ne∑n∫BZδ(E−ϵn,k)Pn,k(r)d3k, which effectively represents an energy-resolved partial charge density. For magnetic systems, the spin-resolved quantities are computed similarly, with the spin-up and spin-down components treated separately to yield the spin density s(r)=ρ↑(r)−ρ↓(r) and the LSDOS S(E,r)=(2π)31∑n∫BZ[δ(E−ϵn,k↑)Pn,k↑(r)−δ(E−ϵn,k↓)Pn,k↓(r)]d3k.
The framework diagram illustrates the process of calculating the plane-averaged LDOS and LSDOS for a composite inorganic-organic system, where the partial charge densities are first averaged over a plane parallel to the Si surface. This averaging step, performed using the PARCHGSPIN routine, reduces the dimensionality of the data, enabling efficient computation of the plane-averaged L(S)DOS via the LDOSMAG and LSDOSMAG routines. The resulting data can be visualized as a function of energy and position, providing insight into the spatial distribution of electronic states. The method is designed to be compatible with the VASP output format, allowing the full L(S)DOS to be written in the CHGCAR format for direct visualization in tools like VESTA.
Experiment
The evaluation of DensityTool utilizes inhomogeneous materials, including a composite system and a perovskite slab model, to validate its capability for extracting meaningful electronic structure insights from complex layered systems. By computing plane-averaged local density of states, the analysis demonstrates that the electronic properties closely follow the alternating atomic layer arrangement. Qualitatively, bulk-like states near the band gap originate predominantly from the PbI₂ layers, while the PbI₂-terminated surface introduces distinct surface states that narrow the overall band gap and exhibit a higher ionization potential compared to the MAI-terminated counterpart. These structural and electronic correlations confirm the tool's effectiveness in characterizing heterogeneous materials and align with established theoretical expectations.
The authors describe the application of DensityTool to analyze inhomogeneous systems, focusing on a perovskite slab model. The tool provides routines for calculating charge and density distributions, with specific implementations for magnetic systems using spin-resolved data. Results from the perovskite slab show distinct electronic structures depending on surface termination, with surface states and band gap differences observed between MAI- and PbI2-terminated surfaces. DensityTool offers routines for both nonmagnetic and magnetic systems, including partial charge and spin calculations. The perovskite slab results reveal that surface termination significantly affects electronic structure, with PbI2-terminated surfaces showing deeper surface states and a reduced band gap. Plane-averaged local density of states indicates that bulk-like states near the band gap are primarily composed of PbI2 layers, while surface states are influenced by the exposed surface termination.
The authors applied DensityTool to analyze an inhomogeneous perovskite slab model using routines for charge, density, and spin-resolved calculations. This setup validates how surface termination modulates local electronic properties, demonstrating that PbI2-terminated surfaces possess deeper surface states and a reduced band gap relative to MAI-terminated configurations. Qualitative results indicate that bulk-like states near the band gap derive from internal PbI2 layers, whereas surface states are directly controlled by the exposed termination chemistry. Ultimately, the analysis confirms that the tool reliably captures termination-dependent electronic variations, highlighting the dominant role of surface composition in shaping perovskite electronic structures.