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

MIT OR 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.3.0.tar.gz (938.1 kB view details)

Uploaded Source

Built Distributions

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

spintronics-0.3.0-cp38-abi3-win_amd64.whl (403.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

spintronics-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (724.3 kB view details)

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

spintronics-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (527.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

spintronics-0.3.0-cp38-abi3-macosx_11_0_arm64.whl (489.9 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

spintronics-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl (540.3 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for spintronics-0.3.0.tar.gz
Algorithm Hash digest
SHA256 81615e01415421873f05f07355cb4ec5f673d00f9467fc8270c44babb05725af
MD5 513b492c97e55a4ac6d6893aa87ebdd2
BLAKE2b-256 bb5b09ce6020ec066351807688d2c0520230029b83692d4aef796e087f4c9e07

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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.3.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: spintronics-0.3.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 403.2 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.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4a81c398300b8a6ee9d6b9a6dff9ae993b436663d3696b2febf3f9a2501caf5b
MD5 6cefd0ca6a5e4464508b9e9ee0576314
BLAKE2b-256 f8993354af4d90119b71eaabc5da06a4d1cd1f6ff30a2af4fd3c1c2c019f0fbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spintronics-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ddf15d3a7f7e96efecadf638c937ed882689f7691d92369e91f4541bd5105001
MD5 cbf77d85b9621144fee73c8c50c3b148
BLAKE2b-256 5ea6880ac4de0d13b6e3a1c670074f21085aabd39e392a9d2ad5deabefd769f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spintronics-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cd91a0c0112cb28f70ad6efc4cac32db1e1314bc78962af730a332a0cae40bbd
MD5 364820fe9d22a4bd25d9fd441d80561e
BLAKE2b-256 ab998729f62ff506ef12ce1652b3dd2a6210272c927162a2879d751f292707ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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.3.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spintronics-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33038dc803ce129861487c27f5195d413c42839a9d5e9db332f08ca11a539ce9
MD5 f6007ed150468f390ead8e1a95a800d2
BLAKE2b-256 071f385e3912b86f98ec3fc8f5f9adb88577db8fb4a3f8210eda31d37b5bc1e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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.3.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spintronics-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fe2072222d9f51b258a7cbeea611e745a1a10c6203e5006b81c8dcb00b303d6d
MD5 3e4887b74db9d8a00b3f913228f4c1aa
BLAKE2b-256 95f25fcac533097682d5015d0632a0d8cc3b88c01c7dfb61988cb69be2478bf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for spintronics-0.3.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