You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently developing my research topic on phase transitions based on the SSCHA 2026 school tutorials (namely Lecture2 and Hands-on-session2). But when I performed the CONFIGS convergence test, the job terminated with the following warning:
RuntimeWarning: invalid value encountered in sqrt a[:] = np.sqrt(1.0 / (2.0 * w))
I suspect that minimizer.run() generated imaginary phonon frequencies, which caused the calculation to fail.
To investigate this, I debugged the script and confirmed that imaginary frequencies were indeed present after minimizer.run() by adding w_check, _ = minimizer.dyn.DiagonalizeSupercell() if np.any(w_check <= 0): print(f"[Warning] {nconf} configs has negative frequencies: {w_check[w_check<=0]}") # Save the refined auxiliary dynamical matrix refined_prefix = os.path.join(OUTPUT_DIR, f"refined_dyn_{nconf}_") minimizer.dyn.save_qe(refined_prefix)
I tried to explicitly force the use of minimizer.dyn.ForcePositiveDefinite() and minimizer.dyn.Symmetrize() after the minimizer.run() and run the script again, but nothing changed.
Why is this happening? I expected ForcePositiveDefinite() to eliminate the imaginary modes. Is there something I might be missing, or is there a recommended way to resolve this issue? Any suggestions would be greatly appreciated.
Hi, it seems very strange.
I suspect the error is not due to imaginary frequencies, in this case it should be written very clearly in the output. The check you are doing on imaginary frequency can just spot a very slightly imaginary part on acoustic modes, that is completely normal and not an issue (even after imposing the ASR). Check the frequencies of the final dynamical matrix inspecting them: where are these imaginary modes? If the code crashes, there should be an error (not just a warning). What is the error? If it crashes without errors, the most likely cause is that you just run out of memory for computing the hessian. Does the terminal says that the process has been killed?
Hi, so there are no imaginary frequencies, those very small are the translational modes that should be exactly zero, their small numerical noise is completely normal and they are neglected by the code.
You should report the full stdout/stderr to have an insight of where the code stops.
The memory requirement does not depend on the number of configurations, but on the number of atoms in the supercell. How many atoms do you have and what is the size of the q mesh? From there we can estimate the memory requirements of the job to see if that is the problem. Other possibility is that the job is killed due to time? If any other error occurs, you should have a tracecall with the error produced by the code.
I understand that the memory requirement correlates with the number of atoms and the q-point grid density.
Now, I have tested a case with a reduced q-mesh; however, no significant improvement was observed. For your reference, I have included the full running command, 6_hessian_converg_nconf.py, and log output below:
running command: python List/6_hessian_converg_nconf.py
log:
`
/share/home/jgsi/anaconda3/envs/sscha/lib/python3.10/site-packages/sscha/aiida_ensemble.py:18: UserWarning: aiida or aiida-quantumespresso are not installed
warnings.warn('aiida or aiida-quantumespresso are not installed')
Running calculation with 20 configurations
Force computed shape: 20
Computing configuration 1 out of 20 (nat = 72)
/share/home/jgsi/anaconda3/envs/sscha/lib/python3.10/site-packages/cellconstructor/calculators.py:90: FutureWarning: Please use atoms.calc = calc
atm.set_calculator(calculator)
Computing configuration 2 out of 20 (nat = 72)
Computing configuration 3 out of 20 (nat = 72)
Computing configuration 4 out of 20 (nat = 72)
Computing configuration 5 out of 20 (nat = 72)
Computing configuration 6 out of 20 (nat = 72)
Computing configuration 7 out of 20 (nat = 72)
Computing configuration 8 out of 20 (nat = 72)
Computing configuration 9 out of 20 (nat = 72)
Computing configuration 10 out of 20 (nat = 72)
Computing configuration 11 out of 20 (nat = 72)
Computing configuration 12 out of 20 (nat = 72)
Computing configuration 13 out of 20 (nat = 72)
Computing configuration 14 out of 20 (nat = 72)
Computing configuration 15 out of 20 (nat = 72)
Computing configuration 16 out of 20 (nat = 72)
Computing configuration 17 out of 20 (nat = 72)
Computing configuration 18 out of 20 (nat = 72)
Computing configuration 19 out of 20 (nat = 72)
Computing configuration 20 out of 20 (nat = 72)
Force computed shape: 20
Traceback (most recent call last):
File "/share/home/jgsi/quip/workspace/Test_5_USED/SSCHA_222/List/6_hessian_converg_nconf.py", line 89, in
minimizer.init()
File "/share/home/jgsi/anaconda3/envs/sscha/lib/python3.10/site-packages/sscha/SchaMinimizer.py", line 1108, in init
qe_sym.SymmetrizeFCQ(fcq, self.dyn.q_stars, asr = "custom")
File "/share/home/jgsi/anaconda3/envs/sscha/lib/python3.10/site-packages/cellconstructor/symmetries.py", line 1032, in SymmetrizeFCQ
self.SymmetrizeDynQ(fcq[iq, :,:], q_points[iq,:])
File "/share/home/jgsi/anaconda3/envs/sscha/lib/python3.10/site-packages/cellconstructor/symmetries.py", line 1573, in SymmetrizeDynQ
dyn_matrix[3 * na : 3* na + 3, 3*nb: 3 * nb + 3] = Methods.convert_matrix_cart_cryst(fc, self.structure.unit_cell, True)
numpy.exceptions.ComplexWarning: Casting complex values to real discards the imaginary part
`
Besides, the process execution time was significantly shorter than the time limit I configured.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all,
I am currently developing my research topic on phase transitions based on the SSCHA 2026 school tutorials (namely Lecture2 and Hands-on-session2). But when I performed the CONFIGS convergence test, the job terminated with the following warning:
RuntimeWarning: invalid value encountered in sqrt a[:] = np.sqrt(1.0 / (2.0 * w))I suspect that minimizer.run() generated imaginary phonon frequencies, which caused the calculation to fail.
To investigate this, I debugged the script and confirmed that imaginary frequencies were indeed present after minimizer.run() by adding
w_check, _ = minimizer.dyn.DiagonalizeSupercell() if np.any(w_check <= 0): print(f"[Warning] {nconf} configs has negative frequencies: {w_check[w_check<=0]}") # Save the refined auxiliary dynamical matrix refined_prefix = os.path.join(OUTPUT_DIR, f"refined_dyn_{nconf}_") minimizer.dyn.save_qe(refined_prefix)I tried to explicitly force the use of
minimizer.dyn.ForcePositiveDefinite()andminimizer.dyn.Symmetrize()after theminimizer.run()and run the script again, but nothing changed.Why is this happening? I expected ForcePositiveDefinite() to eliminate the imaginary modes. Is there something I might be missing, or is there a recommended way to resolve this issue? Any suggestions would be greatly appreciated.
I have uploaded the script 6_hessian_converg_nconf.py for your reference.
I look forward to any comments or suggestions. Thank you in advance for your help again.
Jianguo Si
DIMST, CAS
Beta Was this translation helpful? Give feedback.
All reactions