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.3.2.tar.gz (1.2 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.3.2-cp38-abi3-win_amd64.whl (399.5 kB view details)

Uploaded CPython 3.8+Windows x86-64

spintronics-0.3.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (725.7 kB view details)

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

spintronics-0.3.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (527.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

spintronics-0.3.2-cp38-abi3-macosx_11_0_arm64.whl (490.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

spintronics-0.3.2-cp38-abi3-macosx_10_12_x86_64.whl (532.5 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for spintronics-0.3.2.tar.gz
Algorithm Hash digest
SHA256 431cac755687eb2fa2353c5410b616d776771a29ecd6d88e334ba4d473bc0c31
MD5 c6f15f032da4fd454bd6dabb49fba463
BLAKE2b-256 38b2f4637500c91ac5cf1bb0dccbadea239510189ddd0a1c0f1783c5f8857ea2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spintronics-0.3.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 399.5 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.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4e8b8da9f441938e26810d9492ab4dd6f467cd764986ec16d0b498061bf06d80
MD5 ce6b14cf27db8bd7f6e660dcfdcf8f27
BLAKE2b-256 180291466a9867e609d1057d2f3e4f86f675ab6abcccb9c1e4719ce9becd6c26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spintronics-0.3.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61b00daafa1e73a0a97a09187e69d1d0bb27fe1420ab05ab6a5878e8c41b9ae5
MD5 b7bd0799ea4bfd2476ca12dedfec8c4a
BLAKE2b-256 90b3183a2060e9e69f7bf66c34bbcc711ba41516bc3e9150ba32449b7daefb6c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spintronics-0.3.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ba73bee50d61109e2e0dcb425ce81766865a7d17ac6c11807d96fe651799cb00
MD5 7b2f9d7cd8a9c3e17f479ac93e5e4d06
BLAKE2b-256 94e47a3667395979f7930dea59cb3cfcfbeb3d6cc8647ba7cf88585f1647f332

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spintronics-0.3.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55f8dd3388d71db1b1e15b1ecb30871700c4bb6ba4c270d857fb0ccea128e3b5
MD5 fb3a66bf9d9d96aaae820a4d3dd0b85b
BLAKE2b-256 521d252ffb3a6b7668f55292e1a02098423e78fcbd74c269a695a53519a10dfb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spintronics-0.3.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 16ae52d6e4c6cc323a54039ef3c94a848c8dd52cefc2dbb99613917530cb15d3
MD5 cf29aca7f9a9a5d06c3ac5a0177d31df
BLAKE2b-256 f8b2921893e93569e86491d85823c14db95ae1f517a681cab7ad073caaca74a3

See more details on using hashes here.

Provenance

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