<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- P { margin-top: 0px; margin-bottom: 0px; } p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear developers:<br>
</p>
<p><br>
</p>
<p>I was digging into the code that generates the phonon frequencies from the real space force constants and I think a found a little bug.<br>
</p>
<p><br>
</p>
<p>I have the set of files that you get when you download quantum espresso 5.4.0<br>
</p>
<p><br>
</p>
<p>The bug is in line 536 of matdyn.f90 (which is on PHonon/PH)<br>
</p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 534 </span><span style="">        </span><span style="color:#bcba34">IF</span><span style="">(na_ifc)
</span><span style="color:#bcba34">THEN</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 535 </span><span style="">                                                             </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 536 </span><span style="">           qq</span><span style="color:#bcba34">=</span><span style="color:#46c8d5">sqrt</span><span style="">(q(</span><span style="color:#dd4f33">1</span><span style="">,n)</span><span style="color:#bcba34">**</span><span style="color:#dd4f33">2</span><span style="color:#bcba34">+</span><span style="">q(</span><span style="color:#dd4f33">2</span><span style="">,n)</span><span style="color:#bcba34">**</span><span style="color:#dd4f33">2</span><span style="color:#bcba34">+</span><span style="">q(</span><span style="color:#dd4f33">3</span><span style="">,n)</span><span style="color:#bcba34">**</span><span style="color:#dd4f33">3</span><span style="">)
            </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 537 </span><span style="">           </span><span style="color:#bcba34">if</span><span style="">(qq
</span><span style="color:#bcba34">==</span><span style=""> </span><span style="color:#dd4f33">0.0</span><span style="">) qq</span><span style="color:#bcba34">=</span><span style="color:#dd4f33">1.0</span><span style="">                              </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 538 </span><span style="">           qhat(</span><span style="color:#dd4f33">1</span><span style="">)</span><span style="color:#bcba34">=</span><span style="">q(</span><span style="color:#dd4f33">1</span><span style="">,n)</span><span style="color:#bcba34">/</span><span style="">qq 
                                </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 539 </span><span style="">           qhat(</span><span style="color:#dd4f33">2</span><span style="">)</span><span style="color:#bcba34">=</span><span style="">q(</span><span style="color:#dd4f33">2</span><span style="">,n)</span><span style="color:#bcba34">/</span><span style="">qq 
                                </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 540 </span><span style="">           qhat(</span><span style="color:#dd4f33">3</span><span style="">)</span><span style="color:#bcba34">=</span><span style="">q(</span><span style="color:#dd4f33">3</span><span style="">,n)</span><span style="color:#bcba34">/</span><span style="">qq 
                                </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 541 </span><span style="">                                                             </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 542 </span><span style="">           </span><span style="color:#46c8d5">CALL</span><span style=""> nonanal_ifc (nat,nat_blk,itau_blk,epsil,qhat,zeu,omega,dyn,
</span><span style="color:#bcba34">&</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 543 </span><span style="">                           nr1, nr2, nr3,f_of_q)             </span></p>
<p style="margin-right:0px; margin-left:0px; font-size:14px; line-height:normal; font-family:Menlo; color:rgb(131,148,150); background-color:rgb(1,43,54)">
<span style="color:#bcba34"> 544 </span><span style="">        </span><span style="color:#bcba34">END IF</span><span style="">
</span></p>
<p><br>
</p>
<p>qq is the norm of the q vector. Note that q(3,n) is to the power 3 instead of 2.<br>
</p>
<p><br>
</p>
<p>Best,<br>
</p>
<p>Carlos<br>
</p>
<p>​<br>
</p>
</body>
</html>