You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug in load_phonopy function in Phonons.py – incorrect handling of dynamical matrices #113
I noticed that the load_phonopy function in Phonons.py does not properly load and save the dynamical matrices.
Specifically, I identified three issues:
The FORCE_CONSTANTS file loaded via cellconstructor does not correctly assign the force constants to the respective atoms.
The standard force constants in phonopy are stored in eV/Ų, but cellconstructor expects them in Ry/Bohr², leading to unit inconsistencies.
The alat parameter is not properly initialized, resulting in incorrect vector scaling.
I’ve implemented a possible fix addressing all three points:
Adjusted the code to correctly map the full force constants as output by phonopy.
Applied proper unit conversion to Ry/Bohr².
Correctly initialized the alat parameter.
I’ve attached a modified version of the load_phonopy function for your review if you deem appropriate.
Yes you are right. THe phonopy loader is broken.
I deactivated it for now. However, there is a way to read phonopy dynamical matrices within sscha (and also save), as explained in #87
Thank you very much for your fix. Does this correctly load the dynamical matrix? Be careful, as we noticed that sometimes, even if the phonon energies are the same, you see weird stuff when you plot the phonon bands via interpolation.
Thank you for the suggestion, I will give it a look.
The fix seems to work properly under the conditions that in phonopy the flag FULL_FORCE_CONSTANTS = .TRUE. and that the force constants are saved in eV/Angstrom^2
I have tried to load the phonopy force constants with the suggested fixed method and then save them in QE format.
The eigenvalues and eigenvectors seem to have a good agreement between vasp and QE. Also the band interpolated matrices obtained through phonopy seem congruent with those obtained just using QE, exception made for differences driven by the phonopy finite displacements / QE DFPT different approaches.
I’ve studied #87 and the documentation, but I’m struggling to write a working code for loading Phonopy’s force_constants.hdf5 file to CC.Phonons.Phonons. Could you provide a minimal working example?
I'm trying to convert VASP force constants from phonopy to QE dynamical matrix format, but I'm encountering several issues. I have studied #87 and the documentation, but I still cannot get it working properly. Could you provide a working example for converting phonopy force constants to QE format?
This should be fixed by PR #121 which has just been merged. In the next Cellconstructor version 1.7, phonopy integration should automatically work correctly.
Activity
mesonepigreco commentedon Jul 19, 2025
Yes you are right. THe phonopy loader is broken.
I deactivated it for now. However, there is a way to read phonopy dynamical matrices within sscha (and also save), as explained in #87
Thank you very much for your fix. Does this correctly load the dynamical matrix? Be careful, as we noticed that sometimes, even if the phonon energies are the same, you see weird stuff when you plot the phonon bands via interpolation.
FlemkMeserath commentedon Jul 19, 2025
Thank you for the suggestion, I will give it a look.
The fix seems to work properly under the conditions that in phonopy the flag FULL_FORCE_CONSTANTS = .TRUE. and that the force constants are saved in eV/Angstrom^2
I have tried to load the phonopy force constants with the suggested fixed method and then save them in QE format.
The eigenvalues and eigenvectors seem to have a good agreement between vasp and QE. Also the band interpolated matrices obtained through phonopy seem congruent with those obtained just using QE, exception made for differences driven by the phonopy finite displacements / QE DFPT different approaches.
SergeevGregory commentedon Jul 20, 2025
Dear mesonepigreco and FlemkMeserath,
I’ve studied #87 and the documentation, but I’m struggling to write a working code for loading Phonopy’s force_constants.hdf5 file to CC.Phonons.Phonons. Could you provide a minimal working example?
caolz commentedon Aug 11, 2025
I'm trying to convert VASP force constants from phonopy to QE dynamical matrix format, but I'm encountering several issues. I have studied #87 and the documentation, but I still cannot get it working properly. Could you provide a working example for converting phonopy force constants to QE format?
mesonepigreco commentedon Jul 20, 2026
This should be fixed by PR #121 which has just been merged. In the next Cellconstructor version 1.7, phonopy integration should automatically work correctly.