<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi, Giovanni,</div><div><br></div><div>Yes, I confirm the fermi energy should be right. I actually checked this twice. In the scf and nscf calculations, I used occupation = 'fixed', and got the " highest occupied level (ev): -1.0818" from the output of scf. Then for the calculation of pp.x, I did two tests:</div><div><br></div><div>1. set emin = -65 and emax = -0.5 for plot_num =10</div><div><br></div><div>2. set emin = -65 and not set emax, since according to the input description, for plot_num =10, <font color="#000000"><span style="font-size:14px">if emax is not specified, emax=E_fermi.</span></font></div><div><font color="#000000"><span style="font-size:14px"><br></span></font></div><div><font color="#000000"><span style="font-size:14px">Both tests leads to same result.</span></font></div><div><font color="#000000"><span style="font-size:14px"><br></span></font></div><div><font color="#000000"><span style="font-size:14px">Moreover, since I used occupation = </span></font> 'fixed', no states above EF is calculated. Therefore, even if I set a wrong EF, it should only leads to a smaller integrated value compared to the total number of electrons. But now what I got a integrated value of 29, which is much larger than the 26 electrons in MoS2 monolayer.</div><div><br></div><div>For your convenience, I put my input files here. I used QE-6.3 for those calculations.</div><div><br></div><div><a href="http://MoS2.nscf.in">MoS2.nscf.in</a>:</div><div> </div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div><div> &control</div></div></div></div></div></div><div><div><div><div><div><div> calculation='nscf'</div></div></div></div></div></div><div><div><div><div><div><div> restart_mode='from_scratch',</div></div></div></div></div></div><div><div><div><div><div><div> prefix='MoS2',</div></div></div></div></div></div><div><div><div><div><div><div> pseudo_dir = '../pp',</div></div></div></div></div></div><div><div><div><div><div><div> outdir='./tmp/' </div></div></div></div></div></div><div><div><div><div><div><div> disk_io='low'</div></div></div></div></div></div><div><div><div><div><div><div> /</div></div></div></div></div></div><div><div><div><div><div><div> &system</div></div></div></div></div></div><div><div><div><div><div><div> ibrav=4 ,</div></div></div></div></div></div><div><div><div><div><div><div> a = 3.13079 ,</div></div></div></div></div></div><div><div><div><div><div><div> c = 20, </div></div></div></div></div></div><div><div><div><div><div><div> nat = 3 , ntyp= 2,</div></div></div></div></div></div><div><div><div><div><div><div> ecutwfc= 60.0, </div></div></div></div></div></div><div><div><div><div><div><div> ecutrho= 600.0, </div></div></div></div></div></div><div><div><div><div><div><div> occupations='fixed', </div></div></div></div></div></div><div><div><div><div><div><div> /</div></div></div></div></div></div><div><div><div><div><div><div> &electrons</div></div></div></div></div></div><div><div><div><div><div><div> electron_maxstep=300</div></div></div></div></div></div><div><div><div><div><div><div> conv_thr = 1.0d-7</div></div></div></div></div></div><div><div><div><div><div><div> mixing_beta = 0.7</div></div></div></div></div></div><div><div><div><div><div><div> /</div></div></div></div></div></div><div><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div><div><div><div>&ions</div></div></div></div></div></div><div><div><div><div><div><div> /</div></div></div></div></div></div><div><div><div><div><div><div> &cell</div></div></div></div></div></div><div><div><div><div><div><div> /</div></div></div></div></div></div><div><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div><div><div><div>ATOMIC_SPECIES</div></div></div></div></div></div><div><div><div><div><div><div> Mo 95.94 Mo.pz-spn-rrkjus_psl.0.2.UPF</div></div></div></div></div></div><div><div><div><div><div><div> S 32.07 S.pz-n-rrkjus_psl.0.1.UPF</div></div></div></div></div></div><div><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div><div><div><div>ATOMIC_POSITIONS (crystal)</div></div></div></div></div></div><div><div><div><div><div><div>Mo 0.000000000 0.000000000 0.000000000</div></div></div></div></div></div><div><div><div><div><div><div>S 0.333333333 0.666666667 0.077787748</div></div></div></div></div></div><div><div><div><div><div><div>S 0.333333333 0.666666667 -0.077787748</div></div></div></div></div></div><div><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div><div><div><div>K_POINTS {automatic}</div></div></div></div></div></div><div><div><div><div><div><div>100 100 1 0 0 0</div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><br></div></div><div><br></div><div><a href="http://MoS2.pp.in">MoS2.pp.in</a>:</div><div><br></div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div><div>&inputpp</div></div></div></div></div></div><div><div><div><div><div><div> prefix='MoS2',</div></div></div></div></div></div><div><div><div><div><div><div> outdir='../tmp',</div></div></div></div></div></div><div><div><div><div><div><div> filplot = 'MoS2.charge'</div></div></div></div></div></div><div><div><div><div><div><div> plot_num= 10</div></div></div></div></div></div><div><div><div><div><div><div> emin = -65</div></div></div></div></div></div><div><div><div><div><div><div>/</div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><br></div></div><a href="http://MoS2.avg.in">MoS2.avg.in</a>: </div></div></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><div>1</div></div></div></div></div><div><div><div><div><div><div>MoS2.charge</div></div></div></div></div></div><div><div><div><div><div><div>1.D0</div></div></div></div></div></div><div><div><div><div><div><div>2000</div></div></div></div></div></div><div><div><div><div><div><div>3</div></div></div></div></div></div><div><div>37.7945</div></div></blockquote><div dir="ltr"><br></div>Note the awin=37.7945 in <a href="http://MoS2.avg.in">MoS2.avg.in</a> might not be appropriate, but it will not influence the planar average.</div><div dir="ltr"><br></div><div dir="ltr"><br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thank you very much.</div><div><br></div><div>Ding-Fu</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><b style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Giovanni Cantele</b><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> </span><a href="mailto:users%40lists.quantum-espresso.org?Subject=Re:%20Re%3A%20%5BQE-users%5D%20Unit%20for%20the%20output%20of%20average.x&In-Reply-To=%3CAE0AD77F-2745-4B15-9DF1-E8491D64AAF9%40spin.cnr.it%3E" title="[QE-users] Unit for the output of average.x" style="font-family:"Times New Roman";font-size:medium">giovanni.cantele at spin.cnr.it <br></a><i style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Fri Oct 26 21:08:23 CEST 2018</i> <br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Are you sure about you Fermi level? How did you get it?<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
GIOVANNI<br>
Inviato da iPhone</blockquote><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)"></pre></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Il giorno 26 ott 2018, alle ore 19:33, Dingfu Shao <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">dingfu.shao at gmail.com</a>> ha scritto:
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Dear Giovanni and Paolo,
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Thanks very much for your suggestions.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> I reconsidered the definition of the local density of states (say, LD(x,y,z,E)). Since it is "local", the unit of it should be states/eV/bohr^3 or electrons/eV/bohr^3. Therefore, the integration of it within an energy window should lead to the charge density in this energy window: electrons/bohr^3 . Therefore, if we choose the energy window from the lowest energy to the Fermi energy, we should get exactly the total charge density.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> So I did some tests following Giovanni's suggestion, using a simple case of momolayer MoS2, which has "number of electrons = 26.00". The area of its xy plane is S. For those tests, the previous scf and nscf calculations are the same, with LDA USPP, the occupation= 'fixed', and k-points of 40*40*1 for scf and 100*100*1 for nscf.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> 1. I calculated the total charge density (rho(x,y,z)) using pp.x with plot_num = 0, and then calculate the planar average of it (rho_avg(z)). Then I integrated it by \int (S* rho_avg(z)) dz and I got 25.89. It is close to 26.00, maybe a more accurate value can be obtained by a calculation with denser k points.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> 2. I calculated the integrated local density of states ( ILD(x,y,z)) from -65 eV (this energy is below the lower band) to Fermi energy using pp.x with plot_num =10, and and then calculate the planar average of it ( ILD_avg(z) ). When I integrated it by \int (S* ILD_avg(z)) dz, I got 29.25, which is much larger than the total number of electrons of 26.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> So it seems the the test 2 doesn't correctly reflect the reality. I am not sure it is due to something happened with plot_num = 10 in pp.x, or just I understand this incorrectly.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Any suggestions? Thank you very much!
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Best,
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> Ding-Fu
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> From: Giovanni Cantele <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">giovanni.cantele at spin.cnr.it</a>>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> To: Quantum Espresso users Forum <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">users at lists.quantum-espresso.org</a>>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Cc:
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Bcc:
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Date: Fri, 26 Oct 2018 09:51:40 +0200
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Subject: Re: [QE-users] Unit for the output of average.x
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Dear Ding-Fu,
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> as far as I remember there is a surface factor that you need to adjust units.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> For sure on the ascissa axis the coordinate is in bohr.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> The planar average give you back a quantity with the same units as the averaged quantity
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> (e.g. if you star from charge density in electrons/bohr^3 you get an averaged electron density in electrons/bohr^3),
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> being defined as (let us suppose that you average in the plane defined by a1 and a2 vectors):
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> rho_avg(z) = ( 1 / S ) * integral( dx dy rho(x,y,z) )
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> That means that if you perform
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> integral( dz rho_avg(z) )
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> you get
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> number of electrons / S
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> If you need number of electrons than just multiply by S with
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> S = cross_product( a1, a2 )
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> (in bohr^2)
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Just try, better if you do it with the total charge density, to check if the integral returns you
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> the number of electrons.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> I’m sorry but I cannot check directly if I remember correctly at the moment, but
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> this should work.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Giovanni
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> --
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Giovanni Cantele, PhD
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> CNR-SPIN
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> c/o Dipartimento di Fisica
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Universita' di Napoli "Federico II"
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Complesso Universitario M. S. Angelo - Ed. 6
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Via Cintia, I-80126, Napoli, Italy
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> e-mail: <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">giovanni.cantele at spin.cnr.it</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">gcantele at gmail.com</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Phone: +39 081 676910
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Skype contact: giocan74
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Web page: <a href="https://sites.google.com/view/giovanni-cantele">https://sites.google.com/view/giovanni-cantele</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> On 26 Oct 2018, at 03:31, Dingfu Shao <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">dingfu.shao at gmail.com</a>> wrote:
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Dear QE developers and users:
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> I am wondering what should be the unit of the planar average data got from the average.x
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> I am calculating the planar average of charge density within a energy window. What I did is firstly using pp to get the integrated local density of states (ILDOS) of that energy window with plot_num=10, then using average.x to get the planar average.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> In this case, what is the unit of the second column (say, rho(z)) of the output file? I thought since the DOS has a unit of states/eV, the integration of DOS within a energy window should get some states or electrons. Then the unit of rho(z) should be electron/bohr. But seems it is not. In my case the energy window I concerned contains one electron, However, if I directly integrate rho(z), I can only get a very small value. If I assume the unit is electron/(bohr^3), the integretion of rho(z)*A is also smaller than one (here A is the area of xy plane).
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Can you help me about it? Thank you very much!
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Best,
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Ding-Fu
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Ding-Fu Shao, Ph. D.
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Department of Physics and Astronomy, University of Nebraska-Lincoln
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Lincoln, NE 68588-0299
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> Email: <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">dingfu.shao at gmail.com</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> _______________________________________________
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> users mailing list
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">users at lists.quantum-espresso.org</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">https://lists.quantum-espresso.org/mailman/listinfo/users</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">>><i>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> _______________________________________________
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> users mailing list
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">users at lists.quantum-espresso.org</a>
</i></pre></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">https://lists.quantum-espresso.org/mailman/listinfo/users</a></i></pre></div></blockquote></div></div></div></div></div></div></div>