4. Realspace WFs of graphene

In this tutorial, we will disentangle the 2D graphene, and compute its realspace representation.

  1. construct a Model for Wannier.jl, by reading the win, amn, mmn, and eig files
  2. run Wannier.jl disentangle on the Model to minimize the spread
  3. write the real space WFs to xsf files
Note

Different from previous tutorials, the amn/mmn/eig/unk files in this tutorial are generated by the DFTK.jl package. See dftk.jl script in the tutorial folder for more information.

Tip

This is a HTML version of the tutorial, you can download corresponding

Preparation

Load the package

using Wannier

Model generation

We will use the read_w90 function to read the win, amn, mmn, and eig files, and construct a Model that abstracts the calculation

model = read_w90("graphene")
lattice: Å
  a1:  2.64100  0.00000  0.00000
  a2: -1.32050  2.28717  0.00000
  a3:  0.00000  0.00000 10.00000

atoms: fractional
   C:  0.00000  0.00000  0.00000
   C:  0.33333  0.66667  0.00000

n_bands: 15
n_wann : 5
kgrid  : 3 3 1
n_kpts : 9
n_bvecs: 8

b-vectors:
         [bx, by, bz] / Å⁻¹                weight
  1       0.00000    0.00000   -0.62832    1.26651
  2       0.00000    0.00000    0.62832    1.26651
  3       0.79303    0.45786    0.00000    0.39752
  4      -0.79303   -0.45786    0.00000    0.39752
  5       0.00000   -0.91571    0.00000    0.39752
  6       0.00000    0.91571    0.00000    0.39752
  7      -0.79303    0.45786    0.00000    0.39752
  8       0.79303   -0.45786    0.00000    0.39752

Disentanglement and maximal localization

The disentangle function will disentangle and maximally localize the spread functional, and returns the gauge matrices U,

