Skip to content

Symmetry Representation

symel

Symel dataclass

Symel(symbol: str, vector: ndarray | None, rrep: ndarray, m: int | None = None, n: int | None = None, O: str | None = None)

Symmetry element (SymEl): Symmetry operation with its symbol, representative axis, matrix representation and metadata.

Parameters:

  • symbol (str) –

    Schoenflies symbol of the symmetry element (e.g. "C_3", "sigma_h", "i").

  • vector (ndarray | None) –

    Axis vector for Cn and Sn; plane normal vector for sigma; None for E and i.

  • rrep (ndarray) –

    3x3 real-space matrix representation of the operation.

  • m (int | None, default: None ) –

    Power of the generator (e.g. m=2 for C_3^2).

  • n (int | None, default: None ) –

    Order of the principal axis of the generating cycle.

  • O (str | None, default: None ) –

    Origin class of the element. Options: "E", "sigma_v", "C_2'", "i", "sigma_h".

symtext

symtext.py — Full symmetry characterization of a molecule (Symtext class).

Dependencies: pg_detect — find_point_group point_group — PointGroup symel_gen — pg_to_symels mol_orient — rotate_mol_to_symels atom_mapping — _get_atom_mapping, _get_linear_atom_mapping

Symtext

Symtext(mol, rotate_to_std, reverse_rotate, pg, symels, atom_map)

Full symmetry characterization of a molecule.

Holds the point group, list of symmetry elements, atom permutation map, and the rotation matrices that relate the molecule to the canonical orientation defined by the symmetry elements.

Source code in minimalsym/core/symtext.py
30
31
32
33
34
35
36
37
38
39
40
41
42
def __init__(self, mol, rotate_to_std, reverse_rotate, pg, symels, atom_map):
    self.mol = mol
    self.rotate_to_std = rotate_to_std
    self.reverse_rotate = reverse_rotate
    self.pg = pg
    self.symels = symels
    self.atom_map = atom_map
    if pg.is_linear:
        # Linear groups have infinitely many symmetry elements; the finite
        # atom_map covers only the operations that actually permute atoms.
        self.order = atom_map.shape[1]
    else:
        self.order = len(symels)

from_molecule classmethod

from_molecule(mol)

Build a Symtext from an ase.Atoms object.

Parameters:

  • mol (Atoms) –

Returns:

Source code in minimalsym/core/symtext.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@classmethod
def from_molecule(cls, mol):
    """
    Build a Symtext from an ase.Atoms object.

    Parameters
    ----------
    mol : ase.Atoms

    Returns
    -------
    Symtext
    """
    mol.translate(-mol.get_center_of_mass())
    pgr = find_point_group(mol)
    pg = PointGroup.from_string(pgr.pg)
    mol, reverse_rotate, rotate_to_std = rotate_mol_to_symels(mol, pgr.paxis, pgr.saxis)
    mol.info["pg"] = pgr.pg
    symels = pg_to_symels(pg.str)
    if pg.is_linear:
        atom_map = _get_linear_atom_mapping(mol, pg)
    else:
        atom_map = _get_atom_mapping(mol, symels)
    return Symtext(mol, rotate_to_std, reverse_rotate, pg, symels, atom_map)

from_PointGroupResult classmethod

from_PointGroupResult(mol, pgr, is_linear: bool = False)

Build a Symtext from a PointGroupResult object.

Parameters:

  • mol (Atoms) –
  • pgr (PointGroupResult) –

Returns:

Source code in minimalsym/core/symtext.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
@classmethod
def from_PointGroupResult(cls, mol, pgr, is_linear:bool=False):
    """
    Build a Symtext from a PointGroupResult object.

    Parameters
    ----------
    mol : ase.Atoms
    pgr : PointGroupResult

    Returns
    -------
    Symtext
    """
    pg = PointGroup.from_string(pgr.pg)
    mol, reverse_rotate, rotate_to_std = rotate_mol_to_symels(mol, pgr.paxis, pgr.saxis)
    mol.info["pg"] = pgr.pg
    symels = pg_to_symels(pg.str)
    if pg.is_linear:
        atom_map = _get_linear_atom_mapping(mol, pg)
    else:
        atom_map = _get_atom_mapping(mol, symels)
    return Symtext(mol, rotate_to_std, reverse_rotate, pg, symels, atom_map)

point_group

PointGroup

PointGroup(s, family, n, subfamily)

Schoenflies point group descriptor.

Parses and validates a point group string into its family, order, and subfamily.

Source code in minimalsym/core/point_group.py
 9
10
11
12
13
14
15
16
17
18
def __init__(self, s, family, n, subfamily):
    self.str = s
    self.family = family
    self.n = n
    if self.n == 0:
        self.is_linear = True
    else:
        self.is_linear = False
    self.subfamily = subfamily
    self.dumb_pg()