<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you Stefano! I was actually searching for a better
      reference but did not think about your Rev. Mod. Phys. which I
      usually suggest to our students for reading and understanding a
      bit more about DFPT. Concerning optical properties also this might
      be interesting:
      <a class="moz-txt-link-freetext" href="https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.74.601">https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.74.601</a><br>
    </p>
    <div class="moz-cite-prefix">On 8/9/23 11:30, Stefano Baroni wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DU2PR07MB81775C5627F34378A9A2DEE0AB12A@DU2PR07MB8177.eurprd07.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Helvetica;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}div.WordSection1
        {page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US">Hi All. Many thanks for this interesting
            discussion.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US">Thomas: the literature you recommend (</span><span
            style="font-size:11.0pt"><a
              href="https://pubs.rsc.org/en/content/articlelanding/2023/CP/D2CP05991F"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://pubs.rsc.org/en/content/articlelanding/2023/CP/D2CP05991F</a></span><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US">) is rather ill informed. It overlooks the fact
            that the problem of a proper definition of the position
            operator in the calculation of dielectric and optical
            properties is as old (actually older) than
            density-functional perturbation theory. None of the original
            literature is properly cited. A better informed reference,
            with a historically accurate account of the relevant
            literature is
            <a
              href="https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.73.515"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.73.515</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US">Best regards – SB<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:Helvetica;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                style="font-size:12.0pt;color:black">From:
              </span></b><span style="font-size:12.0pt;color:black">users
              <a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.quantum-espresso.org"><users-bounces@lists.quantum-espresso.org></a> on behalf
              of Thomas Brumme <a class="moz-txt-link-rfc2396E" href="mailto:tbrumme@msx.tu-dresden.de"><tbrumme@msx.tu-dresden.de></a><br>
              <b>Date: </b>Wednesday, 9 August 2023 at 11:13<br>
              <b>To: </b>Quantum ESPRESSO users Forum
              <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.quantum-espresso.org"><users@lists.quantum-espresso.org></a>, Brian de Keijzer
              <a class="moz-txt-link-rfc2396E" href="mailto:briandekeyzer@hotmail.com"><briandekeyzer@hotmail.com></a><br>
              <b>Subject: </b>Re: [QE-users] How does one calculate
              dipole moments or access (readable) wave functions from
              e.g. PW?<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"><span style="font-size:11.0pt">Dear
              Brian,<br>
              <br>
              Sorry to be a bit blunt but your question cannot be
              answered in a <br>
              one-liner and indicates that<br>
              you might miss a few important points.<br>
              <br>
              I guess you have read the input description of bands.x and
              since you're <br>
              are still asking how to<br>
              get the dipole matrix elements you are probably unaware of
              the fact that <br>
              those are not well<br>
              defined in solids. Well, at least the position operator is
              not well <br>
              defined in an infinite solid<br>
              because every point could be the origin. Thus, one has to
              use the <br>
              momentum operator instead.<br>
              (see, e.g., Eq. (7) in this paper <br>
              <a
                href="https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.80.1800)"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.80.1800)</a><br>
              <br>
              I suggest to read some publications first, books, in order
              to understand <br>
              what you need to do.<br>
              This paper seems quite useful - I didn't read it carefully
              though but <br>
              just found it via a quick<br>
              Google search:<br>
              <br>
              <a
                href="https://pubs.rsc.org/en/content/articlelanding/2023/CP/D2CP05991F"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://pubs.rsc.org/en/content/articlelanding/2023/CP/D2CP05991F</a><br>
              <br>
              If you're interested in optical properties then there are
              many more <br>
              things to take into account.<br>
              A good starting point might be the pages of the Yambo
              code, in <br>
              particular this:<br>
              <br>
              <a
                href="https://www.yambo-code.eu/wiki/index.php/Main_Page"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://www.yambo-code.eu/wiki/index.php/Main_Page</a><br>
              <br>
              and more specifically the thesis of Andrea Marini has a
              good collection <br>
              of the equations and<br>
              references<br>
              <br>
              <a
                href="https://www.yambo-code.eu/wiki/images/2/20/Marini_PhD.pdf"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://www.yambo-code.eu/wiki/images/2/20/Marini_PhD.pdf</a><br>
              <br>
              In a nutshell: you need to calculate the dielectric
              function and then <br>
              there are different<br>
              approximations involved.<br>
              <br>
              Kind regards<br>
              <br>
              Thomas<br>
              <br>
              On 8/9/23 09:27, Brian de Keijzer wrote:<br>
              > Hi all,<br>
              ><br>
              ><br>
              > Would anyone know how one retrieves the dipole matrix
              elements from bands.x (or in another way?)?<br>
              ><br>
              > Any help is appreciated.<br>
              ><br>
              ><br>
              > Bests,<br>
              ><br>
              > Brian de Keijzer<br>
              ><br>
              >> On 25 Jul 2023, at 16:09, Brian de Keijzer
              <a class="moz-txt-link-rfc2396E" href="mailto:briandekeyzer@hotmail.com"><briandekeyzer@hotmail.com></a> wrote:<br>
              >><br>
              >> Hi Paolo,<br>
              >><br>
              >> Thank you for your answer’<br>
              >><br>
              >> Bands.x had caught my eye before but I did not
              notice how to make it output transition dipole moments.
              How would one compute those?<br>
              >><br>
              >> Meanwhile I managed to indeed get hdf5 output.
              That’s great! If there is a native way to obtain the
              values I want it’s preferable tho.<br>
              >><br>
              >> Best regards,<br>
              >><br>
              >> Brian de Keijzer<br>
              >><br>
              >>> On 25 Jul 2023, at 13:37, Paolo Giannozzi
              <a class="moz-txt-link-rfc2396E" href="mailto:paolo.giannozzi@uniud.it"><paolo.giannozzi@uniud.it></a> wrote:<br>
              >>><br>
              >>> I think code "bands.x" can compute dipole
              matrix elements.<br>
              >>><br>
              >>> About direct access to wavefunctions: the
              default fortran binary format is basically unreadable
              except via the routines of QE. One may optionally write
              hdf5 files that are much easier to read with external
              utilities, though.<br>
              >>><br>
              >>> Paolo<br>
              >>><br>
              >>>> On 7/25/23 10:40, Brian de Keijzer wrote:<br>
              >>>> [You don't often get email from
              <a class="moz-txt-link-abbreviated" href="mailto:briandekeyzer@hotmail.com">briandekeyzer@hotmail.com</a>. Learn why this is important at
              <a href="https://aka.ms/LearnAboutSenderIdentification"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://aka.ms/LearnAboutSenderIdentification</a>
              ]<br>
              >>>> Hi all,<br>
              >>>> New QE users here. I’ve used QE so far to
              compute band structures for crystals. I am however very
              much interested in calculating the dipole matrix elements
              for said crystals. Does QE have a module that allows one
              to do this? If so, how would that work?<br>
              >>>> Moreover, I have read that it is possible
              to use the wave functions directly. That would allow me to
              compute the dipole elements. Unfortunately most posts that
              I come across appear to be a bit dated tho. What would be
              the best way to access the wave functions using more
              recent versions of e.g. Python? I’ve come across postqe
              but that appears to no longer be in development nor does
              the installation work on my Python 3.9 distribution.<br>
              >>>> Anyhow; I’m looking to learn how to
              compute k-dependent transition dipole moments in QE. It
              would be awesome if anyone would want to provide an
              outline of how such a thing is to be done using the latest
              version of QE.<br>
              >>>> Bests,<br>
              >>>> Brian de Keijzer<br>
              >>>>
              _______________________________________________<br>
              >>>> The Quantum ESPRESSO community stands by
              the Ukrainian<br>
              >>>> people and expresses its concerns about
              the devastating<br>
              >>>> effects that the Russian military
              offensive has on their<br>
              >>>> country and on the free and peaceful
              scientific, cultural,<br>
              >>>> and economic cooperation amongst peoples<br>
              >>>>
              _______________________________________________<br>
              >>>> Quantum ESPRESSO is supported by MaX (<a
                href="http://www.max-centre.eu" moz-do-not-send="true">www.max-centre.eu</a>)<br>
              >>>> users mailing list
              <a class="moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org">users@lists.quantum-espresso.org</a><br>
              >>>> <a
                href="https://lists.quantum-espresso.org/mailman/listinfo/users"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.quantum-espresso.org/mailman/listinfo/users</a><br>
              >>> -- <br>
              >>> 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>
              > The Quantum ESPRESSO community stands by the
              Ukrainian<br>
              > people and expresses its concerns about the
              devastating<br>
              > effects that the Russian military offensive has on
              their<br>
              > country and on the free and peaceful scientific,
              cultural,<br>
              > and economic cooperation amongst peoples<br>
              > _______________________________________________<br>
              > Quantum ESPRESSO is supported by MaX (<a
                href="http://www.max-centre.eu" moz-do-not-send="true">www.max-centre.eu</a>)<br>
              > users mailing list <a class="moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org">users@lists.quantum-espresso.org</a><br>
              > <a
                href="https://lists.quantum-espresso.org/mailman/listinfo/users"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.quantum-espresso.org/mailman/listinfo/users</a><br>
              <br>
              -- <br>
              Dr. rer. nat. Thomas Brumme<br>
              Theoretical chemistry<br>
              TU Dresden - KOE / 103<br>
              Bergstr. 66c<br>
              01069 Dresden<br>
              <br>
              Tel:  +49 (0)351 463 39449<br>
              <br>
              email: <a class="moz-txt-link-abbreviated" href="mailto:thomas.brumme@tu-dresden.de">thomas.brumme@tu-dresden.de</a><br>
              <br>
              _______________________________________________<br>
              The Quantum ESPRESSO community stands by the Ukrainian<br>
              people and expresses its concerns about the devastating<br>
              effects that the Russian military offensive has on their<br>
              country and on the free and peaceful scientific, cultural,<br>
              and economic cooperation amongst peoples<br>
              _______________________________________________<br>
              Quantum ESPRESSO is supported by MaX (<a
                href="http://www.max-centre.eu" moz-do-not-send="true">www.max-centre.eu</a>)<br>
              users mailing list <a class="moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org">users@lists.quantum-espresso.org</a><br>
              <a
                href="https://lists.quantum-espresso.org/mailman/listinfo/users"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.quantum-espresso.org/mailman/listinfo/users</a><o:p></o:p></span></p>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
The Quantum ESPRESSO community stands by the Ukrainian
people and expresses its concerns about the devastating
effects that the Russian military offensive has on their
country and on the free and peaceful scientific, cultural,
and economic cooperation amongst peoples
_______________________________________________
Quantum ESPRESSO is supported by MaX (<a class="moz-txt-link-abbreviated" href="http://www.max-centre.eu">www.max-centre.eu</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>
    <pre class="moz-signature" cols="72">-- 
Dr. rer. nat. Thomas Brumme
Theoretical chemistry
TU Dresden - KOE / 103
Bergstr. 66c
01069 Dresden

Tel:  +49 (0)351 463 39449

email: <a class="moz-txt-link-abbreviated" href="mailto:thomas.brumme@tu-dresden.de">thomas.brumme@tu-dresden.de</a></pre>
  </body>
</html>