hikari.symmetry package

Submodules

hikari.symmetry.group module

This file contains class definition and necessary tools for constructing and evaluating all symmetry groups.

class hikari.symmetry.group.Group(*generators)

Bases: object

Base immutable class containing information about symmetry groups. It stores information for point and space groups and, among others, allows for iteration over its elements from hikari.symmetry.SymmOp.

AXIS_PRIORITY_RULES = '6>61>62>63>64>65>-6>4>41>42>43>-4>-3>3>31>32>2>21'
BRAVAIS_PRIORITY_RULES = 'A+B+C=F>R>I>C>B>A>H>P'
PLANE_PRIORITY_RULES = 'm>a+b=e>a+c=e>b+c=e>a>b>c>n>d'
class System(value)

Bases: Enum

Enumerator class with information about associated crystal system

cubic = 5
property directions
hexagonal = 6
monoclinic = 1
orthorhombic = 2
tetragonal = 4
triclinic = 0
trigonal = 3
property auto_generated_name

Name of the group generated automatically. Use only as approx.

property centering_symbol
classmethod create_manually(generators, operations)

Generate group using already complete list of generators and operators. :param generators: A complete list of group generators :type generators: List[np.ndarray] :param operations: A complete list of group operations :type operations: List[np.ndarray] :return: :rtype:

property generators
property is_achiral
property is_centrosymmetric
Returns

True if group has centre of symmetry; False otherwise.

Return type

bool

property is_chiral
property is_enantiogenic
Returns

True if determinant of all operations in group are positive.

Return type

bool

property is_polar
property is_sohncke
Returns

True if determinant of all operations in group are positive.

Return type

bool

property is_symmorphic
lauefy()
Returns

New PointGroup with centre of symmetry added to generators.

Return type

Group

property operations
property order
reciprocate()
property system
Returns

Predicted crystal system associated with this group

Return type

self.CrystalSystem()

transform(m)

Transform the group using 4x4 matrix. For reference, see bilbao resources or IUCr pamphlet no. 22.

Example

>>> import numpy
>>> from hikari.symmetry import SG
>>> matrix = numpy.array([(1,0,1,0),(0,1,0,0),(-1,0,0,0),(0,0,0,1)])
>>> SG['P21/c'].transform(matrix).auto_generated_name
P 21/n
Parameters

m (np.ndarray) – A 4x4 array containing information about new base and origin.

Returns

Group with new, transformed basis and origin.

Return type

Group

hikari.symmetry.operations module

This file contains class and definitions of 3-dimensional symmetry operations.

class hikari.symmetry.operations.SymmOp(transformation, translation=array([0, 0, 0]))

Bases: object

Class storing information about symmetry operations, with clear string representation and intuitive syntax for combining / utilising operations: “=” to compare two symmetry operations for logical equivalence, “*” to combine two symmetry operations or transform a vector, “** n” to apply symmetry operation n times, “% n” to restrict symmetry operation to n unit cells. Some of the functions may work incorrectly for rhombohedral unit cells #TODO

class Type(value)

Bases: Enum

Enumerator class storing information about type of operation

identity = 3
inversion = 0
reflection = 2
rotation = 1
rotoinversion = 4
rototranslation = -1
transflection = -2
translation = -3
at(point)

Transform operation as little as possible so that its symmetry element contains “point”. To be used after “into” if used together.

Parameters

point (np.array) – Target coordinates of point which should lie in element

Returns

New symmetry operation which contains “point” in its element

Return type

SymmOp

property code
property det
Returns

determinant of 3x3 transformation part of operation’s matrix

Return type

int

extincts(hkl)

Return boolean array with truth whenever reflection should be extinct

Parameters

hkl (np.ndarray) – An array containing one hkl or multiple hkls in columns

Returns

array of booleans, where extinct reflections are marked as True

Return type

np.array

property fold: int

Number of times operation must be repeated to become identity, inversion or translation: n for n-fold axes, 2 for reflections, 1 for other (max 6)

classmethod from_code(code)

Create new symmetry operation using symmetry code “x’,y’,z’” containing transformation of each individual coordinate from x,y,z to x’,y’,z’.

Parameters

code (str) – string representing new coordinates after operation

Returns

Symmetry operation generated from given coordinate triplet code

Return type

SymmOp

classmethod from_matrix(matrix)

Create new symmetry operation using augmented 4x4 transformation matrix

Parameters

matrix (np.ndarray) – augmented 4x4 matrix

Returns

Symmetry operation generated based on augmented matrix

Return type

SymmOp

classmethod from_pair(matrix, vector)

