Interface With Wannier90

The module TightBindingApproximation.Wannier90 offers utilities to parse data from Wannier90 input and output files to ensure the compatibility with both the QuantumLattices and TightBindingApproximation frameworks.

Silicon as a concrete example

Before using the code examples, you need to prepare a set of Wannier90 input and output files. For convenience, we provide a pre-generated dataset as a Julia artifact. To use it, include an Artifacts.toml file in your working directory with the following content:

[WannierDataSets]
git-tree-sha1 = "d69063bceff09edd6f55fcc9f5989c406d37d1b9"

    [[WannierDataSets.download]]
    sha256 = "2205f49c1374b1c834b5f8dd4d3b9c2f97a5f96eb0a4b338bc7da29642787e69"
    url = "https://gist.github.com/waltergu/1821d4285e35de366dbabb5513c23f6f/raw/d69063bceff09edd6f55fcc9f5989c406d37d1b9.tar.gz"

Then this artifact can be used by the following codes as if it were a folder:

using Artifacts
using Pkg

toml = Artifacts.find_artifacts_toml(@__DIR__)

# Directory to contain Wannier90 output files
dir = Pkg.Artifacts.ensure_artifact_installed("WannierDataSets", toml)

Then a Wannier90 tight-binding system can be constructed by reading the data from Wannier90 input and output files:

using Plots
using QuantumLattices
using TightBindingApproximation
using TightBindingApproximation.Wannier90

# seedname of Wannier90 output file
seedname = "silicon"

# Read data from seedname.win, seedname_centres.xyz and seedname_hr.dat,
# and construct the Wannier90 tight-binding system
wan = Algorithm(:silicon, W90(dir, seedname))

Now we plot the energy bands interpolated by Wannier90 versus those computed directly from wan for comparison:

# Read the reciprocal path from seedname.win
path = readpath(dir, seedname)

# Read the energy bands computed by Wannier90 from seedname_band.dat
bands = readbands(dir, seedname)

# Plot the energy bands computed by Wannier90 versus those by `wan` for comparison
plt = plot()
plot!(plt, bands...; xlim=(0.0, distance(path)), label=false, color=:green, alpha=0.6, lw=2.5)
plot!(plt, wan(:EB, EnergyBands(path)), color=:black)
Example block output

The constructed wan can be converted to a normal tight-binding system

# Define the hilbert space. Note that `hilbert.nspin` is 1
# This is because in silicon, the spin-orbital coupling is omitted
# Therefore, seedname_hr.dat in fact describes a spinless system
hilbert = Hilbert(Fock{:f}(4, 1), length(wan.frontend.lattice))

# Convert `wan` to a normal tight-binding system
# Note when `complement_spin=false`, the converted system is also spinless
tba = Algorithm(wan, hilbert; complement_spin=false)
plt = plot()
plot!(plt, bands...; xlim=(0.0, distance(path)), label=false, color=:green, alpha=0.6, lw=2.5)
plot!(plt, tba(:EB, EnergyBands(path)), color=:black)
Example block output
# When `complement_spin=true`, the converted system is spinful
tba = Algorithm(wan, hilbert; complement_spin=true)
plt = plot()
plot!(plt, bands...; xlim=(0.0, distance(path)), label=false, color=:green, alpha=0.6, lw=2.5)
plot!(plt, tba(:EB, EnergyBands(path)), color=:black)
Example block output

Manual

New types to implement the underlying mechanism of QuantumLattices and TightBindingApproximation specified for Wannier90 data:

TightBindingApproximation.Wannier90.W90HoppingsType
W90Hoppings <: OperatorPack{Matrix{Float64}, NTuple{3, Int}}

Hopping amplitudes among the Wannier orbitals in two unitcells with a fixed relative displacement.

Here,

  1. the :value attribute represents the hopping amplitude matrix of Wannier orbitals,
  2. the :id attribute represents the relative displacement of the two unitcells in basis of the lattice translation vectors.
source

Read data from Wannier90 input and output files to construct the Wannier90 tight-binding system:

TightBindingApproximation.Wannier90.readlatticeFunction
readlattice(path::AbstractString, seedname::AbstractString; name::Symbol=Symbol(seedname), projection::Bool=true) -> Lattice{3, Float64, 3}

Read the lattice from the Wannier90 ".win" input file with a given name.

Besides, projection specifies whether only the sites with initial projections in the Wannier90 ".win" input file are included in the constructed lattice.

source
readlattice(path::AbstractString; name::Symbol=:lattice) -> Lattice{3, Float64, 3}

Read the lattice from the "POSCAR" file with a given name.

source

Read data from Wannier90 input files for more information:

TightBindingApproximation.Wannier90.readpathFunction
readpath(path::AbstractString, seedname::AbstractString; length=nothing) -> ReciprocalPath

Read the reciprocal path along which to plot the energy bands from the Wannier90 ".win" input file.

source

Read results from Wannier90 output files:

TightBindingApproximation.Wannier90.readbandsFunction
readbands(path::AbstractString, seedname::AbstractString) -> Tuple{Vector{Float64}, Matrix{Float64}}

Read the energy bands from the Wannier90 "band.dat" output data file when the "bandsplot" parameter in the Wannier90 ".win" input file is set to be true.

source

New types and functions to help implement the conversion to a normal tight-binding system:

QuantumLattices.Frameworks.AlgorithmType
Algorithm(wan::Algorithm{W90}, hilbert::Hilbert; complement_spin::Bool=false, tol::Real=1e-6)

Convert a Wannier90 tight-binding system to the operator formed one.

source

Other utilities: