{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Nanoparticle\nThis tutorial shows how to use the :mod:`ase.cluster` module\nto set up metal nanoparticles with common crystal forms.\nPlease have a quick look at the module's documentation\nlinked above.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Build and optimise nanoparticle\n\nConsider :func:`ase.cluster.Octahedron`. Aside from generating\nstrictly octahedral nanoparticles, it also offers a ``cutoff``\nkeyword to cut the corners of the\noctahedron. This produces \"truncated octahedra\", a well-known structural\nmotif in nanoparticles. Also, the lattice will be consistent with the bulk\nFCC structure of silver.\n\n.. admonition:: Exercise\n\n Play around with :func:`ase.cluster.Octahedron` to produce truncated\n octahedra. Here we set up a cuboctahedral\n silver nanoparticle with 55 atoms. As always, verify yourself with\n the ASE GUI that it is beautiful.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from ase.cluster import Octahedron\n\natoms = Octahedron('Ag', 5, cutoff=2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ASE provides a forcefield code based on effective medium theory,\n:class:`ase.calculators.emt.EMT`, which works for the FCC metals (Cu, Ag, Au,\nPt, and friends). This is much faster than DFT so let's use it to\noptimise our cuboctahedron.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from ase.calculators.emt import EMT\nfrom ase.optimize import BFGS\n\natoms.calc = EMT()\nopt = BFGS(atoms, trajectory='opt.traj')\nhas_converged = opt.run(fmax=0.01)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ground state\n\nOne of the most interesting questions of metal nanoparticles is how\ntheir electronic structure and other properties depend on size.\nA small nanoparticle is like a molecule with just a few discrete energy\nlevels. A large nanoparticle is like a bulk material with a continuous\ndensity of states. Let's calculate the Kohn--Sham spectrum (and density\nof states) of our\nnanoparticle.\n\nWe set up a GPAW calculator and as usual,\nwe set a few parameters to save time since this is not a\nreal production calculation.\nWe want a smaller basis set\nand also a PAW dataset with fewer electrons than normal.\nWe also want to use Fermi smearing since there could be multiple electronic\nstates near the Fermi level.\nThese are GPAW-specific keywords --- with another code, those variables\nwould have other names.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from gpaw import GPAW, FermiDirac\n\nfrom ase.io import read\n\natoms = read('opt.traj')\n\ncalc = GPAW(\n mode='lcao',\n basis='sz(dzp)',\n txt='gpaw.txt',\n occupations=FermiDirac(0.1),\n setups={'Ag': '11'},\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We use this calculator to run a single-point calculation on the\noptimised silver cluster.\nAfter the calculation, we dump the ground state to a file, to\nbe reused later.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "atoms.calc = calc\natoms.center(vacuum=4.0)\natoms.get_potential_energy()\natoms.calc.write('groundstate.gpw')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Density of states\n\nOnce we have saved the ``.gpw`` file, we can write a new script\nwhich loads it and gets the DOS:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n\nfrom ase.dft.dos import DOS\n\ncalc = GPAW('groundstate.gpw')\ndos = DOS(calc, npts=800, width=0.1)\nenergies = dos.get_energies()\nweights = dos.get_dos()\nefermi = calc.get_fermi_level()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example, we sample the DOS using Gaussians of width 0.1 eV.\nWe also mark the Fermi level in the plot.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "fig, ax = plt.subplots()\nax.axvline(efermi, color='k', label=r'$E_{\\mathrm{Fermi}}$ [eV]')\nax.plot(energies, weights)\nax.set_xlabel(r'$E - E_{\\mathrm{Fermi}}$ [eV]')\nax.set_ylabel('DOS [1/eV]')\nax.legend()\nplt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ".. admonition:: Exercise\n\n Looking at the plot, is this spectrum best understood as\n continuous or discrete?\n\n\nThe graph should show us that already with 55 atoms, the plentiful d\nelectrons are well on their way to forming a continuous band (recall\nwe are using 0.1 eV Gaussian smearing). Meanwhile the energies of the\nfew s electrons split over a wider range, and we clearly see isolated\npeaks: The s states are still clearly quantized and have significant\ngaps. What characterises the noble metals Cu, Ag, and Au,\nis that their d band is fully occupied so that the Fermi level lies\namong these s states. Clusters with a\ndifferent number of electrons might have higher or lower Fermi level,\nstrongly affecting their reactivity. We can conjecture that at 55\natoms, the properties of free-standing Ag nanoparticles are probably\nstrongly size dependent.\n\nThe above analysis is speculative. To verify the analysis\nwe would want to calculate s, p, and d-projected DOS to see if our\nassumptions were correct. In case we want to go on doing this,\nthe GPAW documentation will be of help, see: [GPAW DOS](https://gpaw.readthedocs.io/tutorialsexercises/electronic/pdos/pdos.html#module-gpaw.dos)_.\n\n" ] } ], "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 }