3.1.11. horton.symmetry – Geometric symmetries

The symmetry tools in HORTON are just meant to provide optional additional information on top of a System instance.

class horton.symmetry.Symmetry(name, generators, fracs, numbers, cell, labels=None)

Bases: object

Arguments:

name
Whatever name you want to give to this symmetry. This is converted to a string.
generators
A list of (3,4) matrices where the first three columns contain the linear transformation matrix and the last column is a translation vector. These transformations act on the fractional (or reduced) coordinates.
fracs
The fractional coordinates of a primitive cell/unit.
numbers
The corresponding element numbers of the primitive cell/unit
cell
A Cell object. Even for isolated systems a cell object must be provided with nvec=0.

Optional arguments:

labels
A list of unique labels for each atom in the primitive unit. These are generated from the numbers array when not given.
classmethod from_hdf5(grp)

Construct a Symmetry object from a HDF5 group

generate(threshold=0.001)

Apply the generators to the primitive unit to obtain a full molecule.

Optional arguments:

threshold
When, after transformation with the generators, two (or more) symmetry atoms overlap within this threshold, they will be merged into one. The distance is measured in Cartesian coordinates.

Returns:

coordinates
Cartesian coordinates for all atoms.
numbers
Atomic numbers for all atoms.
links
An array of indexes to connect each atom back with an atom in the primitive cell (first column) and a generator (second column).
identify(coordinates, cell, threshold=0.1)

Connect atoms in the primitive unit with atoms in the full molecule

Arguments:

coordinates
An (N, 3) array of atomic coordinates that adhere (with some minor deviation) to this symmetry.
cell
A Cell instance describing the periodic boundary conditions

Optional arguments:

threshold
The maximum allowed distance between the ideal atom position and the actual atom position

Returns:

links
An array of indexes to connect each atom back with an atom in the primitive cell (first column) and a generator (second column).

If an atom in the full molecule can not be linked with an atom in the primitive unit, a SymmetryError is raised. If the full molecule contains less atoms than the perfect crystal (e.g. a vacancy), this method will not complain.

to_hdf5(grp)

Write a symmetry object to an HDF5 group

cell
fracs
generators
labels
name
natom

The number of atoms in the primitive unit

numbers