.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "user-guide/usage/visualization/plot_4_wigner-seitz.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_4_wigner-seitz.py: ***************** Wigner-Seitz cell ***************** This page explains how to plot Wigner-Seitz cell of the direct lattice and Brillouin zone. We use FCC cell as an example. .. GENERATED FROM PYTHON SOURCE LINES 30-36 .. code-block:: Python import wulfric cell = wulfric.cell.SC_FCC(a=3) .. GENERATED FROM PYTHON SOURCE LINES 37-39 When wulfric plots |Wigner-Seitz|_ cell for any given ``cell``, it assumes that ``cell`` contains exactly one lattice point. .. GENERATED FROM PYTHON SOURCE LINES 39-49 .. code-block:: Python pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_cell(cell=cell, legend_label="Original cell") pe.plot_wigner_seitz_cell( cell=cell, plot_vectors=False, color="green", legend_label="Wigner-Seitz cell" ) pe.show() .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 50-54 Brillouin zone ============== Brillouin zone is simply a |Wigner-Seitz|_ cell of the reciprocal ``cell``. Therefore, Brillouin zone can be plotted in two equivalent ways. .. GENERATED FROM PYTHON SOURCE LINES 54-72 .. code-block:: Python rcell = wulfric.cell.get_reciprocal(cell=cell) pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) # Brillouin zone from direct cell pe.plot_brillouin_zone(cell=cell, legend_label="Brillouin zone: method 1", color="red") # Brillouin zone from reciprocal cell pe.plot_wigner_seitz_cell( cell=rcell, legend_label="Brillouin zone: method 2", color="blue", shift=(-6, 0, 0), vector_label="b", ) pe.show() .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 73-78 Other Brillouin zones ===================== By default wulfric plots first Brillouin zone. If you need to plot other ones, use ``shift``. .. GENERATED FROM PYTHON SOURCE LINES 78-102 .. code-block:: Python pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_brillouin_zone(cell=cell, legend_label="First Brillouin zone", color="green") # Compute shift along the first reciprocal lattice vector in absolute coordinates shift = (1, 0, 0) @ rcell pe.plot_brillouin_zone( cell=cell, legend_label="Second Brillouin zone along +b1", color="red", shift=shift, plot_vectors=False, ) pe.plot_brillouin_zone( cell=cell, legend_label="Second Brillouin zone along -b1", color="blue", shift=-shift, plot_vectors=False, ) pe.show() .. raw:: html


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