[Wannier] Questions about xsf output files (units, modifying grid density) and extracting wannier functions' charge distributions

Wai-Ga Ho wdh17 at my.fsu.edu
Thu Jan 28 06:08:07 CET 2021


Hello wannier90 community,

I'm a bit new here, but to give some background, I'm currently analyzing different polymorphs of MgO from an electrostatic lens, and I'd like to use wannier90 to partition the electrons which are treated by density-functional calculations in quantum-espresso.

Now my questions today are regarding the wannier functions (WFs) which are printed to the xsf files. In particular, I'm wondering about things I should keep in mind when building charge distributions out of these wannier functions, so that I may use them for later calculations.

So far, just to check things out, I've tried to calculate the total charge within a single WF, but I'm obtaining some strange results that I can't really make sense of (more on this below).

In my current understanding, the square of a WF provides partial charge densities for the associated orbital, and integrating this in position space across the supercell in which it lives should produce its total charge -- this should come out to 1 if norm-conserved pseudopotentials are implemented (see https://lists.quantum-espresso.org/pipermail/wannier/2012-July/000545.html).

With this in mind, I tried applying this to the discrete WF data sets found in my xsf files. Summing over the squares of each WF data point, I multiplied this result by the volume element that should belong to each point (volume of the supercell divided by total number of data points). However, in one example polymorph, I obtain something like 150 electrons instead of the 1 I expected.

After seeing this, I guess the first most obvious question that may help me troubleshoot my results and understanding are: what units are the xsf data sets written in? I know quantum-espresso's pp.x writes charge-density files in electrons/bohr^3, but I haven't found much concerning wannier90 in the documentation... I'll note that I've been pretty consistently writing input files using angstrom, and in the above-mentioned example, I assumed wannier90 picked up on this and returned the WF in sqrt(electrons/angstrom^3).

Another question might be whether the default position-space grid is fine enough to carry out an integral-to-sum conversion as I've used above, and whether there's any option to increase the grid density

Aside from this, if anyone has any additional advice, comments, or information concerning the data/procedure or any gaps in my understanding, they'll be greatly appreciated.

Thanks in advance,
Wai-Ga David Ho @ FSU and NHMFL


------------------------------------------------------------------------------------------------------------------------------------------------------------

P.S. in case this helps anyone, below I provide some additional details surrounding my procedure/specs for the basic quantum-espresso and wannier90 calculations. The example I used in the main body of this email is for MgO in a CsCl-type arrangement, which I'll continue to use in the description below.

1) In quantum-espresso (v.6.0), I build a 16-atom unit cell for MgO in a CsCl-type arrangement and run a DFT calculation using pw.x on a 5x5x5 kgrid. I used the following norm-conserved pseudopotentials:
Mg_ONCV_PBE-1.2.upf
O_ONCV_PBE-1.2.upf
The input file for this calculation is provided under the "pw.x input" header at the end of this email

2) Examining the output of my DFT calculation, I notice there is a composite group of 24 valence bands which sit right underneath the Fermi energy. This corresponds to 3 bands or 6 electrons per Mg-O pair. Now MgO is quite ionic, and Mg/O ions have nominal charges of +2/-2 respectively, which translates to an empty s-shell on Mg and a full p-shell on O. Thus I decide to get symmetry-adapted wannier functions using oxygen-centered p states in my wannier90 projections block.

3) After the final wannier90.x run (v3.0.0; input file provided below) on a reduced 3x3x3kgrid (where quantum-espresso is still decently converged), I obtain WFs that are real (Im/Re ratios of order 10^-5) and well-localized (individual spreads < 1 angstrom^2). Moreover, I find that the wannierized bands are able to adequately reproduce the quantum-espresso band structure. So these should be a good set of WFs for general purposes.

4) Picking one of the xsf files that were produced by wannier90, I go to the DATAGRID_3D block at the bottom, and from this I extract the grid dimensionality (n1,n2,n3) to get
n = n1*n2*n3 = total # data points.

The DATAGRID_3D block also contains the WF data set, whose elements I square and sum (sum(WF^2)).

Lastly, I obtain the volume of my original 16-atom cell by going to the PRIMVEC block at the top of the file. I multiply their triple-scalar-product/volume by 3^3=27 to get the entire 3x3x3 supercell volume (V) where the WF data set should live. I do not use the data-translation vectors that are written in the DATAGRID_3D block as they do not span the entire 3x3x3 supercell.

With all of this, I take (r=position and ΔV assumed to be the same for each data point)
integral(WF(r)^2 d^3r)  ---> sum(WF(r)^2 ΔV) = sum(WF^2)ΔV
where ΔV=V/n. The result is about 150.4... electrons if V is in cubic angstroms and WF(r) is in sqrt(electrons/angstrom^3)

I may have skipped a few steps in this outline (nscf, band calculations, etc) but if anyone needs to see any of the input files I've excluded, or any output results, please let me know.


--------------------------------------------------------------------- pw.x input --------------------------------------------------------------------------

&CONTROL
    calculation = "scf"
    max_seconds =  8.64000e+04
    pseudo_dir  = "/home/wai-ga/.burai/.pseudopot"

    tstress = .true.
    tprnfor = .true.
    prefix = 'MgO_CsCl'
    outdir='./work/'
    disk_io='low'
    wf_collect=.true.
/

