I wonder if it is possible to calculate the partial charge density by selecting an eigenvalue energy range from a previously converged SCF. I saw that one way is to fix the occupancy of selected bands and recalculate the density but it is not exactly what I need; also, it is not possible to fix the occupancy and the charge density at the same time, which is what is closer to my need. Another option is to generate xsf files using cut3d by selecting specific k-points and bands one by one and then sum all the charge density files by any means or software, like VESTA for example. However, this last part is very time consuming because cut3d runs only in interactive modes and cannot be used in a bash script. What I need is the equivalent of what is described here
for the VASP software.
Do you have any suggestion?
Thanks a lot in advance.
Regarding your second part of the comment, cut3d can be, in fact, automatized and therefore used in a bash script. Please have a look at the internal test v2
This is the input of v2_77:
(Of course at this level the following lines don’t mean much without seeing the actual options, but I left it here as an example)
-0.25 -0.25 -0.25
1.50 1.50 1.50
And you can use simply cut3d < t77.abi once you have, in this case, the density file t76o_DS1_DEN available. That obviously can be replaced by other suitable files for cut3d.
If you need a separation of bands and k-points I recommend looking at the test file v3_t67 where the WF file is treated.
Regarding the first part of your comment, you can run cut3d and direct all your output to a generic
CUT3DDENPOT.nc (netcdf file) with option 15 if you want a more versatile way of dealing with the data.
This file can be handled by AbiPy simply issuing in a python script:
from abipy import abilab
After this you can use the dataframe at your will. You can also use directly in python the cut3d utility via one of abipy classes(see the python class here abio Package — abipy 0.9.1 documentation )
Good luck and let us know if this solution worked for you.
The solution with the nc file didn’t work for me. However, I can use the cut3d solution that you suggested. I can make a bash script which calls cut3d in a loop and generates all the xsf density files which correspond to selected band and k-points; then I can create one xsf density file by summing the single densities contained in each xsf file. This could be done in python if the nc file contained the eigenvalues with the corresponding k-point and band index, but I didn’t find this information in the nc file.
Thanks a lot for the answer!