{ "cells": [ { "cell_type": "markdown", "id": "ac667a88", "metadata": {}, "source": [ "# Tight-binding model of graphene\n", "\n", "This tutorial aims at introducing the tight-binding functionalities available in PyBigDFT. The TB module currently enables to: \n", "- define the geometry of a given system\n", "- extract the corresponding matrix elements from a linear-scaling calculation\n", "- compute the subsequent band structure\n", "\n", "In a nutshell, a comparison is performed between a sub-system (sys_cs) and a supercell (sys_ls) on which a LS run was carried out. This process depends on the local electronic environment, thus enabling to probe the variation due to defects in a solid-state system. " ] }, { "cell_type": "code", "execution_count": 1, "id": "c7409ba4", "metadata": {}, "outputs": [], "source": [ "from BigDFT import Systems, Fragments, Logfiles, TB\n", "from BigDFT.PostProcessing import BigDFTool\n", "from BigDFT.Spillage import MatrixMetadata" ] }, { "cell_type": "code", "execution_count": 2, "id": "2976679d", "metadata": {}, "outputs": [], "source": [ "from matplotlib import cm\n", "from matplotlib import pyplot as plt\n", "from matplotlib.colors import LogNorm, Normalize" ] }, { "cell_type": "code", "execution_count": 3, "id": "723bdcce", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5\n", " warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n" ] } ], "source": [ "import numpy as np\n", "from scipy.constants import value\n", "\n", "sq3 = np.sqrt(3)\n", "Ha2eV = value('Hartree energy in eV') # (A)" ] }, { "cell_type": "markdown", "id": "554634e5", "metadata": {}, "source": [ "## Geometry definition\n", "\n", "Importantly, consistency is required between both systems lattice constants, so that geometrical correspondence can be established. " ] }, { "cell_type": "code", "execution_count": 4, "id": "d5ef1eec", "metadata": {}, "outputs": [], "source": [ "a0 = 2.5 # lattice parameter\n", "name = 'gr_scell' # supercell label " ] }, { "cell_type": "markdown", "id": "e89a33fc", "metadata": {}, "source": [ "Definition of the primitive and conventional cells of an hexagonal lattice. The primitive cell is used to browse the TB workflow, while the conventional one is employed for the recap at the end of this tutorial. " ] }, { "cell_type": "code", "execution_count": 5, "id": "f73af1aa", "metadata": {}, "outputs": [], "source": [ "coord = {'prim': np.array([[0,0,0],\n", " [a0/sq3,0,0]]),\n", " 'conv': np.array([[0,0,0],\n", " [a0/sq3,0,0],\n", " [a0*sq3/2,0,a0/2],\n", " [a0*5/sq3/2,0,a0/2]])}\n", "\n", "cell = {'prim': np.array([[a0*sq3/2,0,a0/2],\n", " [0,float(\"inf\"),0],\n", " [a0*sq3/2,0,-a0/2]]),\n", " 'conv': np.array([[a0*sq3,0,0],\n", " [0,float(\"inf\"),0],\n", " [0,0,a0]])}" ] }, { "cell_type": "markdown", "id": "b14009e8", "metadata": {}, "source": [ "From the definitions of atomic coordinates and the unit cell, the sub-system is constructed. Remember that `Systems` are collections of `Fragments` in BigDFT. In the following, the solid-state system is defined as one fragment. " ] }, { "cell_type": "code", "execution_count": 6, "id": "125bcf3f", "metadata": {}, "outputs": [], "source": [ "positions = [{'C':list(j)} for j in coord['prim']] \n", "posinp = {'positions': positions, 'units': 'angstroem'}\n", "\n", "frag = Fragments.Fragment(posinp=posinp)\n", "sys_cs = Systems.System()\n", "sys_cs[\"FRA:1\"] = frag" ] }, { "cell_type": "markdown", "id": "e758fa8b", "metadata": {}, "source": [ "Since non-orthorombic cells are not yet handled in BigDFT, the following procedure is required when defining the unit cell" ] }, { "cell_type": "code", "execution_count": 7, "id": "f1d43ce0", "metadata": {}, "outputs": [], "source": [ "sys_cs.cell.cell = cell['prim']" ] }, { "cell_type": "markdown", "id": "dae7e54d", "metadata": {}, "source": [ "### Tight-binding parameters" ] }, { "cell_type": "markdown", "id": "e7d762c7", "metadata": {}, "source": [ "The TB parametrization relies on definition on interaction region, where electronic contributions are added to the Hamiltonian. This approach is similar to the localization constraint employed in linear scaling. In addition to a `Systems.System`, a TB object need an interaction radius $d$. " ] }, { "cell_type": "code", "execution_count": 8, "id": "7378ed26", "metadata": {}, "outputs": [], "source": [ "d = 5 # 1nn or 3nn are advised for graphene\n", "tb = TB.TightBinding(sys_cs, d=d)" ] }, { "cell_type": "markdown", "id": "0c5ae682", "metadata": {}, "source": [ "### Mapping between sites and Bravais vectors\n", "\n", "From the previous parametrization, a mapping is established between atoms in the unit cell and their periodic images within a distance $d$. The Bravais vectors connecting those sites are denoted $R_{ij}$. The TB object therefore contains a dictionary $R_{sh}$ defined such as:\n", "