Espira, Optimal Control of Magnetization Switching in Two-Dimensional Magnets
Given a magnetic bit in a two-dimensional van der Waals magnet and a target switching time, compute the field or current pulse that flips it for the least dissipated energy. Espira reproduces the kickoff paper (Badarneh, Cai and Santos, Adv. Mater. 2026, doi 10.1002/adma.202523059) as a verification floor and extends it: analytic optimal paths for uniaxial and spin-orbit-torque switching, a numerical optimal-control problem for the biaxial case, conventional baselines, GRAPE and CRAB, a reliability front, and the beyond-macrospin question answered on a free chain, where domain walls become the optimal reversal above a crossover length. Two independent codes agree with the engine: Spirit on the barrier to 1.4e-06 over six lattices, VAMPIRE on the equation of motion to 4.7e-06, both crossing the equator at 78.7319 ps. 25 of 26 cases baked; two run live in the browser. The engine is the separately published spinoct package.
Business Context
Energy per written bit is the number that decides whether a magnetic memory technology competes, and the gap between a reliable pulse and the cheapest pulse is where the engineering margin lives. Espira quantifies that gap per material and per drive mechanism, and it does so with the caveats a device engineer needs: the switching cost is in tesla-squared-seconds, not joules, and a circuit model has to convert it; the energy floor is linear in the damping, so energies are reported as bands rather than points; FePS3 is a declared negative control; and the reliability preprint corrects its own earlier reading of its table, the added cost of a reliable switch being 2.5 to 15.8 times the bare cost, with the field paying only below a stability factor of about ten.
Strategic Value
Espira is the research-lab pattern at its most complete: a kickoff paper reproduced as a floor, questions answered from persisted dossiers, an engine that lives in its own published package because the optimal-control solver over LLG dynamics is domain-agnostic and no such package existed, and results that answer to two codes the author does not own. Fourteen browser gates run in CI against the built site and again against the production domain after every release, the breadth gate alone 4,381 checks on 0.18.001 with zero console errors, and the record keeps the two production-only defects that gating found after a deploy rather than before: a trailing-slash 404 (only the .html of each route had been written, so a trailing slash served the fallback while the app still mounted) and a readout that showed one case number under another case name while the next artifact loaded. Release 0.16.000 made the Spanish site Spanish: accents restored, mistranslations fixed, every rendered data string translated in a map held to the artifacts, and a gate that fails on English fallbacks and unaccented Spanish. Releases 0.17.000 to 0.18.001 put the six pages in the standard's order and depth, App first at the root, Methodology in six transcribed method families.
The Challenge
Writing a bit in a magnetic memory costs energy, and most of it is wasted: a pulse that is strong enough to flip the magnetization reliably is far larger than the pulse that would flip it for the least dissipation over the same time. Optimal control over the Landau-Lifshitz-Gilbert dynamics answers what the cheapest pulse is, but the answer depends on the material (anisotropy, moment, damping), on whether the bit is driven by a field or by a spin-orbit torque, and on whether the bit behaves as one macrospin at all. Nothing in the public tooling computes those pulses for the two-dimensional van der Waals magnets that are the current candidates, and no public experimental switching dataset exists to calibrate against, so a product has to build its own floor: reproduce a published result exactly, state the units it can and cannot convert, and cross-check against codes it does not own.
Our Approach
The engine is spinoct, a separately published package from its own repository (numpy and scipy core, Pyodide-safe, a torch extra for a batched lane measured against the CPU reference): analytic optimal-control paths for uniaxial and spin-orbit-torque switching, the numerical image-based optimal-control problem for the biaxial case, conventional baselines, GRAPE and CRAB, the free-chain optimal control path, a minimum-energy-path barrier floor and an exact peak-amplitude function. Espira is the product on the CAOS archetype: a material parameter database where every value carries a DOI, a case matrix, the nine named stages, both data contracts, a measured lane gate, manifests with hashes, a model registry and a validate gate. Every declared rung runs in the inference stage, each case declares the observable it reports, and two cases are recomputed live in the browser and compared with their artifacts: C03, spin-orbit torque, and C10, the kickoff replication. The research questions were answered from six dossiers written from primary sources: the reliability front (how much a reliable switch costs over the bare optimum) and the beyond-macrospin question, where a free chain shows domain walls as the optimal reversal above a crossover length at long switching times. Two Zenodo preprints, CC-BY, carry those results, and tests pin each published table to its artifact.
Key Performance Indicators
| KPI | Baseline | Result | Impact |
|---|---|---|---|
| A published result reproduced as the floor | A solver with no external reference | The kickoff paper (Adv. Mater. 2026, doi 10.1002/adma.202523059) is replicated as case C10 and recomputed live in the browser against its artifact | Every extension starts from a number someone else published |
| Two codes the author does not own agree | Self-consistency only | Spirit on the barrier: 1.4e-06 over six lattices, chains and patches; VAMPIRE on the equation of motion: 4.7e-06, both trajectories crossing the equator at 78.7319 ps | The engine is checked, not trusted |
| The cost of reliability, stated with its correction | The bare optimum | A reliable switch costs 2.5 to 15.8 times the bare cost; the field pays only below a stability factor of about ten; the preprint corrected its own earlier reading of the table (F-016) | A device engineer gets the margin, with its caveats |
Architecture
espira pipeline
Technology Stack
Application Screenshots