Create new symmetry operation using point transformation 3x3 matrix and 3-length translation vector. Alias for standard creation method.

Parameters
  • matrix (np.ndarray) – 3x3 point transformation matrix

  • vector (np.ndarray) – 3-length translation vector

Returns

Symmetry operation generated based on matrix - vector pair

Return type

SymmOp

property glide: ndarray

Part of the translation vector stemming from operations’ glide

property glide_fold: int

Number of types glide component of the operation must be repeated in order to contain only integer values, eg.: 3 for “6_2”, 4 for “d”

into(direction, hexagonal=False)

Rotate operation so that its orientation changes to “direction”, while preserving fractional glide. To be used before respective “at” method. Will most likely not work for unimplemented rhombohedral unit cells.

Parameters
  • direction (np.ndarray) – Target orientation for element of symmetry operation

  • hexagonal (bool) – True if operation is defined in hexagonal coordinates

Returns

New symmetry operation whose orientation is “direction”

Return type

SymmOp

property invariants
Returns

List of directions not affected by this symmetry operation

Return type

list[np.ndarray]

property matrix
Returns

Augmented 4 x 4 transformation matrix with float-type values

Return type

np.ndarray

property name
Returns

short name of symmetry operation, eg.: “m”, “3” or “2_1”

Return type

str

property order: int

Number of times operation has to be repeated to become a translation, eg.: n for all n-fold axes, 2 for other (max 6)

property orientation
Returns

Direction of symmetry element (if can be defined) else None

Return type

Union[np.ndarray, None]

property origin: ndarray

Selected point invariant to the symmetry operation

property reciprocal
Returns

relevant symmetry operation in reciprocal hkl space

Return type

SymmOp

property sense
Returns

“+” or “-”, the “sense” of rotation, as given in ITC A, 11.1.2

Return type

str

property tf
property tl
property trace
Returns

trace of 3x3 transformation part of operation’s matrix

Return type

transform(other)

Transform a column containing rows of coordinate points

Parameters

other (np.ndarray) – A vertical numpy array of coordinate triplets kept in rows

Returns

Same-shaped array of coordinate triplets transformed by self

Return type

np.ndarray

property translational
Returns

True if operation has any glide component, False otherwise

Return type

bool

property typ
Returns

crystallographic type of this symmetry operation

Return type

SymmOp.Type

hikari.symmetry.point_groups module

Dictionary containing all known point groups written as Group along with alternative axis settings. The point groups in this dictionary can be accessed using their short Hermann-Maugin notation, as presented below.

No.

CRYSTAL SYSTEM

Hermann-Maugin notation

Schoenflies notation

Can be accessed using

1

triclinic

1

C1

PG[‘1’]

2

-1

Ci

PG[‘-1’]

3

monoclinic

2

C2

PG[‘2’]

4

m

Cs

PG[‘m’]

5

2/m

C2h

PG[‘2/m’]

6

orthorhombic

222

D2

PG[‘222’]

7

mm2

C2v

PG[‘mm2’]

8

mmm

D2h

PG[‘mmm’]

9

tetragonal

4

C4

PG[‘4’]

10

-4

S4

PG[‘-4’]

11

4/m

C4h

PG[‘4/m’]

12

422

D4

PG[‘422’]

13

4mm

C4v

PG[‘4mm’]

14

-42m

D2d

PG[‘-42m’]

-4m2

D2d

PG[‘-4m2’]

15

4/mmm

D4h

PG[‘4/mmm’]

16

trigonal

3

C3

PG[‘3’]

17

-3

C3i

PG[‘-3’]

18

321

D3

PG[‘321’]

312

D3

PG[‘312’]

19

3m1

C3v

PG[‘3m1’]

31m

C3v

PG[‘31m’]

20

-3m1

D3d

PG[‘-3m1’]

-31m

D3d

PG[‘-31m’]

21

hexagonal

6

C6

PG[‘6’]

22

-6

C3h

PG[‘-6’]

23

6/m

C6h

PG[‘6/m’]

24

622

D6

PG[‘622’]

25

6mm

C6v

PG[‘6mm’]

26

-6m2

D3h

PG[‘-6m2’]

-62m

D3h

PG[‘-62m’]

27

6/mmm

D6h

PG[‘6/mmm’]

28

cubic

23

T

PG[‘23’]

29

m-3

Th

PG[‘m-3’]

30

432

O

PG[‘432’]

31

-43m

Td

PG[‘-43m’]

32

m-3m

Oh

PG[‘m-3m’]

hikari.symmetry.space_groups module

