{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# External calculators - CP2K\n\n\nCP2K is a program to perform atomistic and molecular simulations of solid\nstate, liquid, molecular, and biological systems. It provides a general\nframework for different methods such as e.g., density functional theory\n(DFT) using a mixed Gaussian and plane waves approach (GPW).\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We perform an example CP2K DFT calculation by first importing the calculator\nfor CP2K and creating a bulk silicon example atoms object.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from ase.build import bulk\nfrom ase.calculators.cp2k import CP2K\n\natoms = bulk('Si')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, we set up a calculator object and specify CP2K's calculation parameters.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "calc = CP2K(\n xc='LDA', # Exchange-correlation functional\n cutoff=400, # Plane-wave energy cutoff\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and run the calculation:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "atoms.calc = calc\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 }