<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Provided that you have a sufficient number of layers to guarantee in both sides a “bulk-like” region, you can choose the innermost layers.<div class=""><br class=""></div><div class="">But, because you have an interface, what is the quantity are you interested in? The interface barrier (in your case the Schottky barrier, because you have a metal-semiconductor</div><div class="">junction) or the work function? Consider that, in the latter case, because the two sides of the slab are different:</div><div class="">i) the vacuum level is different at the two sides, so you just choose the interplanar distance of the material you are interested in (either ZnO or Au)</div><div class="">ii) because  the vacuum level is different at the two sides, you must consider to add a correction for a “spurious” dipole introduced by boundary conditions, using         tefield=.true.<br class="">        dipfield=.true., and the related variables (see PW/DOC/INPUT_PW.txt for explanation) edit, eamp=0.D0, eopreg and examples</div><div class=""><br class=""></div><div class="">In the case you are instead interested in the interface barrier, you easily figure out that by choosing, as the window for the macroscopic average either the ZnO or the Au interplanar distance you get rid of microscopic oscillations only on one side. In this case, you can compute the averages with both windows, and plot them on the same plot. If needed, you might want to have a look at Fig. 6 of N.R. D’amico, et al,  J. Phys.: Condens. Matter 27 (2015) 015006 </div><div class=""><br class=""></div><div class="">Hope this helps,</div><div class=""><br class=""></div><div class="">    Giovanni</div><div class=""><br class=""></div><div class="">PS Warning: the ZnO orientation you are studying is polar, so the macroscopic average does not give you a constant value of the potential in the innermost part of the ZnO slab,</div><div class="">but a linearly varying one. There are examples in the literature on how the handle the electrostatic potential in polar slabs, see references in the above mentioned paper.<br class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Mar 2015, at 11:47, Bipul Rakshit <<a href="mailto:bipulrr@gmail.com" class="">bipulrr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Really thanks for your suggestion Giovanni,<div class="">I just have few more doubts that if i want to find the work function of Au-ZnO Slab. I have created Au(111) and ZnO(0001) Slab. So it has an interface of Zn-Au and a vacuum of 10 Angstrom. I took 6 layers of Au and 4 double layers of ZnO. Then how to proceed.</div><div class="">Means</div><div class="">1) Which two consecutive atomic planes I have to choose Au-Au, Au-Zn or the Zn-O planes. for the microscopic average calculation?</div><div class=""><br class=""></div><div class="">2) Also in-order to choose the inner part of the slab, so that part is inside the Au-Slab or the ZnO Slab?</div><div class=""><br class=""></div><div class="">regards</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Mar 18, 2015 at 5:02 PM, Giovanni Cantele <span dir="ltr" class=""><<a href="mailto:giovanni.cantele@spin.cnr.it" target="_blank" class="">giovanni.cantele@spin.cnr.it</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">The average electrostatic potential you are calculating/plotting does show microscopic oscillations, revealing the atomic planes</div><div class="">(plot the 2d column of reference/Al100.avg.out  as a function of the 1st one).</div><div class=""><br class=""></div><div class="">The calculation of the work function requires a “constant” energy level to compare the bulk and the slab calculation. For this purpose,</div><div class="">you run a macroscopic average of the x-y averaged electrostatic potential. The window you choose for the macroscopic average</div><div class="">is just the distance between two consecutive atomic planes (in a.u.).</div><div class="">Because the input positions are in alat units, you get</div><div class=""><br class=""></div><div class="">(2.8284271247461898 - 2.1213203435596428) * 5.4235090117 = 3.835</div><div class=""><br class=""></div><div class="">In this way, microscopic oscillations with period 3.835 are averaged and a constant level (in the inner region of the slab) is obtained.</div><div class=""><br class=""></div><div class="">Concerning 17.8087, in order to get this constant value, you can choose any position in the inner part of the slab where the</div><div class="">macroscopic average does not show significant variations.</div><div class=""><br class=""></div><div class="">Giovanni</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On 18 Mar 2015, at 10:49, Bipul Rakshit <<a href="mailto:bipulrr@gmail.com" target="_blank" class="">bipulrr@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class=""><div class=""><div class="">In espresso, there is an example to find the workfunction of Al. In the run_example, the input for the the macroscopic average is the following<br class="">cat > <a href="http://al100.avg.in/" target="_blank" class="">Al100.avg.in</a> <<EOF<br class="">1<br class="">Al100.pot<br class="">1.D0<br class="">1440<br class="">3<br class=""><span style="color:rgb(255,0,0)" class="">3.835000000</span><br class="">EOF<br class=""><br class=""></div>In this file the quantity "3.835" i saw in average.f90 as "awin         ! the size of the window for macroscopic averages"<br class=""><br class=""></div>So my doubt is how we can choose this no. Can we get the information from another file prerun file, like Al100.pot, or something else.<br class=""><br class=""></div>Also in run_example there is another quantity vSlab<br class=""><br class="">vSlab=`grep "17.8087" Al100.avg.out | cut -d \  -f 10`<br clear="all" class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">So how the value correspond to "17.8087" is assign as vSlab?<br class=""><br class=""></div><div class="">Kindly help me in this matter.<br class=""><br class=""></div><div class="">regards<br class=""></div><div class="">-- <br class=""><div class=""><div dir="ltr" class=""><div class="">Dr. Bipul Rakshit<br class="">Research Associate,<br class="">Institute of Physics (IOP),<br class="">Bhubaneswar- <span class="">751 005</span></div><div class="">Orissa <br class=""></div><div class="">India</div></div></div>
</div></div></div></div></div></div>
_______________________________________________<br class="">Pw_forum mailing list<br class=""><a href="mailto:Pw_forum@pwscf.org" target="_blank" class="">Pw_forum@pwscf.org</a><br class=""><a href="http://pwscf.org/mailman/listinfo/pw_forum" target="_blank" class="">http://pwscf.org/mailman/listinfo/pw_forum</a></div></blockquote></div><br class=""><div class="">
-- <br class=""><br class="">Giovanni Cantele, PhD<br class="">CNR-SPIN<br class="">c/o Dipartimento di Fisica<br class="">Universita' di Napoli "Federico II"<br class="">Complesso Universitario M. S. Angelo - Ed. 6<br class="">Via Cintia, I-80126, Napoli, Italy<br class="">e-mail: <a href="mailto:giovanni.cantele@spin.cnr.it" target="_blank" class="">giovanni.cantele@spin.cnr.it</a><br class="">Phone: +39 081 676910<br class="">Skype contact: giocan74<br class=""><br class="">ResearcherID: <a href="http://www.researcherid.com/rid/A-1951-2009" target="_blank" class="">http://www.researcherid.com/rid/A-1951-2009</a><br class="">Web page: <a href="http://people.na.infn.it/~cantele" target="_blank" class="">http://people.na.infn.it/~cantele</a><br class="">