Dictionary containing all known space groups written as Group along with alternative axis settings. The point groups in this dictionary can be accessed using their short Hermann-Maugin notation, as presented below. To access origin choice 1 or 2, append key with “#1” or “2”, eg.: SG[“Fd-3c#2”].

No.

CRYSTAL SYSTEM

Hermann-Maugin short notation

Additional notes

Can be accessed using

1

triclinic

P1

SG[‘P1’]

2

P-1

SG[‘P-1’]

3

monoclinic

P2

unique axis b

SG[‘P2’]

4

P21

unique axis b

SG[‘P21’]

5

C2

unique axis b

SG[‘C2’]

6

Pm

unique axis b

SG[‘Pm’]

7

Pc

unique axis b

SG[‘Pc’]

8

Cm

unique axis b

SG[‘Cm’]

9

Cc

unique axis b

SG[‘Cc’]

10

P2/m

unique axis b

SG[‘P2/m’]

11

P21/m

unique axis b

SG[‘P21/m’]

12

C2/m

unique axis b

SG[‘C2/m’]

13

P2/c

unique axis b

SG[‘P2/c’]

14

P21/c

unique axis b

SG[‘P21/c’]

P1121/a

z,x,y: c-unique

SG[‘P1121/a’]

15

C2/c

unique axis b

SG[‘C2/c’]

16

orthorhombic

P222

SG[‘P222’]

17

P2221

SG[‘P2221’]

18

P21212

SG[‘P21212’]

19

P212121

SG[‘P212121’]

20

C2221

SG[‘C2221’]

21

C222

SG[‘C222’]

22

F222

SG[‘F222’]

23

I222

SG[‘I222’]

24

I212121

SG[‘I212121’]

25

Pmm2

SG[‘Pmm2’]

26

Pmc21

SG[‘Pmc21’]

27

Pcc2

SG[‘Pcc2’]

28

Pma2

SG[‘Pma2’]

29

Pca21

SG[‘Pca21’]

30

Pnc2

SG[‘Pnc2’]

31

Pmn21

SG[‘Pmn21’]

32

Pba2

SG[‘Pba2’]

33

Pna21

SG[‘Pna21’]

Pn21a

x,z,-y orientation

SG[‘Pn21a’]

34

Pnn2

SG[‘Pnn2’]

35

Cmm2

SG[‘Cmm2’]

36

Cmc21

SG[‘Cmc21’]

37

Ccc2

SG[‘Ccc2’]

38

Amm2

SG[‘Amm2’]

39

Aem2

SG[‘Aem2’]

40

Ama2

SG[‘Ama2’]

41

Aea2

SG[‘Aea2’]

42

Fmm2

SG[‘Fmm2’]

43

Fdd2

SG[‘Fdd2’]

44

Imm2

SG[‘Imm2’]

45

Iba2

SG[‘Iba2’]

46

Ima2

SG[‘Ima2’]

47

Pmmm

SG[‘Pmmm’]

48

Pnnn

origin at 222

SG[‘Pnnn’]

origin at -1

