pwtools.pwscf.read_dyn

pwtools.pwscf.read_dyn(filename, natoms=None)[source]

Read one dynamical matrix file (for 1 qpoint) produced by ph.x and extract the same as read_matdyn_modes() for this qpoint only.

All arrays have one dim less compared to read_matdyn_modes().

Parameters:
  • filename (str) – Name of dyn file. Example: “ph.dyn3” for qpoint 3.

  • natoms (int) – number of atoms in the cell (used for nmodes=3*natoms only)

Returns:

  • qpoints, freqs, vecs

  • qpoints (1d array (3,)) – The qpoint of the dyn file.

  • freqs (1d array, (nmodes,) where nmodes = 3*natoms) – 3*natoms phonon frequencies in [cm^-1] at the q-point.

  • vecs (3d complex array (nmodes, natoms, 3)) – Complex eigenvectors of the dynamical matrix for the q-point.