{ "cells": [ { "cell_type": "markdown", "id": "88b65284-bdd1-4140-af28-526e77b9b4b6", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# Activity 2: Setting up the \"experiment\"\n", "\n", "To model a spectroscopy experiment, some parameters need to be correctly defined. In MsSpec, parameters are grouped in different categories (`detector_parameters`, `source_parameters`, `calculation_parameters`...). Each category is an attribute of your calculator object and contains different parameters.\n", "For example, to define the angle of the incoming light with respect to the sample normal direction, you will use\n", "\n", "```\n", "# (assuming your calculator variable is calc)\n", "# e.g: Incoming X-Ray light is 30° from the sample normal\n", "calc.source_parameters.theta = 30\n", "```\n", "\n", "\n", "## Sb-induced smooth growth of Ag on Ag(111) example\n", "\n", "To see how some parameters - not related to the cluster shape - may change the results, we will look at the effect of two parameters:\n", "\n", "1. The source direction\n", "2. The inner potential of the sample\n", "\n", "The inner potential is material specific. It will add to the photoelectron kinetic energy inside the material. When the photoelectron escapes the sample, this internal potential is missing and this will create an energy step that will act as a refraction for the photoelectron intensity. The effect will be significant for large polar angles and for small kinetic energy of the photoelectron.\n", "\n", "Let's look at the effect of those parameters on the following example.\n", "The idea is to use low energy photoelectron diffraction to see the substitution of Ag by Sb atoms on the surface plane.\n", "\n", ":::{seealso}\n", "based on this paper from H. Cruguel *et al.* [Phys. Rev. B **55** R16061](https://doi.org/10.1103/PhysRevB.55.R16061)\n", ":::\n", "\n", "### Building the cluster\n", "\n", "Let's start by building the cluster" ] }, { "cell_type": "markdown", "id": "e7e10211-80ea-49e3-99a4-c57fc3b39539", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "```{literalinclude} SbAg.py\n", ":end-at: symbol = 'Sb' \n", ":lineno-match:\n", "```" ] }, { "cell_type": "code", "execution_count": 1, "id": "0b0a420f-7074-443b-8cb4-1f609f5b123e", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " ASE atomic visualization\n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from ase.build import bulk\n", "from ase.visualize import view\n", "\n", "from msspec.calculator import MSSPEC\n", "from msspec.utils import hemispherical_cluster, get_atom_index, cut_plane\n", "import numpy as np\n", "from matplotlib import pyplot as plt\n", "\n", "# Create the silver cell\n", "Ag = bulk('Ag', cubic=True)\n", "# Orientate the cell in the [111] direction\n", "Ag.rotate((1,1,1), (0,0,1), rotate_cell=True)\n", "# Align the azimuth to match experimental reference\n", "Ag.rotate(15, 'z', rotate_cell=True)\n", "\n", "# Create a cluster\n", "cluster = hemispherical_cluster(Ag, diameter=20, emitter_plane=0)\n", "cluster = cut_plane(cluster, z=-4.8)\n", "cluster.emitter = get_atom_index(cluster, 0,0,0)\n", "cluster[cluster.emitter].symbol = 'Sb'\n", "\n", "view(cluster, viewer='x3d')" ] }, { "cell_type": "markdown", "id": "ae74eedc-5ea4-4782-a49a-dcc2feac6c7c", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### Compute an azimuthal scan\n", "\n", "Now create a calculator and configure experimental parameters" ] }, { "cell_type": "markdown", "id": "a4fed04e-e209-4cdd-822d-dc03a0f65caa", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "```{literalinclude} SbAg.py\n", ":start-after: set_atoms\n", ":end-before: Compute\n", ":lineno-match:\n", ":emphasize-lines: 3,9\n", "```" ] }, { "cell_type": "markdown", "id": "c36f5501-ddc7-41d2-b846-57d34e077d96", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "Finally, add those lines to compute the $\\phi$-scan (in orange) and compare it to the experimental data (in blue).\n", "\n", "```{literalinclude} SbAg.py\n", ":start-after: interstitial_potential\n", ":lineno-match:\n", "```" ] }, { "cell_type": "markdown", "id": "41723719-be45-4fa8-a824-4ccc4c6dd6c0", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ ":::{figure-md} SbAg-fig1\n", "\n", "\n", "Azimuthal ($\\phi$) scan for Sb(4d) emitter in the top layer of Ag(111) at 45 eV kinetic energy.\n", ":::\n", "\n", "The agreement is not satisfactory although most of the features may be identified." ] }, { "cell_type": "markdown", "id": "0332a072-90b0-4d3e-8ee9-06cd16bb2608", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "::::{tab-set}\n", "\n", ":::{tab-item} Quiz\n", "Try to change the source direction and the inner potential of Ag to better match the experiment...\n", "\n", "```{note}\n", "The cluster is smaller than it should for size convergence, but the calculation would take too much memory for this example\n", "```\n", ":::\n", "\n", "::::" ] }, { "cell_type": "markdown", "id": "f5c46ea1-1dc9-4e31-a74c-856ef3451b99", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "```{toggle}\n", "\n", ":::{figure-md} SbAg-fig2\n", "\n", "\n", "Azimuthal ($\\phi$) scan for Sb(4d) emitter in the top layer of Ag(111) at 45 eV kinetic energy, with `muffintin_parameters.interstitial_potential` = 10.2 and `source_parameters.theta` = 22.5\n", ":::\n", "\n", ":::{code} python\n", "# Source geometry (the former SA73 beamline of the LURE synchrotron)\n", "# given in ref 6 of the paper...\n", "calc.source_parameters.theta = 22.5\n", "# Inner potential is generally between 10 and 20 eV for most metrials\n", "calc.muffintin_parameters.inner_potential = 10.2\n", ":::\n", "\n", "```" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11.3" } }, "nbformat": 4, "nbformat_minor": 5 }