&SYSTEM
    a           =  5.31810e+00
    degauss     =  1.00000e-02
    ecutrho     =  2.00000e+03
    ecutwfc     =  2.00000e+02
    ibrav       = 1
    nat         = 16
    ntyp        = 2
    occupations = "fixed"
    smearing    = "gaussian"
/

&ELECTRONS
    conv_thr         =  1.00000e-10
    electron_maxstep = 200
    mixing_beta      =  7.00000e-01
    startingpot      = "atomic"
    startingwfc      = "atomic+random"
/

K_POINTS {automatic}
 5  5  5  0 0 0

ATOMIC_SPECIES
Mg     24.30500  Mg_ONCV_PBE-1.2.upf
O      15.99940  O_ONCV_PBE-1.2.upf

ATOMIC_POSITIONS {angstrom}
Mg      0.000000   0.000000   0.000000
O       1.329525   1.329525   1.329525
Mg      0.000000   0.000000   2.659051
O       1.329525   1.329525   3.988576
Mg      0.000000   2.659051   0.000000
O       1.329525   3.988576   1.329525
Mg      0.000000   2.659051   2.659051
O       1.329525   3.988576   3.988576
Mg      2.659051   0.000000   0.000000
O       3.988576   1.329525   1.329525
Mg      2.659051   0.000000   2.659051
O       3.988576   1.329525   3.988576
Mg      2.659051   2.659051   0.000000
O       3.988576   3.988576   1.329525
Mg      2.659051   2.659051   2.659051
O       3.988576   3.988576   3.988576


---------------------------------------------------------------- wannier90.x input --------------------------------------------------------------------

!CsCl-type MgO:

 num_wann    =  24
 num_iter    = 100
 exclude_bands = 1-40

!===========  additional input for symmetry-adapted mode
site_symmetry = .true.
!===========


! SYSTEM

begin unit_cell_cart
angstrom
5.31810  0.00000  0.00000
0.00000  5.31810  0.00000
0.00000  0.00000  5.31810
end unit_cell_cart

begin atoms_cart
angstrom
Mg      0.000000   0.000000   0.000000
O       1.329525   1.329525   1.329525
Mg      0.000000   0.000000   2.659051
O       1.329525   1.329525   3.988576
Mg      0.000000   2.659051   0.000000
O       1.329525   3.988576   1.329525
Mg      0.000000   2.659051   2.659051
O       1.329525   3.988576   3.988576
Mg      2.659051   0.000000   0.000000
O       3.988576   1.329525   1.329525
Mg      2.659051   0.000000   2.659051
O       3.988576   1.329525   3.988576
Mg      2.659051   2.659051   0.000000
O       3.988576   3.988576   1.329525
Mg      2.659051   2.659051   2.659051
O       3.988576   3.988576   3.988576
end atoms_cart

begin projections
angstrom
c = 1.329525,1.329525,1.329525: p
c = 1.329525,1.329525,3.988576: p
c = 1.329525,3.988576,1.329525: p
c = 1.329525,3.988576,3.988576: p
c = 3.988576,1.329525,1.329525: p
c = 3.988576,1.329525,3.988576: p
c = 3.988576,3.988576,1.329525: p
c = 3.988576,3.988576,3.988576: p
end projections


wannier_plot = true   #uncomment these blocks for the second
restart = plot        #(wannier90.x) execution (not including -pp flag
bands_plot = true     #for postprocessing)
wannier_plot_supercell = 3

write_xyz=.true. #write WF centers in xyz format
use_ws_distance = .true. #improve band interpolation
!translate_home_cell = true

begin kpoint_path
G 0.00 0.00 0.00 X 0.00 0.50 0.00
X 0.00 0.50 0.00 M 0.50 0.50 0.00
M 0.50 0.50 0.00 R 0.50 0.50 0.50
R 0.50 0.50 0.50 G 0.00 0.00 0.00
G 0.00 0.00 0.00 M 0.50 0.50 0.00
M 0.50 0.50 0.00 X 0.00 0.50 0.00
X 0.00 0.50 0.00 R 0.50 0.50 0.50
end kpoint_path

! KPOINTS

mp_grid : 3 3 3

begin kpoints
  0.00000000  0.00000000  0.00000000
  0.00000000  0.00000000  0.33333333
  0.00000000  0.00000000  0.66666667
  0.00000000  0.33333333  0.00000000
  0.00000000  0.33333333  0.33333333
  0.00000000  0.33333333  0.66666667
  0.00000000  0.66666667  0.00000000
  0.00000000  0.66666667  0.33333333
  0.00000000  0.66666667  0.66666667
  0.33333333  0.00000000  0.00000000
  0.33333333  0.00000000  0.33333333
  0.33333333  0.00000000  0.66666667
  0.33333333  0.33333333  0.00000000
  0.33333333  0.33333333  0.33333333
  0.33333333  0.33333333  0.66666667
  0.33333333  0.66666667  0.00000000
  0.33333333  0.66666667  0.33333333
  0.33333333  0.66666667  0.66666667
  0.66666667  0.00000000  0.00000000
  0.66666667  0.00000000  0.33333333
  0.66666667  0.00000000  0.66666667
  0.66666667  0.33333333  0.00000000
  0.66666667  0.33333333  0.33333333
  0.66666667  0.33333333  0.66666667
  0.66666667  0.66666667  0.00000000
  0.66666667  0.66666667  0.33333333
  0.66666667  0.66666667  0.66666667
end kpoints

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/wannier/attachments/20210128/f6069a19/attachment-0001.html>


More information about the Wannier mailing list