Create crystal symmetry#

This example shows various ways to obtain a Symmetry.

The simplest way is to import pre-defined point groups. They are named after the Schoenflies notation and can be imported directly

from orix.quaternion.symmetry import D6h, Oh

print(Oh)  # m-3m in international/Hermann-Mauguin notation

print(D6h)  # 6/mmm
Symmetry (48,) m-3m
[[ 1.      0.      0.      0.    ]
 [ 0.7071  0.      0.      0.7071]
 [ 0.      0.      0.      1.    ]
 [-0.7071  0.      0.      0.7071]
 [ 0.5     0.5     0.5     0.5   ]
 [ 0.      0.      0.7071  0.7071]
 [-0.5    -0.5     0.5     0.5   ]
 [-0.7071 -0.7071  0.      0.    ]
 [ 0.      1.      0.      0.    ]
 [ 0.      0.7071  0.7071  0.    ]
 [ 0.      0.      1.      0.    ]
 [ 0.     -0.7071  0.7071  0.    ]
 [-0.5     0.5     0.5    -0.5   ]
 [ 0.      0.      0.7071 -0.7071]
 [ 0.5    -0.5     0.5    -0.5   ]
 [ 0.7071 -0.7071  0.      0.    ]
 [ 0.      0.7071  0.      0.7071]
 [-0.5     0.5     0.5     0.5   ]
 [-0.7071  0.      0.7071  0.    ]
 [-0.5    -0.5     0.5    -0.5   ]
 [ 0.      0.7071  0.     -0.7071]
 [ 0.5     0.5     0.5    -0.5   ]
 [ 0.7071  0.      0.7071  0.    ]
 [ 0.5    -0.5     0.5     0.5   ]
 [ 1.      0.      0.      0.    ]
 [ 0.7071  0.      0.      0.7071]
 [ 0.      0.      0.      1.    ]
 [-0.7071  0.      0.      0.7071]
 [ 0.5     0.5     0.5     0.5   ]
 [ 0.      0.      0.7071  0.7071]
 [-0.5    -0.5     0.5     0.5   ]
 [-0.7071 -0.7071  0.      0.    ]
 [ 0.      1.      0.      0.    ]
 [ 0.      0.7071  0.7071  0.    ]
 [ 0.      0.      1.      0.    ]
 [ 0.     -0.7071  0.7071  0.    ]
 [-0.5     0.5     0.5    -0.5   ]
 [ 0.      0.      0.7071 -0.7071]
 [ 0.5    -0.5     0.5    -0.5   ]
 [ 0.7071 -0.7071  0.      0.    ]
 [ 0.      0.7071  0.      0.7071]
 [-0.5     0.5     0.5     0.5   ]
 [-0.7071  0.      0.7071  0.    ]
 [-0.5    -0.5     0.5    -0.5   ]
 [ 0.      0.7071  0.     -0.7071]
 [ 0.5     0.5     0.5    -0.5   ]
 [ 0.7071  0.      0.7071  0.    ]
 [ 0.5    -0.5     0.5     0.5   ]]
Symmetry (24,) 6/mmm
[[ 1.     0.     0.     0.   ]
 [ 0.5    0.     0.     0.866]
 [-0.5    0.     0.     0.866]
 [ 0.     0.     0.     1.   ]
 [-0.866  0.     0.     0.5  ]
 [-0.866  0.     0.    -0.5  ]
 [ 0.     1.     0.     0.   ]
 [ 0.     0.5    0.866  0.   ]
 [ 0.    -0.5    0.866  0.   ]
 [ 0.     0.     1.     0.   ]
 [ 0.    -0.866  0.5    0.   ]
 [ 0.    -0.866 -0.5    0.   ]
 [ 0.     0.     0.     1.   ]
 [-0.866  0.     0.     0.5  ]
 [-0.866  0.     0.    -0.5  ]
 [-1.     0.     0.     0.   ]
 [-0.5    0.     0.    -0.866]
 [ 0.5    0.     0.    -0.866]
 [ 0.     0.    -1.     0.   ]
 [ 0.     0.866 -0.5    0.   ]
 [ 0.     0.866  0.5    0.   ]
 [ 0.     1.     0.     0.   ]
 [ 0.     0.5    0.866  0.   ]
 [ 0.    -0.5    0.866  0.   ]]

If one wanted to, one can also combine two point groups to get a third. Here’re two versions of the orthorhombic point group mm2 (C2v) with the 2-fold axis about different axes (importing C2v directly gives the group with the axis about z)

from orix.quaternion.symmetry import C2x, C2z, Csx, Csz, Symmetry

C2v_x = Symmetry.from_generators(C2x, Csz)
C2v_z = Symmetry.from_generators(C2z, Csx)

Notice the different symmetrically equivalent directions

from orix.vector import Vector3d

v = Vector3d([1.0, 1, 1])

print(C2v_x * v)
print(C2v_z * v)
Vector3d (4,)
[[ 1.  1.  1.]
 [ 1. -1. -1.]
 [ 1.  1. -1.]
 [ 1. -1.  1.]]
Vector3d (4,)
[[ 1.  1.  1.]
 [-1. -1.  1.]
 [-1.  1.  1.]
 [ 1. -1.  1.]]

Total running time of the script: (0 minutes 0.609 seconds)

Estimated memory usage: 548 MB

Gallery generated by Sphinx-Gallery