Spin space group (SSG) symmetry analysis toolkit for magnetic materials. Automatically identifies and classifies SSGs, generating symmetry operations, spin Wyckoff positions, and spin Brillouin zones. Designed for integration with first-principles and high-throughput computational workflows.
Project description
findspingroup
findspingroup is a Python toolkit for identifying and analyzing Spin Space Group (SSG) symmetry of magnetic crystal structures.
Given a magnetic CIF file, it determines the corresponding spin space group, constructs a standardized primitive magnetic cell, and provides symmetry- and property-related results for downstream first-principles workflows.
The project is designed for research use, high-throughput screening, and integration with DFT pipelines.
What it does
Given a magnetic structure, findspingroup can:
- identify the spin space group and index
- construct primitive and standardized settings
- expose symmetry operations and international-style symbols
- export repo-generated
.scifsnapshots for roundtrip and workflow use - provide symmetry-constrained property outputs for downstream calculations
Installation
From PyPI
pip install findspingroup
Python version: >= 3.11
From source
git clone https://github.com/LiuQH-lab/FindSpinGroup.git
cd FindSpinGroup
pip install -e .
30-second example
from findspingroup import example_path, find_spin_group
result = find_spin_group(example_path("0.800_MnTe.mcif"))
print(result.index)
print(result.acc)
print(result.convention_ssg_international_linear)
Minimal smoke check:
python - <<'PY'
from findspingroup import example_path, find_spin_group
result = find_spin_group(example_path("0.800_MnTe.mcif"))
print(result.index)
print(result.convention_ssg_international_linear)
PY
Supported inputs
findspingroup accepts:
- standard
.cif - magnetic
.mcif - repo-generated
.scif - a narrow first-version magnetic
POSCARcontract used by this project
Main API
def find_spin_group(
cif: str,
space_tol: float = 0.02,
mtol: float = 0.02,
meigtol: float = 0.00002,
matrix_tol: float = 0.01,
) -> MagSymmetryResult
The function returns a MagSymmetryResult object containing the symmetry analysis result.
Common outputs
Useful fields on MagSymmetryResult include:
indexaccmsg_nummsg_symbolconvention_ssg_international_lineargspg_symbol_linearscif
Example:
from findspingroup import example_path, find_spin_group
result = find_spin_group(example_path("1.237_VCl2.mcif"))
print("index:", result.index)
print("acc:", result.acc)
print("msg:", result.msg_symbol)
print("convention:", result.convention_ssg_international_linear)
Input details
findspingroup supports standard .cif, magnetic .mcif, the current
repo-generated .scif files, and a narrow first-version POSCAR parser for
repo-generated magnetic POSCAR text.
- Standard CIF: Uses structural positions.
- MCIF (Magnetic CIF): Supports files generated by FINDSYM, ISOTROPY, or Vesta.
- The parser looks for
_atom_site_momenttags. - It automatically handles magnetic vectors ($m_x, m_y, m_z$).
- The parser looks for
- SCIF: Supports the current repo-generated
.scifcontract for generator / parser roundtrip work. - POSCAR: Currently supports the repo-generated
CrystalCell.to_poscar(...)contract only.- official POSCAR structural variants:
DirectCartesian- optional
Selective dynamics - one / three scale factors
- negative target-volume scale
- optional trailing
# MAGMOM=line- if absent, moments default to zero
- multiple
#, tabs, and extra spaces aroundMAGMOM =are tolerated
- if no inline
MAGMOMis present, a siblingINCARMAGMOMentry is also supported- repeated entries such as
6*0.0 ;inline statements\\continuation#/!comments
- repeated entries such as
NIONSscalar form is currently promoted to the default z axis- basename
POSCAR/CONTCARor suffix.poscar/.vasp - species names are still required; VASP4 species-omitted files are not yet supported
- official POSCAR structural variants:
.scif export and roundtrip
findspingroup can export a repo-generated spinCIF-style .scif snapshot from a
MagSymmetryResult, and can also parse that generated .scif back through the
same public input path.
from findspingroup import example_path, find_spin_group
result = find_spin_group(example_path("0.800_MnTe.mcif"))
# Default public `.scif` output: legacy profile in the oriented-G0 setting.
scif_text = result.scif
# The same output is also available explicitly.
assert scif_text == result.to_scif(profile="legacy", cell_mode="g0std_oriented")
# Additional export profiles / cell modes exist for audit and roundtrip work.
scif_working = result.to_scif(profile="spincif_working", cell_mode="g0std_oriented")
scif_primitive = result.to_scif(profile="legacy", cell_mode="magnetic_primitive")
Current .scif generator rules:
- repo-local FINDSPINGROUP metadata is emitted under CIF-legal
_space_group_spin.fsg_*tags - symmetry-operation and transform coefficients keep full precision by default
- values close to simple fractions or common square-root forms may be written as
symbolic expressions such as
1/3,2/3, orsqrt(6)/3 - repo-generated
.sciffiles can be parsed back withfind_spin_group(...)and are regression-tested to preserve the identifiedindex
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file findspingroup-0.13.14.tar.gz.
File metadata
- Download URL: findspingroup-0.13.14.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65acf5f95fad4f7108af50996b5509a08118feb855b7584761bd27a26df8d866
|
|
| MD5 |
7539d8ea07349cbf79546f0ecec7c976
|
|
| BLAKE2b-256 |
73452d9b2c9d71ef13ee00e30520358a924599e4a59b0962f3088c87e415dd52
|
Provenance
The following attestation bundles were made for findspingroup-0.13.14.tar.gz:
Publisher:
publish-pypi.yml on LiuQH-lab/FindSpinGroup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
findspingroup-0.13.14.tar.gz -
Subject digest:
65acf5f95fad4f7108af50996b5509a08118feb855b7584761bd27a26df8d866 - Sigstore transparency entry: 1264045023
- Sigstore integration time:
-
Permalink:
LiuQH-lab/FindSpinGroup@b1c1bad341c4fe4b0268f24a8705c3e3b151ded3 -
Branch / Tag:
refs/tags/v0.13.14 - Owner: https://github.com/LiuQH-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b1c1bad341c4fe4b0268f24a8705c3e3b151ded3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file findspingroup-0.13.14-py3-none-any.whl.
File metadata
- Download URL: findspingroup-0.13.14-py3-none-any.whl
- Upload date:
- Size: 4.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b76f149e1c0e22e447263207defac23262053070bd005375d2d05e5a8ddaf8c2
|
|
| MD5 |
53ef048403f9f46abeb144bf15caddbf
|
|
| BLAKE2b-256 |
0d969b331109e8d1982e6310f76295f1c6715ebe718250faba0d4f7489bfd315
|
Provenance
The following attestation bundles were made for findspingroup-0.13.14-py3-none-any.whl:
Publisher:
publish-pypi.yml on LiuQH-lab/FindSpinGroup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
findspingroup-0.13.14-py3-none-any.whl -
Subject digest:
b76f149e1c0e22e447263207defac23262053070bd005375d2d05e5a8ddaf8c2 - Sigstore transparency entry: 1264045125
- Sigstore integration time:
-
Permalink:
LiuQH-lab/FindSpinGroup@b1c1bad341c4fe4b0268f24a8705c3e3b151ded3 -
Branch / Tag:
refs/tags/v0.13.14 - Owner: https://github.com/LiuQH-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b1c1bad341c4fe4b0268f24a8705c3e3b151ded3 -
Trigger Event:
push
-
Statement type: