{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting fermi3d spin_texture\n\nSymmetry does not currently work! Make sure for fermi surface calculations turn off symmetry\n\nPlotting fermi3d spin_texture 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='non-colinear',\n                                calc_type='fermi')\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# sphinx_gallery_thumbnail_number = 1"
      ]
    },
    {
      "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, \"examples\", \"Fe\", \"vasp\", \"non-colinear\", \"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": [
        "## Spin Texture mode\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fermiHandler.plot_fermi_surface(\n    mode=\"spin_texture\",\n    spin_texture=True,\n    supercell=[2, 2, 2],\n    texture_size=0.2,\n    show=True,\n    max_distance=0.3,  # This parameter controls the max distance to search for adjacent points for interpolation.\n    # Lowering could speed the ploting, but too low could make the interpolation fail\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
}