U = disentangle(model);
[ Info: Initial spread
  WF     center [rx, ry, rz]/Š             spread/Ų
   1     1.85584     0.62882    -2.06055     3.54154
   2     0.74661     1.99873     2.16208     3.36211
   3    -0.08527     1.53699    -0.05066     1.94307
   4     0.14002     1.65053    -2.57789     3.34382
   5     0.45353     0.74825     2.23298     3.55341
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
   ΩI  =    10.09105
   Ω̃   =     5.65290
   ΩOD =     4.29533
   ΩD  =     1.35756
   Ω   =    15.74395


[ Info: Initial spread (with states freezed)
  WF     center [rx, ry, rz]/Š             spread/Ų
   1     1.89626     0.26945    -0.22339     4.73722
   2     0.68598     1.87705     0.15546     2.17853
   3    -0.22392     1.64684    -0.04940     0.89851
   4     0.16880     1.39105    -0.39006     3.26065
   5     0.07627     0.97098     0.05757     2.46726
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
   ΩI  =     5.57075
   Ω̃   =     7.97141
   ΩOD =     5.01013
   ΩD  =     2.96128
   Ω   =    13.54217


Iter     Function value   Gradient norm
     0     1.354217e+01     2.151985e+00
 * time: 0.0005841255187988281
     1     1.169183e+01     9.406622e-01
 * time: 0.008275032043457031
     2     1.023329e+01     4.035161e-01
 * time: 0.012202024459838867
     3     8.598539e+00     9.045113e-01
 * time: 0.016198158264160156
     4     7.154213e+00     6.308149e-01
 * time: 0.020301103591918945
     5     6.560142e+00     3.092260e-01
 * time: 0.023138999938964844
     6     6.093727e+00     1.726999e-01
 * time: 0.027220964431762695
     7     5.629500e+00     1.930641e-01
 * time: 0.031100988388061523
     8     5.091823e+00     2.755830e-01
 * time: 0.035089969635009766
     9     4.360216e+00     2.037810e-01
 * time: 0.03895902633666992
    10     3.925312e+00     1.835308e-01
 * time: 0.04288005828857422
    11     3.775209e+00     1.318315e-01
 * time: 0.04679298400878906
    12     3.682070e+00     8.236373e-02
 * time: 0.050675153732299805
    13     3.622598e+00     4.389354e-02
 * time: 0.0545351505279541
    14     3.578643e+00     3.887766e-02
 * time: 0.05840110778808594
    15     3.543920e+00     5.957922e-02
 * time: 0.06230306625366211
    16     3.515775e+00     6.713981e-02
 * time: 0.0662391185760498
    17     3.490008e+00     3.844433e-02
 * time: 0.07015514373779297
    18     3.471231e+00     2.608627e-02
 * time: 0.07404303550720215
    19     3.460128e+00     2.960137e-02
 * time: 0.07802700996398926
    20     3.453181e+00     2.692348e-02
 * time: 0.08213996887207031
    21     3.447028e+00     1.906044e-02
 * time: 0.08628296852111816
    22     3.438509e+00     2.175788e-02
 * time: 0.09052705764770508
    23     3.426140e+00     2.082052e-02
 * time: 0.09465312957763672
    24     3.415771e+00     3.213065e-02
 * time: 0.09872198104858398
    25     3.405369e+00     3.022485e-02
 * time: 0.10280609130859375
    26     3.394791e+00     3.253271e-02
 * time: 0.10675907135009766
    27     3.386954e+00     1.748391e-02
 * time: 0.11067700386047363
    28     3.382066e+00     2.021872e-02
 * time: 0.11459207534790039
    29     3.379125e+00     2.195868e-02
 * time: 0.11854314804077148
    30     3.377628e+00     1.466785e-02
 * time: 0.12245702743530273
    31     3.376604e+00     5.456075e-03
 * time: 0.12632298469543457
    32     3.376136e+00     3.986881e-03
 * time: 0.130202054977417
    33     3.375939e+00     4.682863e-03
 * time: 0.1341249942779541
    34     3.375815e+00     4.532308e-03
 * time: 0.13796496391296387
    35     3.375723e+00     3.516645e-03
 * time: 0.14182615280151367
    36     3.375669e+00     1.913558e-03
 * time: 0.14574909210205078
    37     3.375629e+00     2.387889e-03
 * time: 0.14982819557189941
    38     3.375604e+00     1.514095e-03
 * time: 0.15383315086364746
    39     3.375593e+00     1.215331e-03
 * time: 0.15784716606140137
    40     3.375588e+00     9.369910e-04
 * time: 0.161790132522583
    41     3.375585e+00     4.253795e-04
 * time: 0.16578197479248047
    42     3.375583e+00     3.733042e-04
 * time: 0.169694185256958
    43     3.375582e+00     2.704585e-04
 * time: 0.17354297637939453
    44     3.375582e+00     2.562052e-04
 * time: 0.1774120330810547
    45     3.375581e+00     2.422052e-04
 * time: 0.18126296997070312
    46     3.375581e+00     1.118689e-04
 * time: 0.18512606620788574
[ Info: Final spread
  WF     center [rx, ry, rz]/Š             spread/Ų
   1     2.64105    -0.00000    -0.36994     0.75340
   2     0.66024     1.90597     0.17026     0.62292
   3    -0.66025     1.90599     0.17041     0.62295
   4    -0.00003     1.52476    -0.36998     0.75337
   5    -0.00000     0.76241     0.17035     0.62294
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
   ΩI  =     2.76958
   Ω̃   =     0.60600
   ΩOD =     0.59943
   ΩD  =     0.00657
   Ω   =     3.37558

The initial spread is

omega(model)
  WF     center [rx, ry, rz]/Š             spread/Ų
   1     1.85584     0.62882    -2.06055     3.54154
   2     0.74661     1.99873     2.16208     3.36211
   3    -0.08527     1.53699    -0.05066     1.94307
   4     0.14002     1.65053    -2.57789     3.34382
   5     0.45353     0.74825     2.23298     3.55341
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
   ΩI  =    10.09105
   Ω̃   =     5.65290
   ΩOD =     4.29533
   ΩD  =     1.35756
   Ω   =    15.74395

The final spread is

omega(model, U)
  WF     center [rx, ry, rz]/Š             spread/Ų
   1     2.64105    -0.00000    -0.36994     0.75340
   2     0.66024     1.90597     0.17026     0.62292
   3    -0.66025     1.90599     0.17041     0.62295
   4    -0.00003     1.52476    -0.36998     0.75337
   5    -0.00000     0.76241     0.17035     0.62294
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
   ΩI  =     2.76958
   Ω̃   =     0.60600
   ΩOD =     0.59943
   ΩD  =     0.00657
   Ω   =     3.37558
Note

The convergence thresholds is determined by the keyword arguments of disentangle, e.g., f_tol for the tolerance on spread, and g_tol for the tolerance on the norm of spread gradient, etc. You can use stricter thresholds to further minimize a bit the spread.

Write real space WFs

Now save the U to the model,

model.U .= U;
Tip

You need to use .= to assign the U to the model, because in Julia model is an immutable struct so you cannot use model.U = U.

The write_realspace_wf function reads the UNK files, compute the real space WFs in a n_supercells-sized super cell, and write them to xsf files,

write_realspace_wf("wjl", model; n_supercells=3, format=:xsf)
┌ Info: Reading unk file:
└   filename = "./UNK00001.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 1
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00002.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 2
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00003.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 3
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00004.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 4
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00005.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 5
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00006.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 6
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00007.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 7
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00008.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 8
  n_bands = 15

┌ Info: Reading unk file:
└   filename = "./UNK00009.1"
  n_gx    = 8
  n_gy    = 8
  n_gz    = 24
  ik      = 9
  n_bands = 15

Max Im/Re ratio of WF    1 =     0.0000
Max Im/Re ratio of WF    2 =     0.0000
Max Im/Re ratio of WF    3 =     0.0000
Max Im/Re ratio of WF    4 =     0.0000
Max Im/Re ratio of WF    5 =     0.0000
┌ Info: Writing xsf file:
└   filename = "wjl_00001.xsf"
┌ Info: Writing xsf file:
└   filename = "wjl_00002.xsf"
┌ Info: Writing xsf file:
└   filename = "wjl_00003.xsf"
┌ Info: Writing xsf file:
└   filename = "wjl_00004.xsf"
┌ Info: Writing xsf file:
└   filename = "wjl_00005.xsf"

Now, open the wjl_00001.xsf, etc. files with a 3D visualizer, e.g., vesta, to have a look at the WFs!

Note

To save space, we use a very coarse kpoint grid and reduced sampling of the real space grid, thus the resolution are bad, rerun the calculation with a finer kpoint grid and see the beautiful WFs 😎

We also provide a simple plotting package WannierPlots.jl for quick Visualization of band structure, real space WFs, etc.

First, load the plotting packages

using WGLMakie
set_theme!(; resolution=(800, 800))
using WannierPlots
Tip

Here we want to show the WFs in this web page, so we first load WGLMakie. When you use the WannierPlots package in REPL, you can first load GLMakie, then the WFs will be shown in a standalone window.

Read the 1st WF

xsf = read_xsf("wjl_00001.xsf");

Visualize with WannierPlots.jl,

pos = inv(xsf.primvec) * xsf.atom_positions  # to fractional coordinates
atom_numbers = parse.(Int, xsf.atoms)  # to integer atomic numbers
plot_wf(xsf.rgrid, xsf.W, xsf.primvec, pos, atom_numbers)

Compute WF centers in realspace

There are some other functions that might be useful for evaluating operators in real space, e.g., computing WF centers.

First we need to read the UNK files, and construct the real space WFs in a 3 * 3 * 1-sized super cell (i.e., model.kgrid),

rgrid, W = read_realspace_wf(model, model.kgrid)
(Wannier.RGrid{Float64, LazyGrids.GridSL{Float64, 1, 3, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, LazyGrids.GridSL{Float64, 2, 3, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, LazyGrids.GridSL{Float64, 3, 3, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}}([2.6410001614115757 -1.3204998161171824 0.0; 0.0 2.2871732278108703 0.0; 0.0 0.0 9.99999987000729], [-1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875;;; -1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875;;; -1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875;;; … ;;; -1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875;;; -1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875;;; -1.0 -1.0 … -1.0 -1.0; -0.875 -0.875 … -0.875 -0.875; … ; 1.75 1.75 … 1.75 1.75; 1.875 1.875 … 1.875 1.875], [-1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875;;; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875;;; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875;;; … ;;; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875;;; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875;;; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875; … ; -1.0 -0.875 … 1.75 1.875; -1.0 -0.875 … 1.75 1.875], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0;;; 0.041666666666666664 0.041666666666666664 … 0.041666666666666664 0.041666666666666664; 0.041666666666666664 0.041666666666666664 … 0.041666666666666664 0.041666666666666664; … ; 0.041666666666666664 0.041666666666666664 … 0.041666666666666664 0.041666666666666664; 0.041666666666666664 0.041666666666666664 … 0.041666666666666664 0.041666666666666664;;; 0.08333333333333333 0.08333333333333333 … 0.08333333333333333 0.08333333333333333; 0.08333333333333333 0.08333333333333333 … 0.08333333333333333 0.08333333333333333; … ; 0.08333333333333333 0.08333333333333333 … 0.08333333333333333 0.08333333333333333; 0.08333333333333333 0.08333333333333333 … 0.08333333333333333 0.08333333333333333;;; … ;;; 0.875 0.875 … 0.875 0.875; 0.875 0.875 … 0.875 0.875; … ; 0.875 0.875 … 0.875 0.875; 0.875 0.875 … 0.875 0.875;;; 0.9166666666666666 0.9166666666666666 … 0.9166666666666666 0.9166666666666666; 0.9166666666666666 0.9166666666666666 … 0.9166666666666666 0.9166666666666666; … ; 0.9166666666666666 0.9166666666666666 … 0.9166666666666666 0.9166666666666666; 0.9166666666666666 0.9166666666666666 … 0.9166666666666666 0.9166666666666666;;; 0.9583333333333334 0.9583333333333334 … 0.9583333333333334 0.9583333333333334; 0.9583333333333334 0.9583333333333334 … 0.9583333333333334 0.9583333333333334; … ; 0.9583333333333334 0.9583333333333334 … 0.9583333333333334 0.9583333333333334; 0.9583333333333334 0.9583333333333334 … 0.9583333333333334 0.9583333333333334]), [-0.0009537361828964553 + 2.003856344861184e-8im -0.0012817917556497763 + 1.9503708924130237e-8im … -0.0006267081502384295 + 1.3366433056833444e-8im -0.001284382554399954 + 2.9091036944342253e-8im; -0.0012875139191118987 + 2.4971562263985547e-8im -0.0012859697715225436 + 2.0293823740296585e-8im … 0.0010903230820350838 - 1.759481774821523e-8im -0.0006305664498859235 + 1.4799964977317714e-8im; … ; -0.0006254607414484614 + 1.0105835526432985e-8im -0.00045131829566883136 + 6.8269160332584064e-9im … -0.0006255675013538725 + 1.3457374008361988e-8im -0.0006269780570191231 + 1.1560636460473795e-8im; -0.0012802273083914507 + 2.350772441598068e-8im -0.0012820441740015087 + 2.070922639238779e-8im … -0.0012834011283225876 + 2.7143092064098163e-8im -0.0012812257092607528 + 2.84410181994938e-8im;;; -0.0017038672136910288 + 3.070750358929391e-8im -0.0016608738664445914 + 2.8044844377350664e-8im … -0.000816008182515048 + 1.4712140914866254e-8im -0.001662437242830173 + 3.155555830370983e-8im; -0.0016639632923904882 + 2.9687195536741584e-8im -0.0016630724682372814 + 2.86756171863356e-8im … 0.0004362414688155619 - 8.018585553264895e-9im -0.0008428856250456023 + 1.6018181700802913e-8im; … ; -0.0008153522282938739 + 1.351638568161056e-8im -0.000561344780541615 + 8.917988944149055e-9im … -0.0008157464859531219 + 1.5706763643180688e-8im -0.0008413760798091099 + 1.5043457498987845e-8im; -0.0016603150863132468 + 2.958591293252451e-8im -0.0014063486305064103 + 2.3867245520997e-8im … -0.0014075855373181549 + 2.659416174314681e-8im -0.0016609496267985786 + 3.197288247738486e-8im;;; -0.0019386496982153527 + 3.485815492812769e-8im -0.0015077844976490312 + 2.7005188014036136e-8im … -0.0010493709296909939 + 1.7972160092700257e-8im -0.0015083613114398623 + 2.6668393970764715e-8im; -0.001508637257298639 + 2.715208357610842e-8im -0.0015082949006461884 + 2.745442762097033e-8im … -0.00018583273474060379 + 2.3431369067239416e-9im -0.0009543644192004417 + 1.7448145183303804e-8im; … ; -0.0010491148187113293 + 1.8739873023735736e-8im -0.0009976329898148616 + 1.765822610895319e-8im … -0.001049564174140454 + 1.8944139913018576e-8im -0.0009542169088328651 + 1.6924739423983414e-8im; -0.001507817753077306 + 2.680821159043815e-8im -0.001281562336386384 + 2.257005649659089e-8im … -0.001282406627225101 + 2.2255963770226007e-8im -0.0015080194679825448 + 2.6892284154163743e-8im;;; … ;;; -0.000130748235890527 + 3.516499478180742e-9im -0.00015196997999902817 + 3.8401216103594535e-9im … 0.00030015782196451377 - 5.534408487436718e-9im -0.00015163076592404506 + 3.559440320420758e-9im; -0.00015208706540479445 + 4.7062105154285465e-9im -0.0001521541741633705 + 4.865790209023718e-9im … 0.0004745387776164441 - 8.681895729340589e-9im 0.00015028290965976538 - 1.4698105880543248e-9im; … ; 0.00029935819432600353 - 4.458651596076872e-9im 9.97196393532122e-5 - 9.342445914106712e-10im … 0.00030007882957835307 - 6.205649128053646e-9im 0.00015025017216804826 - 2.3448426980962918e-9im; -0.00015180941020965564 + 3.0145550191898156e-9im 3.445557398479871e-5 + 9.4388235653368e-11im … 3.520034475284537e-5 - 1.2561115843455637e-9im -0.000151490719042415 + 2.8317893377427517e-9im;;; -0.0012454397711449683 + 2.324701926638263e-8im -0.000978346248791588 + 1.859110761016759e-8im … -0.00018239513379278118 + 2.6930266342545868e-9im -0.0009782415575704103 + 1.7862205409224785e-8im; -0.0009790650233108406 + 1.8844930096344964e-8im -0.000978916476021204 + 1.8761169631731356e-8im … 0.0004953023400273717 - 9.243490170044813e-9im -0.00045341113078975866 + 9.430753690321659e-9im; … ; -0.00018284023159788177 + 3.9679998407408474e-9im -0.00015784711373019455 + 3.3447112594996318e-9im … -0.0001821489560326813 + 2.1133921264250413e-9im -0.0004527238952150593 + 8.420889604448472e-9im; -0.0009780144238471927 + 1.826221592005073e-8im -0.00047384629955002827 + 8.68220249398514e-9im … -0.0004733642799119031 + 7.328458824352858e-9im -0.000977710606495925 + 1.7689539083542982e-8im;;; -0.0025708081406585295 + 4.655131932707057e-8im -0.0018875394438186452 + 3.164457434361938e-8im … -0.0005575141756536179 + 1.0201905636633393e-8im -0.0018885534239398243 + 3.559446730879342e-8im; -0.0018905761264766073 + 3.417181516455573e-8im -0.0018898184675984553 + 3.1805448105462176e-8im … 0.000788482005832135 - 1.4185795381735675e-8im -0.0006757700710523414 + 1.3371941919489613e-8im; … ; -0.0005571903885058307 + 9.529982565438367e-9im -0.0003868523536826187 + 6.880969170995775e-9im … -0.0005567346669576559 + 9.897864737694483e-9im -0.0006736125450524809 + 1.1428194933592472e-8im; -0.0018866433374746358 + 3.351585200730669e-8im -0.0011883802662861858 + 2.021380879500977e-8im … -0.0011886357639971591 + 2.2041624123114723e-8im -0.0018868516107665126 + 3.5073383456799924e-8im;;;; 0.0005708414299886731 + 3.8763352593371465e-9im 0.00030456211346394937 + 3.1177896483683103e-9im … 0.0010696931234172398 + 8.125402150691635e-9im 0.0012513374603232812 + 8.655678014612977e-9im; -0.003878952541503119 - 3.230721529653054e-8im -0.004743090068381215 - 4.004461849693102e-8im … 0.0019986398475590234 + 1.686643077749202e-8im -0.0001725437461322036 - 3.2671316231118003e-10im; … ; 0.007167231813466578 + 5.814522609072349e-8im 0.004316021455483361 + 3.4171182429950285e-8im … 0.002252875907227162 + 1.724115623725887e-8im 0.006680804120662011 + 5.3874892528652886e-8im; 0.0070306373879562446 + 5.887723768403951e-8im 0.003952488206196217 + 3.288604550251891e-8im … 0.0015764598110227913 + 1.147192125399648e-8im 0.0056691436418824575 + 4.519174175309103e-8im;;; 0.0018001973104770285 + 1.4692489831250969e-8im 0.001156075753146557 + 9.606156996398873e-9im … 0.0010680814855960356 + 8.917226533566858e-9im 0.0018432902509811961 + 1.522815096629795e-8im; -0.0008713292807031032 - 6.567697086796226e-9im -0.0011895936646351543 - 9.992319640313008e-9im … 0.0016229187998948774 + 1.3550068871913864e-8im 0.0006926518364342039 + 6.686089501109802e-9im; … ; 0.0037151561241456684 + 2.945825341993391e-8im 0.0022879423322757783 + 1.792158371396704e-8im … 0.00044730538051552236 + 3.6158682252078003e-9im 0.002887464494356309 + 2.2996307605074563e-8im; 0.004302173624050887 + 3.5309920317885514e-8im 0.0024543960535603404 + 1.992004545573837e-8im … 0.0008001753373116186 + 6.5077073020515366e-9im 0.0033662853101237723 + 2.7153256105003386e-8im;;; 0.000641721679162717 + 4.988708019213226e-9im 0.00040278047964539707 + 3.485832355018845e-9im … 0.0006874456773727413 + 5.63596712316625e-9im 0.000804105275091456 + 6.314013673014429e-9im; 4.649516994096021e-5 - 4.573312099391084e-11im 0.00011746839615439922 + 8.434259143720436e-10im … 0.000751321768305907 + 6.029608426747243e-9im 0.0005129134906030953 + 3.795358460382629e-9im; … ; 0.0008517812027583693 + 7.012479627070227e-9im 0.0002607377448884257 + 2.2623365472651535e-9im … -0.00038231375427490475 - 2.732735951878803e-9im 0.0002117549013975769 + 1.772609313962133e-9im; 0.0010554434186844425 + 8.64516129594422e-9im 0.0006555620713485875 + 5.479311645610145e-9im … -1.1829783887782084e-6 + 4.4578341481156986e-10im 0.0007768168749102527 + 6.196858173977847e-9im;;; … ;;; -0.00011828685530595415 - 1.8008251080838613e-9im -0.00012339369646809095 - 1.7503657938576038e-9im … -0.00019192281030954873 - 1.4650847705161008e-9im -0.00023825303791875696 - 2.2118565192178536e-9im; -0.0003687912353047936 - 3.46350236665892e-9im -0.000492180276847026 - 4.633165192503609e-9im … -0.00033071692136303014 - 2.786501404135025e-9im -0.00016521797623486985 - 1.4669311581422262e-9im; … ; 0.001435583324319625 + 1.1627851252462204e-8im 0.0010799894556048648 + 8.569131046043554e-9im … 9.274079707380763e-5 + 9.69228224395756e-10im 0.0010029719195801144 + 8.29975499901566e-9im; 0.0006543746539143901 + 4.690691365323882e-9im 0.000667504831380739 + 4.872197779774712e-9im … -0.0002228094644926328 - 1.73802816436221e-9im 0.00036069689913300387 + 2.6436903837953607e-9im;;; -0.00013482709603143559 - 1.6536371687479272e-9im -0.00026245618900421885 - 2.3356252605192003e-9im … -3.2202286984049115e-5 - 3.2591148472112713e-10im 6.709627757092226e-5 + 1.3941121044039329e-10im; -0.0012152350795231063 - 1.0536240084491672e-8im -0.001114673654201266 - 9.647001776021433e-9im … 0.0002299277245703855 + 2.0236260294774025e-9im -0.0004284997572516117 - 3.7996883914722295e-9im; … ; 0.0033056994426870798 + 2.6974481345732388e-8im 0.0021551257878915167 + 1.777298874738875e-8im … 0.0005884944530637112 + 4.829051078767163e-9im 0.0023289741179837544 + 1.889432612836275e-8im; 0.0016991728496237478 + 1.3530588415121436e-8im 0.001229637267114449 + 9.968404432921426e-9im … -0.00032863680153483177 - 2.6531380613893187e-9im 0.0010674231045757284 + 8.303787223801207e-9im;;; -0.0002629386440627606 - 2.7039517335250562e-9im -0.0002962351953345388 - 2.0544602358075883e-9im … 0.0003117510320076282 + 2.0846758408063493e-9im 0.0003971963692834251 + 2.1887580906178623e-9im; -0.0029116610742725346 - 2.4804368520567642e-8im -0.0033442940555751194 - 2.8564552073210663e-8im … 0.0011563943591700056 + 9.280703651184016e-9im -0.00043217551345150075 - 3.563846746647744e-9im; … ; 0.006038255716238359 + 4.954259956292518e-8im 0.003926510559356595 + 3.211008668525651e-8im … 0.001726228496711103 + 1.38205657473911e-8im 0.0051309193204542025 + 4.1930890552920196e-8im; 0.004313589510548949 + 3.640958441840524e-8im 0.002725184693298717 + 2.3046036911395568e-8im … 0.0004075276367364746 + 2.7981009261145315e-9im 0.0030954640924211363 + 2.5043279242791755e-8im;;;; 0.0002345594655950632 - 9.06063560213783e-10im 0.0013259929356573938 - 2.6204312192357193e-9im … -0.00028530549577272953 - 6.897697166527748e-10im -0.00023152675024948642 - 1.9985595585877056e-10im; -0.00023328921172456144 - 5.104316629860821e-10im 0.0002232282488282592 - 1.8751458780780834e-9im … -0.0004717127950568821 + 9.226384872156816e-10im -0.00046116867043085073 + 6.873618865446376e-10im; … ; 0.001369098619756017 - 2.4358885842043794e-9im 0.0014317505877978285 - 3.3817304797505936e-9im … -0.0005434081556207476 + 7.964817556458454e-10im 0.0005949619433793124 - 1.053504586422887e-9im; 0.0013281719591903324 - 2.037520006110189e-9im 0.0015420868889864574 - 2.5406212750884234e-9im … -6.768329378276866e-5 - 1.4282664187150986e-9im 0.00022699531027608097 - 7.644494125291161e-10im;;; 0.0013589112114220539 - 1.2932657182816874e-9im 0.0016174968322274974 - 1.7162030581385768e-9im … -4.560651427066514e-5 + 1.8014318586217431e-10im 0.0007477952983771102 - 4.943744271981545e-10im; 0.0007470127866400014 - 2.1304413788669763e-10im 0.0008895784134703633 - 5.280007280160525e-10im … -4.472683183393925e-5 + 5.035490866870754e-10im 7.455473325822865e-5 + 5.908040322398654e-10im; … ; 0.0011585257647176161 - 2.1161801399275897e-9im 0.0011638945461757884 - 2.8560346954896918e-9im … -0.00014032518643302582 + 8.396966185646941e-10im 0.0007498429988894629 - 9.5683217695492e-10im; 0.0016183635896256385 - 2.1398044410829584e-9im 0.00132069175545739 - 2.044832617564058e-9im … 0.0003545415694684345 - 3.8460591347513584e-10im 0.0008910680709856027 - 1.0594194896351716e-9im;;; 0.000806481744318352 - 7.093136625897007e-10im 0.0008027147799894344 - 7.785056735068154e-10im … 0.00018365742830182136 + 3.00409125044945e-10im 0.0007384516755240259 - 6.012491438364995e-10im; 0.0007383100839519956 - 7.8276339730997e-10im 0.00046492347024395777 - 1.0029781172260499e-10im … 0.00031495764659799654 - 1.12346206411947e-10im 0.0004063886032833398 - 2.8446592766536344e-10im; … ; 0.0005154809789016207 - 1.1356714249566302e-9im 0.00044853600760654623 - 9.071028579126105e-10im … 5.660640513542573e-5 + 1.3198020223000503e-11im 0.0005060948808697421 - 9.368202749043202e-10im; 0.000802804161156716 - 1.0101269203804324e-9im 0.0004438838818332201 - 5.110102015534437e-10im … 0.00047089069171740445 - 2.6066779136425647e-11im 0.00046505462515160665 - 2.3850931337967807e-10im;;; … ;;; 0.00017453224508909656 - 4.882345658707035e-10im 0.00022823384349960447 - 4.0703020246332344e-10im … -1.433211943474807e-5 - 3.9282680657720054e-10im 0.0001349361307473779 - 6.054988860805676e-10im; 0.00013475894840595722 - 3.765657134107641e-10im -0.00022152617775105573 + 4.4033456399850435e-10im … 0.00026523314209778604 - 5.176626284266985e-10im 5.311376563377434e-5 - 2.4743815252920637e-10im; … ; 6.449695421208455e-5 + 2.403821873420759e-10im 0.00040895657518221016 - 6.087303127808648e-10im … 2.5685743284844767e-5 - 2.4812884877554547e-10im 7.004419148086965e-5 - 5.336480437715149e-11im; 0.00022858464739946964 - 2.85300596515603e-10im -4.77774809105688e-5 + 1.9902258169048523e-10im … 0.0001478422516504691 - 6.426378969383615e-10im -0.00022101859837810056 + 2.2237416007748878e-10im;;; 1.7014405587875104e-5 + 4.173033660524276e-10im 0.00022363999945296698 + 3.200905537925008e-10im … -7.99670228143895e-5 - 2.720686423065801e-10im 0.0001610270787455561 - 5.582651694319769e-10im; 0.00016050391994062264 - 2.795088566462687e-10im -0.0001654749194029933 + 5.315483205984048e-10im … 0.0003499726829999237 - 5.717823660532516e-10im 0.00011954586491520603 - 2.723825856223685e-10im; … ; 0.00020552801358650013 + 6.124943993348866e-11im 0.0004978462252751727 - 5.052254868323194e-10im … -0.0003276829190055918 + 9.823651546932001e-11im -9.193351910292024e-6 + 1.8023911260094888e-10im; 0.0002243510454449881 + 2.618652748346643e-10im 0.0001945419269252007 + 3.734340899779692e-10im … 0.00012209915198137803 - 4.0926361306484504e-10im -0.0001643660190927008 + 3.9898769613227714e-10im;;; -0.00010319399745192081 + 2.2938142218986712e-9im 0.0005269585240679324 + 9.637972885057078e-10im … -0.0002611697689065967 - 6.135183241070171e-10im -0.000189019947210436 + 2.0168589175294393e-10im; -0.00019021492528721132 + 9.730717774757301e-11im -0.00012084312259174223 + 1.9479852376220247e-10im … 0.00011679720818045077 - 2.465968370859686e-10im -0.00028201385435674964 - 6.414411286077065e-11im; … ; 0.0006001282929720557 - 4.60643674824827e-10im 0.0009175937228570937 - 1.804000864200998e-9im … -0.0005705454036997839 + 5.75090436788032e-10im 5.949110140164004e-5 + 3.329402968599293e-10im; 0.0005285163201866861 + 1.5169181936792855e-9im 0.0007410267607796811 - 1.8566390477505992e-10im … -0.00010737616549560456 - 8.582638720093053e-10im -0.00011826440099252166 + 1.0444790440048948e-9im;;;; 0.0002503005824950795 + 2.190173535611907e-9im -0.0025183225560725963 - 1.5330918383559144e-8im … 0.0012680739346292878 + 7.859797484922726e-9im 0.002771533733512178 + 1.6574149359866207e-8im; 0.0027726015624512986 + 1.723157400564575e-8im 0.0005868699222579878 + 4.0311404137578e-9im … -0.00013583714967251218 - 9.051666954553974e-10im 0.0019604294954114337 + 1.1813445145339749e-8im; … ; -0.0022931135790111115 - 1.073149344002797e-8im -0.0020101190472119564 - 7.27149879506703e-9im … 0.0006463573370314953 + 4.6171390468635e-9im -0.0010629808783492282 - 4.47444367783952e-9im; -0.0025195866999107083 - 1.4265541648810098e-8im -0.0027042923251004093 - 1.4044677273121167e-8im … 0.0016131853154623438 + 9.850800823007735e-9im 0.0005847534046558371 + 4.593291191074606e-9im;;; 0.0008859187978316142 + 2.3451609932550404e-9im -0.0006679385092972433 - 6.584682581982514e-9im … 0.0005905249931344193 + 4.721957507873113e-9im 0.0017783974819373452 + 9.25251041389451e-9im; 0.001778923640229406 + 1.0093069018289139e-8im 0.0008984420028705334 + 3.88253870373112e-9im … -0.00042718580516431224 - 7.121354898522971e-10im 0.0009965100174445939 + 6.9846941124403666e-9im; … ; -0.0012787072131736868 - 7.0381890802515615e-9im -0.0011608980182966264 - 4.93482081059526e-9im … 0.0005743029621210943 + 3.1696393256977178e-9im -0.0004364671834715418 - 3.047207822683294e-9im; -0.0006684666201791982 - 6.272616214732857e-9im -0.0011963513842292123 - 7.800729676697088e-9im … 0.0010419950094210809 + 6.12011892322147e-9im 0.0008975925186872324 + 3.448650787201937e-9im;;; 0.0009698973627725838 + 3.051981616432678e-9im 0.000790987293312771 + 1.2800101927464465e-9im … -0.00010219662737954154 - 2.43440661533577e-10im 0.0007324719532788322 + 3.370700164008015e-9im; 0.0007325726021303441 + 3.2081650827903305e-9im 0.0007961010899784161 + 2.3658246632970696e-9im … -0.000748759553776471 - 4.176066541954842e-9im 0.000223778526211806 + 1.3982843124112538e-9im; … ; 0.0006306762563231152 + 2.0892105133088172e-9im 0.0006163232372685856 + 2.4063803805499107e-9im … 0.0005113324996400392 + 2.7296071699230615e-9im 0.0005312991485267273 + 1.6350586964611027e-9im; 0.0007909323864860659 + 1.3820709931920385e-9im 0.0005671131094967083 + 8.243385560384916e-10im … 0.0004055331639857046 + 2.104904088220641e-9im 0.0007960929377347553 + 2.9374231529023027e-9im;;; … ;;; 0.0006957551047213911 + 4.487970407537284e-9im 0.0004975722083490762 + 3.239149339761796e-9im … 0.0005789935663792358 + 3.1187973291898117e-9im 0.0007089494814793365 + 4.3912352787565485e-9im; 0.0007090483226423392 + 5.281781002340459e-9im 0.000611415098161375 + 4.362756610837293e-9im … 0.0003417810296316138 + 2.092485754112694e-9im 0.0004516809239202276 + 3.7495461854984855e-9im; … ; 0.0002608942837963282 + 1.4077589281405765e-9im -4.1997200499645455e-5 - 4.01031949064718e-10im … 0.0005329524394198832 + 2.538717981593392e-9im 0.0005728516994020667 + 2.8543192901834638e-9im; 0.0004974762643432996 + 3.0223954108648317e-9im 0.0002968829850459409 + 2.2031483511577514e-9im … 0.0006874984395573733 + 3.3272502739101206e-9im 0.0006112815163164595 + 3.3905136661201616e-9im;;; 0.001085893397657869 + 4.709424446286106e-9im 0.0005816977032427075 + 1.5494230339338808e-9im … 0.0005635356447799236 + 1.88343571063306e-9im 0.0011486780648520822 + 5.457971281720554e-9im; 0.0011489964104578014 + 6.775496527452401e-9im 0.0010469765510900196 + 5.303809601385644e-9im … -4.4971615399162314e-5 - 1.2047912605833093e-9im 0.0007784085680513441 + 4.384248926095038e-9im; … ; 0.00039983400768975704 + 9.324408147610215e-10im -0.00017247739756605702 - 8.670386905546926e-10im … 0.0010705612811311325 + 3.986445366711679e-9im 0.0009800988025588742 + 3.2449638624291546e-9im; 0.0005814393765119076 + 1.0287176971090588e-9im 6.890935578338607e-6 - 1.0732099838447102e-9im … 0.0009294935074350136 + 3.0871634076273184e-9im 0.001046554843508666 + 3.90349991604946e-9im;;; 0.001037465316502866 + 3.70222080403758e-9im -0.0005355106596719743 - 5.167438783198413e-9im … 0.0008603912502375019 + 3.7241389594069556e-9im 0.0020184923167803274 + 8.79841878019384e-9im; 0.0020192184265019003 + 1.0504801268435005e-8im 0.0010347723476674992 + 4.603648398450301e-9im … -0.00014749175128020585 - 1.891835663434291e-9im 0.001423694075481828 + 7.0768024657922686e-9im; … ; -0.0007738154983920465 - 4.37978325173696e-9im -0.0011181499504556544 - 4.426379132729345e-9im … 0.0010258584422135778 + 4.312868358743079e-9im 0.00020568721643669585 + 5.744616202482986e-12im; -0.0005362503784728989 - 4.982932130379653e-9im -0.0011583407840315906 - 6.929865845128274e-9im … 0.0013180213207050807 + 5.541213558218288e-9im 0.0010335152469954081 + 3.5795954057760766e-9im;;;; 0.0005706250705696409 - 3.5472827299000265e-10im 0.007029569920009213 - 2.2548783920297826e-9im … -0.0016877725451915075 - 6.14344744828996e-10im -0.0038779316159687363 - 5.449129773947724e-10im; 0.0012513295083939548 + 9.092817802715104e-10im 0.005667646083741478 + 1.2751738060540814e-9im … 0.00027093734168544904 - 5.086060022215418e-10im -0.0001713458404953325 - 9.906129169271842e-10im; … ; -0.00035558954209090137 - 4.1813632032125825e-10im 0.0013363383101088343 - 1.4666112151889226e-9im … -0.0029863144777167016 + 1.7397428590341473e-9im -0.002930284024673786 + 1.1119763054982648e-9im; 0.00030435863387141246 - 1.2534717253351622e-9im 0.003952440076396039 - 2.551904778540997e-9im … -0.0033053718019886327 + 7.481598673919621e-10im -0.004742693824601878 + 3.451360007974043e-10im;;; 0.0018010804654316932 - 1.2440026015476175e-9im 0.004302579395685951 - 1.417231193512336e-9im … -0.0004407493535804097 + 1.0795203446434254e-10im -0.0008703176536342604 - 7.049679397340568e-10im; 0.0018439716146533597 - 2.0254659986266668e-10im 0.0033664761338418315 + 3.824038092354382e-10im … 0.00042179338407120095 - 1.0973440636102222e-10im 0.0006935584817614461 - 4.483206425697094e-10im; … ; 0.0002475588180295451 - 2.8837278552727874e-10im 0.001008488262615666 - 8.470160599140087e-10im … -0.0011864012795061894 + 1.1831592655840255e-9im -0.0009320910211869462 + 5.347382706386325e-10im; 0.001156622448267171 - 1.0555569612824556e-9im 0.0024549329719167515 - 1.3333828084870367e-9im … -0.001091737051305468 + 4.557101357151779e-10im -0.0011889581686645057 - 2.0330382285068302e-10im;;; 0.0006419271666707189 + 2.535587280262498e-10im 0.0010557422431503667 + 2.6857728001471337e-10im … 1.738003192988331e-5 + 2.952987581506281e-10im 4.674902227679457e-5 - 1.6429864413414208e-11im; 0.0008044018924590922 + 2.2172618216773385e-10im 0.00077712431153631 + 7.452985936740042e-10im … 0.0005008238739436262 + 2.3685128318505655e-10im 0.0005132519235804845 + 1.0725632727649605e-10im; … ; 0.00021250071493016765 + 2.373081561504422e-10im 0.0005459955107029515 + 1.0431250500721036e-10im … -0.0003201273926072967 + 7.018330082799666e-10im -0.0001921108096329733 + 4.4315838344645264e-10im; 0.00040288905945857253 + 2.3867436961995853e-10im 0.0006558986234048895 + 8.937138683427924e-11im … -8.473948907929829e-5 + 2.856093590435903e-10im 0.00011750327576487582 + 3.4067130636534276e-10im;;; … ;;; -0.00011881246021250696 - 4.0752221283095624e-10im 0.0006537661246708122 - 5.016746824817314e-10im … -0.00033243000325403944 - 8.0475150174132e-11im -0.0003690246089143041 - 2.0469442518304218e-10im; -0.00023865893501379208 - 6.276188340738342e-10im 0.00035992591032903625 - 8.320848212563006e-10im … 0.00013174174049553948 - 1.254195456980763e-10im -0.00016520869826717338 - 3.365867361663939e-10im; … ; -0.00013926275102462077 + 5.835314643717276e-11im 0.0003673710435955167 + 1.1453226976003582e-10im … -0.0005660340882093702 - 2.0193769341888176e-10im -0.0005300157456856504 + 8.678083136352358e-12im; -0.00012377759356757177 - 2.598683814432808e-10im 0.0006671880971428934 - 1.8788706089606058e-10im … -0.0005472145209930837 - 4.6559046452337376e-11im -0.0004925341073730478 - 1.7213545326787305e-10im;;; -0.00013598263977135762 + 2.4535468802778143e-10im 0.001697885607970623 - 1.4096286734328117e-10im … -0.0008522746623851243 + 5.63808978478063e-10im -0.0012157079396085222 + 2.889785023928325e-10im; 6.627271966551382e-5 - 1.8015585931820893e-10im 0.0010659285375873707 - 5.7035586901547454e-11im … 2.4318008092406977e-5 + 4.724732770820805e-10im -0.0004284152701897875 + 1.9314119420311815e-10im; … ; -0.0003620449590233117 + 7.118821377290659e-10im 0.0009039963227104052 + 3.294407040761572e-10im … -0.0013891134042273228 + 9.24779715189931e-10im -0.0013816521027775084 + 9.09294622236656e-10im; -0.00026339608302833355 + 6.307905727460773e-10im 0.001229009503129792 + 1.2479693262586652e-10im … -0.0011387834228346848 + 6.177643073016862e-10im -0.0011154057678174633 + 8.234693667693213e-10im;;; -0.00026490649693917257 - 4.3070045890109604e-10im 0.004311477595191626 - 1.6854314309940517e-9im … -0.0013949976665142481 - 5.0554545118054586e-11im -0.0029120990372103984 - 3.027435416555788e-10im; 0.00039597907555771457 - 6.661008081915165e-10im 0.00309299329051387 - 5.170277416076551e-10im … 1.3601255799171435e-5 - 1.9900988881518503e-10im -0.00043166761747336313 - 7.427137647181898e-10im; … ; -0.0005954476478044126 + 3.551669891830065e-10im 0.0011322517165661206 - 5.37729526030163e-10im … -0.00254477509160586 + 1.491482295307156e-9im -0.0024961295122618533 + 1.3156392312391185e-9im; -0.0002976280084628698 + 5.531693486758736e-11im 0.0027244379261679064 - 1.1913345695749003e-9im … -0.002437492276343238 + 7.27001831420567e-10im -0.0033452346915873623 + 1.0575565515906031e-9im])

The real space WFs W, are defined on the grid rgrid.

To compute WF centers, invoke

center(rgrid, W)
3×5 Matrix{Float64}:
 2.60147     0.66097  -0.652653  0.0048935  0.00213058
 0.00879181  1.89915   1.89917   1.50829    0.765053
 7.28641     1.73067   1.7299    7.2866     1.73017

columns are the WF centers in Cartesian coordinates.

Compare with WF center computed in reciprocal space,

center(model)
3×5 Matrix{Float64}:
  2.64105     0.660245  -0.66025   -3.16459e-5  -1.93558e-6
 -1.37658e-6  1.90597    1.90599    1.52476      0.762405
 -0.369938    0.170257   0.170411  -0.36998      0.170355

and yes, they are different, the z coordinate is wrongly computed in the real space because the WFs are truncated along z (you can see this by a 3D visualizer). If we translate the rgrid by half of the c axis along z, then the WFs are complete, and the real space WF centers are much closer to the reciprocal space results.

Note

Because we are using a coarsely sampled real space grid in the UNK files, the WF centers can be improved by rerun the calculation with a more refined real space grid.

That's all about real space!


This page was generated using Literate.jl.