in fact , this question has been asked for many times in the forum.&nbsp; Just do a refined search with &#39;workfunction &#39; or &#39;<br>vacuum level &#39; keywords in google or other engines will <br>help you a lot.&nbsp;&nbsp;&nbsp; And there is also a example about how<br>
to do workfunction&#39;s calculation&nbsp; supplied with QE, which <br>you can find in $QE/examples/WorkFct_example. <br><br>how to define vacuum level ?&nbsp; a simple or handwaving picture is to do plane average of electrostatic potential&nbsp; <br>
perpendicular to vacuum layer.&nbsp; If your vacuum layer is <br>thick enough, you should find a constant value in the vacuum&nbsp;&nbsp; layer region. This value , you then can refer to<br>so-called vacuum level.<br><br><br><div class="gmail_quote">
On Fri, Nov 14, 2008 at 10:36 AM, oulihui666 <span dir="ltr">&lt;<a href="mailto:oulihui666@126.com">oulihui666@126.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Dear pwscf users,</div>
<div>I want to calculate work function, I have got the fermi level,&nbsp;so I must get the vacuum level.</div>
<div>&nbsp;<span style="font-size: 12pt; color: red;" lang="EN-US"><b>work = (vacuum level) - (fermi level)</b></span></div>
<div><span style="font-size: 12pt; color: red;" lang="EN-US">
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000">My&nbsp;input file displayed as follows:</font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000">(1)scf calculation:</font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US">&amp;control<br>&nbsp;&nbsp;&nbsp; calculation=&#39;scf&#39;<br>
&nbsp;&nbsp;&nbsp; restart_mode=&#39;from_scratch&#39;,<br>&nbsp;&nbsp;&nbsp; prefix=&#39;Al&#39;,<br>&nbsp;&nbsp;&nbsp; pseudo_dir = &#39;./&#39;,<br>&nbsp;&nbsp;&nbsp; outdir=&#39;./&#39;<br>&nbsp;/<br>&nbsp;&amp;system<br>&nbsp;&nbsp;&nbsp; ibrav=&nbsp; 0,&nbsp; nat=11, ntyp= 1,<br>&nbsp;&nbsp;&nbsp; ecutwfc =16, <br>&nbsp;&nbsp;&nbsp; occupations=&#39;smearing&#39;, smearing=&#39;methfessel-paxton&#39;, degauss=0.01<br>
&nbsp;/<br>&nbsp;&amp;electrons<br>&nbsp;&nbsp;&nbsp; conv_thr =&nbsp; 1.0d-8<br>&nbsp;&nbsp;&nbsp; mixing_beta = 0.7<br>&nbsp;/<br>CELL_PARAMETERS cubic<br>5.41176&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0<br>0&nbsp;&nbsp;&nbsp; 5.41176&nbsp;&nbsp;&nbsp; 0<br>0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60.9909 <br>ATOMIC_SPECIES<br>Al 13.867&nbsp;&nbsp;&nbsp;&nbsp; Al.vbc.UPF <br>
ATOMIC_POSITIONS {angstrom}<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0<br>Al&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 2.025<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 4.05<br>Al&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 6.075<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 8.1<br>Al&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 10.125<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 12.15<br>
Al&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 14.175<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 16.2<br>Al&nbsp;&nbsp;&nbsp; 1.43189&nbsp;&nbsp;&nbsp; 143189&nbsp;&nbsp;&nbsp; 18.225<br>Al&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 20.25<br>K_POINTS {automatic}<br>&nbsp; 8&nbsp; 8 1&nbsp; 0 0 0<br></span></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US">(2)Electrostatic potential calculation:</span></font></span></p>

<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US">&nbsp;&amp;inputpp<br>
&nbsp;&nbsp;&nbsp; prefix&nbsp; = &#39;Al&#39;<br>&nbsp;&nbsp;&nbsp; outdir = &#39;./&#39;<br>&nbsp;&nbsp;&nbsp; filplot = &#39;Al.pot&#39;<br>&nbsp;&nbsp;&nbsp; plot_num= 11<br>&nbsp;/<br></span></span></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US">(3)<span style="font-size: 12pt;" lang="EN-US">macroscopic averages calculation: average.x.</span></span></span></font></span></p>

<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 12pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US">1<br>
Al.pot<br>1.D0<br>5000<br>3<br>2.95<br></span></span></span></span></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"><font color="#000000"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US"><span style="font-size: 12pt;" lang="EN-US"><span style="font-size: 10.5pt;" lang="EN-US">Finally, I get a output file, <span style="font-size: 12pt;" lang="EN-US">column 1: coordinate u, <b><span style="color: red;">defined over a mesh of npt=5000 point</span></b>s along the direction idir=3, <span style="font-size: 12pt;" lang="EN-US">column 2: <b><span style="color: red;">averaged quantity</span></b> V, </span></span></span></span></span></span></font></span></p>

<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US">column 3: <b><span style="color: red;">macroscopically averaged quantity V</span></b>,&nbsp; I should how to get the vacuum level? any suggestion will be appreciated.</span></p>

<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US"></span>&nbsp;</p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US">Thank you</span></p>
<p style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%;" lang="EN-US">Lihui Ou</span></p></span></div>
<div><br>--<br>
<div>
<div><font face="Arial" size="3">======================================</font></div>
<div><font face="Arial" size="3">Lihui&nbsp;Ou</font></div>
<div><font face="Arial" size="3">PH.D Candidate&nbsp;in Electrochemistry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></div>
<div><font face="Arial" size="3">College of Chemistry and Molecular Science&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></div>
<div><font face="Arial" size="3">Wuhan University,<i>430072</i>,Hubei Province,China&nbsp;</font></div>
<div><i><font face="Arial" size="3">E-mail:</font><a href="mailto:oulihui666@126.com" target="_blank"><font face="Arial" size="3">oulihui666@126.com</font></a></i></div>
<div><font face="Arial" size="3">======================================</font></div></div></div><br><br><hr>
<a href="http://www.yeah.net" target="_blank">网易邮箱10周年,技术见证辉煌</a>
<br>_______________________________________________<br>
Pw_forum mailing list<br>
<a href="mailto:Pw_forum@pwscf.org">Pw_forum@pwscf.org</a><br>
<a href="http://www.democritos.it/mailman/listinfo/pw_forum" target="_blank">http://www.democritos.it/mailman/listinfo/pw_forum</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Hai-Ping Lan <br>Department of Electronics ,<br>Peking University , Bejing, 100871<br><a href="mailto:lanhaiping@gmail.com">lanhaiping@gmail.com</a>, <a href="mailto:hplan@pku.edu.cn">hplan@pku.edu.cn</a><br>