{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Example of kmesh_generator \n\nThis utility can be used to generate a 2D $k$-mesh centered at a given $k$-point and in a given $k$-plane. \nThis is particularly useful in computing 2D spin-textures and plotting 2D Fermi-surfaces. \nFor example, the following command creates a 2D $k_{x}$-$k_{y}$ -mesh centered at the $\\Gamma$ point ($k_{z}= 0$) \nranging from coordinates (-0.5, -0.5, 0.0) to (0.5, 0.5, 0.0) with 5 grids in the x direction and 7 grids in the y direction\n\n.. code-block::\n   :caption: General Format\n\n   pyprocar.generate2dkmesh(x1,y1,x2,y2,z,num_grids_x,num_grids_y)\n\nThis information is automatically written to a KPOINTS file.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# sphinx_gallery_thumbnail_number = 1"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Plotting Kmesh\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import pyvista\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\nimport pyprocar\n\nkpoints = pyprocar.generate2dkmesh(-0.5,-0.5,0.5,0.5,0,5,7)\n\nplotter=pyvista.Plotter()\nplotter.add_mesh(kpoints, color='blue', render_points_as_spheres=True, point_size=20)\nplotter.show_axes()\nplotter.show_grid()\nplotter.show()"
      ]
    }
  ],
  "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
}