{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2ff5929f-c066-496f-b078-0bbc2ab49428",
   "metadata": {},
   "source": [
    "# Activity 8: Inequivalent emitters and the XPD of a substrate"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "394b0c02-f28e-4074-86e5-9dfdf0447adb",
   "metadata": {},
   "source": [
    "XPD can be used to study the adsorption of atoms or molecules on surfaces ([Activity 3](#ssc)), or atomic substitutions on surfaces ([Activity 2](#exp-setup)). In this case, modeling is relatively straightforward, since only one emitter atom is involved.\n",
    "\n",
    "We have seen from previous examples that, for kinetic energies $\\gtrsim$ 500 eV, the use of Rehr-Albers series expansion and scattering path filtering give access to the intensity of deeper emitter atoms ([Activity 7](#path-filtering)).\n",
    "This is the key to computing the total photodiffraction signal of a *substrate*. As emitted photoelectrons originate from highly localized core levels around the atoms, the total signal corresponds to the (incoherent) sum of the intensities of all inequivalent emitters in the probed volume.\n",
    "\n",
    "Let's take a look at how this is done on the following example. \n",
    "\n",
    "\n",
    "## The Aluminium Nitride (AlN) polarity\n",
    "\n",
    "In this example, we will compute polar diagrams of an aluminum nitride substrate.\n",
    "\n",
    "In a work published in 1999, Lebedev *et al.* demonstrated that Photoelectron diffraction can be used as a non invasive tool to unambiguously state the polarity of an AlN surface. Aluminium nitride cristallizes in an hexagonal cell and the authors experimentally showed that the polarity of the surface can be controlled by the annealing temperature during the growth. Both polarities are sketched in the [figure](#AlN-fig1) below.\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "5a4036dc-d087-419f-9a44-749a8b313d5c",
   "metadata": {},
   "source": [
    "(aln-paper)=\n",
    ":::{seealso}\n",
    "based on this paper from V. Lebedev *et al.*\n",
    "[J. Cryst. Growth. **207(4)** p266-72 (1999)](https://doi.org/10.1016/S0022-0248(99)00375-9)\n",
    ":::"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fc1cf08e-77ba-49ea-99a9-8a7bac7c98c7",
   "metadata": {},
   "source": [
    ":::{figure-md} AlN-fig1\n",
    "<img src=\"AlN-fig1.jpg\" alt=\"AlN crystal direction\" width=\"600px\" align=\"center\">\n",
    "\n",
    "AlN hexagonal lattice. Left) N polarity with nitrogen terminated surface and AlN{sub}`4` tetrahedrons pointing downward. Right) Al polarity with aluminium terminated surface and AlN{sub}`4` tetrahedrons pointing upward\n",
    ":::"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "fc180c7b-eb23-47c6-8d18-e092bc777843",
   "metadata": {},
   "source": [
    "The AlN(0001) and (00.-1) faces share the same crystallograpphic symmetry and the Al and N atoms have the same geometrical surrounding differing only in the exchange of Al and N atoms ({numref}`Fig. %s <AlN-fig2>`).\n",
    "\n",
    "It is thus expected that Al(2p) and N(1s) XPD patterns exhibit almost the same features with only small differences due to the contrast between Al and N scattering amplitudes.\n",
    "\n",
    ":::{figure-md} AlN-fig2\n",
    "<img src=\"AlN-fig2.jpg\" alt=\"AlN crystal direction\" width=\"600px\" align=\"center\">\n",
    "\n",
    "Side views of N- or Al- terminated surfaces showing nearest neighbours main polar crystallographic directions. The inset shows the experimental Al(2p)/N(1s) ratio versus polar angle for both AlN polarities (taken from [Lebedev *et al.*](#aln-paper)).\n",
    ":::\n",
    "\n",
    "The strongest differences in photoemission intensities suitable for a quick and unambiguous determination of polarity were found in the (10-10) azimuthal plane at **32°** and **59°** (polar scans in the inset of {numref}`Fig. %s <AlN-fig2>`).\n",
    "\n",
    "These are the directions of short neighbor distances between the atoms of the same element (32°) and between Al and N atoms (58.5°), respectively.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86c20245-abca-4587-bccf-90e0fb09f73c",
   "metadata": {},
   "source": [
    "::::{tab-set}\n",
    "\n",
    ":::{tab-item} <i class=\"fa-solid fa-circle-question\"></i> Quiz\n",
    "Using the crystal view in {numref}`Fig. %s <AlN-fig1>` and assuming that we want to compute Al(2p) and N(1s) intensities for emitters located in 3 different planes to get a *substrate* signal. How many clusters do we need to build ? \n",
    "\n",
    ":::\n",
    "\n",
    "::::"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a3a48ef-196f-435a-b342-3a73e62160f8",
   "metadata": {},
   "source": [
    ":::{toggle}\n",
    "\n",
    ":::{figure-md} AlN-fig3\n",
    "<img src=\"AlN-fig3.jpg\" alt=\"AlN number of clusters\" width=\"600px\" align=\"center\">\n",
    "\n",
    "Number of different clusters to build for Al(2p) and N(1s) in 3 planes\n",
    ":::\n",
    "\n",
    ":::"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82973b9c-bf0c-462a-8114-17ac1e83b799",
   "metadata": {},
   "source": [
    "::::{tab-set}\n",
    "\n",
    ":::{tab-item} <i class=\"fa-solid fa-circle-question\"></i> Quiz\n",
    "Download [this script](AlN.py) and fill in the lines indicated by the comments “FILL HERE”. Run the calculation and check that you are reproducing polar scan of {numref}`Fig. %s <AlN-fig2>`.\n",
    "\n",
    ":::\n",
    "\n",
    "::::"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "abc64fdb-5895-4112-a987-66b3420d78eb",
   "metadata": {},
   "source": [
    "```{toggle}\n",
    "\n",
    ":::{figure-md} AlN-fig4\n",
    "<img src=\"AlN-fig4.png\" alt=\"AlN results\" width=\"600px\" align=\"center\">\n",
    "\n",
    "Polar scans in the (10-10) azimuthal plane of AlN for Al polarity (left) and N polarity (right)\n",
    ":::\n",
    "\n",
    ":::{figure-md} AlN-fig5\n",
    "<img src=\"AlN-fig5.jpg\" alt=\"AlN results\" width=\"600px\" align=\"center\">\n",
    "\n",
    "Al(2p)/N(1s) intensity ratio for both polarities\n",
    ":::\n",
    "\n",
    "As can be seen in {numref}`Fig. %s <AlN-fig5>`, the peaks at 32° and 58.5° are well reproduced by the calculation for an Al polarity. Some discreapancies arise between the experimental work and this simulation especially for large polar angles. This may be due to a too small cluster in diameter for the deeper emitters.\n",
    "\n",
    ":::{literalinclude} AlN_completed.py\n",
    ":lineno-match:\n",
    ":emphasize-lines: 1\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.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
