vibe-sketcherDocumentation

vibesketcher.document.symmetry

Space-group detection, standardisation and cell reduction with spglib (#199).

Optional: pip install 'vibesketcher[symmetry]' installs spglib 2.8.0 (BSD-3-Clause; A. Togo, K. Shinohara and I. Tanaka, Sci. Technol. Adv. Mater. Meth. 4, 2384822 (2024)). Building crystals from a space group does not need it (vibesketcher.document.spacegroups).

Detection reports at a stated length tolerance and never changes the structure. Standardisation returns a new structure in the standard conventional or primitive setting; by default positions are not idealised, and the displacement idealisation would apply is reported so it can be reviewed first. Only three-dimensional, fully ordered cells are analysed: a slab’s layer group is not a space group of its vacuum-padded cell.

Functions

available()

detect(structure, *[, symprec])

The space group, setting, Wyckoff positions and equivalent atoms; read-only.

operations(structure, *[, symprec])

The space-group operations (R, t) in the structure's own fractional basis.

reduce(structure, *, identifier, method)

The same crystal in its Niggli- or Delaunay-reduced cell (det P = +1, same atoms).

standardize(structure, *, identifier[, to, ...])

The structure in the standard conventional or primitive setting of its space group.

Exceptions

SymmetryUnavailable

spglib is not installed.

exception vibesketcher.document.symmetry.SymmetryUnavailable[source]

Bases: RuntimeError

spglib is not installed.

vibesketcher.document.symmetry.available()[source]
Return type:

bool

vibesketcher.document.symmetry.operations(structure, *, symprec=0.001)[source]

The space-group operations (R, t) in the structure’s own fractional basis.

Parameters:
Return type:

list[tuple[ndarray, ndarray]]

vibesketcher.document.symmetry.detect(structure, *, symprec=0.001)[source]

The space group, setting, Wyckoff positions and equivalent atoms; read-only.

symprec is a length tolerance in angstrom.

Parameters:
Return type:

dict[str, Any]

vibesketcher.document.symmetry.standardize(structure, *, identifier, to='conventional', idealize=False, symprec=0.001)[source]

The structure in the standard conventional or primitive setting of its space group.

Without idealize the measured atoms are only re-expressed in the standard basis (spglib’s transformation matrix and origin shift applied to them, orientation kept); with it, spglib’s symmetrised, rotated cell is used. The record states how far idealisation moves atoms and cell vectors either way, so the choice can be reviewed.

Parameters:
Return type:

PeriodicStructure

vibesketcher.document.symmetry.reduce(structure, *, identifier, method)[source]

The same crystal in its Niggli- or Delaunay-reduced cell (det P = +1, same atoms).

Parameters:
Return type:

PeriodicStructure