Official Resources
- Repository: https://github.com/qilauea/WannierIO.jl
- Documentation: https://qilauea.github.io/WannierIO.jl/dev/
- License: MIT License
Overview
WannierIO.jl is a lightweight, zero-dependency Julia library dedicated to reading and writing the standard file formats used by Wannier90 and the broader Wannier ecosystem. It serves as the fundamental I/O layer for high-level Julia packages like Wannier.jl and DFTK.jl, enabling seamless data exchange between Fortran-based legacy codes and modern Julia-based electronic structure tools.
Scientific domain: Electronic Structure, File I/O, Interoperability
Target user community: Developers of Julia packages for materials science and users connecting Julia tools with Wannier90
Theoretical Methods
- Format Parsing: Implements parsers for both formatted (ASCII) and unformatted (binary) Fortran outputs used by Wannier90.
- Data Structures: Defines efficient Julia
structs to represent Wannier Hamiltonians, eigenvalues, and overlap matrices.
Capabilities
- Read/Write Operations:
- Hamiltonians:
_hr.dat (r-space tight-binding models).
- Overlaps:
_mmn.dat (overlap matrices $M_{mn}$).
- Projections:
_amn.dat (projection matrices $A_{mn}$).
- Eigenvalues:
_eig.dat.
- Checkpoints:
_chk.dat (Wannier90 restart files).
- Unit Cells:
_win.dat (Wannier90 input) parsing.
- Band Structures:
_band.dat, _geninterp.dat.
- Binary Support: Handles Fortran binary streams directly, which is crucial for large files where ASCII I/O is slow.
Key Strengths
- Performance: Leveraging Julia's efficient I/O and string handling, often outperforming naive Python parsers.
- Zero Dependencies: Easier to install and maintain within other packages; does not depend on heavy external libraries.
- Correctness: Rigorously tested against standard Wannier90 outputs to ensure bit-wise compatibility.
Inputs & Outputs
- Inputs: Standard Wannier90 file formats (
.win, .mmn, .amn, etc.).
- Outputs: Julia data structures (Arrays, NamedTuples) ready for computation, or files written back to disk in Wannier90 format.
Interfaces & Ecosystem
- Upstream: Reads files generated by Wannier90, Quantum ESPRESSO, VASP, Abinit, etc.
- Downstream Integration:
- Wannier.jl: Uses WannierIO.jl for all file operations.
- DFTK.jl: Available for exporting DFT data to Wannier formats.
Performance Characteristics
- Speed: Optimized for rapid loading of large tight-binding models (GB-sized
hr.dat files).
- Memory: Efficient memory layout mapping directly to Julia arrays.
Limitations & Known Constraints
- Scope: Strictly an I/O library; does not perform Wannierization or physics calculations (use
Wannier.jl for that).
- Formats: Limited to documented Wannier90 formats; ad-hoc formats from less common codes may need custom parsers.
Comparison with Other Codes
- vs. Python (w90io): Faster execution and type-stable return values compared to dynamic Python parsing.
- vs. Fortran I/O: Provides the same capabilities but with the ease of use of a high-level language.
Application Areas
- Workflow Automation: Scripts that process hundreds of Wannier90 runs suitable for high-throughput databases.
- Tool Development: Building block for new post-processing tools in Julia.
Community and Support
- Development: Part of the Qilauea organization (JuliaMolSim).
- Source: Hosted on GitHub.
Verification & Sources