vibe-sketcherDocumentation

vibesketcher.document.spacegroups

Space groups from Hall symbols, in pure Python (#199).

The operations of every setting are generated from its Hall symbol (S. R. Hall, Acta Cryst. A37, 517 (1981); the explicit-origin conventions of R. W. Grosse-Kunstleve, Acta Cryst. A55, 383 (1999)): the lattice symbol adds its centring translations (and inversion when it starts with -), each matrix symbol adds a generator, an optional (vx vy vz) shifts the origin in twelfths, and the group is closed under multiplication modulo lattice translations. The table of settings is _space_group_table (from Gemmi’s table, which follows the International Tables, Vol. A); scripts/generate_space_group_table.py checks every setting against Gemmi.

Operations act on fractional column vectors: x’ = W x + t, with t reduced to [0, 1). This module has no third-party dependency, so it can be checked by an interpreter that only has Gemmi.

Functions

compose(first, second)

second after first: x -> W2 (W1 x + t1) + t2.

crystal_system(number)

find(symbol)

A setting by number, Hermann-Mauguin symbol or Hall symbol.

operations_from_hall(hall)

All operations of the setting the Hall symbol names (centring included).

settings()

Classes

Operation(rotation, translation)

x' = rotation @ x + translation (fractional coordinates, translation in [0, 1)).

Setting(number, hm, extension, qualifier, ...)

class vibesketcher.document.spacegroups.Operation(rotation, translation)[source]

Bases: object

x’ = rotation @ x + translation (fractional coordinates, translation in [0, 1)).

Parameters:
rotation: tuple[tuple[int, int, int], tuple[int, int, int], tuple[int, int, int]]
translation: tuple[Fraction, Fraction, Fraction]
key()[source]
Return type:

tuple[tuple[tuple[int, int, int], tuple[int, int, int], tuple[int, int, int]], tuple[Fraction, Fraction, Fraction]]

apply(point)[source]
Parameters:

point (tuple[float, float, float])

Return type:

tuple[float, float, float]

triplet()[source]

The coordinate triplet, e.g. -y,x-y,z+1/3.

Return type:

str

vibesketcher.document.spacegroups.compose(first, second)[source]

second after first: x -> W2 (W1 x + t1) + t2.

Parameters:
Return type:

Operation

vibesketcher.document.spacegroups.operations_from_hall(hall)[source]

All operations of the setting the Hall symbol names (centring included).

Parameters:

hall (str)

Return type:

list[Operation]

class vibesketcher.document.spacegroups.Setting(number: 'int', hm: 'str', extension: 'str', qualifier: 'str', hall: 'str', standard: 'bool')[source]

Bases: object

Parameters:
number: int
hm: str
extension: str
qualifier: str
hall: str
standard: bool
property symbol: str[source]
property crystal_system: str[source]
property centring: str[source]
operations()[source]
Return type:

list[Operation]

vibesketcher.document.spacegroups.crystal_system(number)[source]
Parameters:

number (int)

Return type:

str

vibesketcher.document.spacegroups.settings()[source]
Return type:

list[Setting]

vibesketcher.document.spacegroups.find(symbol)[source]

A setting by number, Hermann-Mauguin symbol or Hall symbol.

"R -3 c", "R-3c", "R -3 c:H", "167", 167 and "-R 3 2\"c" all name the same setting; ":R" selects rhombohedral axes, ":1"/":2" an origin choice.

Parameters:

symbol (str | int)

Return type:

Setting