# How does Quantum Espresso calculate the dynamical matrices before IFCs in ph.x?

I know about Density Functional Perturbation Theory(DFPT) and I know that we can approximate the Inter-atomic Force Constants (IFCs) using a self-consistent method (see this textbook chapter), so we do know this matrix: $$C^{i,j}_{\alpha,\beta}(l,m) = \frac{\partial^2 E_{el}}{\partial u^i_{\alpha} (l) u^j_{\beta}(m)}$$

where $$u^i_{\alpha}$$(l) is the displacement of the $$\alpha$$th atom in the lth unit cell accross the cartesian i direction. We can get the dynamical matrix at a generic q point by taking the discrete Fourier transform:$$D_{\alpha i , \beta j}(q) = \sum_{m} \frac{1}{\sqrt{m_{\alpha}m_{\beta}}} C^{i,j}_{\alpha,\beta} (l,m) e^ {i q \cdot \left(R_{m}-R_l \right) }$$

For example if I set $$\bf q = 0$$ I can evaluate the frequencies of the eigenmodes using this algorithm:

• Evaluate IFCs using DFPT;
• Find Fourier Transform of IFCs at $$\bf q = 0$$ and get all the matrix element $$D_{\alpha i , \beta j}(0)$$;
• Diagonalize this matrix and get the eigenvalues.

But ph.x seems to do the opposite. It defines a grid of q-points and gets the dynamical matrix at those points. Then using inverse Fourier Transform, via q2r.x, we get the IFCs and with Fourier Interpolation, via matdyn.x, we get the Dynamical Matrix at every q points. But I really do not understand how ph.x can get the dynamical matrix before the IFCs. What am I misunderstanding?

• I don't know what are you confused about here, ph.x can explicitly calculate a dynamical matrix at a given q-point. The quality of the interpolation on a finer q-point grid depends on how coarse the original is. Aug 22, 2023 at 13:12
• I thought that ph.x was able to evaluate the IFCs before the Dynamical Matrix at a given q point. So in my head if you have the IFCs all of the Dynamical Matrices are available via a FFT. I do not understand why ph.x gets the Dynamical Matrices before the IFCs because chapter 2 of the textbook I've linked provides an algorithm for IFCs without talking about q-points grid. So I'm confused :( Aug 22, 2023 at 15:55