Skip to main content

Python package for detecting spin space group on top of spglib

Project description

spinspg

testing License

Python package for detecting spin space group on top of spglib

Features

  • Find spin symmetry operations from spin arrangements

Usage

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])

See API documents for more details.

Installation

git clone git@github.com:spglib/spinspg.git
cd spinspg
pip install .

How to cite spinspg

If you use spinspg in your research, please cite Spglib and the following paper:

@misc{spinspg,
    author = {Kohei Shinohara and Atsushi Togo and Hikaru Watanabe and Takuya Nomoto and Isao Tanaka and Ryotaro Arita},
    title = {Algorithm for spin symmetry operation search},
    year = {2023},
    eprint = {arXiv:2307.12228},
    howpublished = {\url{https://arxiv.org/abs/2307.12228}},
}

Change log

See the change log for recent changes.

License

Spinspg is distributed under a BSD 3-clause license.

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

spinspg-0.1.2.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

spinspg-0.1.2-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file spinspg-0.1.2.tar.gz.

File metadata

  • Download URL: spinspg-0.1.2.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for spinspg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fcb3855c60cad3a7961102af8747b24b0b29a322b3c0620c34371a383647eece
MD5 ff44721bd3cbbba80554f6ef18729c77
BLAKE2b-256 f7982ab14d7e08ece2988392a7b7dad81b716b650bb94e394be6cb07ff89e595

See more details on using hashes here.

File details

Details for the file spinspg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: spinspg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for spinspg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d67c67ee772950669a5e92e6030acf1c418769c8aa659670915b0e2d35af996b
MD5 e557feff48c618a63243258008911e67
BLAKE2b-256 50abc82374d4617d7e523398ce6ad54f6f3bc01df51b5434cf57d29d1a03e612

See more details on using hashes here.

Supported by

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