COOLJAPAN
← All posts

Spintronics 0.2.0 Released — Python Bindings, HDF5 Export, and a Memory Pool for Pure Rust Spin Dynamics

The second release of the pure Rust spintronics library: PyO3 Python bindings, serde + HDF5 export, a memory pool allocator that cuts hot-path allocations by 99%, an HTMX/Axum web demo, runtime unit validation, and 17 worked examples. Simulate LLG dynamics, spin pumping, ISHE/SSE, skyrmions and more — fast, safe, and sovereign.

release spintronics physics-simulation spin-dynamics skyrmion pure-rust llg magnonics pyo3

Spin physics, without the slow Python loops or the segfaulting C++.

On December 24 we released Spintronics 0.2.0 — the second release of our pure Rust library for simulating spin dynamics, spin-current generation, and spin-charge conversion in magnetic and topological materials.

No Python loops. No C++ memory bugs. No Fortran.
No micromagnetics binary to install, no OOMMF or mumax build to babysit, no LAPACK linker errors.
Just clean, memory-safe, physically grounded simulations that compile to a single static binary (or WASM) and run everywhere.

The library is inspired by the pioneering work of Prof. Eiji Saitoh’s group (University of Tokyo / RIKEN CEMS), and 0.2.0 is where it grows from a solid first release into something you can actually wire into your own tools and notebooks.

Why 0.2.0 matters

Spintronics research has long meant a choice between two kinds of pain: slow Python/NumPy scripts that take seconds per LLG run, or fragile C++/Fortran micromagnetics codebases (OOMMF, mumax, custom lab code) that segfault, lose angular momentum to silent unit bugs, and resist reproducibility.

Spintronics 0.1.0 already gave you LLG solvers, spin pumping, ISHE/SSE, skyrmions and a physics-aligned module layout in safe Rust. 0.2.0 is about making that core usable from the outside and cheaper to run in a loop:

This is still an early, foundation-building release — but it is a solid one: 448 tests pass (431 library = 381 unit + 50 doc, plus 17 in the demo), with zero warnings.

Technical Deep Dive: the v0.2.0 module layout

The architecture maps directly onto the physics — 18 modules across 60+ source files:

  1. Core physics
    constants (20+ NIST-validated values: ℏ, γ, e, μ_B, k_B …), vector3 (3D spin/magnetization math, now with zero(), unit_x/y/z(), magnitude_squared(), angle_between(), project()), and the new units module with 14 runtime validators.

  2. Materials (material)
    Ferromagnets (YIG, Permalloy, Fe, Co, Ni, CoFeB), spin interfaces (YIG/Pt, plus new Pt/Ta/W combinations), 2D magnets (CrI₃, Fe₃GeTe₂, MnBi₂Te₄), topological insulators (Bi₂Se₃, Bi₂Te₃) and Weyl semimetals — behind a clean MagneticMaterial / SpinChargeConverter / TopologicalMaterial trait hierarchy.

  3. Dynamics & transport (dynamics, transport, effect)
    LLG solvers (RK4, Heun, adaptive), spin pumping, diffusion, and spin-charge conversion: ISHE, SSE, SOT, Rashba-Edelstein, spin Nernst, topological Hall.

  4. Advanced phenomena & I/O (magnon, thermo, texture, afm, mech, cavity, ai, memory, visualization, python)
    Magnon propagation and spin chains, thermoelectric effects, skyrmions / domain walls / topological charge, THz antiferromagnetics, nanomechanical coupling, cavity magnonics, magnon reservoir computing — plus the new memory (pool allocators, Rk4Workspace / HeunWorkspace), visualization (HDF5/JSON/CSV/VTK) and python modules.

Under the hood, Spintronics 0.2.0 builds on the early SciRS2 core (release candidate, scirs2-core 0.1.0-rc.4) for RNG and parallelism, behind the optional scirs2 feature — kept optional precisely so WASM builds stay lean.

Getting Started

cargo add spintronics

A minimal YIG/Pt spin-pumping + ISHE simulation, reproducing the setup of Saitoh et al. (2006):

use spintronics::prelude::*;

fn main() {
    // Materials: YIG film, YIG/Pt interface, Pt detector strip
    let yig = Ferromagnet::yig();
    let interface = SpinInterface::yig_pt();
    let pt_strip = InverseSpinHall::platinum();

    // Initial magnetization along x, external field along z (FMR condition)
    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 along z

    let dt = 1.0e-13;        // 0.1 ps
    let steps = 10_000;      // 1 ns total

    for _ in 0..steps {
        // Landau-Lifshitz-Gilbert dynamics
        let dm_dt = calc_dm_dt(m, h_eff, GAMMA, yig.alpha);
        m = (m + dm_dt * dt).normalize();

        // Spin current pumped across the interface...
        let js = spin_pumping_current(&interface, m, dm_dt);
        // ...converted to an electric field in Pt via the inverse spin Hall effect
        let _e_field = pt_strip.convert(interface.normal, js);
    }

    println!("final magnetization: {m}");
}

What’s New in 0.2.0

Tips

This is the foundation

Spintronics is young — 0.1.0 debuted only weeks ago — and so is the wider COOLJAPAN ecosystem around it. For now it leans on just the early SciRS2 core (release candidate) for RNG and parallelism, and otherwise stands on its own: pure Rust, minimal dependencies, no native binaries. The goal of 0.2.0 is simply to make that core reachable — from Python, from the browser, and from your data pipeline — so the physics can grow on a solid base.

Repository: https://github.com/cool-japan/spintronics

Star the repo if you’re tired of slow Python scripts or fragile C++ code for spintronics research.

Pure Rust spin dynamics is here — early, but already fast, safe, and sovereign.

KitaSan at COOLJAPAN OÜ December 24, 2025

↑ Back to all posts