<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><big><big>Dear Pedro,<br>
        </big></big><br>
      <big><big>one possible reason for discrepancy is due to the finite
          k-sampling of the Brillouin zone for the evaluation of the
          WFs. The derivatives in k space are approximated with finite
          differences, and the WFs become periodic; this can induce some
          error on the calculated WFs centers and spreads. In
          particular, for Gamma-only sampling, the periodicity is the
          same of the lattice. You can try to use a finer k mesh (2x2x2
          or larger instead of gamma-only) and see if things improve
          (note that we expect that the bands are flat in k-space; this
          is only a way of reducing the error </big></big><big><big>on
          the calculated WFs </big></big><big><big>due to the finite
          k-sampling).<br>
          <br>
          There is also another detail to which you should pay
          attention: if the plane-wave calculation is converged with
          respect to the box size. Try to increase the cell size from
          10.6 angstrom to larger values until the value of the dipole
          (calculated by QE) doesn't change significantly anymore. For
          small box sizes, in fact, you may have spurious effects due to
          the interaction of one water molecule with its periodic
          images.<br>
          <br>
          Hope it helps,<br>
          Giovanni Pizzi<br>
          <br>
        </big></big><br>
      On 07/02/2012 08:42 PM, Pedro Augusto F. P. Moreira wrote:<br>
    </div>
    <blockquote cite="mid:4FF1EB79.8080507@ifi.unicamp.br" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <big><big><big> Dear all,<br>
            <br>
             I have not calculated correctly yet the spontaneous
            polarization of a water molecule as I mentioned in my last
            e-mail. Here, I gonna detail my calculation steps and put my
            inputs and main output and hope that someone could give any
            advice.<br>
             As I said, I did two simulation: (1) as Cantele suggested:
            my h2o.scf input  had tefield=.true. (it can be seen below);
            (2) And using th Wannier funciton centres which I calculated
            with following sequence of commands:<br>
            <br>
            <small>1) pw.x < h2o.scf >scf.out<br>
              2) pw.x < h2o.nscf >nscf.out<br>
              3) wannier90.x -pp h2o <br>
              4) pw2wannier90.x < h2o.pw2wan > pw2wan.out <br>
              5) wannier90.x h2o</small><br>
            <br>
            My inputs and main outputs are bellow. The polarization,
            using WFs, were calculated by the vectorial sum of ion
            positions times their atomic number less twice the WF centre
            sum.<br>
            <br>
             I repeated all calculations, using a "relax" command
            instead of "scf" command in step 1. The positions used on
            the following inputs (h2o.nscf, h2o.win and WF polarization
            calculations) were the relaxed atomic positions.<br>
            <br>
             The polarizations, which I found, are:<br>
            <small><br>
                Methods  |   Polarizations (Debye)<br>
               (1) tefield |    1.8179<br>
               (2) WFs    |    1.8966<br>
              <br>
               using 'relax' command:<br>
               (3) tefield |    1.7828<br>
               (4) WFs </small></big></big><small><big><big>   |   
              1.8544</big></big><br>
        </small></big>
      <title></title>
      <meta name="GENERATOR" content="LibreOffice 3.5 (Linux)">
      <style>
                <!-- 
                BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
                 -->
        </style><big><big><big><br>
             Anyone knows why the polarization values are so discrepant.
            I note that the discrepancies are greater if the atoms are
            dislocated to the center of the cubic cell.<br>
            <br>
              With best regards, </big></big></big><br>
      <big><big><big><br>
              Pedro Moreira</big></big></big><br>
      <br>
      <big><big><big><small><small>##h2o.scf########################################<br>
                &control<br>
                    calculation='scf',              ! it was substituted
                for 'nscf' and 'relax' in calculations with these names<br>
                    restart_mode='from_scratch',<br>
                   
                pseudo_dir='/home/pedro/Documentos/espresso-5.0/pseudo',<br>
                    outdir='/home/pedro/Documentos/espresso-5.0/exec1',<br>
                    prefix='h2o',<br>
                    tprnfor = .true.,<br>
                    nstep = 500,<br>
                    forc_conv_thr = 1.9e-4,<br>
                    tefield=.true.<br>
                    dipfield=.true.<br>
                /<br>
                &system<br>
                    ibrav = 0, <br>
                    nat = 3, ntyp = 2,<br>
                    ecutwfc = 70.0, ecutrho = 700.0,<br>
                    edir=3<br>
                    eamp=0.D0<br>
                    eopreg=0.1<br>
                    emaxpos=0.5<br>
                /<br>
                &electrons<br>
                    electron_maxstep = 500,<br>
                /<br>
                &ions<br>
                /<br>
                ATOMIC_SPECIES<br>
                 H 1.00790 H.blyp-van_ak.UPF<br>
                 O 15.9994 O.blyp-van_ak.UPF<br>
                ATOMIC_POSITIONS angstrom<br>
                O    0.0  0.0  0.0<br>
                H    0.77 0.0  0.62<br>
                H   -0.77 0.0  0.62<br>
                CELL_PARAMETERS angstrom<br>
                   10.6  0.00  0.00<br>
                   0.00  10.6  0.00<br>
                   0.00  0.00  10.6<br>
                K_POINTS {gamma}<br>
                ##############################################</small></small><br>
          </big></big>##scf.out#######################################<br>
             iteration #  6     ecut=    70.00 Ry     beta=0.70<br>
             Davidson diagonalization with overlap<br>
             ethr =  4.01E-07,  avg # of iterations =  2.0<br>
        <br>
      </big> <big>      negative rho (up, down):  0.293E-02 0.000E+00<br>
        <br>
      </big> <big>      Adding external electric field<br>
        <br>
      </big> <big>      Computed dipole along edir(3) : <br>
                Dipole                0.7152 Ry au,          1.8179
        Debye<br>
                Dipole field          0.0011 Ry au<br>
        <br>
      </big> <big>         Potential amp.       -0.0403 Ry<br>
                Total length         18.0280 bohr<br>
        <br>
        <br>
      </big> <big>      total cpu time spent up to now is      134.0
        secs<br>
        <br>
      </big> <big>      End of self-consistent calculation<br>
        <br>
      </big> <big>           k = 0.0000 0.0000 0.0000 ( 39751 PWs)  
        bands (ev):<br>
        <br>
      </big> <big>    -24.8436 -12.5614  -9.1444  -7.1431<br>
        <br>
        !    total energy              =     -34.42311963 Ry</big> <big><br>
             Harris-Foulkes estimate   =     -34.42315705 Ry<br>
             estimated scf accuracy    <       0.00000072 Ry<br>
        ##############################################<br>
        ##h2o.win######################################<br>
        num_wann        =  4 <br>
        num_iter        = 100<br>
        <br>
        begin atoms_cart<br>
        O    0.0  0.0  0.0<br>
        H    0.77 0.0  0.62<br>
        H   -0.77 0.0  0.62<br>
        end atoms_cart<br>
        <br>
        begin projections<br>
        random<br>
        end projections<br>
        <br>
        begin unit_cell_cart<br>
           10.6  0.00  0.00<br>
           0.00  10.6  0.00<br>
           0.00  0.00  10.6<br>
        end unit_cell_cart<br>
        <br>
        mp_grid    : 1 1 1 <br>
        gamma_only : true<br>
        <br>
        begin kpoints<br>
        0.0 0.0 0.0<br>
        end kpoints<br>
        ##############################################<br>
        ##h2o.pw2wan##################################<br>
        &inputpp <br>
           outdir = './'<br>
           prefix = 'h2o'<br>
           seedname = 'h2o'<br>
           spin_component = 'none'<br>
           write_mmn = .true.<br>
           write_amn = .true.<br>
           write_unk = .false.<br>
        /<br>
        ##############################################<br>
        ##h2o.wout_scf##################################<br>
         Writing checkpoint file h2o.chk... done<br>
        <br>
         Final State<br>
          WF centre and spread    1  ( -0.000000, -0.257416, -0.127263
        )     0.53681556<br>
          WF centre and spread    2  ( -0.399319,  0.000000,  0.338531
        )     0.49244402<br>
          WF centre and spread    3  (  0.399320, -0.000000,  0.338532
        )     0.49244441<br>
          WF centre and spread    4  (  0.000000,  0.257415, -0.127263
        )     0.53681748<br>
          Sum of centres and spreads (  0.000001, -0.000001,  0.422537
        )     2.05852147<br>
        <br>
                 Spreads (Ang^2)       Omega I      =     1.816167784<br>
                ================       Omega D      =     0.000000000<br>
                                       Omega OD     =     0.242353686<br>
            Final Spread (Ang^2)       Omega Total  =     2.058521470<br>
 ------------------------------------------------------------------------------<br>
         Time for wannierise            0.012 (sec)<br>
        <br>
         Writing checkpoint file h2o.chk... done<br>
        ##############################################<br>
        ##relax.out####################################<br>
             Computed dipole along edir(3) : <br>
                Dipole                0.7014 Ry au,          1.7828
        Debye<br>
                Dipole field          0.0011 Ry au<br>
        <br>
                Potential amp.       -0.0395 Ry<br>
                Total length         18.0280 bohr<br>
        <br>
        <br>
             total cpu time spent up to now is      688.6 secs<br>
        <br>
             End of self-consistent calculation<br>
        <br>
                  k = 0.0000 0.0000 0.0000 ( 39751 PWs)   bands (ev):<br>
        <br>
           -24.9139 -12.7725  -9.0391  -7.1487<br>
        <br>
        !    total energy              =     -34.42371576 Ry<br>
             Harris-Foulkes estimate   =     -34.42371607 Ry<br>
             estimated scf accuracy    <          4.4E-10 Ry<br>
        <br>
             The total energy is the sum of the following terms:<br>
        <br>
             one-electron contribution =     -64.27367874 Ry<br>
             hartree contribution      =      33.58470996 Ry<br>
             xc contribution           =      -8.36936347 Ry<br>
             ewald contribution        =       4.63384732 Ry<br>
             electric field correction =       0.00076917 Ry<br>
        <br>
             convergence has been achieved in   4 iterations<br>
        <br>
             Forces acting on atoms (Ry/au):<br>
        <br>
             atom    1 type  2   force =    -0.00001778    0.00000017   
        0.00004093<br>
             atom    2 type  1   force =    -0.00002047   -0.00000010  
        -0.00001330<br>
             atom    3 type  1   force =     0.00003825   -0.00000007  
        -0.00002763<br>
        <br>
             Total force =     0.000069     Total SCF correction =    
        0.000038<br>
             SCF correction compared to forces is large: reduce conv_thr
        to get better values<br>
        <br>
             bfgs converged in   6 scf cycles and   5 bfgs steps<br>
             (criteria: energy < 0.10E-03, force < 0.19E-03)<br>
        <br>
             End of BFGS Geometry Optimization<br>
        <br>
             Final energy   =     -34.4237157619 Ry<br>
        Begin final coordinates<br>
        <br>
        ATOMIC_POSITIONS (angstrom)<br>
        O        0.000004575  -0.000000364   0.015670447<br>
        H        0.774640336   0.000000070   0.612163521<br>
        H       -0.774644910   0.000000294   0.612166031<br>
        End final coordinates<br>
        #################################################<br>
        ##h2o.wout_relax###################################<br>
        Writing checkpoint file h2o.chk... done<br>
        <br>
         Final State<br>
          WF centre and spread    1  (  0.000004, -0.255729, -0.113705
        )     0.53766112<br>
          WF centre and spread    2  ( -0.400232,  0.000000,  0.346762
        )     0.48541250<br>
          WF centre and spread    3  (  0.400236, -0.000000,  0.346762
        )     0.48540610<br>
          WF centre and spread    4  (  0.000005,  0.255727, -0.113705
        )     0.53766277<br>
          Sum of centres and spreads (  0.000013, -0.000002,  0.466114
        )     2.04614249<br>
        <br>
                 Spreads (Ang^2)       Omega I      =     1.801532201<br>
                ================       Omega D      =     0.000000000<br>
                                       Omega OD     =     0.244610290<br>
            Final Spread (Ang^2)       Omega Total  =     2.046142491<br>
 ------------------------------------------------------------------------------<br>
        ##################################################<br>
      </big><br>
      <div class="moz-cite-prefix">
        <pre><big><big><big>Em 29-06-2012 18:06, Pedro Augusto F. P. Moreira escreveu:</big></big></big></pre>
      </div>
      <blockquote cite="mid:4FEE18C6.5090906@ifi.unicamp.br" type="cite">
        <pre wrap=""><big><big><big>  Dear all.

  I am trying to calculate the spontaneous electric polarization of a 
