{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting fermi3d spin-polarized\n\nSymmetry does not currently work! Make sure for fermi surface calculations turn off symmetry\n\nPlotting fermi3d spin-polarized example.\n\nFirst download the example files with the code below. Then replace data_dir below.\n\n.. code-block::\n   :caption: Downloading example\n\n    data_dir = pyprocar.download_example(save_dir='', \n                                material='Fe',\n                                code='vasp', \n                                spin_calc_type='spin-polarized-colinear',\n                                calc_type='fermi')\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# sphinx_gallery_thumbnail_number = 2"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import pyvista\n\n# You do not need this. This is to ensure an image is rendered off screen when generating exmaple gallery.\npyvista.OFF_SCREEN = True"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "importing pyprocar and specifying local data_dir\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nimport pyprocar\n\ndata_dir = os.path.join(\n    pyprocar.utils.DATA_DIR,\n    \"examples\",\n    \"Fe\",\n    \"vasp\",\n    \"spin-polarized-colinear\",\n    \"fermi\",\n)\n\n\n# First create the FermiHandler object, this loads the data into memory. Then you can call class methods to plot\n# Symmetry only works for specfic space groups currently.\n# For the actual calculations turn off symmetry and set 'apply_symmetry'=False\nfermiHandler = pyprocar.FermiHandler(code=\"vasp\", dirname=data_dir, apply_symmetry=True)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Plain mode\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# spins in spins polarized calculations specifies which energy bands to plot\nspins = [0, 1]\n\nfermiHandler.plot_fermi_surface(\n    mode=\"plain\",\n    spins=spins,\n    spin_colors=[\"red\", \"blue\"],\n    surface_cmap=\"jet\",\n    show=True,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Parametric mode\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# Here you can look at the atomic projections on a given spin energy bands\natoms = [0]\norbitals = [4, 5, 6, 7, 8]\nspins = [1]\nfermiHandler.plot_fermi_surface(\n    mode=\"parametric\",\n    atoms=atoms,\n    orbitals=orbitals,\n    spins=spins,\n    show=True,\n)\n\n\n# Here you can look at the atomic projections on a given spin energy bands\nspins = [0]\nfermiHandler.plot_fermi_surface(\n    mode=\"parametric\",\n    atoms=atoms,\n    orbitals=orbitals,\n    spins=spins,\n    show=True,\n)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.9.20"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}