Getting Started
Installation
Julia
First install Julia, you can,
- download official release from https://julialang.org/downloads/
- or use
juliaupwhich can better handle multiple Julia versions
Quick notes for installing juliaup, on Linux or macOS:
curl -fsSL https://install.julialang.org | sh
juliaup add releaseWannier.jl
From Julia package manager
Install with the Julia package manager Pkg, just like any other registered Julia package:
pkg> add Wannier # Press ']' to enter the Pkg REPL mode.or
julia> using Pkg; Pkg.add("Wannier")This is the recommended way to install Wannier.jl for end users.
From GitHub
git clone https://github.com/qiaojunfeng/Wannier.jl.git
cd Wannier.jl
julia --project=. -e 'using Pkg; Pkg.update(); Pkg.resolve(); Pkg.instantiate()'From tarball
tar xvf Wannier.jl.tgz
cd Wannier.jl
julia --project=. -e 'using Pkg; Pkg.update(); Pkg.resolve(); Pkg.instantiate()'If you install with Pkg, then start Julia REPL just with julia; if you install with git or tarball, then start with julia --project=PATH_OF_Wannier.jl.
Command-line interface
Additionally, there is a command-line interface (CLI)
cd Wannier.jl
julia --project deps/build.jl install # install CLIThe executable will be installed in ~/.julia/bin/wannier.
After appending ~/.julia/bin to your $PATH, you can use the CLI as follows:
$ wannier -h
wannier v0.1.0
Julia package for Wannier functions.
Usage
wannier <command>
...Since julia needs precompilation of the code, there will be some delay when running the CLI.
Usage
For example, running a maximal localization can be easily achieved by
using Wannier
model = read_w90("silicon")
U = max_localize(model)
write_amn("silicon.amn", U)For a much more detailed usage, please refer to the API documentation and the source code of each function.
Development
The repo is hosted at https://github.com/qiaojunfeng/Wannier.jl
To reduce the startup latency of the Wannier.jl package, and to allow smoother user/development experience, some of the functionality are implemented inside standalone packages:
- The input/output functions are inside
WannierIO.jlrepo, and its documentation at io.wannierjl.org - The plotting related code is inside
WannierPlots.jlrepo, and its documentation at plots.wannierjl.org
Pre-commit
To ensure uniform code style, we use pre-commit, which auto check and fix code style before each git commit. Install the hooks with
cd Wannier.jl
pre-commit installTests
Run tests with
cd Wannier.jl
julia --project=. # start REPL
] # activate Pkg mode
test # run tests