SPARC-X / SPARC

Simulation Package for Ab-initio Real-space Calculations
GNU General Public License v3.0
73 stars 38 forks source link

Help with extracting band gap and band structure #189

Closed Jiang-eat-sugar closed 1 year ago

Jiang-eat-sugar commented 1 year ago

Good morning,

I want to extract the band gap information from the results of sparc static calculation. I assume the density of state(DOS) is from the .eigen file. What is the unit in the "eigval" column? Is it Hartree? In addition, if I want to plot band structure, which file should I look for?

Thanks, Jiang

ajmedford commented 1 year ago

At the moment, we don't have formal infrastructure for plotting DOS, but it is something we have done before. The units should be in Hartree. @ssahoo41 - can you provide the scripts you used for this? We should also think about incorporating this analysis into the Python API to make it easier to use.

xuqimen commented 1 year ago

The eigenvalues are in Hartree as @ajmedford mentioned. Regarding the band structure, we've been working on adding this feature recently and we will provide a Python script to extract the result and/or to create a plot. This feature should be ready in a few days.

ssahoo41 commented 1 year ago

I used the attached script to plot the DOS using the eigenvalues from .eigen script. DOS_script.zip

Jiang-eat-sugar commented 1 year ago

Thanks for letting me know the unit in the .eigen file and sharing the code to plot DOS. I am looking forward to seeing the feature of plotting band structure.

xuqimen commented 1 year ago

The band structure calculation feature is now available in SPARC. You can enable band structure calculations by setting BAND_STRUCTURE: 1 in the .inpt file. Additionally, you'll need to configure KPT_PATHS, KPT_PER_LINE, and INPUT_DENS_FILE accordingly (for more details, refer to the Manual). An example can be found in the tests/CdS_bandstruct/ directory.

Furthermore, we've provided a Python script in the utils/bandstruct/ directory to process the results and visualize the band structure.

Jiang-eat-sugar commented 1 year ago

That is great! I will test the band structure feature soon. By the way, is the phonon band structure feature available now?

xuqimen commented 1 year ago

Great! Phonon band structure calculations have not been implemented yet.

Jiang-eat-sugar commented 1 year ago

I tried the CdS example test on Expanse cluster. It showed a segmentation fault. This is a memory-related error. The inputs are the CdS example files and 96 GB of memory was used. I am not sure what else can cause this error. The error and job files are attached here. slurm-25406127.zip job.zip

xuqimen commented 1 year ago

Did you run the same test as the one in the tests/CdS_bandstructure/standard directory? We need a bit more information to identify the source of the issue. Could you please try rerunning your test in debug mode by setting DEBUG_MODE = 1 in the makefile and recompiling the code using make clean; make -j8.

xuqimen commented 1 year ago

@Jiang-eat-sugar Just a reminder that your job script tries to run the test with 64 processes (srun -n 64) while the number of tasks requested is 48 (#SBATCH -n 48). When you get a chance to rerun the test in debug mode, it's best to fix this discrepancy.