SG[‘Pnnn#2’]

49

Pccm

SG[‘Pccm’]

50

Pban

origin at 222/n

SG[‘Pban’]

origin at -1

SG[‘Pban#2’]

51

Pmma

SG[‘Pmma’]

52

Pnna

SG[‘Pnna’]

53

Pmna

SG[‘Pmna’]

54

Pcca

SG[‘Pcca’]

55

Pbam

SG[‘Pbam’]

56

Pccn

SG[‘Pccn’]

57

Pbcm

SG[‘Pbcm’]

58

Pnnm

SG[‘Pnnm’]

59

Pmmn

origin at mm2/n

SG[‘Pmmn’]

origin at -1

SG[‘Pmmn#2’]

60

Pbcn

SG[‘Pbcn’]

61

Pbca

SG[‘Pbca’]

62

Pnma

SG[‘Pnma’]

63

Cmcm

SG[‘Cmcm’]

64

Cmca

SG[‘Cmca’]

65

Cmmm

SG[‘Cmmm’]

66

Cccm

SG[‘Cccm’]

67

Cmme

SG[‘Cmme’]

68

Ccce

origin at 222

SG[‘Ccce’]

origin at -1

SG[‘Ccce#2’]

69

Fmmm

SG[‘Fmmm’]

70

Fddd

origin at 222

SG[‘Fddd’]

origin at -1

SG[‘Fddd#2’]

71

Immm

SG[‘Immm’]

72

Ibam

SG[‘Ibam’]

73

Ibca

SG[‘Ibca’]

74

Imma

SG[‘Imma’]

75

tetragonal

P4

SG[‘P4’]

76

P41

SG[‘P41’]

77

P42

SG[‘P42’]

78

P43

SG[‘P43’]

79

I4

SG[‘I4’]

80

I41

SG[‘I41’]

81

P-4

SG[‘P-4’]

82

I-4

SG[‘I-4’]

83

P4/m

SG[‘P4/m’]

84

P42/m

SG[‘P42/m’]

85

P4/n

origin at -4 on n

SG[‘P4/n’]

origin at -1 on n

SG[‘P4/n#2’]

86

P42/n

origin at -4

SG[‘P42/n’]

origin at -1 on n

SG[‘P42/n#2’]

87

I4/m

SG[‘I4/m’]

88

I41/a

origin at -4

SG[‘I41/a’]

origin at -1 on b

SG[‘I41/a#2’]

89

P422

SG[‘P422’]

90

P4212

SG[‘P4212’]

91

P4122

SG[‘P4122’]

92

P41212

SG[‘P41212’]

93

P4222

SG[‘P4222’]

94

P42212

SG[‘P42212’]

95

P4322

SG[‘P4322’]

96

P43212

SG[‘P43212’]

97

I422

SG[‘I422’]

98

I4122

SG[‘I4122’]

99

P4mm

SG[‘P4mm’]

100

P4bm

SG[‘P4bm’]

101

P42cm

SG[‘P42cm’]

102

P42nm

SG[‘P42nm’]

103

P4cc

SG[‘P4cc’]

104

P4nc

SG[‘P4nc’]

105

P42mc

SG[‘P42mc’]

106

P42bc

SG[‘P42bc’]

107

I4mm

SG[‘I4mm’]

108

I4cm

SG[‘I4cm’]

109

I41md

SG[‘I41md’]

110

I41cd

SG[‘I41cd’]

111

P-42m

SG[‘P-42m’]

112

P-42c

SG[‘P-42c’]

113

P-421m

SG[‘P-421m’]

114

P-421c

SG[‘P-421c’]

115

P-4m2

SG[‘P-4m2’]

116

P-4c2

SG[‘P-4c2’]

117

P-4b2

SG[‘P-4b2’]

118

P-4n2

SG[‘P-4n2’]

119

I-4m2

SG[‘I-4m2’]

120

I-4c2

SG[‘I-4c2’]

121

I-42m

SG[‘I-42m’]

122

I-42d

SG[‘I-42d’]

123

P4/mmm

SG[‘P4/mmm’]

124

P4/mcc

SG[‘P4/mcc’]

125

P4/nbm

origin at 4/22

SG[‘P4/nbm’]

origin at 2/m

SG[‘P4/nbm#2’]

126

P4/nnc

origin at 422/n

SG[‘P4/nnc’]

origin at -1

SG[‘P4/nnc#2’]

127

P4/mbm

SG[‘P4/mbm’]

128

P4/mnc

SG[‘P4/mnc’]

129

P4/nmm

origin at -4m2

SG[‘P4/nmm’]

origin at 2/m

SG[‘P4/nmm#2’]

130

P4/ncc

origin at -4/ncn

SG[‘P4/ncc’]

origin at -1

SG[‘P4/ncc#2’]

131

P42/mmc

SG[‘P42/mmc’]

132

P42/mcm

SG[‘P42/mcm’]

133

P42/nbc

origin at -4121/c

SG[‘P42/nbc’]

origin at -1

SG[‘P42/nbc#2’]

134

P42/nnm

origin at -42m

SG[‘P42/nnm’]

origin at 2/m

SG[‘P42/nnm#2’]

135

P42/mbc

SG[‘P42/mbc’]

136

P42/mnm

SG[‘P42/mnm’]

137

P42/nmc

origin at -4m2/n

SG[‘P42/nmc’]

origin at -1

SG[‘P42/nmc#2’]

138

P42/ncm

origin at -4cg

SG[‘P42/ncm’]

origin at 2/m

SG[‘P42/ncm#2’]

139

I4/mmm

SG[‘I4/mmm’]

140

I4/mcm

SG[‘I4/mcm’]

141

I41/amd

origin at -4m2

SG[‘I41/amd’]

origin at 2/m

SG[‘I41/amd#2’]

142

I41/acd

origin at -4c21

SG[‘I41/acd’]

origin at -1

SG[‘I41/acd#2’]

143

trigonal

P3

SG[‘P3’]

144

P31

SG[‘P31’]

145

P32

SG[‘P32’]

146

R3

hexagonal axes

SG[‘R3’]

147

P-3

SG[‘P-3’]

148

R-3

hexagonal axes

SG[‘R-3’]

149

P312

SG[‘P312’]

150

P321

SG[‘P321’]

151

P3112

SG[‘P3112’]

152

P3121

SG[‘P3121’]

153

P3212

SG[‘P3212’]

154

P3221

SG[‘P3221’]

155

R32

hexagonal axes

SG[‘R32’]

156

P3m1

SG[‘P3m1’]

157

P31m

SG[‘P31m’]

158

P3c1

SG[‘P3c1’]

159

P31c

SG[‘P31c’]

160

R3m

hexagonal axes

SG[‘R3m’]

161

R3c

hexagonal axes

SG[‘R3c’]

162

P-31m

SG[‘P-31m’]

163

P-31c

SG[‘P-31c’]

164

P-3m1

SG[‘P-3m1’]

165

P-3c1

SG[‘P-3c1’]

166

R-3m

hexagonal axes

SG[‘R-3m’]

167

R-3c

hexagonal axes

SG[‘R-3c’]

168

hexagonal

P6

SG[‘P6’]

169

P61

SG[‘P61’]

170

P65

SG[‘P65’]

171

P62

SG[‘P62’]

172

P64

SG[‘P64’]

173

P63

SG[‘P63’]

174

P-6

SG[‘P-6’]

175

P6/m

SG[‘P6/m’]

176

P63/m

SG[‘P63/m’]

177

P622

SG[‘P622’]

178

P6122

SG[‘P6122’]

179

P6522

SG[‘P6522’]

180

P6222

SG[‘P6222’]

181

P6422

SG[‘P6422’]

182

P6322

SG[‘P6322’]

183

P6mm

SG[‘P6mm’]

184

P6cc

SG[‘P6cc’]

185

P63cm

SG[‘P63cm’]

186

P63mc

SG[‘P63mc’]

187

P-6m2

SG[‘P-6m2’]

188

P-6c2

SG[‘P-6c2’]

189

P-62m

SG[‘P-62m’]

190

P-62c

SG[‘P-62c’]

191

P6/mmm

SG[‘P6/mmm’]

192

P6/mcc

SG[‘P6/mcc’]

193

P63/mcm

SG[‘P63/mcm’]

194

P63/mmc

SG[‘P63/mmc’]

195

cubic

P23

SG[‘P23’]

196

F23

SG[‘F23’]

197

I23

SG[‘I23’]

198

P213

SG[‘P213’]

199

I213

SG[‘I213’]

200

Pm-3

SG[‘Pm-3’]

201

Pn-3

origin at 23

SG[‘Pn-3’]

origin at -3

SG[‘Pn-3#2’]

202

Fm-3

SG[‘Fm-3’]

203

Fd-3

origin at 23

SG[‘Fd-3’]

origin at -3

SG[‘Fd-3#2’]

204

Im-3

SG[‘Im-3’]

205

Pa-3

SG[‘Pa-3’]

206

Ia-3

SG[‘Ia-3’]

207

P432

SG[‘P432’]

208

P4232

SG[‘P4232’]

209

F432

SG[‘F432’]

210

F4132

SG[‘F4132’]

211

I432

SG[‘I432’]

212

P4332

SG[‘P4332’]

213

P4132

SG[‘P4132’]

214

I4132

SG[‘I4132’]

215

P-43m

SG[‘P-43m’]

216

F-43m

SG[‘F-43m’]

217

I-43m

SG[‘I-43m’]

218

P-43n

SG[‘P-43n’]

219

F-43c

SG[‘F-43c’]

220

I-43d

SG[‘I-43d’]

221

Pm-3m

SG[‘Pm-3m’]

222

Pn-3n

origin at 432

SG[‘Pn-3n’]

origin at -3

SG[‘Pn-3n#2’]

223

Pm-3n

SG[‘Pm-3n’]

224

Pn-3m

origin at -43m

SG[‘Pn-3m’]

origin at -3m

SG[‘Pn-3m#2’]

225

Fm-3m

SG[‘Fm-3m’]

226

Fm-3c

SG[‘Fm-3c’]

227

Fd-3m

origin at -43m

SG[‘Fd-3m’]

origin at -3m

SG[‘Fd-3m#2’]

228

Fd-3c

origin at 23

SG[‘Fd-3c’]

origin at -3

SG[‘Fd-3c#2’]

229

Im-3m

SG[‘Im-3m’]

230

Ia-3d

SG[‘Ia-3d’]

Module contents

Module containing symmetry operations and point groups to be used by other objects.