COOLJAPAN
← All posts

Spintronics 0.3.2 Released — Altermagnets, Quantum Spin Liquids, and Gauge-Invariant Topology

Spintronics 0.3.2 adds a k·p altermagnet band model with GMR-like spin valves, d-orbital orbitronics, a resonating-valence-bond spin-liquid solver, streaming simulation with binary OVF I/O, and fixes to Hermitian eigenvectors and the Kane-Mele Z2 invariant. 2059 tests, 118 doc tests, 0 warnings.

release spintronics scirs2 physics-simulation altermagnetism orbitronics quantum-spin-liquid topological-materials pure-rust magnonics

For a century, magnetism came in two flavors — ferromagnetic or antiferromagnetic. Altermagnets are a third, and Spintronics 0.3.2 gives them a real band model, a spin valve, and a quantum spin-liquid solver to keep them company.

Today we released Spintronics 0.3.2 — the largest physics expansion since the 0.3.0 debut. It adds a momentum-resolved altermagnet band model and spin valve, d-orbital orbitronics, a resonating-valence-bond (RVB) quantum-spin-liquid solver with a chirality-to-transport pipeline, hopfion stability analysis, strain-driven LLG dynamics, a streaming simulation API with binary OVF I/O, and a much larger Python test surface — alongside two correctness fixes that change real numerical output for anyone using Hermitian eigenvectors or the Kane-Mele Z2 invariant.

No Python loops. No C++ memory bugs. No Fortran. No external binaries or unsafe code in hot paths. Just clean, memory-safe, physically accurate simulations that compile to a single static binary (or WASM) and run everywhere.

This is not a debut and not a rewrite. 0.3.1 sharpened the demagnetizing-field hot loop and closed a topological API gap; 0.3.2 opens four new physics domains on top of the same SimulationBuilder, LLG/LLB, and prelude surface that shipped in 0.3.0 — and fixes two subtle bugs in the topological-materials math that every consumer of eigenvectors or Z2 invariants inherits automatically.

Why Spintronics 0.3.2 is a game changer

OOMMF, mumax³, and hand-rolled Python/Mathematica scripts remain the default tools for this kind of condensed-matter physics, and each carries a different tax:

Spintronics 0.3.2 addresses all four directly:

Technical Deep Dive

  1. Altermagnetism and orbital physics (altermagnet/, orbitronics/). AltermagnetBandModel is a two-sublattice k·p Bloch Hamiltonian parameterized by kinetic hopping, hybridization, Néel exchange splitting, an altermagnetic t_am term, and an optional spin-orbit coupling lambda_soc; crystal_hall_conductivity() and spin_hall_conductivity() integrate Berry curvature over the Fermi sea. AltermagnetSpinValve reuses that model to compute GMR-like magnetoresistance from the relative crystal-axis angle between two altermagnetic layers. Alongside it, orbitronics::crystal_field builds real-cubic-harmonic d-orbital angular-momentum operators and octahedral/tetrahedral/tetragonal crystal-field Hamiltonians, and orbitronics::d_orbital_moment’s CrystalFieldModel derives Hund’s-rule ground states and effective moments for 12 preset 3d ions spanning Ti³⁺ to Cu²⁺.

  2. Frustration and topology (frustrated/rvb, frustrated/transport, topomagnon/). The new rvb module enumerates the dimer-covering (valence-bond) basis, computes Sutherland loop-counting overlaps, and solves a Löwdin-canonically-orthogonalized generalized eigenproblem for the variational RVB ground state, cross-checked against dense exact diagonalization and a matrix-free Lanczos solver in the S_z=0 sector for up to 16 sites (53 tests). frustrated::transport turns per-plaquette scalar spin chirality into an emergent magnetic field and a topological Hall response for triangular, kagome, and pyrochlore lattices. This is also where the release’s two topology fixes live: CMatrix::hermitian_eigendecomposition moved from a Householder-tridiagonalization scheme with a subtle phase/sign bug to a cyclic Jacobi algorithm verified to machine precision up to n=16, and KaneMeleModel’s Z2 invariant and Rashba block were corrected for gauge invariance and time-reversal symmetry respectively.

  3. Textures and mechanics (texture/, magnon/, mech/). hopfion_stability_modes diagonalizes the Hessian of the total energy functional around a relaxed hopfion to extract collective-coordinate eigenmodes, with Hopfion::with_profile_and_offset() providing a rigidly-translated ansatz to probe the translation zero-modes directly. magnon::SdwRelaxationDynamics relaxes a spin-density-wave order parameter toward SdwGapSolver’s self-consistent gap via time-dependent Ginzburg-Landau (Model A) dynamics. mech::strain_driven_dynamics couples oscillating surface-acoustic-wave or AC-piezoelectric strain into a magnetoelastic effective field, driven through the existing Dormand-Prince adaptive integrator.

  4. Simulation infrastructure, materials, and I/O (builder/, material/disorder.rs, io/ovf.rs, python/). Simulation::run_streaming() executes the identical integration loop as run() — same solver dispatch, same finite-value checks, same renormalization — but reports state through a caller-supplied callback instead of collecting a trajectory. material::disorder::GradedInterface models Linear/Exponential/ErrorFunction grading laws for spatially-varying Ms/A/K across a compositionally graded interface. On the Python side, LlbMaterial, LlbSolver, OnsagerMatrix, SpinCaloritronicsMaterial, and the batch RK4 helpers are now fully typed in __init__.pyi and covered by a new 168-test pytest suite.

