.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/symmetry/create_symmetry.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_symmetry_create_symmetry.py: ======================= Create crystal symmetry ======================= This example shows various ways to obtain a :class:`~orix.quaternion.symmetry.Symmetry`. .. GENERATED FROM PYTHON SOURCE LINES 29-31 The simplest way is to import pre-defined point groups. They are named after the Schoenflies notation and can be imported directly .. GENERATED FROM PYTHON SOURCE LINES 31-37 .. code-block:: Python from orix.quaternion.symmetry import D6h, Oh print(Oh) # m-3m in international/Hermann-Mauguin notation print(D6h) # 6/mmm .. rst-class:: sphx-glr-script-out .. code-block:: none 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. ]] .. GENERATED FROM PYTHON SOURCE LINES 38-42 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) .. GENERATED FROM PYTHON SOURCE LINES 42-47 .. code-block:: Python from orix.quaternion.symmetry import C2x, C2z, Csx, Csz, Symmetry C2v_x = Symmetry.from_generators(C2x, Csz) C2v_z = Symmetry.from_generators(C2z, Csx) .. GENERATED FROM PYTHON SOURCE LINES 48-49 Notice the different symmetrically equivalent directions .. GENERATED FROM PYTHON SOURCE LINES 49-55 .. code-block:: Python from orix.vector import Vector3d v = Vector3d([1.0, 1, 1]) print(C2v_x * v) print(C2v_z * v) .. rst-class:: sphx-glr-script-out .. code-block:: none 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.]] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.609 seconds) **Estimated memory usage:** 548 MB .. _sphx_glr_download_examples_symmetry_create_symmetry.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: create_symmetry.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: create_symmetry.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: create_symmetry.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_