{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting density of states\n\nPlotting density 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='SrVO3',\n                                code='vasp', \n                                spin_calc_type='non-spin-polarized',\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\", \"SrVO3\", \"vasp\", \"non-spin-polarized\", \"fermi\"\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Plain mode\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "pyprocar.dosplot(code=\"vasp\", mode=\"plain\", fermi=5.3017, dirname=data_dir)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Parametric mode\n\nFor details on the meaning of the indices of the atomic projection please refer to the user guide :ref:'atomic_projections'\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "atoms = [0, 1, 2, 3, 4]\norbitals = [4, 5, 6, 7, 8]\nspins = [0]\n\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"parametric\",\n    fermi=5.3017,\n    atoms=atoms,\n    orbitals=orbitals,\n    clim=[0, 1],\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## parametric_line mode\n\nFor details on the meaning of the indices of the atomic projection please refer to the user guide :ref:'atomic_projections'\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "atoms = [0, 1, 2, 3, 4]\norbitals = [4, 5, 6, 7, 8]\nspins = [0]\n\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"parametric_line\",\n    fermi=5.3017,\n    atoms=atoms,\n    orbitals=orbitals,\n    clim=[0, 1],\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## stack_species mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "orbitals = [4, 5, 6, 7, 8]\nspins = [0]\n\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"stack_species\",\n    fermi=5.3017,\n    orbitals=orbitals,\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## stack_orbtials mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "atoms = [2, 3, 4]\nspins = [0]\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"stack_orbitals\",\n    fermi=5.3017,\n    atoms=atoms,\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## stack mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "items = dict(Sr=[0], O=[1, 2, 3], V=[4, 5, 6, 7, 8])\npyprocar.dosplot(code=\"vasp\", mode=\"stack\", fermi=5.3017, items=items, dirname=data_dir)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## overlay_species mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "orbitals = [4, 5, 6, 7, 8]\nspins = [0]\n\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"overlay_species\",\n    fermi=5.3017,\n    orbitals=orbitals,\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## overlay_orbtials mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "atoms = [0]\nspins = [0]\npyprocar.dosplot(\n    code=\"vasp\",\n    mode=\"overlay_orbitals\",\n    fermi=5.3017,\n    atoms=atoms,\n    spins=spins,\n    dirname=data_dir,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## overlay mode\n\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "items = dict(Sr=[0], O=[1, 2, 3], V=[4, 5, 6, 7, 8])\npyprocar.dosplot(\n    code=\"vasp\", mode=\"overlay\", fermi=5.3017, items=items, 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
}