
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples\04-fermi3d\plot_fermi3d_spin-polarized.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_fermi3d_spin-polarized.py>`
        to download the full example code.

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

.. _sphx_glr_examples_04-fermi3d_plot_fermi3d_spin-polarized.py:


.. _ref_plotting_fermi3d_spin-polarized:

Plotting fermi3d spin-polarized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Plotting fermi3d spin-polarized example.

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='Fe',
                                code='vasp', 
                                spin_calc_type='spin-polarized-colinear',
                                calc_type='fermi')

.. GENERATED FROM PYTHON SOURCE LINES 23-25

.. code-block:: Python

    # sphinx_gallery_thumbnail_number = 2








.. GENERATED FROM PYTHON SOURCE LINES 26-31

.. 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 32-33

importing pyprocar and specifying local data_dir

.. GENERATED FROM PYTHON SOURCE LINES 33-49

.. code-block:: Python


    import os
    import pyprocar

    data_dir = f"{pyprocar.utils.ROOT}{os.sep}data{os.sep}examples{os.sep}Fe{os.sep}vasp{os.sep}spin-polarized-colinear{os.sep}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

    C:\Users\lllang\miniconda3\envs\pyprocar_dev\lib\site-packages\spglib\spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['wyckoffs']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead
      warnings.warn(

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




.. GENERATED FROM PYTHON SOURCE LINES 50-54

Plain mode
+++++++++++++++++++++++++++++++++++++++



.. GENERATED FROM PYTHON SOURCE LINES 54-66

.. code-block:: Python


    # spins in spins polarized calculations specifies which energy bands to plot
    spins =[0,1]

    fermiHandler.plot_fermi_surface(mode="plain",
                                    spins = spins,
                                    spin_colors= ['red','blue'],
                                    surface_cmap="jet",
                                    show=True,)






.. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_001.png
   :alt: plot fermi3d spin polarized
   :srcset: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_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




.. GENERATED FROM PYTHON SOURCE LINES 67-71

Parametric mode
+++++++++++++++++++++++++++++++++++++++



.. GENERATED FROM PYTHON SOURCE LINES 71-92

.. code-block:: Python


    # Here you can look at the atomic projections on a given spin energy bands
    atoms=[0]
    orbitals=[4,5,6,7,8]
    spins=[1]
    fermiHandler.plot_fermi_surface(mode="parametric",
                                  atoms=atoms,
                                  orbitals=orbitals,
                                  spins=spins,
                                  show=True,)


    # Here you can look at the atomic projections on a given spin energy bands
    spins=[0]
    fermiHandler.plot_fermi_surface(mode="parametric",
                                  atoms=atoms,
                                  orbitals=orbitals,
                                  spins=spins,
                                  show=True,)





.. rst-class:: sphx-glr-horizontal


    *

      .. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_002.png
          :alt: plot fermi3d spin polarized
          :srcset: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_002.png
          :class: sphx-glr-multi-img

    *

      .. image-sg:: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_003.png
          :alt: plot fermi3d spin polarized
          :srcset: /examples/04-fermi3d/images/sphx_glr_plot_fermi3d_spin-polarized_003.png
          :class: sphx-glr-multi-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
                    --------------------------------------------------------
                

                    --------------------------------------------------------
                    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
                    --------------------------------------------------------
                





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

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


.. _sphx_glr_download_examples_04-fermi3d_plot_fermi3d_spin-polarized.py:

.. only:: html

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

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

      :download:`Download Jupyter notebook: plot_fermi3d_spin-polarized.ipynb <plot_fermi3d_spin-polarized.ipynb>`

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

      :download:`Download Python source code: plot_fermi3d_spin-polarized.py <plot_fermi3d_spin-polarized.py>`

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

      :download:`Download zipped: plot_fermi3d_spin-polarized.zip <plot_fermi3d_spin-polarized.zip>`


.. only:: html

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

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