kylebystrom / pawpyseed

Parallel C/Python package for numerical analysis of PAW DFT wavefunctions
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

noncollinear WF components written to wrong filenames #13

Closed bernstei closed 4 years ago

bernstei commented 4 years ago

NCLWavefunction writes its components with

        filename1 = "%s_UP_REAL" % filename_base
        filename2 = "%s_DOWN_REAL" % filename_base
        filename3 = "%s_UP_IMAG" % filename_base
        filename4 = "%s_DOWN_IMAG" % filename_base
        res0, res1 = self._write_realspace_state(filename1, filename2, filename3, filename4,
                                            scale, b, k, s)

but from what I can tell from the pawpyc.pyx, filenames 1 & 2 should correspond to real and imaginary parts (referred to as resr and resi), and 3 & 4 to real and imaginary parts, respectively, so these files are being misnamed. This is in pawpyc.pyx around line 600, in the definition of

    def _write_realspace_state(self, filename1, filename2, filename3, filename4,
                                double scale, int b, int k, int s):
kylebystrom commented 4 years ago

Sorry for the late reply. Thanks for catching this and #12. I will push fixes today.

kylebystrom commented 4 years ago

Should be fixed now. File names are in the right order and self.dim gets passed instead of dim. Let me know if it works, and if so I can close these.

bernstei commented 4 years ago

Thanks - the new code looks good. I did just notice that NCLWavefunction.write_density_realspace() (which I don't use, and therefore haven't tested) appears to need the same dim -> self.dim fix when it calls _convert_to_vasp_volumetric().

kylebystrom commented 4 years ago

You're right. I just fixed that too. Thanks for again for catching these bugs! The changes are on master right now; I will probably add a new version to PyPI in a couple weeks after a few other small additions I am planning.

bernstei commented 3 years ago

Not really reopening, but do you know when you're planning to update the PyPI version? It's still showing a June 2020 release.

kylebystrom commented 3 years ago

Just updated PyPI (v0.6.4). Thanks for the reminder!