Skip to main content

High-performance spintronics simulation library

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spintronics-0.5.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spintronics-0.5.0-cp38-abi3-win_amd64.whl (402.0 kB view details)

Uploaded CPython 3.8+Windows x86-64

spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (724.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (527.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl (489.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl (538.8 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file spintronics-0.5.0.tar.gz.

File metadata

  • Download URL: spintronics-0.5.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spintronics-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8f45e287790aa99e8402bea1d1ccdc006393c1bf70eac3b08862240279cd7e3c
MD5 3dc7444575d29e91f0684c1153c9135f
BLAKE2b-256 476d27a0354976b657382cab5b443059cd5769239b1b71f56d2d3a41d4a0aa0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0.tar.gz:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spintronics-0.5.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: spintronics-0.5.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 402.0 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spintronics-0.5.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c34bba6c5956d3c28a23ed80c0791a35eebf02c309066cd07852a762edb7f95c
MD5 a54be63b309275aaaa3169b1aaf7308d
BLAKE2b-256 89fc8c0ef160bf605e54c0894cc010d0af188c2c003129e61c9ceb771ce27ca3

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0-cp38-abi3-win_amd64.whl:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7900a7be4f5280ba922119d1803b0e0795e15d8d0bcadb0bfe876fc54e7070a7
MD5 1bf17229de71a1c646aaf0d10742c3d3
BLAKE2b-256 6fd1aebb9f78b30b1379b3fd514aeef36caeb072a7c7c7209321f5a36ddf01bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 337dcced7b569019bb5f28a08478c2b1a49171a5d5ed3268b106793286a345c2
MD5 cee804e51488142b27e3def1e6654f04
BLAKE2b-256 f68e7b9f559a57f43005f567acad7ae5cdf446e607e94c5147aa33f23daf8f92

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77cf7e4206ed950e049cd6c4d4997d48a5e7ef85aca1b6e5cb742029bce8ff77
MD5 285653dd9a56ac9c87a04f1bdb9d4cef
BLAKE2b-256 715e0e26273a9619067f0865a344a3821c88302ab57e2dfa2c4a209fe8b809c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c010678b72dd50640f7af6829854768e719f39ba302abe5df73e657536946c4d
MD5 4bd96951ecdec31b20f43f4ef397ca7c
BLAKE2b-256 9eef1d2df0aad14c7432b8022e3f4420a0ffe1587bca85475c7a3023e55a459f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: pypi-publish.yml on cool-japan/spintronics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page