{ "cells": [ { "cell_type": "markdown", "id": "ef8763a5", "metadata": {}, "source": [ "# Factory functions\n", "\n", "Abipy provides factory functions to build input files for typical calculations.\n", "These functions return `AbinitInput` or `MultiDataset` objects, depending\n", "on the number of steps required by the calculation.\n", "\n", "One can use the factories to generate automatically input files or\n", "call these functions inside python code to build workflows for high-throughput applications.\n", "Note that the default values do not always correspond to the default behaviour of Abinit.\n", "In particular, the majority of the factory functions construct input files\n", "for **spin-polarized calculations** (`nsppol=2`) with a **Fermi-Dirac** occupation scheme and\n", "a physical temperature of **0.1 eV**.\n", "It is always possible to change the default behaviour either\n", "by passing these options to the factory function or by changing the objects returned by the factory.\n", "\n", "Also note that the factory functions do not use `get*` or `ird*` variables to connect the different\n", "steps. Client code is in charge of connecting the different parts.\n", "For a command line interface, use the `abinp.py` script." ] }, { "cell_type": "code", "execution_count": 1, "id": "7b4f4f4b", "metadata": {}, "outputs": [], "source": [ "import os\n", "import warnings\n", "warnings.filterwarnings(\"ignore\") # to get rid of deprecation warnings\n", "\n", "import abipy.data as abidata\n", "import abipy.abilab as abilab\n", "abilab.enable_notebook() # This line tells AbiPy we are running inside a notebook\n", "from abipy.abilab import AbinitInput" ] }, { "cell_type": "markdown", "id": "417698b2", "metadata": {}, "source": [ "## Ground-state calculation\n", "\n", "Let us generate an input file for a standard GS calculation for silicon in which\n", "the structure is read from an external CIF file:" ] }, { "cell_type": "code", "execution_count": 2, "id": "0ee63803", "metadata": {}, "outputs": [ { "data": { "text/html": [ "