.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "user-guide/usage/visualization/plot_6_kpath.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_user-guide_usage_visualization_plot_6_kpath.py: ******************* K-path and k-points ******************* This page explains how to plot a set of atoms. .. GENERATED FROM PYTHON SOURCE LINES 29-59 .. code-block:: Python import wulfric import numpy as np cell = np.array( [ [5.64, 0.00, 0.00], [0.00, 5.64, 0.00], [0.00, 0.00, 5.64], ] ) atoms = { "names": ["Cl1", "Cl2", "Cl3", "Cl4", "Na1", "Na2", "Na3", "Na4"], "positions": np.array( [ (0, 0, 0), (1 / 2, 1 / 2, 0), (1 / 2, 0, 1 / 2), (0, 1 / 2, 1 / 2), (1 / 2, 1 / 2, 1 / 2), (1 / 2, 0, 0), (0, 1 / 2, 0), (0, 0, 1 / 2), ] ), } spglib_data = wulfric.get_spglib_data(cell, atoms) .. GENERATED FROM PYTHON SOURCE LINES 60-62 Best way to interact with high-symmetry points and k-path is trough the :py:class:`wulfric.Kpoints`. First, we create one .. GENERATED FROM PYTHON SOURCE LINES 62-67 .. code-block:: Python kp = wulfric.Kpoints.from_crystal( cell, atoms, spglib_data=spglib_data, convention="HPKOT" ) .. GENERATED FROM PYTHON SOURCE LINES 68-69 Now one can check the recommended k-path and pre-defined high-symmetry points .. GENERATED FROM PYTHON SOURCE LINES 69-74 .. code-block:: Python print(kp.path_string) print(kp.hs_table()) .. rst-class:: sphx-glr-script-out .. code-block:: none GAMMA-X-U|K-GAMMA-L-W-X Name rel_b1 rel_b2 rel_b3 k_x k_y k_z GAMMA 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 X 0.00000000 1.00000000 0.00000000 0.00000000 1.11403995 0.00000000 L 0.50000000 0.50000000 0.50000000 0.55701997 0.55701997 0.55701997 W 0.50000000 1.00000000 -0.00000000 0.55701997 1.11403995 -0.00000000 W2 0.00000000 1.00000000 0.50000000 0.00000000 1.11403995 0.55701997 K 0.75000000 0.75000000 -0.00000000 0.83552996 0.83552996 -0.00000000 U 0.25000000 1.00000000 0.25000000 0.27850999 1.11403995 0.27850999 .. GENERATED FROM PYTHON SOURCE LINES 75-79 High-symmetry points are given by relative coordinates with respect to the reciprocal cell of the original cell. However, the points correspond to the Brillouin zone of the **primitive** cell, which may or may not be the one that have k-path and high symmetry points lying on its edges .. GENERATED FROM PYTHON SOURCE LINES 79-97 .. code-block:: Python prim_cell, _ = wulfric.crystal.get_primitive(cell, atoms, spglib_data=spglib_data) pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_brillouin_zone( cell=prim_cell, color="red", legend_label="Brillouin zone of primitive cell" ) pe.plot_kpath(kp=kp, legend_label="K-path") pe.plot_kpoints(kp=kp, legend_label="K-points") pe.plot_brillouin_zone( cell=cell, color="chocolate", legend_label="Brillouin zone of original cell" ) pe.show() .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.133 seconds) .. _sphx_glr_download_user-guide_usage_visualization_plot_6_kpath.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_6_kpath.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_6_kpath.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_6_kpath.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_