spinspg
spinspg is a Python package for detecting spin space group on top of spglib
- Document(latest): https://spinspg.readthedocs.io/en/latest/
- GitHub: https://github.com/spglib/spinspg
- PyPI: https://pypi.org/project/spinspg/
Features
- Find spin symmetry operations from spin arrangements
Usage
{func}spinspg.get_spin_symmetry returns spin symmetry operations of a given spin arrangement, analogous to Spglib's {ref}spglib:py_get_magnetic_symmetry for magnetic symmetry operations.
For comprehensive output details, refer to API documents.
import numpy as np
from spinspg import get_spin_symmetry
# Antiferromagnetic rutile structure
a = 4.87
c = 3.31
x_4f = 0.695169
lattice = np.diag([a, a, c])
positions = np.array([ # Fractional coordinates
[0, 0, 0], # Mn(2a)
[0.5, 0.5, 0.5], # Mn(2a)
[x_4f, x_4f, 0], # F(4f)
[-x_4f, -x_4f, 0], # F(4f)
[-x_4f + 0.5, x_4f + 0.5, 0.5], # F(4f)
[x_4f + 0.5, -x_4f + 0.5, 0.5], # F(4f)
])
numbers = np.array([0, 0, 1, 1, 1, 1])
magmoms = np.array([ # In Cartesian coordinates
[0, 0, 2.5],
[0, 0, -2.5],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
])
# Find spin symmetry operations
sog, rotations, translations, spin_rotations = get_spin_symmetry(lattice, positions, numbers, magmoms)
print(f"Spin-only group: {sog}") # COLLINEAR(axis=[0. 0. 1.])
# Some operations have nontrivial spin rotations
idx = 2
print(f"Rotation ({idx})\n{rotations[idx]}")
print(f"Translation ({idx})\n{translations[idx]}")
print(f"Spin rotation ({idx})\n{spin_rotations[idx]}") # -> diag([1, 1, -1])
Installation
pip install spinspg
How to cite spinspg
If you use spinspg in your research, please cite both Spglib and the subsequent paper:
@article{spinspg,
author = "Shinohara, Kohei and Togo, Atsushi and Watanabe, Hikaru and Nomoto, Takuya and Tanaka, Isao and Arita, Ryotaro",
title = "{Algorithm for spin symmetry operation search}",
journal = "Acta Cryst. A",
year = "2024",
volume = "80",
number = "1",
pages = "94--103",
month = "Jan",
doi = {10.1107/S2053273323009257},
url = {https://doi.org/10.1107/S2053273323009257},
}
Change log
See the change log for recent changes.
License
spinspg is released under a BSD 3-clause license.
Metadata
Release files for spinspg 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spinspg-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for spinspg-0.3.2-py3-none-any.whl |
Release files / spinspg-0.3.2-py3-none-any.whl
| Download URL | spinspg-0.3.2-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2206b3b0b4f2f6d5eca18ec3f0452decfbf227589b5e631a4fa2b481dcae414
|
|
BLAKE2b-256 checksum How to use checksums |
cb1af2d524e7c5b4f3b3f8fc8d9340f3d09e8fa2ba8f50922164c81bae691551
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for spinspg 0.3.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.