symmetry_exposed#
- class irmsd.api.symmetry_exposed.SymmetryOperation(label: str, kind: str, order: int, power: int, matrix: ndarray, translation: ndarray, axis: ndarray | None, point: ndarray | None, permutation: ndarray, maxdev: float | None = None)[source]#
Bases:
objectSymmetry operation
x' = matrix @ x + translation.Atom
imaps ontopermutation[i], soop.apply(pos)[i]matchespos[op.permutation[i]]within the symmetry tolerance.- matrix#
Orthogonal part.
- Type:
(3,3) ndarrayoffloat64
- translation#
In Å; nonzero when the element misses the origin.
- Type:
(3,) ndarrayoffloat64
- axis#
Rotation axis, or plane normal for sigma; None for E and i.
- Type:
(3,) ndarrayoffloat64orNone
- permutation#
0-based image atom of each atom.
- Type:
(N,) ndarrayofint32
- __annotations__ = {'axis': 'np.ndarray | None', 'kind': 'str', 'label': 'str', 'matrix': 'np.ndarray', 'maxdev': 'float | None', 'order': 'int', 'permutation': 'np.ndarray', 'point': 'np.ndarray | None', 'power': 'int', 'translation': 'np.ndarray'}#
- __dataclass_fields__ = {'axis': Field(name='axis',type='np.ndarray | None',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'kind': Field(name='kind',type='str',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'label': Field(name='label',type='str',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'matrix': Field(name='matrix',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'maxdev': Field(name='maxdev',type='float | None',default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'order': Field(name='order',type='int',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'permutation': Field(name='permutation',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point': Field(name='point',type='np.ndarray | None',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'power': Field(name='power',type='int',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'translation': Field(name='translation',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}#
- __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)#
- __dict__ = mappingproxy({'__module__': 'irmsd.api.symmetry_exposed', '__annotations__': {'label': 'str', 'kind': 'str', 'order': 'int', 'power': 'int', 'matrix': 'np.ndarray', 'translation': 'np.ndarray', 'axis': 'np.ndarray | None', 'point': 'np.ndarray | None', 'permutation': 'np.ndarray', 'maxdev': 'float | None'}, '__doc__': 'Symmetry operation ``x\' = matrix @ x + translation``.\n\n Atom ``i`` maps onto ``permutation[i]``, so ``op.apply(pos)[i]``\n matches ``pos[op.permutation[i]]`` within the symmetry tolerance.\n\n Attributes\n ----------\n label : str\n e.g. "E", "C3", "C3^2", "S6^5", "i", "sigma", "Cinf".\n kind : str\n One of "E", "C", "S", "i", "sigma".\n order : int\n n of C_n^k / S_n^k; 0 for Cinf, 1 for E, 2 for i and sigma.\n power : int\n k of C_n^k / S_n^k; 1 for E, i, sigma.\n matrix : (3, 3) ndarray of float64\n Orthogonal part.\n translation : (3,) ndarray of float64\n In Å; nonzero when the element misses the origin.\n axis : (3,) ndarray of float64 or None\n Rotation axis, or plane normal for sigma; None for E and i.\n point : (3,) ndarray of float64 or None\n A point on the element in Å; None for E.\n permutation : (N,) ndarray of int32\n 0-based image atom of each atom.\n maxdev : float or None\n Largest atom displacement in Å; None for derived operations.\n ', 'maxdev': None, 'apply': <function SymmetryOperation.apply>, '__dict__': <attribute '__dict__' of 'SymmetryOperation' objects>, '__weakref__': <attribute '__weakref__' of 'SymmetryOperation' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'label': Field(name='label',type='str',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'kind': Field(name='kind',type='str',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'order': Field(name='order',type='int',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'power': Field(name='power',type='int',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'matrix': Field(name='matrix',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'translation': Field(name='translation',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'axis': Field(name='axis',type='np.ndarray | None',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point': Field(name='point',type='np.ndarray | None',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'permutation': Field(name='permutation',type='np.ndarray',default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'maxdev': Field(name='maxdev',type='float | None',default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__init__': <function SymmetryOperation.__init__>, '__repr__': <function SymmetryOperation.__repr__>, '__eq__': <function SymmetryOperation.__eq__>, '__hash__': None, '__match_args__': ('label', 'kind', 'order', 'power', 'matrix', 'translation', 'axis', 'point', 'permutation', 'maxdev')})#
- __eq__(other)#
Return self==value.
- __init__(label: str, kind: str, order: int, power: int, matrix: ndarray, translation: ndarray, axis: ndarray | None, point: ndarray | None, permutation: ndarray, maxdev: float | None = None) None#
- __match_args__ = ('label', 'kind', 'order', 'power', 'matrix', 'translation', 'axis', 'point', 'permutation', 'maxdev')#
- __module__ = 'irmsd.api.symmetry_exposed'#
- __repr__()#
Return repr(self).
- irmsd.api.symmetry_exposed._classify(proper: bool, n: int, k: int) tuple[str, int, int, str][source]#
Reduced (kind, order, power, label) of C_n^k (proper) or S_n^k.
- irmsd.api.symmetry_exposed._element_to_operation(el: dict, i: int) SymmetryOperation[source]#
- irmsd.api.symmetry_exposed._run(raw, atom_numbers, positions, threshold, primary_threshold, max_axis_order, max_opt_cycles, max_atoms)[source]#
Validate input and call a raw binding; None if skipped for size.
- irmsd.api.symmetry_exposed.get_point_group(atom_numbers: ndarray, positions: ndarray, *, threshold: float = 0.1, primary_threshold: float = 0.5, max_axis_order: int = 10, max_opt_cycles: int = 100, max_atoms: int | None = 200) str | None[source]#
Schoenflies point group from the brute-force analyzer ported from CREST.
- Parameters:
atom_numbers (
(N,) int32-like) – Atomic numbers (or types).positions (
(N,3) float64-like) – Cartesian coordinates in Å.threshold (
float, optional) – Final symmetry tolerance in Bohr: the largest atom displacement an element may cause to be accepted (default: 0.1, as in CREST). Increase for noisy or loosely optimized geometries; large systems need this more, since the worst atom deviation grows with size. Too tight a value on such structures is also slow, as every near-miss candidate is fully optimized before being rejected.primary_threshold (
float, optional) – Tolerance in Bohr for the initial pairing of symmetry-related atoms and the distance prescreening of candidates (default: 0.5). Too small values miss elements of distorted structures; larger values test many more candidates, which dominates the cost for large systems.max_axis_order (
int, optional) – Highest rotation axis order searched, for proper and improper axes alike (default: 10). An S2n axis needs at least 2n, so values below 10 lose e.g. the S10 axes of Ih and D5d and with them the group.max_opt_cycles (
int, optional) – Maximum optimization cycles per candidate element (default: 100).max_atoms (
intorNone, optional) – Skip the analysis for structures with more atoms than this, since the search scales steeply with system size (default: 200, as in CREST). None disables the limit.
- Returns:
Schoenflies symbol, e.g. “C2v”, “Dinfh”; the highest proper axis (e.g. “C3”) if no tabulated group matches; None if skipped by
max_atoms.- Return type:
- Raises:
ValueError – If positions is not (N, 3) or max_axis_order < 2.
- irmsd.api.symmetry_exposed.get_symmetry_elements(atom_numbers: ndarray, positions: ndarray, *, threshold: float = 0.1, primary_threshold: float = 0.5, max_axis_order: int = 10, max_opt_cycles: int = 100, max_atoms: int | None = 200) tuple[str | None, list[SymmetryOperation]][source]#
Point group and located symmetry elements, each as its generating operation.
- Parameters:
atom_numbers (
(N,) int32-like) – Atomic numbers (or types).positions (
(N,3) float64-like) – Cartesian coordinates in Å.threshold (
float, optional) – Final symmetry tolerance in Bohr: the largest atom displacement an element may cause to be accepted (default: 0.1, as in CREST). Increase for noisy or loosely optimized geometries; large systems need this more, since the worst atom deviation grows with size. Too tight a value on such structures is also slow, as every near-miss candidate is fully optimized before being rejected.primary_threshold (
float, optional) – Tolerance in Bohr for the initial pairing of symmetry-related atoms and the distance prescreening of candidates (default: 0.5). Too small values miss elements of distorted structures; larger values test many more candidates, which dominates the cost for large systems.max_axis_order (
int, optional) – Highest rotation axis order searched, for proper and improper axes alike (default: 10). An S2n axis needs at least 2n, so values below 10 lose e.g. the S10 axes of Ih and D5d and with them the group.max_opt_cycles (
int, optional) – Maximum optimization cycles per candidate element (default: 100).max_atoms (
intorNone, optional) – Skip the analysis for structures with more atoms than this, since the search scales steeply with system size (default: 200, as in CREST). None disables the limit.
- Returns:
- Raises:
ValueError – If positions is not (N, 3) or max_axis_order < 2.
- irmsd.api.symmetry_exposed.get_symmetry_operations(atom_numbers: ndarray, positions: ndarray, *, threshold: float = 0.1, primary_threshold: float = 0.5, max_axis_order: int = 10, max_opt_cycles: int = 100, max_atoms: int | None = 200) tuple[str | None, list[SymmetryOperation]][source]#
Point group and all distinct powers of the located elements.
Order: E, i, mirror planes, proper, then improper rotations. For finite groups the length equals the group order; for Cinfv/Dinfh only the operations generated by i, sigma and C2 are returned (the Cinf axis comes from
get_symmetry_elements()).- Parameters:
atom_numbers (
(N,) int32-like) – Atomic numbers (or types).positions (
(N,3) float64-like) – Cartesian coordinates in Å.threshold (
float, optional) – Final symmetry tolerance in Bohr: the largest atom displacement an element may cause to be accepted (default: 0.1, as in CREST). Increase for noisy or loosely optimized geometries; large systems need this more, since the worst atom deviation grows with size. Too tight a value on such structures is also slow, as every near-miss candidate is fully optimized before being rejected.primary_threshold (
float, optional) – Tolerance in Bohr for the initial pairing of symmetry-related atoms and the distance prescreening of candidates (default: 0.5). Too small values miss elements of distorted structures; larger values test many more candidates, which dominates the cost for large systems.max_axis_order (
int, optional) – Highest rotation axis order searched, for proper and improper axes alike (default: 10). An S2n axis needs at least 2n, so values below 10 lose e.g. the S10 axes of Ih and D5d and with them the group.max_opt_cycles (
int, optional) – Maximum optimization cycles per candidate element (default: 100).max_atoms (
intorNone, optional) – Skip the analysis for structures with more atoms than this, since the search scales steeply with system size (default: 200, as in CREST). None disables the limit.
- Returns:
- Raises:
ValueError – If positions is not (N, 3) or max_axis_order < 2.