Getting Started

cargo add spintronics

spintronics defaults to ["fem", "scirs2", "serde"]. Here’s the new altermagnet band model on the MnTe preset — a real, zero-net-moment collinear altermagnet whose two spin sublattices still see different effective masses away from the nodal directions:

use spintronics::altermagnet::AltermagnetBandModel;
use spintronics::error::Result;

fn main() -> Result<()> {
    let model = AltermagnetBandModel::mnte();
    let k_mag = 0.4 / model.a_lattice;

    // Spin-resolved bands at a point away from the nodal directions.
    let (up, down) = model.spin_bands(k_mag, 0.0);
    let splitting = model.spin_splitting_at(k_mag, 0.0);
    println!("spin splitting at |k|a = 0.4: {splitting:+.4} eV");
    println!("  up   bands: [{:+.4}, {:+.4}]", up.lower, up.upper);
    println!("  down bands: [{:+.4}, {:+.4}]", down.lower, down.upper);

    // Compensated altermagnet: net spin polarization integrates to ~zero,
    // and the crystal Hall response vanishes without spin-orbit coupling.
    let k_max = 0.8 / model.a_lattice;
    let polarization = model.net_spin_polarization(41, k_max)?;
    let hall = model.crystal_hall_conductivity(41, k_max)?;
    println!("net spin polarization: {polarization:+.3e} (compensated)");
    println!("crystal Hall (no SOC): {hall:+.3e} (vanishes without SOC)");

    Ok(())
}

For long runs, swap in the streaming API instead of run():

use spintronics::prelude::*;

let mut sim = SimulationBuilder::new()
    .material(Ferromagnet::yig())
    .external_field(Vector3::new(0.0, 0.0, 0.1))
    .solver_rk4()
    .initial_magnetization(Vector3::new(1.0, 0.0, 0.0))
    .time_step(1.0e-13)
    .num_steps(500_000)
    .build()?;

sim.run_streaming(|step, m, energy| {
    if step % 100_000 == 0 {
        println!("step {step}: m = {m:?}, E = {energy:.6e} J/m^3");
    }
    Ok(())
})?;

What’s New in 0.3.2

Tips

This is the foundation

Spintronics remains the spintronics and magnonics backend for the COOLJAPAN scientific stack, and 0.3.2 is squarely a physics-simulation release built on top of it:

0.3.2 doesn’t touch that foundation — it adds four new physics domains and two topological correctness fixes on top of it, while keeping the SimulationBuilder/prelude surface wire-compatible.

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

Star the repo if you want condensed-matter physics — altermagnets, quantum spin liquids, topological invariants — that’s tested and gauge-invariant, without a single line of Python glue holding it together.

The era of a fresh one-off Python script for every new phase of matter is over. Pure Rust spintronics simulation is here — three physics domains richer, and two topological invariants more trustworthy.

KitaSan at COOLJAPAN OÜ July 7, 2026

↑ Back to all posts