How does one parse the chg file to plot the planar average charge density for a surface slab using VASP?? I am trying to calculate the planar averaged charge density difference.
The plane-averaged charge density difference can be written as ∆σ=σ_A+B −σ_A −σ_B . Here, σ_A+B is the plane-averaged density of the combined A+B system, and σ_A and σ_B are the plane-averaged densities of the A and B, respectively, which will calculated by freezing the atomic positions of the respective components in the combined system.
If you are familiar with FORTRAN, the following code calculates the plane-averaged charge density difference (and bunch of other things) for a Cu+P system. Make sure to reformat/rename the CHGCARs accordingly.