pymatgen
pymatgen copied to clipboard
Symmetry Reduction in `pymatgen.io.vasp.optics`
Hi!
Firstly, thanks to the developers for the recent addition of the pymatgen.io.vasp.optics
module, this is very very useful! 🙌
For large k-point meshes or large numbers of electronic bands, these functions can become slow on a desktop computer (e.g. taking ~7 minutes for a 8x8x8 kpoint mesh for a CdTe primitive cell, with 24 bands), and possibly intractable at denser kpoint meshes where spectral convergence is reached.
A primary origin of this is the fact that there is no symmetry reduction of the kpoint set, so the number of kpoints becomes very large as the k-point density is increased. In the DielectricFunctionCalculator
class docstring, it states:
Currently, this Calculator only works for ``ISYM=0`` calculations since we cannot gauranttee that our
externally defined symmetry operations are the same as VASP's. This can be fixed by printing the
symmetry operators into the vasprun.xml file. If this happens in future versions of VASP,
we can dramatically speed up the calculations here by considering only the irreducible kpoints.
I understand the issue that VASP's symmetry operations aren't printed to the vasprun.xml
, so the calculations must be run using ISYM = 0
(without symmetry reduction). However, would it still be possible and useful to add an optional parameter to use pymatgen
's symmetry analysis tools to perform symmetry reduction of the kpoint set for parsing?
i..e. taking the non-symmetry-reduced VASP outputs, but then reducing to only the irreducible kpoints with appropriate kpoint weights, and then perform the post-processing (which should be greatly sped up by this)?
I believe all the functions for this are available in pymatgen
(I'm just not totally familiar with them). This would be quite a useful addition for our workflow. Either way, it's a very useful module! 😃
Not an expert on this but maybe @jmmshn can comment.
That sounds like it would work. TBH I made this with defects in mind so the K-point problem was not super bad for me. I never actually used pymatgen's generated kpoints in calculations so it might work.
Although one problem to be aware of is that I noticed that the pymatgen generated kpoints produced density of states that are not normalized properly (saw this when I ran non-scf uniform calculations) so I would watch for that very carefully to make sure the final results for the optics spectra have the correct normalization.
It's not clear to me why you need the symmetry operations? Can't you just parse the k-points multiplicities from the vasprun? Then you can just use the multiplicities in your integration. All the information should already be available.
Sorry for the late reply I was on a lengthy family leave and had Covid for like 2 weeks right when I came back. All better now!
@utf, agreed but the actual problem with using ISYM = 0 is that VASP will then choose to do some aggressive reduction in how many matrix elements are calculated in the WAVEDER (I think I will only do 0 -> VBM for one index). Then you lose the ability to tweak the Fermi-level in post-processing which was the main focus for me at the time. I poked around the VASP source code quite a bit and couldn't see an easy way of untangling this.