
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples\04-fermi3d\plot_de_hass_van_alphen.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_04-fermi3d_plot_de_hass_van_alphen.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_04-fermi3d_plot_de_hass_van_alphen.py:


.. _ref_plotting_de_hass_van_alphen:

Showing how to get van alphen fequencies from the fermi surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Symmetry does not currently work! Make sure for fermi surface calculations turn off symmetry

Van alphen fequencies example. De has van alphen frequencies (F) in terms of extremal fermi surface areas (A) is given below.
To compare the theoretical freuqencies we will compare with the results taken from the experimental paper
"The Fermi surfaces of copper, silver and gold. I. The de Haas-Van alphen effect"(https://doi.org/10.1098/rsta.1962.0011).


.. math::

   F = \frac{ c \hbar A }{ 2 \pi e  }   !(cgs)

   e = 4.768e^{-10} !statcoulombs

   c = 3.0e^{10} !cm/s

   \hbar = 1.0546e^{-27} !erg*s

First download the example files with the code below. Then replace data_dir below.

.. code-block::
   :caption: Downloading example

    data_dir = pyprocar.download_example(save_dir='', 
                                material='Au',
                                code='vasp', 
                                spin_calc_type='non-spin-polarized',
                                calc_type='fermi')

.. GENERATED FROM PYTHON SOURCE LINES 36-39

.. code-block:: Python


    # sphinx_gallery_thumbnail_number = 1








.. GENERATED FROM PYTHON SOURCE LINES 40-46

.. code-block:: Python


    import pyvista

    # You do not need this. This is to ensure an image is rendered off screen when generating exmaple gallery.
    pyvista.OFF_SCREEN = True








.. GENERATED FROM PYTHON SOURCE LINES 47-48

importing pyprocar and specifying local data_dir

.. GENERATED FROM PYTHON SOURCE LINES 48-63

.. code-block:: Python


    import os

    import pyprocar

    data_dir = os.path.join(
        pyprocar.utils.DATA_DIR, "examples", "Au", "vasp", "non-spin-polarized", "fermi"
    )

    # First create the FermiHandler object, this loads the data into memory. Then you can call class methods to plot
    # Symmetry only works for specfic space groups currently.
    # For the actual calculations turn off symmetry and set 'apply_symmetry'=False
    fermiHandler = pyprocar.FermiHandler(code="vasp", dirname=data_dir, apply_symmetry=True)






.. rst-class:: sphx-glr-script-out

 .. code-block:: none


                    WARNING : Fermi Energy not set! Set `fermi={value}`. By default, using fermi energy found in given directory.
                    ---------------------------------------------------------------------------------------------------------------
                




.. GENERATED FROM PYTHON SOURCE LINES 64-67

Maximal cross sectional area along the (0,0,1)
++++++++++++++++++++++++++++++++++++++++++++++++++


.. GENERATED FROM PYTHON SOURCE LINES 67-78

.. code-block:: Python



    fermiHandler.plot_fermi_cross_section_box_widget(
        bands=[5],
        slice_normal=(0, 0, 1),
        slice_origin=(0, 0, 0),
        surface_opacity=0.40,
        mode="parametric",
        show=True,
    )




.. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_001.png
   :alt: plot de hass van alphen
   :srcset: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_001.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


                    --------------------------------------------------------
                    There are additional plot options that are defined in a configuration file. 
                    You can change these configurations by passing the keyword argument to the function
                    To print a list of plot options set print_plot_opts=True

                    Here is a list modes : plain , parametric , spin_texture , overlay
                    Here is a list of properties: fermi_speed , fermi_velocity , harmonic_effective_mass
                    --------------------------------------------------------
                
    ij,uvwabj->uvwabi
    Bands being used if bands=None:  {0: 0}




.. GENERATED FROM PYTHON SOURCE LINES 79-84

In the above figure we can see the cross section area is :math:`A = 4.1586 Ang^{-2} = 4.1586e^{16} cm^{-2} (cgs)`.

:math:`F = \frac{ c \hbar A }{ 2 \pi e  } = 4.365e^8 G`

:math:`F_{exp} = 4.50e^7 G`

.. GENERATED FROM PYTHON SOURCE LINES 86-90

Minimal cross sectional area along the (0,0,1)
++++++++++++++++++++++++++++++++++++++++++++++++++



.. GENERATED FROM PYTHON SOURCE LINES 90-100

.. code-block:: Python


    fermiHandler.plot_fermi_cross_section_box_widget(
        bands=[5],
        slice_normal=(0, 0, 1),
        slice_origin=(0, 0, 1.25),
        surface_opacity=0.40,
        mode="parametric",
        show=True,
    )




.. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_002.png
   :alt: plot de hass van alphen
   :srcset: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_002.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


                    --------------------------------------------------------
                    There are additional plot options that are defined in a configuration file. 
                    You can change these configurations by passing the keyword argument to the function
                    To print a list of plot options set print_plot_opts=True

                    Here is a list modes : plain , parametric , spin_texture , overlay
                    Here is a list of properties: fermi_speed , fermi_velocity , harmonic_effective_mass
                    --------------------------------------------------------
                
    Bands being used if bands=None:  {0: 0}




.. GENERATED FROM PYTHON SOURCE LINES 101-107

In the above figure we can see the cross section area is :math:`A = 0.1596 Ang^{-2} = 0.1596e^{16} cm^{-2} (cgs)`.

:math:`F = \frac{ c \hbar A }{ 2 \pi e  } = 1.68e^7 G`

:math:`F_{exp} = 1.50e^7 G`


.. GENERATED FROM PYTHON SOURCE LINES 109-113

Extremal cross sectional area along the (0,1,1)
++++++++++++++++++++++++++++++++++++++++++++++++++



.. GENERATED FROM PYTHON SOURCE LINES 113-124

.. code-block:: Python


    fermiHandler.plot_fermi_cross_section_box_widget(
        bands=[5],
        slice_normal=(0, 1, 1),
        slice_origin=(0, 0, 0),
        surface_opacity=0.40,
        mode="parametric",
        show=True,
    )





.. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_003.png
   :alt: plot de hass van alphen
   :srcset: /examples/04-fermi3d/images/sphx_glr_plot_de_hass_van_alphen_003.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


                    --------------------------------------------------------
                    There are additional plot options that are defined in a configuration file. 
                    You can change these configurations by passing the keyword argument to the function
                    To print a list of plot options set print_plot_opts=True

                    Here is a list modes : plain , parametric , spin_texture , overlay
                    Here is a list of properties: fermi_speed , fermi_velocity , harmonic_effective_mass
                    --------------------------------------------------------
                
    Bands being used if bands=None:  {0: 0}




.. GENERATED FROM PYTHON SOURCE LINES 125-130

In the above figure we can see the cross section area is :math:`A = 4.3956 Ang^{-2} = 4.3956e^{16} cm^{-2} (cgs)`.

:math:`F = \frac{ c \hbar A }{ 2 \pi e  } = 4.61e^8 G`

:math:`F_{exp} = 4.85e^8 G`


.. rst-class:: sphx-glr-timing

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


.. _sphx_glr_download_examples_04-fermi3d_plot_de_hass_van_alphen.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_de_hass_van_alphen.ipynb <plot_de_hass_van_alphen.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_de_hass_van_alphen.py <plot_de_hass_van_alphen.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: plot_de_hass_van_alphen.zip <plot_de_hass_van_alphen.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