</div>
<br class=""></div><br class="">_______________________________________________<br class="">
Pw_forum mailing list<br class="">
<a href="mailto:Pw_forum@pwscf.org" class="">Pw_forum@pwscf.org</a><br class="">
<a href="http://pwscf.org/mailman/listinfo/pw_forum" target="_blank" class="">http://pwscf.org/mailman/listinfo/pw_forum</a><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Dr. Bipul Rakshit<br class="">Research Associate,<br class="">Institute of Physics (IOP),<br class="">Bhubaneswar- <span class="">751 005</span></div><div class="">Orissa <br class=""></div><div class="">India</div></div></div>
</div>
_______________________________________________<br class="">Pw_forum mailing list<br class=""><a href="mailto:Pw_forum@pwscf.org" class="">Pw_forum@pwscf.org</a><br class="">http://pwscf.org/mailman/listinfo/pw_forum</div></blockquote></div><br class=""><div apple-content-edited="true" class="">
-- <br class=""><br class="">Giovanni Cantele, PhD<br class="">CNR-SPIN<br class="">c/o Dipartimento di Fisica<br class="">Universita' di Napoli "Federico II"<br class="">Complesso Universitario M. S. Angelo - Ed. 6<br class="">Via Cintia, I-80126, Napoli, Italy<br class="">e-mail: <a href="mailto:giovanni.cantele@spin.cnr.it" class="">giovanni.cantele@spin.cnr.it</a><br class="">Phone: +39 081 676910<br class="">Skype contact: giocan74<br class=""><br class="">ResearcherID: <a href="http://www.researcherid.com/rid/A-1951-2009" class="">http://www.researcherid.com/rid/A-1951-2009</a><br class="">Web page: <a href="http://people.na.infn.it/~cantele" class="">http://people.na.infn.it/~cantele</a><br class="">

</div>
<br class=""></div></div></body></html>