COOLJAPAN
← All posts

Spintronics 0.1.0 Released — Pure Rust Spin Dynamics, Spin Currents, and Topological Materials

The first release of Spintronics: a pure Rust library for simulating spin dynamics, spin-current generation, and spin-charge conversion (ISHE, SSE) in magnetic and topological materials. LLG solvers, magnons, skyrmions, FEM micromagnetics, and WASM — an alternative to slow Python/NumPy scripts and fragile C++/Fortran lab codes.

release spintronics physics-simulation spin-dynamics magnetism llg topological-materials pure-rust wasm

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.

  1. Core primitivesconstants (ℏ, γ, e, μ_B, k_B), vector3 for spin/magnetization vector math, and material for ferromagnets (YIG, Py, Fe, Co, Ni, CoFeB), interfaces, and spin-mixing conductance.

  2. Dynamics and transportdynamics (the Landau–Lifshitz–Gilbert solver), transport (spin pumping after Saitoh 2006, and spin diffusion), and effect (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.

  3. Textures, magnons, and moremagnon (spin waves, spin chains, magnon detection), texture (skyrmions, domain walls, topological-charge calculation), thermo (anomalous Nernst, thermal magnons), plus mech (Barnett and Einstein–de Haas coupling), fluid (spin-vorticity coupling), afm (THz antiferromagnetic dynamics), stochastic (finite-temperature Langevin dynamics), ai (magnon-based reservoir computing), and cavity (magnon–photon hybrids).

  4. 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

Tips

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

↑ Back to all posts