We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The to_cube function of VolumetricData has a bug: it stores in lines 4-6 the real-space vectors instead of the size of a voxel.
to_cube
To Reproduce
from pymatgen.io.common import VolumetricData cubefile = VolumetricData.from_cube(IN_FNAME) cubefile.to_cube(OUT_FNAME)
E.g. in my case, original file (lines 4-6):
72 0.170589 0.000000 0.000000 80 0.000000 0.163473 0.000000 108 -0.114105 0.000000 0.125017
Output file:
72 12.282408 0.000000 0.000000 80 0.000000 13.077840 0.000000 108 -12.323340 0.000000 13.501836
Expected behavior The correct values are written in the cube file.
It should be as simple as changing the following lines:
pymatgen/pymatgen/io/common.py
Lines 349 to 365 in e513400
file.write( f"\t {self.dim[0]} " f"{self.structure.lattice.matrix[0][0] / self.dim[0] * ang_to_bohr :.6f} " f"{self.structure.lattice.matrix[0][1] / self.dim[0] * ang_to_bohr :.6f} " f"{self.structure.lattice.matrix[0][2] / self.dim[0] * ang_to_bohr :.6f} \n" )
and analogously for the following two lines.
The text was updated successfully, but these errors were encountered:
VolumetricData.to_cube()
Thanks for reporting! 👍
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
The
to_cube
function of VolumetricData has a bug: it stores in lines 4-6 the real-space vectors instead of the size of a voxel.To Reproduce
E.g. in my case, original file (lines 4-6):
Output file:
Expected behavior
The correct values are written in the cube file.
It should be as simple as changing the following lines:
pymatgen/pymatgen/io/common.py
Lines 349 to 365 in e513400
to something like (untested, but should work)
and analogously for the following two lines.
The text was updated successfully, but these errors were encountered: