aiida-wannierjl
An AiiDA plugin that wraps Wannier.jl (pinned to rev 65245c59 of the qiaojunfeng/Wannier.jl fork, requires Julia >= 1.11) to manipulate Wannier functions from within AiiDA workflows.
Each calculation renders a small Julia driver script (driver.jl) and runs it against a persistent, pinned Wannier.jl project environment. The AiiDA Code is the Julia binary itself, so the calculations are remote-capable and provenance is tracked like any other AiiDA CalcJob. Results come back through a machine-readable results.json that the parsers turn into AiiDA output nodes.
Features
The plugin provides three CalcJobs, one per Wannier.jl operation:
wannierjl.check_neighbors(CheckNeighborsCalculation) — reads a wannier90 run (.win,.chk,.mmn,.amn,.eig) withread_w90_with_chkand reports whether the k-point stencil contains the six cubic nearest-neighbour b-vectors (Wannier.has_cubic_neighbors). Output: aBoolnodehas_cubic_neighbors.wannierjl.generate_neighbors(GenerateNeighborsCalculation) — writes acubic.nnkpfile with the six cubic b-vectors viaWannier.write_nnkp_cubic, so that a.mmnwith cubic neighbours can be regenerated. Output: aSinglefileDatanodennkp_file.wannierjl.split(SplitCalculation) — splits a Wannier manifold into blocks withWannier.Tools.mrwf, given 1-based index groups. Outputs, under dynamic namespaces: per-blockFolderData(blocks.block_i, containingamn/eig/mmn), the per-block.winfiles (win_files.block_i), and the per-block split U matrices (u_matrices.block_i, the<seedname>_split.amnfiles).
Input files for each CalcJob can be supplied either explicitly as SinglefileData ports or picked up from a parent calculation's remote working directory (parent_folders.* RemoteData), which is how the .chk file — not normally retrieved by upstream wannier90 plugins — is symlinked in from a wannier90 run on the same computer.
workflows extra
Installing the optional workflows extra pulls in aiida-workgraph and aiida-quantumespresso and exposes split_wannierization, an aiida-workgraph @task.graph that orchestrates the full split:
from aiida_wannierjl.workflows import split_wannierization
It runs check_neighbors and, only when the cubic neighbours are missing, generates the cubic.nnkp, regenerates the cubic .mmn with a Pw2wannier90Calculation (forcing write_mmn=.true., write_amn=.false., SCDM off), and then runs split — all in a single invocation, with the cubic branch decided at runtime. Re-wannierization and U-matrix merging are deliberately out of scope and stay in the downstream consumer (koopmans).
Julia environment
The Wannier.jl project environment is created once per machine, never per calculation. A helper builds the pinned project (Pkg.add of Wannier.jl at rev 65245c59 plus JSON) and, by default, a PackageCompiler.jl sysimage so that each calculation loads in ~0.1 s instead of paying the multi-second using Wannier cost on every fresh process. The sysimage path travels on the Code node, and the CalcJobs pick it up automatically (falling back to a plain --project load when no sysimage is known).
See the get started guide for the full setup procedure (setup_julia_environment and get_wannierjl_code in aiida_wannierjl.helpers).
Installation
pip install aiida-wannierjl[workflows] # drop [workflows] if you don't need the workgraph
verdi quicksetup # better to set up a new profile
verdi plugin list aiida.calculations # should list the three wannierjl.* plugins
You also need a Julia >= 1.11 installation and the one-time environment setup described above.
Usage
Once you have registered a Julia code (labelled e.g. wannierjl@localhost), a minimal generate_neighbors run looks like:
verdi daemon start # make sure the daemon is running
cd examples
./example_01.py # generate a cubic.nnkp from a small .win
verdi process list -a # check the record of the calculation
See examples/example_01.py for the corresponding Python.
Development
git clone https://github.com/elinscott/aiida-wannierjl .
cd aiida-wannierjl
pip install --upgrade pip
pip install -e .[pre-commit,workflows] # install extra dependencies
pre-commit install # install pre-commit hooks
pytest -v # discover and run all tests
The test suite mocks the Julia code, so it runs in CI without a real Julia installation. See the developer guide for more information.
Citing
If you use this plugin for your research, please cite the following work:
- J. Qiao, G. Pizzi, and N. Marzari, Automated mixing of maximally localized Wannier functions into target manifolds, npj Comput. Mater. 9, 206 (2023), https://doi.org/10.1038/s41524-023-01147-9.
- J. Qiao, G. Pizzi, and N. Marzari, Projectability disentanglement for accurate and automated electronic-structure Hamiltonians, npj Comput. Mater. 9, 208 (2023), https://doi.org/10.1038/s41524-023-01146-w.
See CITATION.cff (or the GitHub "Cite this repository" button) for how to cite this plugin itself.
License
MIT
Contact
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiida_wannierjl-0.1.0.tar.gz.
File metadata
- Download URL: aiida_wannierjl-0.1.0.tar.gz
- Upload date:
- Size: 112.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fbc2b9bcd2eae4698c5a77984e9377e1e5152659027afb28fa5561867d2b31e
|
|
| MD5 |
411db85e7177a81fc03a368f2d8d7bed
|
|
| BLAKE2b-256 |
e339859fa64dab3c0e8551b9316f5fb2f882d0ee07aa96dc74163c80e76a8898
|
Provenance
The following attestation bundles were made for aiida_wannierjl-0.1.0.tar.gz:
Publisher:
publish.yml on elinscott/aiida-wannierjl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiida_wannierjl-0.1.0.tar.gz -
Subject digest:
1fbc2b9bcd2eae4698c5a77984e9377e1e5152659027afb28fa5561867d2b31e - Sigstore transparency entry: 2599032094
- Sigstore integration time:
-
Permalink:
elinscott/aiida-wannierjl@5c9d7edd1c7bd8f129284ce9231047b2e69944a5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elinscott
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c9d7edd1c7bd8f129284ce9231047b2e69944a5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aiida_wannierjl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aiida_wannierjl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
443855b657b204e01d94aebb87fbea0cc29b438d04bf9d8081eac6b8ac0243e0
|
|
| MD5 |
0e810bac72c60c0869ee886308a45e97
|
|
| BLAKE2b-256 |
cc61f00711d1b9bff5c6fded7af2a2f2d9e6a19919d756ea2c5ad36d73b001eb
|
Provenance
The following attestation bundles were made for aiida_wannierjl-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on elinscott/aiida-wannierjl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiida_wannierjl-0.1.0-py3-none-any.whl -
Subject digest:
443855b657b204e01d94aebb87fbea0cc29b438d04bf9d8081eac6b8ac0243e0 - Sigstore transparency entry: 2599032181
- Sigstore integration time:
-
Permalink:
elinscott/aiida-wannierjl@5c9d7edd1c7bd8f129284ce9231047b2e69944a5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elinscott
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c9d7edd1c7bd8f129284ce9231047b2e69944a5 -
Trigger Event:
release
-
Statement type: