Spintronics research has lived in slow Python notebooks and fragile C++/Fortran lab codes for too long. Today that changes.
On December 1 we released Spintronics 0.1.0, the first public release of a pure Rust library for simulating spin dynamics, spin-current generation, and spin-charge conversion phenomena in magnetic and topological materials. It is inspired by the pioneering work of Prof. Eiji Saitoh’s group (University of Tokyo / RIKEN CEMS).
No Python loops. No C++ memory bugs. No Fortran.
No external binaries, no -sys wrappers around a lab’s aging codebase.
Just clean, memory-safe, physically grounded simulations that compile to a single static binary — or to WebAssembly, so the same model runs in a browser.
This is a debut, not a finished cathedral. But it is a real, working foundation, and it already covers a lot of ground.
Why pure-Rust spintronics
If you have done spin-transport or micromagnetic work, you know the two usual paths, and you know they hurt.
The first is Python and NumPy. It is wonderful for sketching an idea and miserable the moment you need a long LLG integration or a lattice sweep. The interpreter loop dominates, vectorization only goes so far, and a single-spin precession study that should be instant turns into a coffee break.
The second is the established micromagnetic and lab codes — OOMMF, mumax3, and the pile of hand-rolled C++/Fortran that every group seems to inherit. They are fast and battle-tested, but they are also rigid, hard to extend, easy to segfault, and almost impossible to drop into a web demo or a notebook without a fight. Reproducing someone else’s run often means reproducing their entire build environment first.
Spintronics 0.1.0 takes a third path. Rust’s ownership model means spin and angular momentum cannot silently “disappear”; data races and segfaults are gone by construction; and the same crate compiles natively for a cluster or to WASM for an interactive page. The README reports preliminary benchmarks against Python + NumPy on an Intel Core i7 — roughly 52× on an LLG solve, 100× on a skyrmion-number calculation, and 59× on spin-chain evolution. Treat those as early numbers, not a marketing promise; a proper benchmark suite is still in development. The point of 0.1.0 is not a leaderboard. It is that the slow path and the fragile path are no longer your only two options.
Technical Deep Dive: the 0.1.0 layout
The crate is organized as physics-focused modules, so the code maps fairly directly onto the Hamiltonians and transport equations you already think in.
-
Core primitives —
constants(ℏ, γ, e, μ_B, k_B),vector3for spin/magnetization vector math, andmaterialfor ferromagnets (YIG, Py, Fe, Co, Ni, CoFeB), interfaces, and spin-mixing conductance. -
Dynamics and transport —
dynamics(the Landau–Lifshitz–Gilbert solver),transport(spin pumping after Saitoh 2006, and spin diffusion), andeffect(Inverse Spin Hall Effect and Spin Seebeck Effect). Additional effects in this release include spin-orbit torque, DMI, the Edelstein effect, the spin Nernst effect, the topological Hall effect, and Rashba splitting. -
Textures, magnons, and more —
magnon(spin waves, spin chains, magnon detection),texture(skyrmions, domain walls, topological-charge calculation),thermo(anomalous Nernst, thermal magnons), plusmech(Barnett and Einstein–de Haas coupling),fluid(spin-vorticity coupling),afm(THz antiferromagnetic dynamics),stochastic(finite-temperature Langevin dynamics),ai(magnon-based reservoir computing), andcavity(magnon–photon hybrids). -
Solvers, FEM, and I/O — multiple LLG integrators (RK4, adaptive time-stepping, Heun’s method for the stochastic case, implicit methods for stiff problems), an optional finite-element micromagnetics path (Delaunay meshing, sparse assembly, CG/BiCGSTAB/SOR/Jacobi iterative solvers with Jacobi/SSOR preconditioners), and export to VTK, CSV, JSON, plus OOMMF OVF import/export so you can interoperate with existing tooling.
Spintronics 0.1.0 is built on the early SciRS2 core (release candidate) — it optionally depends on scirs2-core 0.1.0-rc.2 for random number generation and parallel utilities. That dependency is feature-gated, so a basic simulation (and every WASM build) can run without it.
Getting Started
Add the crate:
cargo add spintronics
A minimal YIG/Pt spin-pumping example — generate a spin current from precessing magnetization, then convert it to an electric field via the inverse spin Hall effect in platinum:
use spintronics::prelude::*;
fn main() {
// YIG/Pt system
let yig = Ferromagnet::yig();
let interface = SpinInterface::yig_pt();
let pt_strip = InverseSpinHall::platinum();
// Initial magnetization along x, external field along z
let mut m = Vector3::new(1.0, 0.0, 0.0);
let h_eff = Vector3::new(0.0, 0.0, 1.0) * 0.1; // 0.1 T
let dt = 1.0e-13; // 0.1 ps
for _ in 0..1000 {
// Landau–Lifshitz–Gilbert dynamics
let dm_dt = calc_dm_dt(m, h_eff, GAMMA, yig.alpha);
m = (m + dm_dt * dt).normalize();
// Spin pumping → spin current → ISHE electric field
let js = spin_pumping_current(&interface, m, dm_dt);
let e_field = pt_strip.convert(interface.normal, js);
println!("m = ({:.3}, {:.3}, {:.3}) E = {:?}", m.x, m.y, m.z, e_field);
}
}
This reproduces the setup of the landmark Saitoh et al. (2006) experiment. The same crate compiles to WebAssembly, so a single-spin LLG simulator, a spin-chain magnon demo, and a spin Hall calculator can all run live in a browser.
What’s inside
- Core effects — spin-orbit torque (field-like and damping-like), Dzyaloshinskii–Moriya interaction (interface and bulk), the Edelstein effect, the spin Nernst effect, the topological Hall effect, and the Rashba effect.
- Solvers — RK4, adaptive time-stepping, Heun’s method for stochastic LLG, implicit methods for stiff equations, a SIMD-optimized spin-chain solver, and a parallel multi-domain solver.
- Materials — topological insulators (Bi₂Se₃, Bi₂Te₃, Bi₂Te₄), Weyl semimetals, 2D magnets (CrI₃, Fe₃GeTe₂, MnBi₂Te₄), synthetic antiferromagnets and multilayers, chiral magnets (MnSi, FeGe), and temperature-dependent parameters for YIG, Py, Fe, Co, Ni, CoFeB and common antiferromagnets (NiO, MnF₂, …).
- Finite-element micromagnetics — Delaunay 2D/3D meshing, linear triangular and tetrahedral elements, sparse stiffness/mass assembly (with parallel assembly), CG/BiCGSTAB/SOR/Jacobi solvers, Jacobi/SSOR preconditioners, and exchange/anisotropy/demagnetization/Zeeman energy terms.
- I/O and WASM — VTK, CSV, and JSON export, OOMMF OVF import/export, and wasm-bindgen bindings with an interactive web demo.
- Validation — examples reproduce published results (Saitoh 2006 and others), backed by physics-correctness tests and doc tests with LaTeX equations and runnable snippets.
Tips
- Default features include
femandscirs2. They pull inscirs2-spatial(for finite-element meshing) andscirs2-core(for RNG and parallelism). If you only need analytic dynamics and want the leanest build, disable them withdefault-features = false. - Building for the browser? Use the
wasmfeature instead:cargo build --features wasm --target wasm32-unknown-unknown(orwasm-pack build --features wasm --target web). The WASM path does not requirescirs2-core. - Pick the integrator for the problem. Use RK4 or adaptive time-stepping for deterministic LLG, switch to Heun’s method when you add thermal (stochastic) fields, and reach for the implicit solvers when the dynamics get stiff.
- Reaching for FEM? The micromagnetic FEM path benefits from a preconditioner — Jacobi or SSOR on top of CG/BiCGSTAB converges much faster than the bare iterative solver on realistic meshes.
- Reproducibility is built in. Seed the RNG so stochastic runs are deterministic, and lean on Rust’s types to keep unphysical states from compiling in the first place.
- Interoperate, don’t rewrite. OOMMF OVF import/export lets you bring states in from existing tools and push results back out, so Spintronics can slot into a workflow rather than replace it wholesale.
This is the foundation
Spintronics 0.1.0 is the very first release — early, but already a solid base to build on. It deliberately does one thing: make pure-Rust spin-dynamics simulation real, fast enough to be useful, and safe by construction. Everything else grows from here.
Repository: https://github.com/cool-japan/spintronics
Star the repo if you are tired of slow Python scripts or fragile C++ codes for spintronics research.
Pure Rust spintronics is here — early, but fast, safe, and sovereign.
— KitaSan at COOLJAPAN OÜ December 1, 2025