FINDSYM: Symmetry detection for crystal structures
Project description
FINDSYM: Crystal Structure Symmetry Detection
FINDSYM is a Python package for detecting and analyzing crystal structure symmetries. It provides tools to identify space groups, point groups, and Wyckoff positions in crystalline materials.
Features
- Space Group Detection: Automatically identifies the space group of crystal structures
- Point Group Analysis: Determines the point group symmetries
- Wyckoff Position Assignment: Assigns atoms to their corresponding Wyckoff positions
- Primitive Cell Finding: Converts structures to their primitive cells
- 3D Visualization: Interactive visualization of crystal structures (optional)
- Multiple File Formats: Supports CIF, POSCAR, XYZ, and other common structure formats
Installation
From PyPI (recommended)
pip install findsym
With visualization support
pip install findsym[visualization]
From source
git clone https://github.com/yourusername/findsym.git
cd findsym
pip install -e .
Dependencies
numpy>= 1.18.0ase>= 3.20.0 (Atomic Simulation Environment)spglib>= 1.16.0 (Space group library)matplotlib>= 3.3.0 (optional, for visualization)
Quick Start
Command Line Usage
# Basic symmetry analysis
findsym structure.cif
# With custom tolerance
findsym structure.cif --tolerance 1e-4
# With 3D visualization
findsym structure.cif --visualize
Python API
from findsym import findsym
# Analyze a crystal structure
result = findsym("SrTiO3.cif", tolerance=1e-3, visualize=True)
print(f"Space group number: {result['number']}")
print(f"Point group: {result['point group']}")
Examples
Analyzing SrTiO3
import findsym
# Load and analyze SrTiO3 structure
result = findsym.findsym("SrTiO3_mp-4651_primitive.cif")
# Output will show:
# - Space group information
# - Standardized lattice parameters
# - Wyckoff positions for each atom
# - Symmetry operations
Batch Processing
import glob
from findsym import findsym
# Process multiple structures
for cif_file in glob.glob("*.cif"):
print(f"Processing {cif_file}...")
result = findsym(cif_file)
print(f"Space group: {result['number']}")
Output Information
FINDSYM provides detailed symmetry information including:
- Space Group: International symbol and number
- Point Group: Point group symbol
- Lattice Parameters: Standardized unit cell
- Wyckoff Positions: Site symmetries for each atom
- Symmetry Operations: Complete set of symmetry transformations
- Equivalent Atoms: Grouping of symmetrically equivalent atoms
Supported File Formats
- CIF (Crystallographic Information File)
- POSCAR/CONTCAR (VASP)
- XYZ
- PDB
- And many others supported by ASE
Visualization
When using the --visualize flag or visualize=True parameter, FINDSYM creates an interactive 3D plot showing:
- Crystal structure with atoms colored by element
- Unit cell boundaries
- Proper atomic radii
- Structure information overlay
Advanced Usage
Custom Tolerance
# For high-precision structures
result = findsym("precise_structure.cif", tolerance=1e-5)
# For experimental/noisy data
result = findsym("experimental_structure.cif", tolerance=1e-2)
Programmatic Access
from findsym.core import (
parse_input,
find_primitive_cell,
identify_point_group,
match_to_standard_space_group
)
# Load structure
structure = parse_input("structure.cif")
# Find primitive cell
primitive = find_primitive_cell(structure)
# Get space group
dataset = match_to_standard_space_group(primitive, tolerance=1e-3)
print(f"Space group: {dataset['international']}")
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the original FINDSYM from BYU's Isotropy Software Suite
- Built on top of spglib for symmetry operations
- Uses ASE for structure handling
- Visualization powered by matplotlib
Project details
Release history Release notifications | RSS feed
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 findsym-0.1.1.tar.gz.
File metadata
- Download URL: findsym-0.1.1.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2c6a69297324cb3a05cf9ac5d6e31c8c097557437669aca702df566f2cd0431
|
|
| MD5 |
1ec3856f0e505e55e42c9752cf0544b6
|
|
| BLAKE2b-256 |
744b12fe94943291c216da415fcca90a0233cc705f9f95439d4a92eb76151109
|
File details
Details for the file findsym-0.1.1-py3-none-any.whl.
File metadata
- Download URL: findsym-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
590c18569d95f97e038eadecc586618246a80bf288ed726376cb11025820e3ec
|
|
| MD5 |
77acbef1d9de60386c3538a3dd0c24ed
|
|
| BLAKE2b-256 |
f96b95a2adfa085e835030c12523b57b14306f560a5e2507ead0a8eb651207de
|