Library for Crystal Symmetry in Rust
A fast and robust crystal symmetry finder, written in Rust.
Interfaces
Each interface has its own README with installation, usage, and development instructions:
- Rust (
moyo): core implementation
- Python (
moyopy): Python binding
- C (
moyoc): C binding, built and consumed with CMake
- Fortran: Fortran interface on top of
moyo::moyof CMake target)
- JavaScript (
moyo-wasm): JavaScript and WebAssembly
- Web viewer: browse the 230 space groups, 80 layer
moyo-wasm)
A landing hub linking all interfaces is served at the site root, apps/landing).
The functionality categories below mirror the sections of the moyopy API reference.
Legend: β supported Β· π‘ partial Β· β not exposed Β· β not applicable.
| Category | Functionality | Rust (moyo) | Python (moyopy) | C (moyoc) | Fortran | JS/WASM (moyo-wasm) | | -------------------- | -------------------- | ------------- | ----------------- | ----------- | ------- | --------------------- | | Shared | Core types | β
| β
| π‘ | π‘ | π‘ | | Space group | Dataset from cell | β
| β
| β
| β
| β
| | Space group | Data access | β
| β
| π‘ | π‘ | π‘ | | Space group | Group identification | β
| β
| π‘ | π‘ | β | | Layer group | Dataset from cell | β
| β
| β
| β
| β | | Layer group | Data access | β
| β
| π‘ | π‘ | π‘ | | Layer group | Group identification | β
| β
| β
| β
| β | | Magnetic space group | Dataset from cell | β
| β
| β
| β
| β | | Magnetic space group | Data access | β
| β
| β
| β
| π‘ | | Magnetic space group | Group identification | β
| β
| β
| β
| β |
Notes:
- Core types are
Cell,Operations, andUnimodularTransformation. C
Cell, magnetic cells, Operations, and MagneticOperations;
WASM exposes only Cell and (implicitly) Operations via the dataset
output. UnimodularTransformation is not bound in either.
- "Dataset from cell" is the main symmetry-analysis entry point
MoyoDataset, MoyoLayerDataset, MoyoCollinearMagneticDataset,
MoyoNonCollinearMagneticDataset).
- "Data access" covers classification tables and lookup helpers (e.g.
Setting, Centering, HallSymbolEntry, SpaceGroupType,
ArithmeticCrystalClass, operationsfromnumber, LayerSetting,
LayerCentering, LayerHallSymbolEntry, LayerGroupType,
LayerArithmeticCrystalClass, operationsfromlayer_number,
MagneticSpaceGroupType, magneticoperationsfromuninumber).
- C's "Data access" is π‘ because the standalone
Centering,
ArithmeticCrystalClass, and WyckoffPosition classes are not bound
(their content is reachable as strings through the entry and group-type
lookups); the settings, Hall symbol entries, group types, and
operationsfrom* generators are all exposed.
- "Group identification" recovers a group label from a primitive list of
PointGroup + SpaceGroup + integral_normalizer,
LayerGroup, MagneticSpaceGroup). C's space-group row is π‘ because
integral_normalizer is not bound; PointGroup, SpaceGroup,
LayerGroup, and MagneticSpaceGroup are all exposed.
- The Fortran interface wraps the complete moyoc API, so its column matches
How to cite moyo and its interfaces
If you use moyo or its interfaces in your work, please cite the following figshare entry.
@misc{moyo,
author = {Kohei Shinohara},
title = {{moyo: A fast and robust crystal symmetry finder, written in Rust}},
year = {2026},
month = {1},
doi = {10.6084/m9.figshare.31081162.v1},
url = {https://figshare.com/articles/software/moyoAfastandrobustcrystalsymmetryfinderwritteninRust_/31081162},
note = {Source code available at \url{https://github.com/spglib/moyo}}
}
This citation may be superseded by a peer-reviewed publication in the future.
Dev
cargo install cargo-release cargo-edit cargo-deny cargo-semver-checks
How to release
Prerequisites: cargo install cargo-release cargo-edit cargo-deny cargo-semver-checks
cargo semver-checksto lint a new releasecargo set-version --bump patchfor patch version increment- Write change log and create a pull request
- After merging the pull request, run
cargo release --execute(If you already release the package in crates.io, runcargo release --execute --no-publish)
Debugging
RUST_LOG=debug cargo test -- --nocapture
Acknowledgments
We thank Dr. Yusuke Seto for providing the crystallographic database. We thank Dr. Juan RodrΓguez-Carvajal for providing the magnetic space-group database.