spintronics
Python bindings for the spintronics Rust library — a pure-Rust, high-performance library for simulating spin dynamics, spin current generation, and conversion phenomena in magnetic and topological materials.
Installation
pip install spintronics
Quick Start
import spintronics
# Create a ferromagnetic material (YIG preset)
yig = spintronics.Ferromagnet.yig()
print(f"YIG saturation magnetization: {yig.ms:.2e} A/m")
print(f"YIG Gilbert damping: {yig.alpha}")
# 3D vector operations
v1 = spintronics.Vector3(1.0, 0.0, 0.0)
v2 = spintronics.Vector3(0.0, 1.0, 0.0)
cross = v1.cross(v2)
print(f"Cross product: {cross}")
# LLG magnetization dynamics
sim = spintronics.LlgSimulator(yig)
sim.set_magnetization(1.0, 0.0, 0.0)
sim.set_external_field(0.0, 0.0, 0.1) # 100 mT along z
trajectory = sim.evolve(1e-9, 1000)
print(f"Final state: t={trajectory[-1][0]:.2e} s, m=({trajectory[-1][1]:.4f}, {trajectory[-1][2]:.4f}, {trajectory[-1][3]:.4f})")
# Spin pumping + ISHE detection
sp = spintronics.SpinPumpingSimulation()
sp.set_fmr_conditions(9.65e9, 0.1)
result = sp.run(1e-9, 1000)
print(f"Peak ISHE voltage: {result['peak_voltage']:.4e} V")
# Physical constants
print(f"HBAR = {spintronics.HBAR:.4e} J·s")
print(f"GAMMA = {spintronics.GAMMA:.4e} rad/(s·T)")
print(f"KB = {spintronics.KB:.4e} J/K")
Available Classes
| Class | Description |
|---|---|
Vector3 |
3D vector with cross/dot product, normalization, arithmetic |
Ferromagnet |
Material parameters (damping, Ms, anisotropy); presets: YIG, Permalloy, CoFe, CoFeB, Fe, Co, Ni |
SpinInterface |
FM/NM interface (spin mixing conductance); presets: YIG/Pt, Py/Pt |
InverseSpinHall |
ISHE spin-to-charge conversion; presets: Pt, Ta, W |
LlgSimulator |
LLG equation integrator (RK4/Euler); trajectory output |
SpinPumpingSimulation |
Complete FMR → spin current → ISHE voltage workflow |
Physical Constants
| Constant | Description |
|---|---|
HBAR |
Reduced Planck constant (J·s) |
GAMMA |
Electron gyromagnetic ratio (rad/(s·T)) |
E_CHARGE |
Elementary charge (C) |
MU_B |
Bohr magneton (J/T) |
KB |
Boltzmann constant (J/K) |
Building from Source
Requires Rust and maturin.
git clone https://github.com/cool-japan/spintronics
cd spintronics/py
pip install maturin
maturin develop --release
License
Apache-2.0
Copyright (c) 2025 COOLJAPAN OÜ (Team KitaSan)
Metadata
Release files for spintronics 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spintronics-0.5.0.tar.gz | 1.1 MB | With provenance | Details for spintronics-0.5.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| spintronics-0.5.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details for spintronics-0.5.0-cp38-abi3-win_amd64.whl |
| spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details for spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details for spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details for spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl |
| spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details for spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl |
Total release size: 3.8 MB
Release files / spintronics-0.5.0.tar.gz
| Download URL | spintronics-0.5.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f45e287790aa99e8402bea1d1ccdc006393c1bf70eac3b08862240279cd7e3c
|
|
BLAKE2b-256 checksum How to use checksums |
476d27a0354976b657382cab5b443059cd5769239b1b71f56d2d3a41d4a0aa0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / spintronics-0.5.0-cp38-abi3-win_amd64.whl
| Download URL | spintronics-0.5.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 402.0 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c34bba6c5956d3c28a23ed80c0791a35eebf02c309066cd07852a762edb7f95c
|
|
BLAKE2b-256 checksum How to use checksums |
89fc8c0ef160bf605e54c0894cc010d0af188c2c003129e61c9ceb771ce27ca3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 724.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7900a7be4f5280ba922119d1803b0e0795e15d8d0bcadb0bfe876fc54e7070a7
|
|
BLAKE2b-256 checksum How to use checksums |
6fd1aebb9f78b30b1379b3fd514aeef36caeb072a7c7c7209321f5a36ddf01bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 527.4 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
337dcced7b569019bb5f28a08478c2b1a49171a5d5ed3268b106793286a345c2
|
|
BLAKE2b-256 checksum How to use checksums |
f68e7b9f559a57f43005f567acad7ae5cdf446e607e94c5147aa33f23daf8f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 489.5 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
77cf7e4206ed950e049cd6c4d4997d48a5e7ef85aca1b6e5cb742029bce8ff77
|
|
BLAKE2b-256 checksum How to use checksums |
715e0e26273a9619067f0865a344a3821c88302ab57e2dfa2c4a209fe8b809c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logRelease files / spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 538.8 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c010678b72dd50640f7af6829854768e719f39ba302abe5df73e657536946c4d
|
|
BLAKE2b-256 checksum How to use checksums |
9eef1d2df0aad14c7432b8022e3f4420a0ffe1587bca85475c7a3023e55a459f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logSecurity for spintronics 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for spintronics-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.