<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Just replied off list. <br>
    </p>
    <p>But in case anyone else is interested, DFTB+ uses only the lower
      triangle for most large symmetric/hermitian matrices.</p>
    <p>Regards</p>
    <p>Ben<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 30/11/17 16:46, Sharma SRK Chaitanya
      Yamijala wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJkCsLmTXhVffUAh=sUJsarTgo0zN3te4pa9o23Kx0yUtSzpqg@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Dear DFTB+ developers,
        <div><br>
        </div>
        <div>I am using the output of "makeDensityMatrix" subroutine
          from a nonSCC calculation (on Benzene) for testing our lab
          code on PLDM. </div>
        <div><br>
        </div>
        <div>As  </div>
        <div><br>
        </div>
        <div><font color="#0000ff">\rho_{\mu \nu} = \sum_{i}^{Occ} n_{i}
            c_{\mu i}c_{\nu i} \\</font></div>
        <div><br>
        </div>
        <div>and</div>
        <div><br>
        </div>
        <div>
          <div><font color="#0000ff">\langle \Phi_{i}| \Phi_{i}\rangle =
              \sum_{\mu \nu}^{nAOs} c_{\mu i}c_{\nu i} S_{\mu \nu} = 1 ~
              \forall ~ i\\</font></div>
        </div>
        <div><br>
        </div>
        <div>
          <div>
            <div class="gmail_signature">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">I was expecting that sum over
                        (rho(mu,nu) * S(mu,nu)) will give me the
                        summation over the fillings of all occupied
                        orbitals (as given by the below equation).</div>
                      <div dir="ltr"><br>
                      </div>
                      <div dir="ltr"><font color="#0000ff">\sum_{\mu
                          \nu}^{nAOs} \rho_{\mu \nu} S_{\mu \nu} =
                          \sum_{\mu \nu} \sum_{i}^{Occ} n_{i} c_{\mu
                          i}c_{\nu i} S_{\mu \nu} = \sum_{i}^{Occ} n_{i}
                          \left(\sum_{\mu \nu} c_{\mu i}c_{\nu i} S_{\mu
                          \nu} \right) = \sum_{i}^{Occ} n_{i} <br>
                        </font></div>
                      <div dir="ltr"><br>
                      </div>
                      <div dir="ltr">If the above equation is right,
                        then for the case of benzene and for
                        the nonSCC calculation this should give me 30 as
                        the answer (15 occupied levels and with an
                        occupation number of 2 for each). With the
                        minimum modifications to the DFTB+ code, I was
                        not able to get this answer. </div>
                      <div dir="ltr"><br>
                      </div>
                      <div><b>The minimal modifications I did were
                          below:</b></div>
                      <div><b><br>
                        </b></div>
                      <div>Before the scc loop, I saved the overlap
                        matrix and I have used this and the output of
                        "makeDensityMatrix" routine</div>
                      <div><br>
                      </div>
                      <div>
                        <div>    if (tCheck) then</div>
                        <div>      call unpackHS(overlapReal, over,
                          neighborList%iNeighbor, nNeighbor,&</div>
                        <div>        & iAtomStart, iPair,
                          img2CentCell)</div>
                        <div>      call blockSymmetrizeHS(overlapReal,
                          iAtomStart)</div>
                        <div>      currentOverlap = overlapReal</div>
                        <div>    end if</div>
                        <div><br>
                        </div>
                        <div>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
                        <div>    !! SCC-loop</div>
                        <div>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
                      </div>
                      <div><br>
                      </div>
                      <div>....</div>
                      <div>....</div>
                      <div><br>
                      </div>
                      <div>
                        <div>if (tDensON2) then</div>
                        <div>              call
                          makeDensityMatrix(SSqrReal,
                          HSqrReal(:,:,iSpin2), filling(:,1,iSpin),&</div>
                        <div>                  &
                          neighborlist%iNeighbor, nNeighbor, orb,
                          iAtomStart, img2CentCell)</div>
                        <div>            else</div>
                        <div>              call
                          makeDensityMatrix(SSqrReal,
                          HSqrReal(:,:,iSpin2), filling(:,1,iSpin))</div>
                        <div><br>
                        </div>
                        <div>!********************************************************************</div>
                        <div>              sumFilling=0.0d0</div>
                        <div>              do iSurf=1,sqrHamSize</div>
                        <div>               
                           sumFilling=sumFilling+SSqrReal(iSurf,iSurf)*currentOverlap(iSurf,iSurf)</div>
                        <div>              end do</div>
                        <div>              do iSurf=1,sqrHamSize-1</div>
                        <div>                do jSurf=iSurf+1,sqrHamSize</div>
                        <div>                 
 sumFilling=sumFilling+2.0d0*SSqrReal(iSurf,jSurf)*currentOverlap(iSurf,jSurf)</div>
                        <div>                end do</div>
                        <div>              end do</div>
                        <div>             
                          write(*,*)"sumFilling",sumFilling</div>
                        <div>
                          <div>!********************************************************************</div>
                        </div>
                        <div><br>
                        </div>
                        <div>            end if</div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>
                        <div dir="ltr">I believe I am doing something
                          wrong (either in the code or in the equation)
                          and any advice on your end is highly
                          appreciated.<font color="#000000"><br>
                          </font></div>
                      </div>
                      <div><br>
                      </div>
                      <div><font color="#000000">Thanking you,</font></div>
                      <div><font color="#000000">Sincerely,</font></div>
                      <div><font color="#000000">Sharma.</font></div>
                      <div><font color="#000000"><br>
                        </font></div>
                      <div><font color="#000000">P.S.: </font>You can
                        use <a
                          href="https://www.codecogs.com/latex/eqneditor.php"
                          moz-do-not-send="true">https://www.codecogs.com/latex/eqneditor.php</a>
                        to visualize the above equations (by copying and
                        pasting them)</div>
                      <div dir="ltr">
                        <div><br>
                        </div>
                      </div>
                      <div dir="ltr"><font color="#000000"><br>
                        </font></div>
                      <div dir="ltr"><font color="#000000">--------------------------------------------------------------------<br>
                          <font size="2" face="arial, helvetica,
                            sans-serif">Sharma</font></font></div>
                      <div dir="ltr"><font face="arial, helvetica,
                          sans-serif" color="#000000"><a
                            href="http://www.chem.rochester.edu/groups/huo/people/"
                            target="_blank" moz-do-not-send="true">http://www.chem.rochester.edu/groups/huo/people/</a></font></div>
                      <div dir="ltr"><br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
DFTB-Plus-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:DFTB-Plus-User@mailman.zfn.uni-bremen.de">DFTB-Plus-User@mailman.zfn.uni-bremen.de</a>
<a class="moz-txt-link-freetext" href="https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user">https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
      Dr. B. Hourahine, SUPA, Department of Physics,
    University of Strathclyde, John Anderson Building,
            107 Rottenrow, Glasgow G4 0NG, UK.
    +44 141 548 2325, <a class="moz-txt-link-abbreviated" href="mailto:benjamin.hourahine@strath.ac.uk">benjamin.hourahine@strath.ac.uk</a>

2013/4 THE Awards Entrepreneurial University of the Year
      2012/13 THE Awards UK University of the Year

   The University of Strathclyde is a charitable body,
        registered in Scotland, number SC015263</pre>
  </body>
</html>