{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting fermi2d noncolinear\n\nPlotting fermi2d noncolinear example. For more information about fermi2d refer to `fermi2d`\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": "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)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Spin Texture Projection\n\nBy setting spin_texture to be true, You can plot the arrows for the spin textures.\nBy default the projected values of the arrows will be s_z.\nBut you can change this by setting arrow_projection to one of the following\n'x','y','z','x^2','y^2','z^2'\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "pyprocar.fermi2D(\n    code=\"vasp\",\n    dirname=data_dir,\n    fermi=5.5962,\n    spin_texture=True,\n    spin_projection=\"x\",\n    arrow_size=3,\n    arrow_density=10,\n    plot_color_bar=True,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Spin Texture single color\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "pyprocar.fermi2D(\n    code=\"vasp\",\n    dirname=data_dir,\n    fermi=5.5962,\n    spin_texture=True,\n    arrow_color=\"blue\",\n    arrow_size=3,\n    arrow_density=10,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Selecting band indices\n\nYou can specify specfic bands with the band indices keyword.\nband_indices will be a list of list that contain band indices. Below I only plot bands 14,15\nAlso you can specify the colors of the bands as well with band_colors\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "band_indices = [[6, 7]]\nband_colors = [[\"blue\", \"red\"]]\npyprocar.fermi2D(\n    code=\"vasp\",\n    mode=\"plain_bands\",\n    fermi=5.5962,\n    band_indices=band_indices,\n    band_colors=band_colors,\n    spin_texture=True,\n    arrow_size=3,\n    arrow_density=10,\n    dirname=data_dir,\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
}