{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.chdir(\"siesta_2\")\n", "import numpy as np\n", "import sisl as si\n", "import matplotlib.pyplot as plt\n", "\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Siesta --- graphene\n", "\n", "This tutorial will describe a complete walk-through of a large fraction of the `sisl` functionalities that may be related to the [Siesta code](https://gitlab.com/siesta-project/siesta).\n", "\n", "Contrary to the $\\mathrm H_2\\mathrm O$ system this tutorial will emphasize the usefulness of performing bandstructures etc. directly in Python using sisl.\n", "\n", "## Creating the geometry\n", "\n", "Our system of interest will be the smallest graphene cell. Instead of defining the atomic positions, the carbon atoms and supercell for graphene, we use a default implementation of graphene in `sisl`. There are a small selection of the typical geometries, including graphene." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "graphene = si.geom.graphene(1.44)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us plot the geometry." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "graphene.plot(axes=\"xy\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we need to create the input fdf file for Siesta:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "open(\"RUN.fdf\", \"w\").write(\n", " \"\"\"%include STRUCT.fdf\n", "SystemLabel siesta_2\n", "PAO.BasisSize SZP\n", "MeshCutoff 250. Ry\n", "CDF.Save true\n", "CDF.Compress 9\n", "SaveHS true\n", "SaveRho true\n", "%block kgrid.MonkhorstPack\n", " 61 1 1 0.\n", " 1 61 1 0.\n", " 0 0 1 0.\n", "%endblock\n", "\"\"\"\n", ")\n", "graphene.write(\"STRUCT.fdf\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating the electronic structure\n", "\n", "Before proceeding, run Siesta to calculate the ground state electronic structure.\n", "\n", "After having completed the Siesta run we may read the Hamiltonian to manipulate and extract different information.\n", "After reading the Hamiltonian it is obvious that a great deal of new data has been associated with the Hamiltonian." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fdf = si.get_sile(\"RUN.fdf\")\n", "H = fdf.read_hamiltonian()\n", "print(H)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Calculating DOS and PDOS\n", "\n", "When we are dealing with periodic structures (such as graphene) it is imperative to calculate the density of states in a simple and efficient manner. Below we will calculate the DOS for a variety of Monkhorst-Pack grids to check the convergence of the DOS (it shouldn't take more than a minute):\n", "\n", "
Warning
\n", "\n", " This tutorial cannot fully converge the $k$-points. Please do the final convergence your self.\n", " You'll see little change after $\\approx 60$.\n", "