2. Disentanglement of entangled manifold
In the second tutorial, we will run the disentanglement algorithm on the silicon valence + conduction bands. As usual, we need to
- generate the
amn,mmn, andeigfiles by usingQuantum ESPRESSO(QE) - construct a
ModelforWannier.jl, by reading thewin,amn,mmn, andeigfiles - run
Wannier.jldisentangleon theModelto minimize the spread - write the maximal localized gauge to a new
amnfile
This is a HTML version of the tutorial, you can download corresponding
- Jupyter notebook:
tutorial.ipynb - Julia script:
tutorial.jl
Preparation
Load the package
using Wannier
using Printf # for pretty printUse the run.sh script which automate the scf, nscf, pw2wannier90 steps.
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("si2")lattice: Å
a1: 0.00000 2.71527 2.71527
a2: 2.71527 0.00000 2.71527
a3: 2.71527 2.71527 0.00000
atoms: fractional
Si: 0.00000 0.00000 0.00000
Si: 0.25000 0.25000 0.25000
n_bands: 16
n_wann : 8
kgrid : 4 4 4
n_kpts : 64
n_bvecs: 8
b-vectors:
[bx, by, bz] / Å⁻¹ weight
1 0.28925 -0.28925 0.28925 1.49401
2 -0.28925 -0.28925 -0.28925 1.49401
3 -0.28925 0.28925 -0.28925 1.49401
4 -0.28925 -0.28925 0.28925 1.49401
5 0.28925 0.28925 -0.28925 1.49401
6 -0.28925 0.28925 0.28925 1.49401
7 0.28925 -0.28925 -0.28925 1.49401
8 0.28925 0.28925 0.28925 1.49401The read_w90 function will parse the win file and set the frozen window for the Model according to the dis_froz_min and dis_froz_max parameters in the win file. However, you can also change these parameters by calling the set_frozen_win! function.
Disentanglement and maximal localization
The disentangle function will disentangle and maximally localize the spread functional, and returns the gauge matrices U,
U = disentangle(model)16×8×64 Array{ComplexF64, 3}:
[:, :, 1] =
0.111761+0.698219im … 2.58153e-8+1.22317e-7im
-4.87003e-8-1.43163e-8im 0.250007-0.0294491im
3.98028e-8+7.13461e-9im -0.252285-0.36804im
5.07799e-8-1.11992e-10im -0.485848+0.038466im
-8.77988e-8+1.35684e-7im -0.279255-0.197916im
-1.54707e-7-4.39447e-7im … 0.27269+0.346345im
9.27033e-8+3.34284e-7im -0.227774-0.369662im
-0.0321752+0.706356im 1.96826e-7+4.36805e-7im
2.22365e-9+7.77753e-9im 3.0155e-8-3.35082e-8im
4.74728e-9+9.52079e-10im -2.93517e-9+8.63692e-8im
6.04808e-9-2.69522e-9im … -2.40791e-8+5.38945e-9im
6.64407e-9-1.60265e-8im -2.31374e-7-1.05431e-7im
3.77989e-9+1.93567e-8im -9.19568e-8-7.42529e-8im
-4.87148e-9-2.80427e-10im 1.58719e-7+1.61337e-7im
-0.00448668-0.00228008im -3.3663e-9+1.68558e-9im
6.34946e-10-8.35856e-10im … -3.72729e-8-1.77602e-8im
[:, :, 2] =
-0.661154-0.197991im 0.0325423-0.0826608im … 0.0130113+0.0878778im
0.215855-0.383447im -0.139837-0.287351im -0.220069+0.231721im
8.07755e-8-3.7246e-8im 0.247498+0.264292im -0.439968-0.220343im
9.67953e-8-3.22014e-8im 0.354636-0.276516im -0.153893-0.25986im
-0.0617892-0.455648im -0.062591+0.292035im -0.0960857-0.282789im
-6.90833e-8-4.60069e-7im -0.451142-0.267179im … -0.219797-0.35931im
2.59152e-7-3.96048e-7im 0.0896819+0.160793im 0.0206672-0.361896im
0.253347-0.226618im 0.317992+0.127168im 0.273153+0.206585im
-2.60454e-9+5.00388e-8im -0.0895461+0.0491383im 0.00364945+0.0191664im
-1.00799e-7+1.479e-7im 0.0279981+0.0597544im -0.0316425+0.115783im
-0.0311393-0.0292906im -0.0533976+0.0750946im … -0.08054-0.0447642im
-0.0139832+0.0324625im -0.0543361+0.0733565im -0.0912503+0.00263846im
-5.77148e-8+6.31325e-8im 0.0131604+0.0518483im 0.0113719+0.0669979im
-9.01861e-9+5.99055e-9im 0.0348641-0.0371696im -0.0027809+0.0288572im
-9.97351e-8+6.00984e-8im 0.0211478+0.0505144im 0.00620119+0.0573059im
5.59049e-9+3.9318e-8im -0.0150015-0.0324432im … 0.0139075+0.0275808im
[:, :, 3] =
0.194735+0.665427im … -0.0225189-0.0769488im
0.424525-0.193276im -0.279245+0.127134im
-3.94301e-9-5.37264e-8im 0.387526+0.288074im
3.43764e-8+2.94624e-8im -0.0253234+0.315482im
-0.529944+0.0397836im -0.26855+0.0201608im
-3.65288e-7+1.14008e-7im … -0.0751052-0.486782im
-8.26018e-8-1.21567e-7im 0.08397-0.165231im
-0.0901249+0.0265775im -0.259789+0.0766124im
-8.65739e-9-1.3668e-8im -6.89277e-8-8.32443e-8im
4.10469e-8-1.39546e-8im 4.56205e-8-1.68473e-7im
2.15434e-9-1.27165e-10im … 8.85642e-9-1.1719e-8im
-2.15567e-8-1.48861e-7im 0.222481+0.015572im
1.42184e-8-8.75885e-8im 0.0801181+0.0149682im
0.0713511-0.0719651im 0.205672-0.207444im
1.53271e-8+8.42603e-9im 4.55633e-8+2.14888e-8im
0.00524269+0.0125858im … 0.0151125+0.036279im
;;; …
[:, :, 62] =
-0.0699355-0.661997im … -0.0487142+0.0268936im
-0.205777+0.528887im 0.2158-0.0599727im
-0.0930781+0.18439im -0.273468-0.240602im
-1.1529e-8-8.93419e-8im -0.425952-0.261849im
0.237539-0.170351im -0.0891282-0.0339242im
-0.183237-0.0632996im … -0.0215613-0.214618im
-0.193365-0.128422im -0.277801-0.254419im
-1.76789e-7+3.17089e-7im 0.156194+0.39984im
-0.0100242+0.0936122im -0.251338+0.0988819im
-7.93848e-8-1.64522e-7im -0.185032-0.0692895im
-9.76773e-8-1.07332e-7im … -0.153484+0.0144726im
0.0444768-0.00579216im 0.0269545+0.0664283im
-0.0168293-0.0547054im 0.10661-0.144434im
0.00795924-0.0141399im 0.0186389+0.00215521im
-6.20133e-8+1.30235e-8im -2.7749e-5+0.0540993im
-0.0122906+0.0257909im … -0.0526103+0.0557264im
[:, :, 63] =
0.3079-0.598662im … -0.0687038+0.133584im
-0.5526-0.127377im 0.188777+0.043514im
0.0146735-0.133843im 0.0397664-0.362729im
-1.8363e-8-3.12989e-8im 0.376624-0.328869im
-0.24724-0.0974201im 0.100232+0.0394928im
9.43668e-8-1.81287e-7im … 0.357925+0.349127im
-0.0556494+0.111995im -0.100911+0.203086im
-0.300382-0.115051im -0.363839-0.139356im
-5.00901e-8+1.02551e-9im -1.38692e-7+3.55247e-9im
0.081216+0.0793804im 0.147274+0.143944im
-0.0285746+0.00544723im … -0.0534185+0.0101834im
-0.0554396-0.0198563im -0.180232-0.0645515im
0.00904487+0.00439827im 0.0164016+0.00797549im
0.00314076+0.00492826im 0.00569513+0.00893664im
-2.54626e-8+1.15726e-8im -2.69943e-7+1.57787e-7im
-0.000159879-0.00318789im … -0.00486934-0.0971257im
[:, :, 64] =
0.687305-0.0627372im … -0.0766937+0.0448319im
-0.400027+0.183313im -0.0580926-0.314245im
-1.28304e-8+3.41617e-8im 0.128068-0.0855533im
-7.28342e-8-1.76194e-8im -0.0955143+0.548169im
-0.163109+0.429917im 0.29437+0.0504904im
2.40733e-7-1.73422e-8im … -0.185985+0.165522im
-2.66338e-7-5.48803e-8im 0.490407-0.0795231im
0.245784+0.234799im 0.28851+0.184532im
-1.12221e-8-2.39453e-9im 0.0145893+0.00549528im
7.622e-8-3.41044e-9im -0.108438+0.0527799im
0.0344254-0.0253473im … -0.071148-0.0585533im
0.0151444+0.0319373im 0.0702677+0.0582753im
-3.77952e-8+2.21599e-8im 0.00569708-0.0142884im
4.06438e-8+7.86089e-8im -0.0631211-0.0351796im
-7.32305e-8+2.24036e-9im 0.0512993-0.014826im
-2.01529e-8-5.14719e-10im … 0.0374042-0.00510306imThe initial spread is
omega(model) WF center [rx, ry, rz]/Šspread/Ų
1 -0.00000 0.00000 0.00000 1.33119
2 0.00001 0.00011 -0.00000 1.92293
3 -0.00000 0.00011 0.00011 1.92297
4 0.00001 -0.00000 0.00011 1.92303
5 1.35763 1.35763 1.35763 1.33119
6 1.35762 1.35752 1.35763 1.92293
7 1.35763 1.35752 1.35752 1.92297
8 1.35762 1.35763 1.35752 1.92303
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
ΩI = 9.69628
Ω̃ = 4.50396
ΩOD = 4.49427
ΩD = 0.00968
Ω = 14.20024
The final spread is
omega(model, U) WF center [rx, ry, rz]/Šspread/Ų
1 0.00000 0.00000 0.00000 1.44670
2 0.00000 0.00000 -0.00000 2.09677
3 -0.00000 -0.00000 0.00000 2.09677
4 -0.00000 -0.00000 -0.00000 2.09677
5 1.35763 1.35763 1.35763 1.44670
6 1.35763 1.35763 1.35763 2.09677
7 1.35763 1.35763 1.35763 2.09677
8 1.35763 1.35763 1.35763 2.09677
Sum spread: Ω = ΩI + Ω̃, Ω̃ = ΩOD + ΩD
ΩI = 10.05117
Ω̃ = 5.42285
ΩOD = 5.36573
ΩD = 0.05711
Ω = 15.47402
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.
Save the new gauge
Again, we save the new gauge to an amn file, which can be used as the new initial guess for Wannier90, or reuse it in Wannier.jl.
write_amn("si2.dis.amn", U)[ Info: Written to file: si2.dis.amnGreat! Now you have finished the disentanglement tutorial.
As you can see, the workflow is very similar to the previous tutorial: the Wannierization functions, max_localize and disentangle, accept a Model and some convergence thresholds, and return the gauge matrices. This interface are also adopted in other Wannierization algorithms, shown in later tutorials.
This page was generated using Literate.jl.