{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# External calculators - GPAW\n\nMany external calculators can be used with ASE, including GPAW_, Abinit_,\nVasp_, Siesta_, `Quantum ESPRESSO`_, Asap_, LAMMPS_ ,\nFhiAIMS_, MACE_, and many more, see `supported calculators` for the\nfull list.\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setting up an external calculator with ASE\n\nThis tutorial will cover how to set up a basic calculation in ASE, using\nseveral external calculator, GPAW_, CP2K_ and ASAP_ and\ntheir tutorials `ext_calc_cp2k` and `ext_calc_asap`\nAll these are various external calculators, performing DFT GPAW and\nCP2K or using classical potentials, via ASAP.\n\nWe will start by looking at GPAW_,\n\n\n## GPAW\n- GPAW is an electronic structure code implemented as a Python\n library with C backend.\n- GPAW includes a few command line tools, but is generally\n always used with ASE.\n- Due to this close relationship many GPAW developers are also\n ASE developers.\n- GPAW implements the projector-augmented wave (PAW) method which requires\n atomic \u201csetups\u201d with pseudopotentials.\n\nTo begin with, we run a single-point energy calculation using\nKohn-Sham density-functional theory (DFT). First, we import GPAW\nand create the atoms object\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from gpaw import GPAW, PW\n\nfrom ase.build import bulk\n\natoms = bulk('Cu')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Second, we attach GPAW as a calculator\n- We specify a number of parameters:\n\n- xc sets the exchange-correlation functional\n- kpts sets the Brillouin-zone sampling\n- mode sets the basis set; in this case a 400 eV cutoff plane-wave\n basis is used.\n- For more information about valid parameters, see the GPAW docs.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "atoms.calc = GPAW(xc='PBE', kpts=(3, 3, 3), mode=PW(400))\n\nenergy = atoms.get_potential_energy()\nprint(energy)" ] } ], "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.13.7" } }, "nbformat": 4, "nbformat_minor": 0 }