pwtools.pwscf.read_matdyn_freq

pwtools.pwscf.read_matdyn_freq(filename)[source]

Parse frequency file produced by QE’s matdyn.x (“flfrq” in matdyn.x input, usually “matdyn.freq” or so) when calculating a phonon dispersion on a grid (ldisp=.true., used for phonon dos) or a pre-defined k-path in the BZ.

Used in bin/plot_dispersion.py.

In QE 5.x, a file with suffix “.gp” (e.g. “matdyn.freq.gp”) is now written, where:

>>> import numpy as np
>>> from pwtools import kpath, pwscf
>>> d = np.loadtxt("matdyn.freq.gp")
>>> kpoints,freqs = pwscf.read_matdyn_freq("matdyn.freq")
>>> np.allclose(d[:,0], kpath.get_path_norm(kpoints))
>>> np.allclose(d[:,1:], freqs)
Parameters:

filename (file with k-points and phonon frequencies) –

Returns:

  • kpoints (array (nks, 3)) – Array with nks k-points. AFAIK the unit is always 2*pi/alat with alat = celldm(1).

  • freqs (array (nks, nbnd)) – Array with nbnd energies/frequencies at each of the nks k-points. For phonon DOS, nbnd == 3*natoms.

Notes

matdyn.in:

&input
    asr='simple',
    amass(1)=26.981538,
    amass(2)=14.00674,
    flfrc='fc',
    flfrq='matdyn.freq.disp'
/
101                                | nks
0.000000    0.000000    0.000000   |
0.037500    0.037500    0.000000   | List of nks = 101 k-points
....                               |

filename has the form:

<header>
<k-point, (3,)>
<frequencies,(nbnd,)
<k-point, (3,)>
<frequencies,(nbnd,)
...

for example:

&plot nbnd=   6, nks= 101 /
          0.000000  0.000000  0.000000
  0.0000    0.0000    0.0000  456.2385  456.2385  871.5931
          0.037500  0.037500  0.000000
 23.8811   37.3033   54.3776  455.7569  457.2338  869.8832
 .....