I tried a nac calculated for In2O3 system, containing 40 atoms. When I used “amset phonon-frequency -o2 OUTCAR” to extracted POP frequency, “ValueError: cannot reshape array of size 120 into shape (3,3)” occurs. I found in phonon_frequency.py file, the eigenvectors calculated by VASP will be truned into a 33 matrix. However, in In2O3 system, the eigenvectors for a single q point will be a 1 120 vectors, so it cannot be turned to be 3*3 matrixs. It confused me, I hope I will get help from you. The OUTCAR, INCAR, POSCAR are attached.
Hi @chen_wang,
This issue has been resolved already, please try to reinstall the recent version of AMSET and retry calculating the POP frequency. If the problem still persists please do the following modification to phonon_frequency.py
.
Update the function reshape_to_3x3(real_parts)
def reshape_to_3x3(real_parts):
"""Reshape a flat list of real parts into a 3x3 array."""
return np.array(real_parts).reshape(3, 3)
to function reshape_to_Nx3(real_parts)
at line 156
def reshape_to_Nx3(real_parts):
"""Reshape a flat list of real parts into Nx3 arrays."""
if len(real_parts) % 3 != 0:
raise ValueError("Unexpected number of real parts, cannot reshape into Nx3.")
num_atoms = len(real_parts) // 3 # Determine number of atomic groups
return np.array(real_parts).reshape(num_atoms, 3)