Skip to main content

Build Status Coverage Status Docs status PyPI version

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) with read_w90_with_chk and reports whether the k-point stencil contains the six cubic nearest-neighbour b-vectors (Wannier.has_cubic_neighbors). Output: a Bool node has_cubic_neighbors.
  • wannierjl.generate_neighbors (GenerateNeighborsCalculation) — writes a cubic.nnkp file with the six cubic b-vectors via Wannier.write_nnkp_cubic, so that a .mmn with cubic neighbours can be regenerated. Output: a SinglefileData node nnkp_file.
  • wannierjl.split (SplitCalculation) — splits a Wannier manifold into blocks with Wannier.Tools.mrwf, given 1-based index groups. Outputs, under dynamic namespaces: per-block FolderData (blocks.block_i, containing amn/eig/mmn), the per-block .win files (win_files.block_i), and the per-block split U matrices (u_matrices.block_i, the <seedname>_split.amn files).

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:

See CITATION.cff (or the GitHub "Cite this repository" button) for how to cite this plugin itself.

License

MIT

Contact

edwardlinscott@gmail.com

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiida_wannierjl-0.1.0.tar.gz (112.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiida_wannierjl-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

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

Hashes for aiida_wannierjl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1fbc2b9bcd2eae4698c5a77984e9377e1e5152659027afb28fa5561867d2b31e
MD5 411db85e7177a81fc03a368f2d8d7bed
BLAKE2b-256 e339859fa64dab3c0e8551b9316f5fb2f882d0ee07aa96dc74163c80e76a8898

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_wannierjl-0.1.0.tar.gz:

Publisher: publish.yml on elinscott/aiida-wannierjl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for aiida_wannierjl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 443855b657b204e01d94aebb87fbea0cc29b438d04bf9d8081eac6b8ac0243e0
MD5 0e810bac72c60c0869ee886308a45e97
BLAKE2b-256 cc61f00711d1b9bff5c6fded7af2a2f2d9e6a19919d756ea2c5ad36d73b001eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_wannierjl-0.1.0-py3-none-any.whl:

Publisher: publish.yml on elinscott/aiida-wannierjl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page