Skip to content
spglibPublic

About

Python package for detecting spin space group on top of spglib

Topics

Resources

Stars

25 stars

Watchers

3 watching

Forks

Repository files navigation

spinspg

testing License PyPI version PyPI - Downloads

spinspg detects spin space groups using moyopy for crystal symmetry.

Features

  • Find spin symmetry operations from spin arrangements

Usage

spinspg.get_spin_symmetry returns spin symmetry operations of a given spin arrangement. For output details, see the API reference.

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 = next(i for i, rotation in enumerate(spin_rotations) if rotation[2, 2] < 0)
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 moyo and the following 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.

About

Python package for detecting spin space group on top of spglib

Topics

Resources

Stars

25 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages