<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Dear Ben,</p>
    <p>I think you are right on both accounts... thanks for pointing out
      the problem in eq A7<br>
    </p>
    <p>the equation in reciprocal space equivalent to  A6 and correctly
      coded in PW/src/scf_mod.f90 in function rho_ddot (lines ~450 - 490
      )<br>
    </p>
    <p>0.5 4pi e^2 Omega \sum |Delta_rho|^2/|G|^2<br>
    </p>
    <p> it has the correct dimensions of      e^2 x [length^-1] <br>
    </p>
    <p>so A7 should be multiplied by Omega^2/2 to make it correct.</p>
    <p><br>
    </p>
    <p>The root of the equivalence between A6 and the (corected) A7 is
      that  <br>
    </p>
    <p>\int exp(+iGr) 1/|r| d3r = 4pi/|G|^2;  rho(r) = \sum_G exp(+iGr)
      rho(G); and<br>
    </p>
    <p>\int exp(+i(G-G')r) d3r = Omega delta(G,G')</p>
    <p>where in the last term the integral is done over the unit cell
      because we are looking for a "per cell" quantity.</p>
    <p><br>
    </p>
    <p>best regards</p>
    <p>stefano</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 27/09/19 21:04, Ben Comer wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:5c94b289-d7a4-7bd1-5970-f6ff97df7582@gatech.edu">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>I figured the code had to be correct, and are equations A.6 and
        A.7 equivalent? It's not trivially obvious that they would be
        equal as one is an integral in real space whereas the other is
        an integral in reciprocal space. If they are the same it looks
        like A.7 might be missing the volume factor and a factor of 1/2.<br>
      </p>
      <div class="moz-cite-prefix">On 9/27/19 2:28 AM, Paolo Giannozzi
        wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAPMgbCu_Shz_vp+E+7Vn0cSsayi0OTZwDV6Qamn31AB8YicS-w@mail.gmail.com">
        <div dir="ltr">
          <div>The code is correct. Eq.A7 likely assumes that
            rho(G)=\int rho(r) exp(-iGr)dr, instead of the more usual
            definition rho(G)=(1/Omega) \int rho(r) exp(-iGr)dr
            <br>
          </div>
          <div><br>
          </div>
          <div>Paolo<br>
          </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2019 at
            11:53 PM Ben Comer <<a href="mailto:bcomer3@gatech.edu"
              moz-do-not-send="true">bcomer3@gatech.edu</a>> wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div bgcolor="#FFFFFF">
              <p>Dr. Giannozzi,</p>
              <p>Per the conversation, I read through the rho_ddot
                function. In line 490 of scf_mod.f90 it appears that the
                volume, omega, is being multiplied rather than divided
                as it is in equation A.7 I'm concerned that one of the
                versions of these equations may be incorrect. please let
                me know if I am under a misapprehension.</p>
              <p><a
                  href="https://github.com/QEF/q-e/blob/master/PW/src/scf_mod.f90#L490"
                  target="_blank" moz-do-not-send="true">https://github.com/QEF/q-e/blob/master/PW/src/scf_mod.f90#L490</a></p>
              <div class="gmail-m_-2127499003259828511moz-cite-prefix">On
                9/26/19 3:57 PM, Paolo Giannozzi wrote:<br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">
                  <div class="gmail_quote">
                    <div dir="ltr" class="gmail_attr">On Thu, Sep 26,
                      2019 at 9:44 PM Ben Comer <<a
                        href="mailto:bcomer3@gatech.edu" target="_blank"
                        moz-do-not-send="true">bcomer3@gatech.edu</a>>
                      wrote:<br>
                    </div>
                    <blockquote class="gmail_quote" style="margin:0px
                      0px 0px 0.8ex;border-left:1px solid
                      rgb(204,204,204);padding-left:1ex">
                      <div bgcolor="#FFFFFF">
                        <p>Just a quick follow up, the text seems to
                          imply that A7 is used rather than A6. do you
                          know where this is defined in the source code?<br>
                        </p>
                      </div>
                    </blockquote>
                    <div>
                      <div dir="ltr">Variable dr2 in PW/src/mix_tho.f90,
                        routine rho_ddot in PW/src/scf_mix.f90
                      </div>
                      <br>
                    </div>
                    <div>Paolo<br>
                    </div>
                    <blockquote class="gmail_quote" style="margin:0px
                      0px 0px 0.8ex;border-left:1px solid
                      rgb(204,204,204);padding-left:1ex">
                      <div bgcolor="#FFFFFF">
                        <div
class="gmail-m_-2127499003259828511gmail-m_7390029215997806863moz-cite-prefix">On
                          9/26/19 10:57 AM, Paolo Giannozzi wrote:<br>
                        </div>
                        <blockquote type="cite">
                          <div dir="ltr">
                            <div>If I remember correctly: Eq.A6 of
                              J.Phys.: Condens. Matter 21, 395502 (2009)</div>
                            <div><br>
                            </div>
                            <div>Paolo<br>
                            </div>
                          </div>
                          <br>
                          <div class="gmail_quote">
                            <div dir="ltr" class="gmail_attr">On Thu,
                              Sep 26, 2019 at 4:52 PM Ben Comer <<a
                                href="mailto:bcomer3@gatech.edu"
                                target="_blank" moz-do-not-send="true">bcomer3@gatech.edu</a>>
                              wrote:<br>
                            </div>
                            <blockquote class="gmail_quote"
                              style="margin:0px 0px 0px
                              0.8ex;border-left:1px solid
                              rgb(204,204,204);padding-left:1ex">
                              Hello,<br>
                              <br>
                              I'm trying to understand what exactly
                              estimated SCF accuracy is. Does <br>
                              anyone know where I can find a formal
                              definition of what it is and how <br>
                              it is being calculated? The structure of
                              the output file implies that it <br>
                              is related to the Harris-Foulkes and the
                              total energy, but it is clearly <br>
                              not the trivial difference between these
                              two quantities.<br>
                              <br>
                              Thanks in advance,<br>
                              Ben Comer<br>
                              Georgia Tech<br>
                              <br>
_______________________________________________<br>
                              Quantum ESPRESSO is supported by MaX (<a
                                href="http://www.max-centre.eu/quantum-espresso"
                                rel="noreferrer" target="_blank"
                                moz-do-not-send="true">www.max-centre.eu/quantum-espresso</a>)<br>
                              users mailing list <a
                                href="mailto:users@lists.quantum-espresso.org"
                                target="_blank" moz-do-not-send="true">
                                users@lists.quantum-espresso.org</a><br>
                              <a
                                href="https://lists.quantum-espresso.org/mailman/listinfo/users"
                                rel="noreferrer" target="_blank"
                                moz-do-not-send="true">https://lists.quantum-espresso.org/mailman/listinfo/users</a><br>
                            </blockquote>
                          </div>
                          <br clear="all">
                          <br>
                          -- <br>
                          <div dir="ltr"
class="gmail-m_-2127499003259828511gmail-m_7390029215997806863gmail_signature">
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>Paolo Giannozzi, Dip. Scienze
                                    Matematiche Informatiche e Fisiche,<br>
                                    Univ. Udine, via delle Scienze 208,
                                    33100 Udine, Italy<br>
                                    Phone +39-0432-558216, fax
                                    +39-0432-558222<br>
                                    <br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <br>
                          <fieldset
class="gmail-m_-2127499003259828511gmail-m_7390029215997806863mimeAttachmentHeader"></fieldset>
                          <pre class="gmail-m_-2127499003259828511gmail-m_7390029215997806863moz-quote-pre">_______________________________________________
Quantum ESPRESSO is supported by MaX (<a class="gmail-m_-2127499003259828511gmail-m_7390029215997806863moz-txt-link-abbreviated" href="http://www.max-centre.eu/quantum-espresso" target="_blank" moz-do-not-send="true">www.max-centre.eu/quantum-espresso</a>)
users mailing list <a class="gmail-m_-2127499003259828511gmail-m_7390029215997806863moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org" target="_blank" moz-do-not-send="true">users@lists.quantum-espresso.org</a>
<a class="gmail-m_-2127499003259828511gmail-m_7390029215997806863moz-txt-link-freetext" href="https://lists.quantum-espresso.org/mailman/listinfo/users" target="_blank" moz-do-not-send="true">https://lists.quantum-espresso.org/mailman/listinfo/users</a></pre>
                        </blockquote>
                      </div>
                      _______________________________________________<br>
                      Quantum ESPRESSO is supported by MaX (<a
                        href="http://www.max-centre.eu/quantum-espresso"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">www.max-centre.eu/quantum-espresso</a>)<br>
                      users mailing list <a
                        href="mailto:users@lists.quantum-espresso.org"
                        target="_blank" moz-do-not-send="true">
                        users@lists.quantum-espresso.org</a><br>
                      <a
                        href="https://lists.quantum-espresso.org/mailman/listinfo/users"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">https://lists.quantum-espresso.org/mailman/listinfo/users</a></blockquote>
                  </div>
                  <br clear="all">
                  <br>
                  -- <br>
                  <div dir="ltr"
                    class="gmail-m_-2127499003259828511gmail_signature">
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>Paolo Giannozzi, Dip. Scienze Matematiche
                            Informatiche e Fisiche,<br>
                            Univ. Udine, via delle Scienze 208, 33100
                            Udine, Italy<br>
                            Phone +39-0432-558216, fax +39-0432-558222<br>
                            <br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <br>
                <fieldset
                  class="gmail-m_-2127499003259828511mimeAttachmentHeader"></fieldset>
                <pre class="gmail-m_-2127499003259828511moz-quote-pre">_______________________________________________
Quantum ESPRESSO is supported by MaX (<a class="gmail-m_-2127499003259828511moz-txt-link-abbreviated" href="http://www.max-centre.eu/quantum-espresso" target="_blank" moz-do-not-send="true">www.max-centre.eu/quantum-espresso</a>)
users mailing list <a class="gmail-m_-2127499003259828511moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org" target="_blank" moz-do-not-send="true">users@lists.quantum-espresso.org</a>
<a class="gmail-m_-2127499003259828511moz-txt-link-freetext" href="https://lists.quantum-espresso.org/mailman/listinfo/users" target="_blank" moz-do-not-send="true">https://lists.quantum-espresso.org/mailman/listinfo/users</a></pre>
              </blockquote>
            </div>
          </blockquote>
        </div>
        <br clear="all">
        <br>
        -- <br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>Paolo Giannozzi, Dip. Scienze Matematiche
                  Informatiche e Fisiche,<br>
                  Univ. Udine, via delle Scienze 208, 33100 Udine, Italy<br>
                  Phone +39-0432-558216, fax +39-0432-558222<br>
                  <br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Quantum ESPRESSO is supported by MaX (<a class="moz-txt-link-abbreviated" href="http://www.max-centre.eu/quantum-espresso">www.max-centre.eu/quantum-espresso</a>)
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>