This guide provides a systematic approach for researchers and computational materials scientists to diagnose and resolve the common issue of negative (imaginary) phonon frequencies in Quantum ESPRESSO ph.x calculations.
This guide provides a systematic approach for researchers and computational materials scientists to diagnose and resolve the common issue of negative (imaginary) phonon frequencies in Quantum ESPRESSO ph.x calculations. It covers foundational concepts explaining what negative frequencies signify, detailed methodological workflows for robust calculations, targeted troubleshooting strategies for numerical and physical instabilities, and validation techniques to confirm result reliability. The article synthesizes official documentation, community expertise, and practical examples to offer a complete solution framework applicable to various material systems, enabling users to distinguish between numerical artifacts and genuine physical instabilities in their simulations.
In computational physics, particularly in phonon calculations, a negative frequency does not imply a frequency value less than zero in the ordinary sense. Instead, it signifies an imaginary frequency. Mathematically, if the eigenvalue of the dynamical matrix is negative, the resulting frequency ( \omega ) is calculated as ( \omega = \sqrt{\lambda} ). When ( \lambda ) is negative, the frequency becomes an imaginary number ( \omega = i\sqrt{|\lambda|} ). In the output of codes like Quantum ESPRESSO, this is often reported as a "negative" value for convenience, but it physically represents an imaginary mode [1].
Imaginary frequencies reveal a dynamic instability in the system's structure [1]. A stable structure at a local energy minimum should have only real, positive vibrational frequencies. An imaginary frequency corresponds to a mode—a specific pattern of atomic displacement—along which the system's potential energy decreases, not increases. If the atoms are displaced along the direction of this mode, they will not oscillate back to their starting positions but will instead move towards a different, more stable configuration [1]. In the context of transition state theory, a single imaginary frequency is the hallmark of a saddle point on the potential energy surface, which is the unstable point separating reactants from products [1]. The presence of multiple imaginary frequencies can indicate a high-dimensional saddle point connecting multiple reaction pathways [1].
This guide addresses the most common causes and solutions for unphysical imaginary frequencies.
The most frequent cause of unexpected imaginary frequencies is an insufficiently relaxed structure [2] [3]. The phonon calculation must be performed on a structure that is at a true local minimum of the potential energy surface.
vc-relax or relax calculation. The structure is still "feeling" a slope in the energy landscape, leading to instabilities [3].pw.x relaxation input, use stricter convergence thresholds.
The phonon calculation (ph.x) must be performed on exactly the same potential energy surface as the self-consistent field (SCF) calculation that produced the ground state. Using different parameters creates an inconsistency [3].
pseudo_dir, k-point grid, exchange-correlation functional (LDA/GGA), or vdw_corr differ between the pw.x (SCF) and ph.x calculations [3].&SYSTEM and &ELECTRONS namelists of your SCF calculation are identical to those used to generate the charge density read by ph.x.The phonon calculation itself may not be fully self-consistent.
tr2_ph threshold in the ph.x input is too loose, or the k-point grid for the phonons (nk1, nk2, nk3) is too coarse [2] [3].ph.x and matdyn.x results [4].ph.x input, use a lower threshold.
nq1, nq2, nq3 grid in ph.x is dense enough for your system [2].At the gamma point (q=0), the three acoustic modes should have frequencies exactly equal to zero, corresponding to translational invariance. Finite-size effects and numerical approximations can cause these to be slightly non-zero, sometimes appearing as small imaginary frequencies [5].
q2r.x and matdyn.x, use the zasr and asr flags to impose the Acoustic Sum Rule.
dynmat.x with the ASR imposed. If the acoustic mode then has a very small frequency (e.g., < 1 cm⁻¹) and other modes are unchanged, you can trust your results [5].The relationship between these primary issues and their solutions can be visualized in the following troubleshooting workflow:
This discrepancy often arises from the interpolation process [4]. ph.x calculates the dynamical matrix exactly at a specific set of q-points. q2r.x then uses these to create a force constant matrix in real space, and matdyn.x interpolates this matrix to get frequencies at any q-point. If the original ph.x q-point grid (nq1, nq2, nq3) is too coarse, the interpolation can be inaccurate and introduce imaginary frequencies at q-points not explicitly calculated by ph.x [4]. The solution is to use a denser grid in your ph.x calculation.
Yes, this is expected and correct. In transition state theory, a saddle point on the potential energy surface is characterized by exactly one imaginary frequency [1]. The eigenvector of this mode points along the reaction coordinate—the path atoms take to convert from reactants to products.
Multiple imaginary frequencies at a single point indicate a higher-order saddle point [1]. This means there is more than one direction in which the energy decreases. In the context of a reaction path, this might mean that the same saddle point connects to more than two potential energy minima (e.g., multiple reaction pathways) [1]. It may also suggest that an even lower-energy saddle point exists nearby, and you should follow one of the imaginary modes to find it [1].
The following table helps distinguish between physical and numerical instabilities:
| Feature | Physical Instability | Numerical Instability |
|---|---|---|
| Magnitude | Often large (e.g., > 50 cm⁻¹) [3] | Often small (e.g., < 20 cm⁻¹) |
| Location | May occur at multiple q-points | Often only at gamma (Γ) or a few points [5] |
| Persistence | Remains after tightening convergence | Disappears or shrinks with better convergence [4] |
| ASR Test | Unaffected by imposing the ASR | Often fixed by imposing the ASR [5] |
The following table summarizes key parameters in Quantum ESPRESSo that are critical for obtaining accurate, physical phonon spectra.
| Calculation Step | Parameter | Description & Function | Recommended Value |
|---|---|---|---|
| pw.x (Relax/SCF) | forc_conv_thr |
Force convergence threshold; crucial for finding a true minimum. | 1.0d-5 Ry/au or tighter [2] |
etot_conv_thr |
Total energy convergence threshold. | 1.0d-6 Ry or tighter [2] |
|
conv_thr |
SCF cycle convergence for electron density. | 1.0d-12 or tighter [2] |
|
ecutwfc / ecutrho |
Plane-wave kinetic energy cutoffs. | Must be high enough for convergence [5] | |
| ph.x | tr2_ph |
Phonon SCF convergence threshold. | 1.0d-14 or tighter [4] [2] |
nq1, nq2, nq3 |
Grid of q-points for phonon calculation. | System-dependent; must be converged [2] | |
| q2r.x | zasr |
Applies Acoustic Sum Rule to force constants. | 'crystal' [4] [2] |
| matdyn.x | asr |
Applies Acoustic Sum Rule during interpolation. | 'crystal' [4] [2] |
A comprehensive guide to diagnosing the root causes of negative frequencies in your phonon calculations
Negative frequencies in Quantum ESPRESSO ph.x calculations represent imaginary phonon modes that can either signal a computational problem or reveal genuine physical instability in your material's structure. Correctly diagnosing the origin is crucial for producing reliable research. This guide provides a systematic approach to troubleshooting these issues.
Imaginary frequencies (reported as negative values in phonon dispersion plots) indicate that the atomic configuration is not at a true energy minimum. The critical distinction researchers must make is whether these represent:
The acoustic sum rule (ASR) violation typically results in small negative frequencies (< 10 cm⁻¹) for acoustic modes at Γ-point, which are usually artifacts. In contrast, large imaginary frequencies (> 20-50 cm⁻¹) often suggest genuine instability, particularly if they persist after thorough convergence testing [5].
Follow this logical workflow to identify the root cause of negative frequencies in your calculations:
The most common source of spurious negative frequencies stems from insufficiently tight convergence criteria across multiple parameters:
Table 1: Key Convergence Parameters and Recommended Values
| Parameter | Typical Problematic Value | Recommended Value | Purpose |
|---|---|---|---|
tr2_ph |
1.0d-10 | 1.0d-14 to 1.0d-16 [2] [6] | Phonon SCF convergence threshold |
conv_thr (pw.x) |
1.0d-6 | 1.0d-8 to 1.0d-10 [2] | Electron SCF convergence threshold |
forc_conv_thr |
1.0d-3 | 1.0d-4 to 1.0d-5 [7] [6] | Force convergence in relaxation |
etot_conv_thr |
1.0d-4 | 1.0d-5 to 1.0d-6 [7] | Energy convergence in relaxation |
| k-point grid | Sparse (e.g., 4×4×1) | Denser grid (e.g., 12×12×1) [2] [6] | Brillouin zone sampling |
A real-world example demonstrates how adjusting these parameters resolved issues: a user calculating phonons for bilayer MoS₂ reported that reducing tr2_ph and using a 4×4×1 k-point grid eliminated negative frequencies that appeared with looser settings [6].
Inadequate plane-wave cutoffs or poor-quality pseudopotentials can artificially destabilize phonons:
ecutwfc): Insufficient values cause inaccurate force constantsecutrho): Typically 4×ecutwfc for ultrasoft pseudopotentials, 8-12× for norm-conserving [8]The ASR requires that the frequency of acoustic modes at the Γ-point should be zero. Finite grid effects break translational invariance, typically resulting in small violations [5]:
dynmat.x or matdyn.x with asr='crystal' [2]A poorly relaxed structure is a common cause of genuine imaginary frequencies:
Table 2: Structural Relaxation Quality Checklist
| Checkpoint | Indicator of Quality | Problematic Signature |
|---|---|---|
| Final forces | < 0.001 Ry/bohr [7] | Significant residual forces (> 0.01 Ry/bohr) |
| Stress tensor | Diagonal components < 0.5 GPa | High residual stress |
| Energy convergence | < 1.0d-5 Ry between steps [7] | Oscillating energy values |
| Atomic positions | Symmetry-preserved | Atoms drifted from symmetric positions |
For 2D materials, ensure sufficient vacuum separation (typically 15-20 Å) to prevent spurious interactions between periodic images [6]. The assume_isolated parameter should be properly configured for low-dimensional systems [2].
When computational artifacts have been ruled out, consider these valid causes of structural instability:
Research on Y₂C MXenes demonstrates proper validation: after thorough convergence and multiple relaxation steps, the persistence of certain vibrational modes confirmed genuine dynamical stability [9].
Table 3: Research Reagent Solutions for Stable Phonon Calculations
| Solution Component | Specific Implementation | Function |
|---|---|---|
| Structural Relaxation | vc-relax with cell_dofree='ibrav' [7] |
Simultaneous optimization of atomic positions and lattice vectors |
| Convergence Testing | Systematic cutoff & k-point grids [2] | Determines parameters for numerically converged forces |
| Phonon Calculation | ph.x with ldisp=.true. and nq1,nq2,nq3 [10] [2] |
Direct DFPT calculation on q-point grid |
| Post-processing | q2r.x + matdyn.x with asr='crystal' [2] |
Fourier interpolation of force constants with ASR imposition |
| Validation | Phonon dispersion across entire Brillouin zone | Confirms absence of imaginary modes in stable materials |
Initial Diagnostic
Systematic Convergence
Structural Re-examination
Final Validation
Always start with tighter convergence parameters than default, particularly for metallic systems or those with vacuum [5] [6]
Validate your relaxed structure by checking residual forces and stresses before phonon calculations
Apply ASR corrections systematically as part of your post-processing workflow [2]
Use consistent parameters throughout your workflow - identical pseudopotentials, k-point grids, and convergence criteria between relaxation and phonon calculations
When imaginary frequencies persist after thorough convergence testing, seriously consider they may reflect genuine physical instability requiring structural re-evaluation
By following this systematic approach, researchers can confidently distinguish between computational artifacts and genuine physical phenomena, ensuring the reliability of their phonon calculations and the scientific conclusions drawn from them.
The Acoustic Sum Rule (ASR) embodies the principle of translational invariance in physical systems. In the context of phonon calculations, it requires that the frequency of the three acoustic modes at the gamma point (Γ, q=0) must be precisely zero. This represents the fact that translating the entire crystal as a rigid body should not cost any energy. The ASR is a fundamental check on the quality and correctness of a phonon calculation.
Violations of the ASR in practical calculations occur because translational invariance is broken in approximated computations. The primary, most irreducible cause is the discreteness of the Fast Fourier Transform (FFT) grid used in Plane-Wave (PW) calculations. Other contributing factors can include insufficient convergence parameters (such as tr2_ph for phonons and conv_thr for the ground state) or, for molecules, a less-than-perfect convergence of the molecular geometry. If the nonzero frequencies are small (typically less than 10 cm⁻¹), this is usually not a cause for major concern, and the ASR can be imposed in post-processing with excellent results [11] [5].
"Negative" frequencies are technically imaginary frequencies (ω² ≤ 0). Their appearance can signal different issues:
ecutwfc/ecutrho, or overly large convergence thresholds) or it may signal a real mechanical instability of the chosen crystal structure with the approximations you used [5] [12]. A systematic convergence check and verification that your initial structure is reasonable are crucial first steps.Errors like symmetry operation is non orthogonal, wrong representation, or wrong degeneracy are almost always a consequence of atomic positions that are close to, but not exactly at, high-symmetry positions. The code's symmetry detection has a finite tolerance, and small deviations can break it.
Solution: To prevent this, always define the Bravais lattice using the correct ibrav value (avoid ibrav=0), and use Wyckoff positions if known. This must be done in the initial self-consistent field (SCF) calculation, not just the phonon calculation [11] [5].
A small violation of the ASR is normal, but large violations indicate a problem. Follow this diagnostic workflow to identify and correct the issue.
The following table summarizes key parameters that influence ASR violations and their recommended adjustments for mitigation.
Table 1: Key Parameters Affecting ASR Violations and Convergence
| Parameter | Description | Role in ASR/Convergence | Recommended Action for Issues |
|---|---|---|---|
conv_thr |
SCF convergence threshold for the ground-state calculation. | A threshold that is too large introduces noise in forces, hindering a proper geometry optimization and phonon calculation [12]. | Tighten to 1.0e-10 or lower for high-quality phonons [12]. |
tr2_ph |
Convergence threshold for the phonon self-consistency. | Directly controls the accuracy of the phonon calculation. A larger value can cause bad frequencies and ASR violations [5]. | Reduce to 1.0d-14 or lower [13]. |
ecutrho |
Charge density cutoff (for USPP, PAW). | A discrete FFT grid is the primary cause of ASR violation. Increasing ecutrho densifies this grid, reducing the problem [5]. |
Increase significantly, especially for GGA calculations or systems with vacuum [5]. |
ASR |
Acoustic Sum Rule imposition in matdyn.x. |
Corrects for the inherent violation by enforcing the sum rule on the force constants [14]. | Apply asr='crystal' or asr='all' for infrared-active solids [14] [13]. |
Imaginary frequencies can be the most challenging problem to solve, as they can be either a numerical artifact or a physical phenomenon.
Table 2: Troubleshooting Negative Phonon Frequencies
| Symptom | Possible Cause | Diagnostic Steps | Solution |
|---|---|---|---|
| Imaginary frequencies only at Γ for acoustic/rotational modes | Finite-size effects or imperfect geometry convergence. | Check if the structure is fully optimized. | Improve the ground-state geometry optimization [11] [12]. |
| Isolated imaginary frequencies at specific q-points | Numerical: Insufficient convergence. | Systematically converge ecutwfc, ecutrho, k-point grid, and conv_thr/tr2_ph [5]. |
Follow the convergence protocol in the next section. |
| Multiple or large-magnitude imaginary frequencies | Physical: Mechanical instability of the crystal structure. | Verify the initial structure is correct and stable. | The calculation might be correct, revealing an instability. Consider studying a different phase. |
| Imaginary frequencies in 2D materials | Incorrect treatment of electrostatic interactions. | Check the input parameters for 2D systems. | Use assume_isolated = '2D' in the SYSTEM namelist of the initial pw.x calculation [13]. |
To minimize numerical artifacts like ASR violations and imaginary frequencies, a rigorous convergence study is essential. Here is a detailed methodology:
Ground-State Energy Cutoffs:
ecutwfc). The charge density cutoff (ecutrho) is typically 8-12 times ecutwfc (or 4 times for norm-conserving pseudopotentials). Using a higher cutoff than for standard scf calculations is often necessary for accurate phonons [13].K-Point Grid Convergence:
Geometry Optimization:
1.0e-5 Ry/au or lower) to ensure the structure is at a true minimum. Crucially, converge the scf conv_thr to a very tight value (e.g., 1.0e-10) during this step to reduce noise in the forces [12].Phonon-Specific Parameters:
Post-Processing and Validation:
q2r.x to obtain real-space force constants.matdyn.x to get the phonon dispersion. At this stage, apply the ASR (e.g., asr='crystal') to correct the small violations of the acoustic modes [14] [13].Table 3: Key Input Parameters for ph.x and matdyn.x
| Category | Parameter | Program | Function and Usage |
|---|---|---|---|
| File & Directory | prefix, outdir |
ph.x |
Must match the initial pw.x scf calculation to read the correct data [10]. |
fildyn |
ph.x |
Specifies the output file for dynamical matrices [10]. | |
flfrc |
matdyn.x |
Input file containing the force constants from q2r.x [14]. |
|
| Convergence | tr2_ph |
ph.x |
Self-consistency threshold for phonons; crucial for accuracy [10]. |
niter_ph |
ph.x |
Maximum number of scf iterations in the phonon code [10]. | |
| Q-point Control | ldisp |
ph.x |
If .true., calculates phonons on a uniform grid defined by nq1, nq2, nq3 [10] [13]. |
nq1, nq2, nq3 |
ph.x |
Defines the uniform q-grid for ldisp=.true. [13]. |
|
| Sum Rule & Corrections | asr |
matdyn.x |
Critical for fixing ASR. Options: 'no', 'simple', 'crystal', 'all'. Use 'crystal' for 3D, 'one-dim' for 2D, 'all' for infrared-active solids [14]. |
loto_2d |
matdyn.x |
Set to .true. for correct 2D treatment of LO-TO splitting [14]. |
My ph.x calculation stops with an error about reading a file or a recover file. What should I do?
This typically indicates a problem with the input data file from the pw.x SCF calculation. The file could be bad, incomplete, or produced by an incompatible version of the code. If the error mentions a recover file (cannot recover or error reading recover file), you likely have a corrupted restart file from a previous failed run. To fix this, remove all files named recover* in your outdir [5].
Why does ph.x warn that "occupation numbers probably wrong"?
This warning appears for metallic or spin-polarized systems when the smearing method for occupations is not used. You should set occupations = 'smearing' in your pw.x input file for the initial SCF calculation [5].
My phonon dispersion from matdyn.x shows negative frequencies, but the original ph.x results were fine. Why?
This common issue can have several causes. It often indicates that your initial structure is not fully relaxed, so ensure your geometry optimization uses tight convergence thresholds (e.g., forc_conv_thr = 1.0d-5 and etot_conv_thr = 1.0d-6). Other causes include an insufficient k-point grid for metals, or a charge density cutoff (ecutrho) that is too low, especially when using ultrasoft pseudopotentials (USPP) or the PAW method [5] [4]. For 2D materials, a specific fix is to set assume_isolated = '2D' in the SYSTEM namelist of your pw.x input to correctly handle long-range interactions and avoid imaginary acoustic frequencies near the gamma point [13].
The acoustic modes at Γ do not have zero frequency. Is this an error?
Not necessarily. The Acoustic Sum Rule (ASR) is never exactly fulfilled due to the system's lack of perfect translational invariance on a discrete grid. The frequency of acoustic modes is typically below 10 cm⁻¹ but can be higher. You can test this by diagonalizing the dynamical matrix with dynmat.x while imposing the ASR. If the acoustic mode frequency becomes very small (<1 cm⁻¹) and other modes remain unchanged, your results are trustworthy [5].
I get "wrong degeneracy" or other symmetry-related errors. How can I fix them?
These errors are often caused by atomic positions that are very close to, but not exactly at, high-symmetry positions. To prevent this, define the Bravais lattice using the correct ibrav value (avoid ibrav=0) and use Wyckoff positions when known in your self-consistent calculation with pw.x [5].
The appearance of negative (imaginary) frequencies in phonon calculations often signals a mechanical instability in the chosen structure. The table below summarizes the primary causes and solutions, tailored for different system types.
| System Type | Common Causes | Recommended Fixes |
|---|---|---|
| All Systems | - Insufficient structure relaxation- SCF convergence threshold (conv_thr) too large- Phonon convergence threshold (tr2_ph) too large- Wrong atomic masses in input |
- Use tighter force/energy convergence in pw.x relaxation (forc_conv_thr = 1.0d-5, etot_conv_thr = 1.0d-6) [4]- Reduce conv_thr and tr2_ph (e.g., 1.0d-14) [5] [4]- Verify amass for each atomic type [5] |
| 2D Materials | - Incorrect treatment of long-range interactions due to periodic images | - In pw.x input, set assume_isolated = '2D' [13]- Apply ASR appropriate for 2D systems (e.g., asr = 'crystal' in q2r.x/matdyn.x) [13] |
| Metals | - Insufficient k-point grid- Slow convergence with smearing, especially with semicore states- Incommensurate phonon wave-vectors | - Use a denser k-point grid [5]- Employ a smaller smearing parameter (degauss) and ensure occupations='smearing' [5] |
| Systems with USPP/PAW | - Charge density cutoff (ecutrho) is too low |
- Increase ecutrho (typically ecutrho = 8 * ecutwfc) [5] |
| General Numerical Issues | - Wavefunction cutoff (ecutwfc) is too low- Violation of the Acoustic Sum Rule (ASR) |
- Systematically increase ecutwfc [5]- Impose ASR in q2r.x (zasr) and matdyn.x (asr); 'crystal' is often a good choice [4] [13] |
This workflow outlines the standard procedure for calculating phonon dispersion, incorporating system-specific checks.
Workflow for Phonon Dispersion
SCF Ground-State Calculation (pw.x)
ecutwfc) and, for USPP/PAW, a high ecutrho [5].occupations='smearing' and use an appropriately dense k-point grid [5].assume_isolated='2D' or assume_isolated='1D' in the SYSTEM namelist to correctly handle electrostatic interactions [13].conv_thr = 1.0d-8 or tighter) [13].Phonon Calculations on a Mesh (ph.x)
ldisp = .true. and define the mesh with nq1, nq2, nq3.tr2_ph = 1.0d-14) [4].fildyn parameter specifies the output file for the dynamical matrices.Generate Interatomic Force Constants (q2r.x)
Calculate Phonon Dispersion and DOS (matdyn.x)
flfrc to the force constants file from q2r.x.asr = 'crystal' to consistently apply the ASR [4].q_in_band_form = .true. and provide the q-point path.dos = .true. and define a mesh with nk1, nk2, nk3.This table lists the key software components and their roles in a typical Quantum ESPRESSO phonon calculation workflow.
| Item | Function in the Experiment |
|---|---|
pw.x |
The core plane-wave self-consistent field (SCF) code for calculating the electronic ground state and performing structural relaxations [13]. |
ph.x |
The density functional perturbation theory (DFPT) code for calculating phonon frequencies and eigenvectors on a uniform q-point mesh [13]. |
q2r.x |
Computes the interatomic force constants in real space by Fourier transforming the dynamical matrices from ph.x [13]. |
matdyn.x |
Calculates the phonon dispersion along any q-point path and the phonon density of states using the force constants from q2r.x [13]. |
dynmat.x |
A utility to diagonalize the dynamical matrix, often used to test the effect of different Acoustic Sum Rules (ASR) on the phonon frequencies [5]. |
| Pseudopotential Files | Define the effective interaction between ions and valence electrons. The choice and quality of pseudopotentials (e.g., NC, USPP, PAW) are critical for accuracy. |
A self-consistent field (SCF) calculation aims to find the electronic ground state of a system by iteratively solving the Kohn-Sham equations until the energy and electron density no longer change significantly. This ground-state charge density is the fundamental starting point for subsequent phonon calculations using ph.x. Imaginary frequencies (often reported as "negative frequencies") in phonon calculations can often be traced back to an inaccurate or un-converged ground state. These frequencies signify an instability, which can either be a real physical property of the system or, more often, an artifact of a poor-quality SCF calculation or insufficient structural relaxation [5] [11] [2].
The flowchart below outlines the logical progression for diagnosing and fixing the root causes of negative phonon frequencies.
The following table summarizes the key parameters in your SCF input that require careful attention to ensure a high-quality ground state for phonon calculations.
| Parameter (Namelist) | Recommended Setting for Phonons | Function & Rationale |
|---|---|---|
calculation (&CONTROL) |
'scf' |
Specifies a self-consistent field calculation to obtain the ground-state density [16]. |
conv_thr (&ELECTRONS) |
1.0d-12 to 1.0d-16 [2] [12] |
The convergence threshold for the SCF cycle. A tighter threshold (smaller number) is critical to reduce numerical noise in forces [12]. |
ecutwfc (&SYSTEM) |
System-dependent (converged) | Plane-wave kinetic energy cutoff for wavefunctions. Must be high enough for total energy convergence [5] [16]. |
ecutrho (&SYSTEM) |
4 * ecutwfc (for USPP/PAW) [5] |
Cutoff for charge density. Too low a value can violate translational invariance, affecting acoustic modes [5]. |
occupations (&SYSTEM) |
'smearing' for metals/spin-polarized; 'fixed' for insulators [5] [17] |
Incorrect smearing for metallic systems leads to errors. Macroscopic field contributions require 'fixed' occupations [5] [11]. |
K_POINTS |
Dense grid for metals | A converged k-point grid is essential. Metallic systems with semicore states require particularly careful convergence [5]. |
forc_conv_thr (&IONS) |
1.0d-8 or tighter (in VC-RELAX) |
Force convergence threshold in geometry optimization. Poor structural relaxation is a primary cause of imaginary frequencies [2] [12]. |
dynmat.x or matdyn.x using the asr flag (e.g., asr='crystal') to fix this [5] [2].ATOMIC_SPECIES and ph.x input are correct.conv_thr in the SCF calculation and tr2_ph in the ph.x input [5] [2].wrong degeneracy) usually occur when atomic positions are close to, but not exactly on, high-symmetry positions. To prevent this, use the correct ibrav value and Wyckoff positions in the SCF calculation instead of ibrav=0 [5] [11].| Item / Utility | Function in Quantum ESPRESSO |
|---|---|
pw.x |
The main PWscf code for performing SCF, structural relaxation, and MD calculations [16]. |
ph.x |
The PHonon code for calculating linear response phonons and vibrational spectra [5] [15]. |
dynmat.x / matdyn.x |
Post-processing codes to diagonalize the dynamical matrix and enforce the Acoustic Sum Rule (ASR) [5] [2]. |
| Pseudopotential File (UPF) | File containing the atomic pseudopotential, defining the electron-ion interaction [16]. |
conv_thr & tr2_ph |
Numerical parameters controlling the convergence of the SCF (pw.x) and phonon (ph.x) calculations, respectively [5] [2]. |
vc-relax |
A calculation type that performs a variable-cell relaxation to optimize both atomic positions and unit cell vectors [2]. |
To methodically eliminate numerical artifacts, follow this workflow for parameter convergence testing.
ecutwfc and ecutrho: Start with a single-point SCF calculation for your material. Systematically increase ecutwfc until the change in total energy is smaller than your desired accuracy (e.g., 1 meV/atom). Set ecutrho = 4 * ecutwfc if using ultrasoft pseudopotentials or the PAW method [5] [16].K_POINTS automatic) until the total energy converges [19].calculation = 'vc-relax' run. Set forc_conv_thr to a very tight value, such as 1.0d-8 Ry/Bohr or lower, to ensure forces are minimized [2] [12].scf calculation with an exceptionally tight conv_thr (e.g., 1.0d-12 to 1.0d-16) [2] [12]. The output density of this calculation is your high-quality ground state for ph.x.ph.x with tight convergence: In your ph.x input, set a tight convergence threshold with tr2_ph (e.g., 1.0d-14 to 1.0d-16) to match the quality of your SCF calculation [2].By meticulously following this protocol and understanding the role of each critical parameter, you can significantly increase the reliability of your phonon calculations and confidently interpret the results, distinguishing numerical artifacts from true physical instabilities.
Density Functional Perturbation Theory (DFPT) calculations using Quantum ESPRESSO's ph.x code represent a powerful approach for determining lattice dynamical properties, yet researchers frequently encounter the troubling issue of negative (imaginary) frequencies in their results. These non-physical frequencies indicate dynamical instabilities in the calculated structure and often stem from inaccuracies in either the initial structural model or the computational parameters used in the phonon calculation. Within the context of thesis research on fixing negative frequencies, this technical guide synthesizes practical troubleshooting knowledge and parameter optimization strategies to help computational materials scientists, chemists, and drug development researchers achieve stable, physically meaningful phonon results. The occurrence of negative frequencies typically signals that the system is mechanically unstable with the chosen approximations, requiring methodical investigation across the entire computational workflow from structural relaxation to phonon calculation convergence.
Table: Common Causes and Solutions for Negative Frequencies
| Problem Category | Specific Symptoms | Recommended Solutions | Key ph.x/pw.x Parameters to Adjust |
|---|---|---|---|
| Structural Issues | Negative frequencies persist across multiple q-points; structure not at energy minimum | Tighten relaxation convergence; verify forces and stresses | forc_conv_thr = 1e-5 (tighter) [7], etot_conv_thr = 1e-8 [7], cell_dofree = 'ibrav' [7] |
| Pseudopotential & Basis Set | Negative frequencies especially in covalent systems; convergence with ecut unclear | Increase plane-wave cutoffs; verify pseudopotential quality | ecutwfc (increase) [5], ecutrho = 8*ecutwfc (USPP/PAW) [5] |
| k-point Sampling | Metallic systems with semicore states; slow convergence with k-points | Use denser k-point grids; adjust smearing | ngkpt (increase) [5], smearing = 'gaussian' [5], degauss (reduce) [5] |
| Phonon Calculation Convergence | Inconsistent results across q-points; SCF convergence warnings | Tighten phonon convergence thresholds; adjust mixing parameters | tr2_ph = 1e-14 (tighter) [4], niter_ph = 200 (increase) [10], alpha_mix(niter) [10], nmix_ph = 8 [10] |
| Acoustic Sum Rule (ASR) | Significant acoustic mode violations at Γ-point (>10 cm⁻¹) | Apply ASR corrections in post-processing | asr = 'crystal' (in q2r.x/matdyn.x) [4] |
Figure 1: Diagnostic workflow for systematic identification and resolution of negative frequency issues in ph.x calculations.
The diagnostic pathway begins with verifying the quality of the initial structure relaxation, as an improperly relaxed structure represents the most common source of imaginary frequencies [4]. The workflow proceeds through checking residual forces, k-point convergence for the specific system type (with particular attention to metallic systems with semicore states) [5], phonon SCF convergence, and finally application of acoustic sum rule corrections where appropriate. At each stage, failure to meet convergence criteria necessitates returning to earlier computational stages with adjusted parameters.
Table: Key ph.x Input Parameters for Stable DFPT Results
| Parameter | Recommended Value | Purpose | Effect on Stability |
|---|---|---|---|
tr2_ph |
1e-12 to 1e-14 | Phonon SCF convergence threshold | Tighter values prevent premature convergence; essential for metallic systems [4] |
niter_ph |
100-200 | Maximum phonon SCF iterations | Prevents early termination; allows difficult perturbations to converge [10] |
alpha_mix(niter) |
0.3-0.7 (iteration-dependent) | Potential mixing factor | Improves SCF convergence; lower values stabilize oscillating solutions [10] |
nmix_ph |
4-8 | Number of iterations for potential mixing | Higher values can speed convergence but use more memory [10] |
verbosity |
'high' | Detailed output | Enables monitoring of convergence per perturbation [4] |
recover |
.false. (initially) | Restart from interrupted run | Set to .true. only to continue failed calculations [10] |
ldisp |
.true. | Automatic q-point grid generation | For full phonon dispersion with nq1, nq2, nq3 [4] |
asr |
(in q2r.x/matdyn.x) | Acoustic sum rule imposition | Corrects acoustic mode violations; 'crystal' type recommended [4] |
Before executing ph.x, researchers should systematically verify these precursor calculations:
Ground-State Convergence: Confirm the SCF calculation achieves at least 1e-10 Ry energy convergence, with particularly tight thresholds (1e-8 Ry or better) for metallic systems or those with delicate electronic structure [7].
Structural Optimization Quality: Ensure geometry optimization (relax or vc-relax) reaches force thresholds below 0.001 Ry/Bohr, with stress tensor components below 0.5 GPa for solid systems [7].
k-point Grid Validation: Verify the k-point sampling produces well-converged Fermi surface properties for metals or band gaps for insulators, with particularly dense grids required for systems with nested Fermi surfaces or van Hove singularities [5].
Pseudopotential Verification: Confirm pseudopotentials accurately reproduce all-electron equations of state and elastic properties, with particular attention to semicore states and magnetic systems [5].
Q1: Why do I obtain negative frequencies even after thorough structure relaxation?
This persistent issue often stems from multiple contributing factors. First, verify that your relaxation utilized sufficiently tight convergence criteria (forc_conv_thr=1e-5 Ry/Bohr or tighter, etot_conv_thr=1e-8 Ry) [7]. Second, certain exchange-correlation functionals (particularly GGAs) are known to produce dynamical instabilities for specific materials where experimental evidence shows stability [5]. In such cases, hybrid functionals or van der Waals corrections may be necessary. Third, ensure your k-point grid is commensurate with the phonon q-point grid, as mismatches can introduce spurious instabilities, particularly for metallic systems [5].
Q2: How can I distinguish physical instabilities from numerical artifacts?
Genuine physical instabilities typically manifest as consistent negative frequencies across multiple q-points, particularly at zone boundary points where soft modes often occur. Numerical artifacts, conversely, tend to be isolated to specific q-points, especially those non-commensurate with the k-point grid [5]. To test this, perform two calculations: first with your standard parameters, then with increased ecutwfc (by 20-30%) and denser k-point sampling (2× in each direction). If the negative frequencies persist with similar magnitude across both calculations, they likely represent genuine physical instabilities [5].
Q3: What does "Wrong degeneracy error in star_q" indicate and how can it be resolved?
This error arises when the specified q-vector differs slightly from a high-symmetry point due to numerical precision issues [5]. The code compares the input q-vector with symmetry-equivalent points using a tolerance of 10⁻⁵, and discrepancies within this range can cause symmetry recognition failures. The solution is to ensure high-symmetry q-points are specified with exact fractional coordinates (e.g., 0.5 instead of 0.500001) or to use the automatic q-point generation via ldisp=.true. with nq1, nq2, nq3 [5] [4].
Q4: Why do acoustic modes at Γ-point show significant non-zero frequencies?
This Acoustic Sum Rule (ASR) violation occurs because the exchange-correlation energy computation on discrete real-space grids breaks exact translational invariance [5]. The problem is typically more severe for GGA functionals than LDA, and for systems with vacuum regions (surfaces, molecules) where reduced gradient diverges [5]. While frequencies below 10 cm⁻¹ are generally acceptable, larger violations can be corrected by applying the ASR in q2r.x and matdyn.x using asr='crystal' [4]. The ultimate test is to diagonalize the dynamical matrix with imposed ASR; if acoustic modes then show frequencies <1 cm⁻¹ with other modes unchanged, the corrected results are reliable [5].
Q5: How can I optimize computational efficiency while maintaining accuracy?
For multi-q-point calculations, avoid computing all perturbations in a single execution. Instead, run separate calculations for different q-points or irreducible perturbations, as each has different computational workload and symmetry constraints [20]. Use more MPI processes for computationally heavy perturbations (those at low-symmetry q-points) and fewer for lighter ones (high-symmetry points). This approach significantly improves overall computational efficiency compared to uniform parallelization [20].
Table: Critical Computational Components for Stable Phonon Calculations
| Component | Function | Implementation Notes |
|---|---|---|
| Optimized Structures | Provides energy-minimized starting configuration | Always use vc-relax with tight convergence before phonons [7] |
| Hard Pseudopotentials | Accurate electron-ion interaction representation | Prefer PAW or NC pseudopotentials with high ecutwfc when negative frequencies persist [5] |
| k-point Grids | Brillouin zone sampling for electronic structure | Metallic systems require denser grids; ensure commensurability with q-points [5] |
| Mixing Parameters | Stabilize SCF convergence in DFPT | Use alpha_mix and nmix_ph to handle difficult perturbations [10] |
| ASR Corrections | Imposes translational invariance | Apply in post-processing with q2r.x and matdyn.x [4] |
| Symmetry Tools | Identifies irreducible representations | Use ibrav (not 0) and Wyckoff positions to minimize symmetry errors [5] |
Q1: My ph.x calculation shows positive frequencies, but matdyn.x produces negative ones at the same q-points. Why?
This common discrepancy arises because the dynamical matrices from ph.x are calculated on a coarse q-grid. The interpolation performed by q2r.x and matdyn.x can introduce errors if the initial grid is too sparse, force constants are imperfect, or the Acoustic Sum Rule (ASR) is misapplied [4]. The ultimate test is to diagonalize the dynamical matrix with program dynmat.x, imposing the ASR [5].
Q2: What is the most critical factor for eliminating imaginary frequencies near the Γ-point?
Ensuring your crystal structure is fully and accurately relaxed is paramount. A poorly relaxed structure, even with minimal residual forces, is a primary cause of unphysical imaginary frequencies, as the system is not in a true energy minimum [4] [2]. For 2D materials, correctly activating the 2D treatment with assume_isolated = '2D' in the pw.x input and loto_2d = .true. in the matdyn.x input is also crucial [13] [2].
Q3: How do I choose between different Acoustic Sum Rule (ASR) options?
The ASR corrects for broken translational invariance. The 'crystal' type is often a robust choice as it imposes translational invariance via an optimized correction [14] [13]. For infrared-active solids, using asr = 'all' in matdyn.x along with read_lr = .true. is required to include long-range force constants, as recommended in recent research [14].
Q4: My dispersion curve looks "messed up" compared to my ph.x results. What went wrong?
This typically indicates a problem during the interpolation workflow. Key suspects are an insufficiently dense q-grid in the initial ph.x calculation or an inconsistency in atomic masses between the ph.x and matdyn.x inputs [5] [4]. Always verify that the masses specified with the amass keyword are identical and correct in both inputs.
Before delving into complex fixes, verify these foundational elements.
outdir directory in all input files points to the correct location containing the SCF charge density [5].amass values for each atom type in both ph.x and matdyn.x inputs.flfrc, fildyn). Remove old recover* files from outdir if a previous calculation failed [5].Follow this optimized workflow, paying close attention to the key parameters in the tables below.
Step 1: Self-Consistent Field (SCF) Calculation with pw.x
This initial step must provide a highly converged electronic ground state. Use tighter thresholds than for a single-point energy calculation [13].
Table: Key pw.x &ELECTRONS Namelist Parameters for Phonon Accuracy
| Parameter | Recommended Value | Function |
|---|---|---|
conv_thr |
1.0d-12 to 1.0d-16 |
Convergence threshold for SCF cycle [4] [2]. |
mixing_beta |
0.2 to 0.7 |
Mixing factor for self-consistency [13] [2]. |
ecutwfc / ecutrho |
Higher than normal | Plane-wave cutoffs; increase if negative frequencies persist [5] [13]. |
Step 2: Dynamical Matrix Calculation with ph.x
This is the most computationally demanding step. A denser q-grid is critical for accurate interpolation [21].
Table: Key ph.x &INPUTPH Namelist Parameters
| Parameter | Recommended Value | Function |
|---|---|---|
tr2_ph |
1.0d-14 to 1.0d-16 |
Convergence threshold for phonon self-consistency [13] [4] [2]. |
nq1, nq2, nq3 |
System-dependent (e.g., 6 6 6) |
Dimensions of the uniform q-point grid for DFPT calculations [13] [21]. |
ldisp |
.true. |
Enables calculation on a uniform grid of q-points [13] [2]. |
Step 3: Fourier Transform to Real Space with q2r.x
This step converts dynamical matrices into real-space force constants.
Table: Key q2r.x &INPUT Namelist Parameters
| Parameter | Recommended Value | Function |
|---|---|---|
zasr |
'crystal' or 'all' |
Applies Acoustic Sum Rule during the force constant generation [13] [2]. |
Step 4: Interpolated Dispersion with matdyn.x
This final step generates the phonon dispersion along high-symmetry paths.
Table: Key matdyn.x &INPUT Namelist Parameters for Frequency Accuracy
| Parameter | Recommended Value | Function |
|---|---|---|
asr |
'crystal' or 'all' |
Type of Acoustic Sum Rule to apply; must be consistent with q2r.x [14] [13]. |
loto_2d |
.true. for 2D systems |
Activates correct treatment of LO-TO splitting in 2D [14] [13]. |
loto_disable |
.false. (default) |
Set to .true. only for testing to disable LO-TO splitting at q=0 [14]. |
read_lr |
.true. for asr='all' |
Reads long-range force constants, crucial for infrared-active solids [14]. |
If problems persist, consider these advanced strategies.
nq1, nq2, nq3 grid in the ph.x calculation. A converged phonon dispersion should not change significantly with a denser grid.ph.x [5].Table: Key "Research Reagent" Solutions for Quantum ESPRESSO Phonon Calculations
| Item | Function in Workflow |
|---|---|
pw.x |
Computes the electronic ground state and charge density, forming the foundation for all subsequent perturbative calculations [13] [22]. |
ph.x |
Implements Density Functional Perturbation Theory (DFPT) to calculate the dynamical matrices on a uniform grid of q-points [13] [22]. |
q2r.x |
Performs an inverse Fourier transform of the dynamical matrices to obtain the interatomic force constants in real space [13] [22]. |
matdyn.x |
Interpolates the real-space force constants to calculate phonon frequencies at any q-point, enabling the plotting of smooth dispersion curves and DOS [14] [13]. |
| Acoustic Sum Rule (ASR) | A constraint correction applied to force constants to enforce translational invariance, crucial for having acoustic modes go to zero at the Γ-point [14] [5]. |
This guide provides targeted troubleshooting for Quantum ESPRESSO ph.x calculations, focusing on resolving negative frequencies in complex systems like 2D materials and metallic compounds. These issues often point to structural instabilities or computational settings mismatches rather than simple code errors. The following FAQs and protocols will help you diagnose and fix these problems systematically.
FAQ 1: My ph.x calculation finishes successfully, but I get negative frequencies when I run matdyn.x to plot the phonon dispersion. What is wrong?
This is a common issue that typically originates from the initial self-consistent field (SCF) calculation performed with pw.x, not the phonon code itself. The most probable cause is that your crystal structure was not fully relaxed to its ground state. The residual forces and stresses on the atoms mean that the dynamical matrix is calculated for a structure that is not at a minimum of its potential energy surface, leading to imaginary phonon modes. To fix this, ensure your structure relaxation uses tight convergence criteria for both energy and forces before starting phonon calculations [4].
FAQ 2: What does the error "occupation numbers probably wrong" mean, and how do I fix it?
This warning appears when you are calculating a metallic or spin-polarized system but have not set the occupations variable to 'smearing' in your pw.x input. Metals require smearing (e.g., Marzari-Vanderbilt, Methfessel-Paxton) to properly handle partial occupancy of electronic states near the Fermi level. Without it, the calculation of total energy and forces can be incorrect. To resolve this, in your pw.x input, set occupations = 'smearing' and choose an appropriate smearing parameter (e.g., 'mv') and a small degauss value [5].
FAQ 3: The frequencies of the acoustic modes at the gamma point (q=0) are not zero. Is this an error?
Not necessarily. A small deviation (e.g., less than 10 cm⁻¹) is expected due to the Acoustic Sum Rule (ASR) violation. This occurs because the system is never perfectly translationally invariant in practice, as the exchange-correlation energy is computed on a discrete real-space grid. The problem can be more severe in 2D systems or those with vacuum, and with GGA functionals compared to LDA. You can impose the ASR during post-processing using the dynmat.x tool. If the acoustic mode frequency drops to nearly zero (e.g., < 1 cm⁻¹) while other modes remain unchanged, your results are trustworthy [5].
FAQ 4: My system is a 2D material. Are there any special considerations to avoid negative frequencies?
Yes. 2D materials, often simulated with a vacuum layer, can be particularly sensitive to several factors:
ecutwfc) and the charge density cutoff (ecutrho), which is typically ecutrho = 4 * ecutwfc [5].A poorly relaxed structure is the most common source of unphysical negative frequencies.
pw.x structural relaxation (calculation = 'vc-relax' or 'relax') input.etot_conv_thr = 1.0d-10 or lower (e.g., 1.0d-12)forc_conv_thr = 1.0d-8 or lower (e.g., 1.0d-10) [4]tstress = .true. and ensure the stress tensor components are also converged.ph.x calculation.Insufficient convergence in the SCF or phonon steps can cause numerical instabilities.
pw.x SCF input, tighten the convergence threshold: conv_thr = 1.0d-12 or lower [4].ph.x input, tighten the phonon convergence threshold: tr2_ph = 1.0d-14 or lower [4].ecutwfc and, if using USPP/PAW, ecutrho.Metals and systems with topological properties require special attention to sampling and electron-phonon coupling.
occupations = 'smearing' in the pw.x input.nqc parameter in a ph.x metals calculation should be commensurate with the k-point grid to avoid errors from non-commensurate q-vectors [5].The following diagram outlines the logical workflow for diagnosing and fixing negative frequencies, integrating the protocols above.
These values are starting points. Always perform convergence tests for your specific system.
| Parameter | Typical Standard Value | Recommended Tight Value | Function |
|---|---|---|---|
forc_conv_thr |
1.0d-3 Ry/Bohr | 1.0d-8 to 1.0d-10 Ry/Bohr | Force convergence in relaxation [4] |
etot_conv_thr |
1.0d-4 Ry | 1.0d-10 to 1.0d-12 Ry | Energy convergence in relaxation [4] |
conv_thr |
1.0d-6 Ry | 1.0d-11 to 1.0d-12 Ry | SCF energy convergence [4] |
tr2_ph |
1.0d-12 | 1.0d-14 | Phonon calculation convergence [4] |
ecutwfc |
System-dependent | 20-30% higher | Plane-wave kinetic energy cutoff [5] |
| System Type | Key Parameters | Potential Pitfalls |
|---|---|---|
| 2D Materials (e.g., MXC₃, M₂B₂H₄) [24] [23] | Large vacuum layer; Dense k-grid in 2D; ASR = 'crystal' in q2r.x/matdyn.x. |
Spurious interaction from small vacuum; Incorrect treatment of long-range interactions. |
| Metallic Compounds | occupations = 'smearing'; Very dense k-point grid; Commensurate q-point grid. |
Slow k-point convergence; "Occupation numbers probably wrong" error [5]. |
| Systems with Vanadium (e.g., V₂B₂H₄) [23] | Check for magnetic ordering (FM, AFM). | Magnetic ground state might be missed in non-spin-polarized calculations. |
The study of novel 2D materials often reveals new platforms for topological superconductivity. The following table lists material classes from recent research that are relevant for computational studies of phonons and superconductivity.
| Material / System | Function / Role in Research | Key Characteristic (from first-principles) |
|---|---|---|
| 2D MXC₃(M:X = In:As, Se:As, In:Te) [24] | Platform for 2D topological superconductivity. | Predicted to be thermodynamically/dynamically stable; Phonon-mediated superconductors with Tc up to 33.6 K. |
| Hydrogenated Transition-Metal Borides (e.g., Nb₂B₂H₄, V₂B₂H₄) [23] | High-Tc 2D BCS superconductor at ambient pressure. | Hydrogenation enhances high-frequency phonons; Calculated Tc of 69 K and 83 K, respectively. |
| Rutile Structure (e.g., TiO₂) [4] | Prototype material for testing computational methods. | Known to exhibit phonon instabilities (negative frequencies) when calculated with GGA functionals. |
A systematic guide to eliminating unphysical negative phonon frequencies in your Quantum ESPRESSO calculations
What does a negative phonon frequency indicate?
A negative phonon frequency (often reported as an imaginary frequency) signals a mechanical instability in your simulated crystal structure [5]. Fundamentally, it means the system can lower its energy by distorting along the corresponding vibrational mode. While this can sometimes indicate a genuine physical instability, more often it results from insufficient convergence of key computational parameters in the ph.x or preceding pw.x calculation [5] [2].
The Acoustic Sum Rule (ASR) and Acoustic Modes
For non-metallic systems at the gamma point (q=0), the frequencies of the three acoustic modes should be precisely zero, fulfilling the Acoustic Sum Rule. In practice, finite grid calculations lead to small violations [5]. Frequencies below 10 cm⁻¹ are typically acceptable, but values approaching 100 cm⁻¹ suggest problems. The ultimate test is to re-diagonalize the dynamical matrix using dynmat.x with the ASR imposed. If this yields acoustic modes with frequencies below 1 cm⁻¹, you can trust your other results [5].
The table below summarizes the primary parameters to test when troubleshooting negative frequencies.
| Parameter | Description & Impact | Typical Symptoms of Poor Convergence | Recommended Verification Steps |
|---|---|---|---|
ecutwfc / ecutrho |
Plane-wave kinetic energy cutoffs for wavefunctions/charge density [25] [8]. Too low values are a primary cause of bad frequencies [5]. | "Lousy" phonons, negative frequencies, gross ASR violations [5]. | Perform a dedicated convergence test for the total energy and forces in the SCF calculation before any phonon run [26]. |
| k-point Grid | Sampling of the Brillouin zone for the SCF calculation [25]. Convergence is slow for metals, especially with semicore states [5]. | Negative frequencies, particularly for metallic systems [5]. | Test increasingly dense grids until total energy and phonon frequencies stabilize. |
tr2_ph |
Convergence threshold for the self-consistency of the phonon calculation [10]. A threshold that is too large can yield bad frequencies [5]. | Phonon frequencies fail to converge, leading to inaccuracies. | Systematically lower tr2_ph (e.g., to 1.0d-14) and monitor the convergence of the dynamical matrix [2]. |
conv_thr |
Convergence threshold for the self-consistency of the initial SCF calculation [25]. | A structure that is not fully relaxed propagates errors to the phonon calculation. | Use a tight threshold (e.g., 1.0d-12 to 1.0d-16) in the pw.x relaxation and SCF calculations [2] [13]. |
Atomic Masses (amass) |
Masses of atomic species used to build the dynamical matrix [10]. Wrong masses yield wrong frequencies [5]. | All phonon frequencies are incorrectly scaled, though the force constants are valid [5]. | Verify the amass values in the ph.x input match those in the pseudopotential files. |
Follow this workflow to methodically identify and resolve the source of negative frequencies.
A poorly relaxed structure is a common source of instability [2].
calculation = 'vc-relax' in pw.x to optimize both atomic positions and lattice vectors.&IONS namelist, set forc_conv_thr to a stringent value (e.g., 1.0d-5 Ry/Bohr or ~0.00026 eV/Å). In the &ELECTRONS namelist, ensure conv_thr is tight (e.g., 1.0d-12 or lower) [2].Before running ph.x, you must establish a fully converged electronic ground state.
ecutwfc and ecutrho Convergence:
ecutwfc.ecutwfc. The value is sufficiently converged when the energy change is smaller than the conv_thr used in your production run.ecutrho = 4 * ecutwfc for norm-conserving pseudopotentials, or 8 * ecutwfc for ultrasoft pseudopotentials [8]. For higher accuracy in phonon calculations, consider using a higher cutoff than the minimum sufficient for energy convergence [13].k-point Grid Convergence:
8x8x8, 12x12x12, 16x16x16).smearing = 'gaussian' and degauss value) [5] [8].Once the SCF is robust, focus on the phonon calculation itself.
tr2_ph Threshold: This is the convergence threshold for the phonon self-consistent cycle [10]. If your pw.x conv_thr was 1.0d-12, try setting tr2_ph = 1.0d-14 for the phonon calculation [2].alpha_mix(niter) (the mixing factor) and increasing nmix_ph (the number of iterations used in potential mixing) to values between 8 and 20, which can speed up convergence at the cost of more memory [10].ph.x and the force constants with q2r.x, impose the ASR when generating the final dispersion with matdyn.x. In the matdyn.x input, use asr = 'crystal' or asr = 'simple' [2] [13].assume_isolated = '2D' in the &SYSTEM namelist of the initial pw.x calculation to correctly handle the long-range interactions and avoid imaginary acoustic frequencies near the gamma point [13].This table provides a quick reference for the key parameters discussed in this guide.
| Input File | Parameter | Function | Recommendation |
|---|---|---|---|
| pw.x | ecutwfc / ecutrho |
Kinetic energy cutoff for wavefunctions/charge density [25]. | Converge first with SCF calculations; use higher values for phonons [13]. |
conv_thr |
SCF convergence threshold for the electronic energy [25]. | Use a tight threshold (e.g., 1.0d-12). |
|
forc_conv_thr |
Convergence threshold for ionic forces during relaxation [25]. | Set to a stringent value (e.g., 1.0d-5 Ry/Bohr). |
|
k-point grid |
Defines sampling of the Brillouin zone [25]. | Test grids of increasing density until energy stabilizes. | |
| ph.x | tr2_ph |
SCF convergence threshold for the phonon calculation [10]. | Set lower than pw.x conv_thr (e.g., 1.0d-14). |
nq1, nq2, nq3 |
Defines the q-point grid for phonon calculations when ldisp=.true. [10]. |
Determines the mesh for calculating dynamical matrices. | |
nmix_ph |
Number of iterations used in potential mixing [10]. | Increase (8-20) to speed up convergence. | |
| matdyn.x | asr |
Applies the Acoustic Sum Rule to the force constants [2]. | Use 'crystal' or 'simple' to fix acoustic modes at Γ. |
My calculation stopped with "occupation numbers probably wrong." What should I do?
This warning appears for metallic or spin-polarized systems when the occupation type is not set to smearing. In your pw.x input, inside the &SYSTEM namelist, set occupations = 'smearing' and select an appropriate smearing function (e.g., smearing = 'gaussian') and a small broadening value (degauss) [5] [8].
I get "wrong degeneracy" or other symmetry-related errors. How can I fix them?
These errors often occur when atomic positions are almost, but not exactly, at high-symmetry positions. The solution is to define your system using the correct ibrav value (not 0) and, if known, use Wyckoff positions in the initial pw.x calculation. This ensures the code correctly identifies all symmetry operations [5].
After a calculation fails, ph.x cannot restart and gives errors about recover files. What is the solution?
This indicates corrupted restart files from the previous failed run. Remove all files named recover* in your outdir directory, and then restart the calculation [5].
For a 2D material, I get negative frequencies near the gamma point even after convergence. What else can I try?
Ensure you have set assume_isolated = '2D' in the &SYSTEM namelist of your pw.x input file. This is crucial for correctly handling the long-rangeelectrostatics in low-dimensional systems and often resolves issues with acoustic modes [13].
A technical guide for computational researchers tackling unstable phonon calculations
Negative frequencies (or imaginary frequencies) in Quantum ESPRESSO phonon calculations are not merely numerical noise; they are a fundamental indicator of a mechanical instability in your simulated structure. This means the atomic configuration you provided is not in a stable energy minimum, causing the phonon code to detect modes that lower the system's energy, which manifest as imaginary frequencies [5]. For researchers, especially in drug development where accurate biomolecular simulations are critical, this instability can invalidate subsequent property predictions.
The primary culprit is almost invariably inadequate structural relaxation [4] [5]. If the initial structure is not sufficiently relaxed—meaning the interatomic forces and internal stresses are not minimized to a tight enough threshold—the resulting "equilibrium" structure is not truly at equilibrium. When the phonon code (ph.x) constructs the dynamical matrix based on this pseudo-equilibrium state, it correctly identifies these residual instabilities [5]. Other contributing factors include insufficient SCF convergence criteria (conv_thr, tr2_ph), an inadequate plane-wave energy cutoff (ecutwfc, ecutrho), or a poorly converged k-point grid [5].
Before proceeding, confirm that the negative frequencies are an artifact of poor relaxation and not a real property of your system. Cross-check the following:
ph.x for a few high-symmetry q-points individually. If these show only positive frequencies, but the band structure from matdyn.x shows negatives, the problem likely lies with the force constants generated by q2r.x, pointing to a global relaxation issue [4].dynmat.x program to impose the ASR and see if the acoustic modes correct themselves.1. Tighten Relaxation Convergence Criteria
The most critical step is to ensure your initial structure is perfectly relaxed. For a vc-relax (variable cell relaxation) calculation, use the following pw.x input parameters as a starting point for a high-quality relaxation [4] [7]:
| Parameter | Recommended Value | Purpose |
|---|---|---|
forc_conv_thr |
1.0e-5 to 1.0e-4 Ry/Bohr | Convergence threshold for forces [7]. |
etot_conv_thr |
1.0e-6 to 1.0e-5 Ry | Convergence threshold for total energy [7]. |
conv_thr |
1.0e-8 to 1.0e-10 Ry | SCF cycle convergence threshold [7]. |
cell_dofree |
'ibrav' |
Allows cell to change shape according to its Bravais symmetry [7]. |
2. Optimize Key SCF and Phonon Parameters After a successful, tight relaxation, ensure the subsequent phonon calculation is also well-converged.
| Parameter | Recommended Value | Function |
|---|---|---|
ecutwfc / ecutrho |
Increase by 20-30% | Higher cutoff improves accuracy of energy and force calculations [5]. |
tr2_ph |
1.0e-14 | Stricter convergence for the phonon SCF calculation [4] [13]. |
k-point grid |
Use denser grid | Essential for metals and systems with complex Fermi surfaces [5]. |
3. Apply the Acoustic Sum Rule (ASR)
Always impose the ASR in both q2r.x and matdyn.x calculations to correct for small violations of translational invariance.
4. Address System-Specific Issues
assume_isolated = '2D' in the SYSTEM namelist of your pw.x input to correctly handle long-range interactions and prevent imaginary frequencies near the Gamma point [13].The following workflow diagram illustrates the integrated process of structural relaxation and phonon calculation, highlighting the critical steps to prevent negative frequencies.
Q1: My ph.x calculation had positive frequencies, but matdyn.x shows negative ones. Why?
This is a classic sign that the problem is with the overall force field, not a single q-point. The ph.x calculation on a discrete grid might be stable, but the Fourier interpolation performed by q2r.x and matdyn.x uses force constants from the entire grid. If the initial structure relaxation was inadequate, these force constants are inconsistent, leading to unphysical imaginary frequencies in the full phonon band structure [4].
Q2: How tight should the convergence criteria for relaxation be?
There is no one-size-fits-all answer, but for reliable phonons, aim for forc_conv_thr of 1.0e-5 Ry/Bohr or tighter, and an SCF conv_thr of 1.0e-8 to 1.0e-10 Ry [4] [7]. The system is considered relaxed when the maximum force on any atom is below forc_conv_thr.
Q3: I have a negative frequency only at the Gamma point. What should I do?
This is often an Acoustic Sum Rule (ASR) violation. First, ensure you are using asr = 'crystal' in your matdyn.x input. If the problem persists, it underscores that your structure is not perfectly relaxed. The ultimate test is to run dynmat.x to impose the ASR; if the acoustic modes then drop to nearly zero (< 1 cm⁻¹), you can trust the other modes, but should still improve the initial relaxation [5].
Q4: Are negative frequencies always a sign of a problem? Not necessarily. They can indicate a genuine structural instability, meaning the crystal structure you are simulating is metastable or unstable at the level of theory you are using (e.g., with GGA). It can suggest a phase transition. However, you must first rule out technical issues by following the troubleshooting steps above [5].
This table lists the key "research reagents"—the core computational tools and parameters—within the Quantum ESPRESSO ecosystem that are essential for successful structural relaxation and phonon analysis.
| Tool / Parameter | Function & Purpose |
|---|---|
pw.x |
The core plane-wave self-consistent field code used for structural relaxation (relax, vc-relax) and generating the ground-state electron density [13]. |
ph.x |
The phonon code using Density-Functional Perturbation Theory (DFPT) to calculate the dynamical matrix on a grid of q-points [13]. |
q2r.x |
Computes the interatomic force constants in real space by inverse Fourier transform of the dynamical matrices [13]. |
matdyn.x |
Calculates the phonon dispersion across any path in the Brillouin zone and the phonon density of states by Fourier transforming the force constants [13]. |
forc_conv_thr |
The primary tolerance in pw.x controlling structural relaxation quality; defines the target maximum residual force on any atom [7]. |
etot_conv_thr |
The tolerance for the total energy change between successive relaxation steps [7]. |
tr2_ph |
The convergence threshold for the self-consistency loop within the ph.x calculation [4] [13]. |
asr / zasr |
The Acoustic Sum Rule imposition in matdyn.x (asr) and q2r.x (zasr) to enforce zero frequency for acoustic modes at the Gamma point [4] [13]. |
By systematically applying these diagnostic and remediation strategies, you can transform the frustrating occurrence of negative frequencies from a dead-end error into a valuable guide for achieving truly high-quality, physically meaningful simulation results.
A technical guide for resolving pervasive symmetry and convergence challenges in Quantum ESPRESSO phonon calculations
Q1: What does the "wrong degeneracy" error mean and what causes it?
This error occurs during phonon calculations when the code detects that the degeneracy of phonon modes does not match what is expected from the crystal's symmetry operations. The root cause is almost invariably atomic positions that are close to, but not sufficiently close to, their exact symmetry positions [11] [5].
Even minute deviations—smaller than typical geometry optimization thresholds—can break the symmetry enough to trigger this error. Quantum ESPRESSO compares the rotated q-vector with the original with an acceptance tolerance of approximately 10⁻⁵ (set in PW/src/eqvect.f90). If your q-vector differs from a high-symmetry point by an amount on this order, the symmetry identification fails [5]. Using ibrav=0 (the free lattice parameter) exacerbates this problem because it doesn't enforce the intrinsic symmetry of your crystal system.
Q2: Why are my acoustic modes not zero at the Γ-point, and what is the Acoustic Sum Rule (ASR)?
The Acoustic Sum Rule embodies the translational invariance of the system, which requires that the sum of all atomic forces in any direction must be zero. In practice, this manifests as three phonon modes at the Γ-point (q=0) that should have zero frequency—the acoustic modes. When these frequencies are not zero, it indicates ASR violation due to numerical approximations in the calculation [11].
The primary source of this violation comes from the discreteness of the Fast Fourier Transform (FFT) grid [11]. The calculated frequency of the acoustic mode is typically less than 10 cm⁻¹, but in problematic cases can reach up to 100 cm⁻¹ [5]. This problem is generally more severe for GGA functionals than LDA because GGA functionals have more strongly varying forms, particularly in systems with significant vacuum portions [5].
Q3: What is the relationship between "negative frequencies" and these issues?
"Negative" frequencies (actually imaginary frequencies where ω² ≤ 0) can stem from multiple sources [11]:
Table: Troubleshooting Guide for Common Phonon Calculation Errors
| Error Symptom | Primary Causes | Diagnostic Steps |
|---|---|---|
"Wrong degeneracy" in star_q |
Atomic positions imperfectly symmetric; q-vector slightly off high-symmetry point [5] | Verify atomic positions against Wyckoff positions; check q-vector values |
| Non-zero acoustic modes | ASR violation from discrete FFT grid; insufficient convergence [11] [5] | Check convergence of FFT grid (ecutwfc, ecutrho); enforce ASR in post-processing |
| "Negative" (imaginary) frequencies | Insufficient convergence; real mechanical instability; ASR violation [11] [5] | Methodically tighten convergence parameters; verify with ASR correction |
| Mysterious symmetry-related errors | Using ibrav=0 with near-symmetric atomic positions [11] [5] |
Switch to correct ibrav value; use Wyckoff positions in SCF calculation |
ibrav value: Avoid ibrav=0 in your self-consistent calculation. Instead, specify the correct Bravais lattice type for your crystal [11] [5].dyn.Symmetrize() to impose symmetry and ASR on a calculated dynamical matrix [27].The ASR can be imposed during the post-processing stages using q2r.x and matdyn.x:
In q2r.x: Use the zasr variable with one of these options [28]:
'simple': Previous implementation correcting diagonal elements'crystal': 3 translational ASR via optimized correction (projection)'one-dim': 3 translational + 1 rotational ASR'zero-dim': 3 translational + 3 rotational ASRIn matdyn.x: Use the asr variable with similar options [14]:
'crystal': 3 translational ASR via optimized correction'all': 3 translational + 3 rotational ASR + 15 Huang conditions (requires write_lr=.true. in q2r.x and read_lr=.true. in matdyn.x for infrared-active solids) [14]For infrared-active solids: When using asr='all', ensure long-range force constants are handled properly by setting write_lr=.true. in q2r.x and read_lr=.true. in matdyn.x [14].
To prevent both ASR violations and spurious imaginary frequencies:
conv_thr to at least 1.0e-10 (from the typical 1.0e-6) to lower noise in forces [12].ecutwfc and ecutrho (typically ecutrho = 4-8 × ecutwfc for ultrasoft pseudopotentials) [5].tr2_ph to 1.0e-16 or lower for more accurate phonon calculations [12].
Phonon Calculation Troubleshooting Workflow
Table: Key Parameters for Resolving Symmetry and ASR Issues
| Parameter/Utility | Function | Recommended Settings |
|---|---|---|
ibrav |
Defines Bravais lattice type | Use specific value rather than 0 [11] [5] |
| Wyckoff positions | Atomic coordinates respecting symmetry | Use when known instead of free coordinates [11] [5] |
zasr (in q2r.x) |
Enforces ASR during IFC generation | 'crystal' for translations; 'one-dim'/'zero-dim' for rotations [28] |
asr (in matdyn.x) |
Enforces ASR during phonon interpolation | 'crystal' or 'all' (with Huang conditions) [14] |
conv_thr |
SCF convergence threshold | 1.0e-10 or tighter for forces [12] |
tr2_ph |
Phonon calculation convergence | 1.0e-16 or tighter [12] |
ecutwfc/ecutrho |
Plane-wave cutoffs | Systematically converged; higher values reduce ASR violation [5] |
dyn.Symmetrize() |
Python function to impose symmetry/ASR | Use on dynamical matrices from output [27] |
For metallic systems: Convergence with respect to k-point grid and smearing is notoriously slow when semicore states are present, particularly for phonon wave-vectors not commensurate with the k-point grid [5]. Additionally, the current implementation of electron-phonon coefficients works for metals only, not insulators [11].
For infrared-active solids: When enforcing the complete ASR with Huang conditions (asr='all'), you must enable the handling of long-range force constants by setting write_lr=.true. in q2r.x and read_lr=.true. in matdyn.x [14]. This ensures proper treatment of the non-analytical part that contributes to LO-TO splitting.
Low-symmetry crystals: To obtain q=0 results for different directions, specify twice q=0 in the q-point list [14]. The direction q̂ (as q→0) for the non-analytic part is extracted from the sequence of q-points as q̂ = q(n) - q(n-1) or q̂ = q(n) - q(n+1) [14].
Successfully addressing symmetry and precision issues requires methodical parameter convergence and appropriate use of symmetry enforcement tools. By implementing these protocols, researchers can distinguish genuine physical instabilities from numerical artifacts, laying the foundation for reliable lattice dynamics calculations in materials research.
A fundamental challenge in computational materials science, particularly within density-functional perturbation theory (DFPT) calculations using Quantum ESPRESSO's ph.x, is the occurrence of unphysical negative frequencies (imaginary phonon modes) in phonon dispersion spectra. These results signal a mechanical instability in the chosen structure under the employed computational parameters [5] [2]. For researchers investigating low-dimensional materials like 2D systems (e.g., monolayers, surfaces), this problem is especially prevalent near the gamma point (Γ) due to violations of the Acoustic Sum Rule (ASR) and inadequate treatment of long-range electrostatics in non-periodic dimensions [5] [29] [13]. This guide provides targeted troubleshooting and methodologies to systematically resolve these issues, ensuring physically meaningful phonon calculations essential for predicting material properties and stability.
Q1: My ph.x calculation stops with errors about reading files or recover files. What should I do?
pw.x calculation or corrupted restart files.
pw.x is complete and was generated by a compatible version of the code. Verify that your outdir and prefix variables in the ph.x input correctly point to the SCF calculation results [5].recover* in your specified outdir directory and restart the calculation [5].Q2: ph.x reports "occupation numbers probably wrong" and continues. Is this a problem?
smearing. While the calculation may continue, it is not recommended to ignore this. For such systems, you should set occupations = 'smearing' in the pw.x input file to ensure proper treatment of partial occupancies [5].Q3: Why are my acoustic modes at Γ not exactly zero, and when should I worry?
dynmat.x while imposing the ASR. If this yields an acoustic mode with ω < 1 cm⁻¹ and leaves other modes unchanged, your results are trustworthy [5].Q4: My phonons are completely wrong, with severe negative frequencies, wrong symmetries, or gross ASR violations. What went wrong?
vc-relax) is converged with tight thresholds for forces (forc_conv_thr) and total energy (etot_conv_thr) [2].conv_thr in pw.x) or phonon (tr2_ph in ph.x) calculations might be too large. Try reducing them (e.g., tr2_ph=1.0d-14) [5] [2] [13].ecutwfc) and, crucially, for charge density (ecutrho) might be too low. Increasing ecutrho (often 4-8 times ecutwfc) can help [5].amass) in the ph.x input will directly lead to wrong frequencies [5].Q5: What is the Acoustic Sum Rule (ASR), and which scheme should I use for my system?
The table below summarizes the common ASR schemes and their applications:
Table: Acoustic Sum Rule (ASR) Schemes in Quantum ESPRESSO
| Scheme | Keyword | System Type | Description |
|---|---|---|---|
| No Correction | 'no' |
Testing | Applies no correction. Not recommended for production. |
| Simple 1D-3D | 'simple' |
Isotropic 3D crystals | Applies a universal correction. Good for standard 3D materials. |
| Crystal | 'crystal' |
Anisotropic crystals | Respects the crystalline symmetry. Recommended for most bulk systems. [2] [13] |
| 2D Crystal | '2D' |
2D materials (e.g., graphene, hBN) | Applies the sum rule only in the plane of the material. Essential for 2D systems. [13] |
These schemes are applied in q2r.x (via zasr) and/or matdyn.x (via asr).
Q6: I am calculating phonons for a 2D material (like graphene or MoS₂). What special settings are required to avoid negative frequencies?
pw.x for SCF: You must set assume_isolated = '2D' in the SYSTEM namelist. This activates a different Poisson solver that correctly handles the non-periodic (Z) direction, which is crucial for avoiding unphysical interactions between periodic images. This is often the most critical step for fixing imaginary acoustic modes in 2D systems [13].ph.x: No special change is needed beyond ensuring a well-converged calculation.q2r.x and matdyn.x: Apply the appropriate 2D ASR. Set zasr = '2D' in q2r.x and asr = '2D' in matdyn.x [13].Q7: I get "Wrong degeneracy" or other symmetry-related errors. How can I fix them?
ibrav value in your pw.x input instead of ibrav=0.The phonon dispersion from matdyn.x still shows small imaginary frequencies after applying ASR. Is my structure unstable?
Can I use Grimme's DFT-D3 dispersion correction with phonon calculations?
d3hess.x [2].How important is convergence in the initial SCF calculation for accurate phonons?
conv_thr = 1.0d-12 or lower in pw.x) and a higher plane-wave cutoff (ecutwfc and ecutrho) is highly recommended for phonon calculations compared to a simple single-point energy calculation [5] [13].My calculation is running very slowly. What parameters can I adjust?
ph.x. Setting nmix_ph = 8 (or higher) can significantly speed up convergence at the cost of slightly higher memory usage. Adjusting alpha_mix can also help [10].This workflow outlines the standard steps for a robust phonon calculation in bulk systems.
Diagram: Standard Phonon Calculation Workflow for 3D Bulk Materials
Geometry Optimization (pw.x):
calculation = 'vc-relax').forc_conv_thr = 1.0d-4 Ry/bohr and etot_conv_thr = 1.0d-5 Ry.SCF Calculation (pw.x):
calculation = 'scf'.ecutwfc, ecutrho) than those used for a simple energy calculation [13].conv_thr = 1.0d-12 or tighter.Phonon Calculation (ph.x):
Q to R Fourier Transform (q2r.x):
Phonon Dispersion (matdyn.x):
flfrc.asr = 'crystal' to be consistent with q2r.x.q_in_band_form = .true..flfrq) and, optionally, the eigenvectors (flvec).This protocol modifies the standard workflow to correctly handle the unique electrostatics of 2D systems.
Diagram: Modified Workflow for 2D Materials Highlighting Critical Settings
The key differences from the 3D protocol are:
pw.x (SCF): The SYSTEM namelist must include assume_isolated = '2D' to employ a Poisson solver tailored for slab-like geometries [29] [13].q2r.x: The ASR must be set to the 2D variant: zasr = '2D' [13].matdyn.x: Similarly, the ASR is set to asr = '2D' [13].Table: Key Input Parameters for Fixing Negative Frequencies in ph.x Calculations
| Input Parameter | Program | Function | Recommended Value for Troubleshooting |
|---|---|---|---|
assume_isolated |
pw.x |
Corrects long-range electrostatics for 0D, 1D, and 2D systems. Set to '2D' for monolayers and surfaces. |
'2D' |
asr / zasr |
matdyn.x / q2r.x |
Applies Acoustic Sum Rule to enforce zero acoustic modes at Γ. Choice depends on system dimensionality. | 'crystal' (3D), '2D' (2D) |
tr2_ph |
ph.x |
Convergence threshold for the phonon self-consistent cycle. Tighter thresholds improve accuracy. | 1.0d-14 [2] [13] |
conv_thr |
pw.x |
Convergence threshold for the electronic SCF cycle. A tighter threshold is crucial for accurate forces. | 1.0d-12 or lower |
ecutwfc / ecutrho |
pw.x |
Plane-wave kinetic energy cutoffs. Higher values improve basis set completeness, critical for phonons. | Increase by 20-30% from standard values [5] |
nmix_ph |
ph.x |
Number of iterations for potential mixing. A higher value can significantly speed up convergence. | 8 (default is 4) [10] |
forc_conv_thr |
pw.x |
Force convergence threshold in geometry optimization. Ensures the initial structure is truly stable. | 1.0d-4 Ry/bohr or tighter [2] |
What does a "negative frequency" in my phonon calculation mean? A negative frequency, more accurately an imaginary frequency, indicates a dynamical instability in the calculated structure. This means the atomic configuration you started with is not a true local minimum on the potential energy surface and may undergo a phase transition to a more stable structure [2].
My calculation was running, but now ph.x has stopped. What should I check?
First, verify that the data file produced by your preceding pw.x calculation is good, complete, and was generated by a compatible version of the code. An incomplete or corrupted data file is a common cause for ph.x to stop with an error [5].
Can I perform a phonon calculation at just the Gamma-point? Yes, you can calculate phonons at the Gamma-point only using Density Functional Perturbation Theory (DFPT). This is perfectly reasonable for studying specific properties like Raman spectra. However, if you need phonon dispersions or properties at other q-points, you must converge your calculations with respect to a full q-point grid [15].
Why are my acoustic modes at the Gamma-point not exactly zero?
A small, non-zero frequency (typically <10 cm⁻¹) for acoustic modes at Γ is normal and results from the Acoustic Sum Rule (ASR) not being exactly verified due to the discrete real-space grid used in the calculation. You can diagonalize the dynamical matrix with dynmat.x while imposing the ASR to obtain corrected, near-zero frequencies [5].
Problem: The phonon calculation completes but yields negative frequencies, frequencies with wrong symmetries, or gross Acoustic Sum Rule violations [5] [2].
| Troubleshooting Step | Action and Purpose |
|---|---|
| Verify Structural Relaxation | Ensure the atomic structure is fully relaxed to the ground state. A poor or incomplete relaxation (e.g., residual forces or stresses) is a primary cause of imaginary frequencies. Re-run vc-relax with tight convergence thresholds (forc_conv_thr, etot_conv_thr) [2]. |
| Check Convergence Parameters | Systematically tighten key convergence parameters in both the SCF (pw.x) and phonon (ph.x) calculations. The table below provides a starting point for investigation [5] [2]. |
| Inspect Pseudopotentials | Ensure all pseudopotentials are generated using the same flavor of Density Functional Theory (DFT). Using inconsistent pseudopotentials can cause the code to stop [17]. |
| Apply Acoustic Sum Rule | Impose the ASR in post-processing (e.g., in q2r.x or matdyn.x using asr='crystal') to correct the acoustic modes at the Gamma point [2]. |
Problem: The code issues a warning about occupation numbers and continues. This typically occurs in metallic or spin-polarized systems [5].
pw.x input, set occupations='smearing' and choose an appropriate smearing function (e.g., 'gaussian' or 'mv'). Avoid using occupations='fixed' for metallic systems [17] [5].Problem: Errors related to symmetry operations occur [5].
pw.x input, define the Bravais lattice using the correct ibrav value instead of ibrav=0.Before concluding a structure is unstable, methodically check the convergence of these parameters. The following table summarizes key parameters to test, drawing from a real example of troubleshooting monolayer InSe [2].
| Parameter | Description | Function in Calculation | Investigative Range |
|---|---|---|---|
ecutwfc |
Plane-wave kinetic energy cutoff for wavefunctions. | Determines the basis set size and computational cost. | Increase incrementally (e.g., from 60 Ry to 80 Ry). |
ecutrho |
Cutoff for charge density and potential (often 4x or 8x ecutwfc). |
Critical for ultrasoft pseudopotentials (USPP) and PAW. | Ensure it is a sufficient multiple of ecutwfc (e.g., 240 Ry to 480 Ry) [2]. |
| k-point Grid | Grid of points in the Brillouin zone for electronic integration. | Samples electron states; crucial for metals. | Use a denser grid (e.g., from 12x12x1 to 24x24x1 for 2D) [2]. |
| q-point Grid | Grid for phonon calculation in the Brillouin zone. | Samples phonon wavevectors. | Test convergence with a denser grid (e.g., 8x8x1) [15]. |
conv_thr |
Convergence threshold for the SCF cycle. | Stops the electronic minimization when energy change is below this value. | Tighten significantly (e.g., from 1.0e-6 to 1.0e-12 or 1.0e-16) [2]. |
tr2_ph |
Convergence threshold for the phonon calculation. | Stops the phonon self-consistency cycle. | Tighten (e.g., to 1.0e-14 or lower) [2]. |
mixing_beta |
Mixing parameter for SCF charge density. | Aids convergence of difficult SCF calculations. | Adjust if SCF is not converging (e.g., 0.2 to 0.7) [2]. |
The following input blocks are adapted from a published case study on monolayer InSe, which encountered negative frequencies. Use them as a reference for structuring your own calculations [2].
Sample pw.x Input (SCF Calculation)
Atomic species and positions follow as in the original input file [2].
Sample ph.x Input
| Item | Function in Calculation |
|---|---|
| Pseudopotentials | Replace the core electrons of an atom with a potential, simplifying the calculation while retaining chemical accuracy. All pseudopotentials in a single calculation must be generated using the same DFT functional [17]. |
| Acoustic Sum Rule (ASR) | A physical rule requiring the frequencies of acoustic modes at the Gamma point (q=0) to be zero. It can be imposed in post-processing (e.g., in q2r.x or matdyn.x) to correct small numerical errors [5] [2]. |
| Density Functional Perturbation Theory (DFPT) | The mathematical framework used by ph.x to compute phonon frequencies and other response properties by considering the linear response of the electronic system to a displacement perturbation [15]. |
| k-points and q-points | k-points: Sample the electronic Brillouin zone in the SCF calculation. q-points: Sample the phonon Brillouin zone. Both grids must be converged for accurate results [15]. |
| Smearing Functions | (e.g., Gaussian, Marzari-Vanderbilt) A technique to assign partial occupations to electron states near the Fermi level, which is essential for achieving SCF convergence in metallic systems [17]. |
The following diagram outlines a systematic workflow for diagnosing and fixing negative phonon frequencies.
A technical guide for Quantum ESPRESSO users troubleshooting phonon calculations
Problem: After a ph.x calculation, the acoustic modes at the gamma point (q=0) do not exhibit zero frequency, which is expected due to the system's translational invariance. This indicates a violation of the Acoustic Sum Rule (ASR).
Solution: The dynmat.x tool can be used to re-diagonalize the dynamical matrix while imposing different types of ASR, which can force the acoustic modes to zero frequency. The ultimate test is to diagonalize the dynamical matrix with dynmat.x, imposing the ASR. If you obtain an acoustic mode with a much smaller ω (let us say < 1cm⁻¹) with all other modes virtually unchanged, you can trust your results [5].
The dynmat.x program reads a dynamical matrix file produced by the phonon code, can apply a chosen Acoustic Sum Rule, and diagonalizes the dynamical matrix [30].
The key to fixing the acoustic modes lies in the &INPUT namelist of the dynmat.x input file. Critical variables for ASR include [30]:
| Parameter | Type | Default | Description & Allowed Values |
|---|---|---|---|
fildyn |
Character | 'matdyn' | Input file containing the dynamical matrix (e.g., 'prefix.dyn' from ph.x). |
asr |
Character | 'no' | Type of Acoustic Sum Rule: 'no', 'simple' (3 translational ASR), 'crystal' (3 translational, optimized), 'one-dim' (3 trans. + 1 rotational), 'zero-dim' (3 trans. + 3 rotational). |
axis |
Integer | 3 | For 1D systems (asr='one-dim'), indicates the rotation axis (1=Ox, 2=Oy, 3=Oz). |
This example, from a user calculating a one-dimensional system (silicon nanowire), applies a one-dimensional ASR including rotational invariance around the x-axis [31].
The choice of ASR depends on the dimensionality of your system. The following table summarizes the options [30] [32]:
ASR Type (asr parameter) |
Translational ASR | Rotational ASR | Recommended Use |
|---|---|---|---|
'no' |
No | No | Testing purposes only. |
'simple' |
Yes (3) | No | Bulk, 3D periodic systems. Corrects diagonal elements. |
'crystal' |
Yes (3) | No | Bulk crystals. Uses an optimized correction (projection). |
'one-dim' |
Yes (3) | Yes (1) | 1D systems (nanowires, nanotubes). Axis set by axis parameter. |
'zero-dim' |
Yes (3) | Yes (3) | 0D systems (molecules, clusters). |
The following diagram illustrates the recommended workflow to diagnose and correct acoustic sum rule violations in your phonon calculations, positioning dynmat.x as a verification and correction tool.
| Item | Function in Experiment | Technical Specification |
|---|---|---|
| Dynamical Matrix File | Primary input for dynmat.x. Contains the force constants from the ph.x DFPT calculation. |
Specified via fildyn parameter (e.g., 'prefix.dyn' or 'prefix.dyn1' for Gamma-point) [30]. |
| ASR Type | Determines the mathematical correction applied to enforce translational/rotational invariance. | Choose from 'simple', 'crystal', 'one-dim', or 'zero-dim' via the asr parameter [30]. |
Atomic Masses (amass) |
Critical for correct frequency calculation. Masses are used when diagonalizing the dynamical matrix. | Must be specified in atomic mass units for each atom type. Should match values used in ph.x [30]. |
Q-direction (q) |
Defines the direction for calculating non-analytical contributions (LO-TO splitting) along a specific Cartesian direction. | A real vector q(1), q(2), q(3). Required for proper treatment of longitudinal and transverse optical modes [30] [33]. |
Q1: My dynmat.x calculation fixed the acoustic modes, but matdyn.x still shows negative frequencies at gamma. Why? [31]
A: This is a known phenomenon, especially in low-dimensional systems. While dynmat.x diagonalizes the dynamical matrix from ph.x directly and can perfectly impose the ASR for that specific point, matdyn.x performs a Fourier interpolation of force constants from q2r.x to get the dynamical matrix at any q-point. Small numerical inaccuracies in the force constants can be amplified during this interpolation, leading to residual ASR violations and negative frequencies at interpolated q-points, including gamma. Using the same, appropriate asr keyword in both dynmat.x and matdyn.x/q2r.x inputs is crucial for consistency.
Q2: What if imposing the ASR with dynmat.x does not fix my negative frequencies, or they are large and not just near the gamma point? [5]
A: Large or persistent negative frequencies (imaginary frequencies) often signal a deeper problem beyond mere ASR violation. This can indicate a mechanical instability in your simulated structure. You should check:
vc-relax in pw.x) with tight convergence thresholds for forces and stresses [2].pw.x) and phonon (ph.x) calculations (e.g., conv_thr = 1.0d-12 or lower in pw.x, tr2_ph = 1.0d-14 or lower in ph.x) [2] [34].ecutwfc, ecutrho) and k-point grid are sufficiently dense [5].assume_isolated = '2D' in the SYSTEM namelist of your pw.x input to avoid spurious interactions between periodic images [13].dynmat.x tool is essential for verifying and enforcing the Acoustic Sum Rule (ASR) in phonon calculations, particularly for correcting non-zero acoustic modes at the gamma point [30] [5].asr parameter tailored to system dimensionality, accurate atomic masses, and correct dynamical matrix file reference [30].dynmat.x ASR application, with other modes remaining unchanged, validates the underlying phonon calculation [5].dynmat.x can correct ASR violations, persistent large negative frequencies often indicate fundamental issues like inadequate structure relaxation or poor convergence that require addressing at the pw.x or ph.x level [2] [5].What is the most common cause of negative frequencies in ph.x calculations?
Negative frequencies often indicate a mechanical instability in the calculated structure. The most common causes are your structure not being sufficiently relaxed or an issue with the choice of exchange-correlation functional (LDA vs. GGA) [5] [4]. It is critical to first ensure your structure is fully optimized with tight convergence criteria for forces and energies before starting a phonon calculation.
My ph.x calculation finished with positive frequencies, but matdyn.x shows negative frequencies in the band structure. Why?
This discrepancy can arise from how the force constants are interpolated between q-points. While the dynamical matrices calculated directly by ph.x at specific q-points may be fine, the process of generating the force constant file (q2r.x) and interpolating to new q-points (matdyn.x) can introduce instabilities if the initial supercell used for the q-grid was too small, or if the Acoustic Sum Rule (ASR) is not properly imposed in all steps [5] [4]. Ensure you use the same ASR (e.g., zasr='crystal') in both q2r.x and matdyn.x inputs.
How do LDA and GGA typically differ in predicting phonon frequencies? Generally, GGA functionals tend to produce lattice constants that are slightly larger and more accurate than LDA, which typically over-binds and underestimates them. This directly impacts the calculated phonon spectra. While both can sometimes underestimate phonon frequencies, GGA often leads to a systematic underestimation of bulk moduli and phonon frequencies compared to LDA [35]. In some cases, such as for rutile TiO₂, GGA is known to predict unstable (negative) phonons where LDA does not, indicating a genuine sensitivity of the predicted ground state to the functional [4].
The ground-state structure from your pw.x calculation is the foundation for phonons. If it is not fully relaxed, the forces on atoms will not be zero, leading to imaginary phonons.
pw.x) with tighter convergence thresholds.forc_conv_thr = 1.0d-5 (Ry/bohr)etot_conv_thr = 1.0d-8 (Ry)The ASR states that the sum of all atomic forces in a unit cell must be zero, which guarantees that acoustic phonons have zero energy at the gamma point. Numerical errors can break this invariance.
q2r.x input, add: zasr = 'crystal'matdyn.x input, add: asr = 'crystal'dynmat.x to diagonalize the dynamical matrix with the imposed ASR to verify the results [5].Insufficient convergence in either the self-consistent field (SCF) cycle of the ground state or the iterative solution in ph.x can lead to inaccurate forces and dynamical matrices.
pw.x): conv_thr = 1.0d-11 (Ry)ph.x): tr2_ph = 1.0d-14For metallic systems, convergence is notoriously slow. Using a coarse k-point grid or inappropriate smearing can cause problems.
pw.x input, use: occupations = 'smearing' and choose a smearing (e.g., smearing = 'gaussian') with a suitable degauss value.The choice between LDA and GGA can be decisive. If your system is known to have instabilities with one functional, switching may be necessary.
The table below summarizes general trends and performance characteristics of LDA and GGA in predicting properties relevant to phonon calculations, based on documented studies [37] [35].
| Property | LDA (Local Density Approximation) | GGA (Generalized Gradient Approximation) | Experimental Reference & Notes |
|---|---|---|---|
| Lattice Constant | Typically underestimated (over-binding) [35] | Generally more accurate or slightly overestimated [35] | For NaI, exp. ~6.47 Å; LDA ~6.39 Å; GGA ~6.59 Å [37] |
| Bulk Modulus | Typically overestimated [35] | Often underestimated [35] | Softer lattices in GGA contribute to lower phonon frequencies. |
| Cohesive Energy | Overestimated [35] | Closer to experimental values [35] | GGA total energies are generally more accurate. |
| Phonon Frequencies | Often overestimated (stiffer bonds) | Often underestimated (softer bonds) [35] | For Si, GGA (PW) underestimates frequencies vs. LDA and experiment [35]. |
| Structural Stability | Can incorrectly stabilize some phases | Can predict instabilities (negative frequencies) where LDA does not [4] | E.g., Rutile TiO2 phonons are unstable with GGA but not LDA [4]. |
This protocol provides a step-by-step methodology for a systematic comparison of LDA and GGA performance in predicting phonon properties for a material like Sodium Iodide (NaI) [37].
1. Computational Setup
ph.x for phonons) [37].2. Ground-State Self-Consistent Field (SCF) Calculation
pw.x):
calculation = 'scf'ecutwfc = 50 (Ry) /* Convergence testing required /ecutrho = 400 (Ry) / Often 8-10 x ecutwfc /occupations = 'smearing' / Critical for metals /smearing = 'gaussian'degauss = 0.01 (Ry)conv_thr = 1.0d-11 (Ry)forc_conv_thr = 1.0d-5 (Ry/bohr) / For relaxation /etot_conv_thr = 1.0d-8 (Ry) / For relaxation */3. Structural Relaxation
pw.x):
calculation = 'vc-relax' /* For full cell and ionic relaxation */4. Phonon Calculation via DFPT
ph.x):
tr2_ph = 1.0d-14ldisp = .true.nq1 = 4, nq2 = 4, nq3 = 4 /* Set a suitable q-grid */outdir = './'fildyn = 'prefix.dyn'5. Post-Processing for Phonon Dispersion
q2r.x to create the force constant file from the dynamical matrices. Input: &INPUT fildyn='prefix.dyn' flfrc='prefix.fc' zasr='crystal' /matdyn.x to calculate frequencies along a path. Input: &INPUT asr='crystal' flfrc='prefix.fc' flfrq='prefix.freq' flvec='prefix.modes' /6. Data Analysis and Comparison
| Tool / Reagent | Function in Experiment |
|---|---|
| Quantum ESPRESSo Suite | Integrated suite of open-source computer codes for electronic-structure calculations and materials modeling at the nanoscale. Core components are pw.x (SCF/relax) and ph.x (phonons) [37]. |
| Norm-Conserving Pseudopotentials | A type of pseudopotential that preserves the charge density outside the core region. Used to represent the core electrons, making plane-wave DFT calculations computationally feasible [37]. |
| PBE-GGA Functional | A specific and very popular parameterization of the GGA functional. Often used as a standard for comparison against LDA [37]. |
| XCrysDen | A program for visualizing crystal structures and densities. Useful for visualizing your input structure and verifying atomic positions [37]. |
dynmat.x Code |
A tool in the Quantum ESPRESSO distribution used to diagonalize the dynamical matrix and analyze phonon modes, with the option to impose the Acoustic Sum Rule (ASR) post-calculation [5]. |
The diagram below outlines the critical steps for performing and troubleshooting a phonon calculation, highlighting key decision points for dealing with negative frequencies.
What does an imaginary frequency in my phonon calculation mean?
An imaginary frequency (often reported as a negative value in output files) indicates that your system is dynamically unstable at the calculated level of theory [5] [38]. Mathematically, it arises from a negative eigenvalue of the dynamical matrix, which corresponds to a direction in the potential energy surface where the energy decreases, not increases [38]. This can be either a computational artifact or the signature of a genuine soft mode.
My ph.x calculation had positive frequencies, but matdyn.x shows imaginary ones. Why?
This discrepancy often points to issues with the interpolation process [4]. The ph.x program calculates the dynamical matrix on a discrete grid of q-points. The q2r.x and matdyn.x programs then use these to build a real-space force constant matrix and interpolate it to any q-point for the band structure. If the original q-point grid in the ph.x calculation is too coarse, the interpolation can introduce inaccuracies that manifest as imaginary frequencies, even if the frequencies at the calculated points were real [4] [13].
How can I distinguish a computational error from a real soft mode?
A systematic approach is needed to distinguish between them. The table below outlines common causes and their solutions.
| Cause | Description | Solution |
|---|---|---|
| Insufficient Structural Relaxation | The atomic positions, cell volume, and shape are not at a true energy minimum, so forces or stresses remain [4]. | Tighten convergence criteria in the pw.x relaxation (forc_conv_thr, etot_conv_thr) [4]. |
| Poor SCF Convergence | The self-consistent field (SCF) calculation for the ground-state electron density is not fully converged [5]. | Reduce conv_thr in the pw.x input and increase tr2_ph in the ph.x input [5]. |
| Insufficient k-points or q-points | The sampling of the Brillouin zone is too sparse, failing to capture the electronic or vibrational structure accurately [5]. | Use a denser k-point grid in the pw.x SCF calculation and a denser q-point grid (nq1, nq2, nq3) in the ph.x calculation [4] [13]. |
| Inadequate Plane-Wave Cutoff | The energy cutoffs (ecutwfc, ecutrho) are too low, leading to an inaccurate description of the wavefunctions and charge density [5]. |
Systematically increase ecutwfc and ecutrho until total energy and phonon frequencies converge. |
What does "following the imaginary mode" mean in practice?
It is a systematic procedure to find a lower-energy structure. The eigenvector of the dynamical matrix associated with the imaginary phonon describes the pattern of atomic displacements that lowers the energy. You "follow" this mode by:
S_α = S_reference + α * U_mode [38].S_α using pw.x. Plotting energy versus α will reveal a potential well, and the minimum of this well corresponds to the new, lower-symmetry, stable structure [38].Step 1: Verify and Improve the Initial Structure
A structurally sound input is the most critical factor for obtaining physically meaningful phonons.
pw.x vc-relax or relax) with tighter convergence thresholds. For example, set forc_conv_thr to 1.0d-5 Ry/Bohr or lower and etot_conv_thr to 1.0d-6 Ry or lower [4].assume_isolated = '2D' in the SYSTEM namelist of your pw.x input to correctly handle the long-range Coulomb interactions and prevent spurious imaginary acoustic modes [13].Step 2: Ensure Computational Parameters are Converged
Inaccurate computational parameters are a common source of unphysical instabilities.
ecutwfc and ecutrho) and the k-point grid. Phonon properties often require higher cutoffs than those needed for ground-state energy convergence [5] [13].ph.x input, use a denser q-point grid by increasing nq1, nq2, and nq3. A 4x4x4 grid is often a minimum starting point for simple systems, with 6x6x6 or 8x8x8 being more reliable [4] [13].pw.x) and phonon (ph.x) calculations. In your pw.x input, set conv_thr = 1.0d-10 or lower. In your ph.x input, set tr2_ph = 1.0d-14 or lower [4] [5].Step 3: Apply the Acoustic Sum Rule (ASR)
The ASR ensures that the frequencies of the three acoustic modes at the Brillouin zone center (Γ-point) are exactly zero, a consequence of translational invariance.
q2r.x and matdyn.x have an asr (or zasr) input flag. Apply the 'crystal' ASR to clean up small imaginary frequencies in the acoustic modes [4] [13]. If you have imaginary frequencies only for the acoustic modes at Gamma and they are small (e.g., < 20 cm⁻¹), applying the ASR is usually sufficient [5].
The Rutile Computational Problem
A user on the Matter Modeling Stack Exchange reported a classic problem: their ph.x calculation for rutile showed positive frequencies at computed q-points, but the interpolated band structure from matdyn.x contained negative frequencies [4]. This is a strong indicator of an interpolation error due to an insufficiently coarse q-point grid in the initial DFPT calculation. The solution was to re-run the ph.x calculation with a denser grid (nq1=6, nq2=6, nq3=6 or higher) to capture the force constants more accurately before interpolation [4] [13].
Genuine Soft Mode in High-Pressure Ice
A study of high-pressure ice phases (VII, VIII, and X) provides a clear example of a physically real soft mode [39]. Theoretical calculations using classical molecular dynamics failed to reproduce the experimentally observed phase transition from proton-ordered ice VIII to proton-disordered ice VII at ~60 GPa and 200 K. However, when nuclear quantum effects (proton tunneling and zero-point motion) were included via ab initio path-integral molecular dynamics (PIMD), the calculations successfully showed the transition [39]. The "softening" of the potential energy barrier, driven by quantum tunneling, was the physical origin of the instability. In this case, the imaginary mode (if calculated in the higher-symmetry phase) pointed directly to a real, physically meaningful phase transition.
| Research Reagent / Computational Tool | Function / Explanation |
|---|---|
ph.x |
The main Quantum ESPRESSO program for calculating phonons using Density Functional Perturbation Theory (DFPT) [13]. |
q2r.x |
Computes the interatomic force constants in real space by performing an inverse Fourier transform of the dynamical matrices generated by ph.x [4] [13]. |
matdyn.x |
Calculates the phonon dispersion across the entire Brillouin zone by Fourier interpolating the real-space force constants [4] [13]. |
| Acoustic Sum Rule (ASR) | A constraint applied in q2r.x (zasr) or matdyn.x (asr) to enforce zero frequency for acoustic modes at Γ, fixing small errors from finite grid effects [4] [5] [13]. |
| Eigenvector of Imaginary Mode | The atomic displacement pattern associated with a soft mode; used to "follow" the mode to a lower-energy structure [38]. |
| Path-Integral Molecular Dynamics (PIMD) | A simulation method that incorporates nuclear quantum effects, essential for correctly modeling phase transitions in systems with light atoms like hydrogen [39]. |
Successfully resolving negative phonon frequencies in Quantum ESPRESSO requires a multifaceted approach that combines rigorous computational methodology with careful physical interpretation. By systematically addressing convergence parameters, structural relaxation quality, and appropriate application of sum rules, researchers can distinguish numerical artifacts from genuine physical instabilities. The implementation of robust validation protocols ensures reliable phonon spectra that accurately represent material properties. Mastering these techniques enables confident prediction of dynamical stability and lattice vibrational properties, providing crucial insights for materials design and drug development applications where understanding molecular interactions and stability is paramount. Future directions include leveraging improved exchange-correlation functionals, advanced solvation models for biological systems, and machine learning approaches to accelerate convergence in complex molecular simulations.