<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"CMU Bright Roman";
        panose-1:2 0 6 3 0 0 0 0 0 0;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"CMU Bright Roman";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman"">Dear Nicola,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman"">Thank you very much; this is exactly what I needed to learn. Cheers!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Sincerely yours,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Jacob Williams<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Ph.D. candidate, Yang group<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Duke University Department of Chemistry
<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">developers <developers-bounces@lists.quantum-espresso.org> on behalf of Colonna Nicola (PSI) <nicola.colonna@psi.ch><br>
<b>Date: </b>Thursday, August 18, 2022 at 6:48 AM<br>
<b>To: </b>developers@lists.quantum-espresso.org <developers@lists.quantum-espresso.org><br>
<b>Subject: </b>Re: [QE-developers] KCW: doubled nkstot after q /= 0 nscf calculation<o:p></o:p></span></p>
</div>
<div id="divtagdefaultwrapper">
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black">Dear Jacob,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> this is just because of the way QE handles the k and k+q points: in a LR calculation at finite q you need the KS states at k AND at k+q.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> A non-SCF calculation is done to compute these states. In setup_nscf.90 (called by kcw_run_nscf) nkstot is doubled to reflect this need.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> But this does not means that all of a sudden you have twice the number of k points. It's just the way the code indices the k and k+q points<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> for the NSCF calculation. The "correct" number of kpoint is stored in the global variable nksq (see kcw_initialize_ph.f90 or equivalently
<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> PHONON/PH/initialize_ph.f90).
<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"> For the nkstot definition have a look at setup_nscf.f90 (in LR_Modules) and at set_kplusq.f90 (in PW/src) called by setup_nscf.f90
<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:Helvetica;color:black">!----------------------------------------------------------------------------<br>
SUBROUTINE setup_nscf ( newgrid, xq, elph_mat )<br>
  !----------------------------------------------------------------------------<br>
  !<br>
  ! ... This routine initializes variables for the non-scf calculations at k<br>
  ! ... and k+q required by the linear response calculation at finite q.<br>
  ! ... In particular: finds the symmetry group of the crystal that leaves<br>
  ! ... the phonon q-vector (xq) or the single atomic displacement (modenum)<br>
  ! ... unchanged; determines the k- and k+q points in the irreducible BZ<br>
  ! ... Needed on input (read from data file):<br>
  ! ... "nsym" crystal symmetries s, t_rev, "nrot" lattice symetries "s"<br>
  ! ... "nkstot" k-points in the irreducible BZ wrt lattice symmetry<br>
  <b>! ... Produced on output:<br>
  ! ... symmetries ordered with the "nsymq" phonon symmetries first<br>
  ! ... "nkstot" k- and k+q-points in the IBZ calculated for the phonon sym.)<br>
  ! ... Misc. data needed for running the non-scf calculation</b><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black"> Hope this help,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black">Nicola<o:p></o:p></span></p>
</div>
<p><span style="font-size:10.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<div id="Signature">
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black">-----------------------------------------------------</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black">PAUL SCHERRER INSTITUT</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black">Nicola S. Colonna<br>
<br>
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Helvetica;color:black">WHGA/150<br>
CH-5232 Villigen-PSI<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;color:black">Da:</span></b><span style="font-size:11.0pt;color:black"> developers <developers-bounces@lists.quantum-espresso.org> per conto di Jacob Williams <jacob.z.williams@duke.edu><br>
<b>Inviato:</b> martedě 16 agosto 2022 22:18:37<br>
<b>A:</b> developers@lists.quantum-espresso.org<br>
<b>Oggetto:</b> [QE-developers] KCW: doubled nkstot after q /= 0 nscf calculation</span><span style="font-size:11.0pt">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman"">Dear all,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman"">I am working on the LOSC correction for DFT (extending doi:10.1103/PhysRevB.106.035147), with code that modifies the KCW module from QE 7.1. So, first, I’d like to thank the
 developers of KCW for their excellent work and for discovering a primitive-cell-periodic way to handle Wannier function densities, which had troubled my collaborator and me for some years.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman"">I need to use nkstot == nk1 * nk2 * nk3 * nspin as part of the calculation analogous to screen_coeff.f90, after the Sternheimer equation calculations are finished. However, when
 nk1, nk2, and nk3 are all greater than 1, it seems that the routine kcw_run_nscf(), or perhaps the linear-response calculation of alpha, recalculates nkstot and in particular doubles it for q /= 0. (I can find this by printing nkstot to standard output at
 lines 108 and 253 respectively of KCW/src/screen_coeff.f90 and then executing KCW/examples/example01/run_example; I find that before the linear response calculation nkstot = 16, but after nkstot = 32.) Could you enlighten me as to why this change to nkstot
 occurs?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Sincerely yours,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Jacob Williams</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Ph.D. candidate, Yang group</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Vice President, Graduate Chemistry Council</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"CMU Bright Roman";color:black">Duke University Department of Chemistry
</span><o:p></o:p></p>
</div>
</div>
</body>
</html>