symmetry_finder
Native symmetry detection for crystal structures.
Finds the full symmetry of a crystal from its atomic positions and lattice vectors using a hierarchical, numpy-vectorized algorithm:
- Metric tensor filter - keeps rotations R where R^T G R = G
- Translation search - finds candidate translations for each rotation
- Full verification - checks all atoms map to same-element partners
- Space group identification - feeds results into identify_standard_setting()
find_asymmetric_unit_indices(positions, elements, symops, A, atol=0.01)
Group atoms into orbits under symmetry operations and pick representatives.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions
|
(N, 3) fractional coordinates |
required | |
elements
|
(N,) integer atomic numbers |
required | |
symops
|
list of SymmetryOperation objects |
required | |
A
|
(3, 3) direct lattice matrix |
required | |
atol
|
Cartesian tolerance in Angstroms |
0.01
|
Returns:
| Type | Description |
|---|---|
|
list of indices into positions array, one per orbit |
Source code in chmpy/crystal/symmetry_finder.py
find_symmetry_operations(unit_cell, positions, elements, atol=0.01)
Find all symmetry operations of a crystal structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit_cell
|
UnitCell object |
required | |
positions
|
(N, 3) fractional coordinates of all atoms in unit cell |
required | |
elements
|
(N,) integer atomic numbers |
required | |
atol
|
Cartesian tolerance in Angstroms |
0.01
|
Returns:
| Type | Description |
|---|---|
|
list[SymmetryOperation]: all detected symmetry operations |