single water molecule as a test.
  I am using Quantum Espresso (pw.x and wannier90). I did by two 
methods:  (1) using  tefield=.true. as suggested by Cantele 
(<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.democritos.it/pipermail/pw_forum/2009-March/011936.html">http://www.democritos.it/pipermail/pw_forum/2009-March/011936.html</a>) and 
(2) by Wannier function centres (WF).
  I run a set of simulations with different initial atomic positions. 
The first simulation, I used the positions mentioned by Cantele and 
found P = 1.82 D and P =1.84 D by method (1). By WF, P= 1.90 D and 1.92 
D. The first values are calculated with BLYP functional and the second 
ones with PBE functional.
  After that, I moved initially all atoms by a vector (1.0  0.0  0.0) 
angstrom, relaxed the molecule and did again the calculations above. I 
found for Cantele way: P = 1.78 D and 1.80 D. By WF, P = 6.33 D and 6.37 D.
  My questions are:

  (a) I expected to find values closer to 1.87 D in all calculations, 
but all they are diverging from this value by, at least, 2 %. Should I 
really expect it ?
  (b) Anyone knows what can be happening in WF calculations when I moved 
the atoms? I know that if the atoms were moved beyond the unit cell, a 
constant factor would be summed to polarization. But, I think that is 
not my case because the dislocation vector was 1.0 A , while my cubic 
cell has 10.6 A edges.

  With best regards,

  Pedro

</big></big></big></pre>
        <big> </big></blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Pedro Moreira

IFGW - Unicamp - Brazil</pre>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Wannier mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Wannier@quantum-espresso.org">Wannier@quantum-espresso.org</a>
<a class="moz-txt-link-freetext" href="http://www.democritos.it/mailman/listinfo/wannier">http://www.democritos.it/mailman/listinfo/wannier</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Giovanni Pizzi
Post-doctoral Research Scientist
EPFL STI IMX THEOS
MXC 319 (Bâtiment MXC)
Station 12
CH-1015 Lausanne (Switzerland)
Phone: +41 21 69 31159
</pre>
  </body>
</html>