<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>yes, except the S matrix is never stored anywhere but is
        applied to the wfc by the s_1psi routine,</tt></p>
    <p><tt>so more something like <br>
      </tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt> sum = 0.d0</tt></p>
    <p><tt> call s_1psi( npwx, npw, evc(1,b), spsi )</tt></p>
    <p><tt> DO  i = 1,npw</tt></p>
    <p><tt>     sum = sum + conjg(evc(i,b)) * spsi(i)<br>
         END DO</tt></p>
    <p><tt> <br>
      </tt></p>
    <p><br>
    </p>
    <p>stefano</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 11/12/18 15:36, John McFarland
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BYAPR05MB4502E59771BA27639212FEDCF2A60@BYAPR05MB4502.namprd05.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
        dir="ltr">
        <p style="margin-top:0;margin-bottom:0">Dear all,</p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">As I understand it, the
          wavefunction for each k-point is given by ecv(:,:), with the
          first index representing a single particle basis and the
          second index representing each band.  I'm guessing that when a
          normalized wavefunction is contracted over the S matrix, the
          result should equal one for each band.  What I think this
          would look like in code is:<br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;"> sum = 0</span><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;"> DO  i = 1,npwx</span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;">    DO j = 1,npwx</span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;">       sum = sum + evc(i,b) * S(i,j) *
          </span><span style="font-family: "Arial Black",
            Arial, sans-serif;">evc(j,b)</span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;">    END DO</span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: "Arial Black", Arial,
            sans-serif;"> END DO</span></p>
        <p style="margin-top:0;margin-bottom:0"><span><br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span>and sum should
            equal 1 for any band b.  Is my understanding correct?</span></p>
        <p style="margin-top:0;margin-bottom:0"><span><br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span>Best regards,<br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span>John McFarland<br>
          </span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org">users@lists.quantum-espresso.org</a>
<a class="moz-txt-link-freetext" href="https://lists.quantum-espresso.org/mailman/listinfo/users">https://lists.quantum-espresso.org/mailman/listinfo/users</a></pre>
    </blockquote>
  </body>
</html>