Skip to content

Bug when saving the dynamical matrix #76

Description

@mesonepigreco

Discussed in https://github.com/orgs/SSCHAcode/discussions/146

Originally posted by kw600 July 27, 2023
I am wondering if there is any place I can report bugs. I just put it here now.

There is a bug in the save_qe() of Phonons.py. (line 1248). The original code is as follows:

            for i in range(n_atoms):
                fp.write("( %10.6f%10.6f %10.6f%10.6f %10.6f%10.6f )\n" %
                         (np.real(atomic_disp[3*i, mu]), np.imag(atomic_disp[3*i,mu]),
                          np.real(atomic_disp[3*i+1, mu]), np.imag(atomic_disp[3*i+1,mu]),
                          np.real(atomic_disp[3*i+2, mu]), np.imag(atomic_disp[3*i+1,mu])))

Look at the last line np.real(atomic_disp[3i+2, mu]), np.imag(atomic_disp[3i+1,mu])
The second imaginary part index should be [3i+2,mu] instead of [3i+1,mu].
This makes the imaginary part disapper in the calculations of out of plane vibrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions