SpectroscopySchool/msspecbook/_build/html/Activity09/Activity09.html

628 lines
35 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en" data-content_root="../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Activity 9: Comparing simulation and experiment with R-factors &#8212; MsSpec Tour</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="../_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="../_static/togglebutton.css?v=13237357" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css?v=be8a1c11" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx-thebe.css?v=4fa983c6" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../_static/documentation_options.js?v=9eb32ce0"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=f281be69"></script>
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="../_static/togglebutton.js?v=4a39c7ea"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="../_static/design-tabs.js?v=f930bc37"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
<script async="async" src="../_static/sphinx-thebe.js?v=c100c467"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'Activity09/Activity09';</script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Activity 10: Parallelization and multi-processing in MsSpec" href="../Activity10/Activity10.html" />
<link rel="prev" title="Activity 8: Inequivalent emitters and the XPD of a substrate" href="../Activity08/Activity08.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search this book..."
aria-label="Search this book..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="../intro.html">
<img src="../_static/logo.jpg" class="logo__image only-light" alt="MsSpec Tour - Home"/>
<script>document.write(`<img src="../_static/logo.jpg" class="logo__image only-dark" alt="MsSpec Tour - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="../intro.html">
Welcome to this small MsSpec tour
</a>
</li>
</ul>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../Activity01/Activity01.html">Activity 1: Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity02/Activity02.html">Activity 2: Setting up the “experiment”</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity03/Activity03.html">Activity 3: Adsorbates and the single scattering approach</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity04/Activity04.html">Activity 4: From single scattering to multiple scattering</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity05/Activity05.html">Activity 5: Multiple scattering in the forward scattering regime</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity06/Activity06.html">Activity 6: Effect of the temperature</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity07/Activity07.html">Activity 7: Large clusters and path filtering</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity08/Activity08.html">Activity 8: Inequivalent emitters and the XPD of a substrate</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Activity 9: Comparing simulation and experiment with R-factors</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity10/Activity10.html">Activity 10: Parallelization and multi-processing in MsSpec</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Activity11/Activity11.html">Activity 11: Spectral radius and convergence</a></li>
<li class="toctree-l1"><a class="reference internal" href="../backmatter.html">Final word</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-download-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<ul class="dropdown-menu">
<li><a href="../_sources/Activity09/Activity09.ipynb" target="_blank"
class="btn btn-sm btn-download-source-button dropdown-item"
title="Download source file"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="btn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="window.print()"
class="btn btn-sm btn-download-pdf-button dropdown-item"
title="Print to PDF"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
<button class="sidebar-toggle secondary-toggle btn btn-sm" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</button>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1>Activity 9: Comparing simulation and experiment with R-factors</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> Contents </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#the-unusual-tilt-of-co-molecule-on-fe-001">The unusual tilt of CO molecule on Fe(001)</a></li>
</ul>
</nav>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<section class="tex2jax_ignore mathjax_ignore" id="activity-9-comparing-simulation-and-experiment-with-r-factors">
<h1>Activity 9: Comparing simulation and experiment with R-factors<a class="headerlink" href="#activity-9-comparing-simulation-and-experiment-with-r-factors" title="Link to this heading">#</a></h1>
<p>In order to extract precise crystallographic information from electronic spectroscopy, we need to compare MsSpec calculations with experimental results and adjust the modelling parameters to simulate the experiment as accurately as possible.</p>
<p><em>R-factors</em> (reliability factors) are commonly used for this task. In the following example, we will see how MsSpec can extract the adsorption geometry of a molecule.</p>
<section id="the-unusual-tilt-of-co-molecule-on-fe-001">
<h2>The unusual tilt of CO molecule on Fe(001)<a class="headerlink" href="#the-unusual-tilt-of-co-molecule-on-fe-001" title="Link to this heading">#</a></h2>
<p>The carbon monoxide molecule can be adsorbed onto a Fe(001) surface in the hollow site. It was experimentally demonstrated that the CO molecule is tilted by 55<span class="math notranslate nohighlight">\(\pm\)</span>2° in &lt;100&gt; azimuthal directions. The molecule is bonded to the Fe surface by the carbon atom and the adsorption height was estimated to be <span class="math notranslate nohighlight">\(\sim\)</span> 0.6 Å.</p>
<div class="admonition seealso" id="cofe-paper">
<p class="admonition-title">See also</p>
<p>based on this paper from R. S. Saiki <em>et al.</em>
<a class="reference external" href="https://doi.org/10.1103/PhysRevLett.63.283">Phys. Rev. Lett. <strong>63(3)</strong> p283-6 (1989)</a></p>
</div>
<p>We will try to reproduce the polar scan of the figure below of CO adsorbed in the hollow site of the Fe(001) surface with simple single scattering calculations with MsSpec and by using R-Factors to find the best adsorption geometry. We will use the simple cluster displayed on the left hand side of the figure.</p>
<figure class="align-default" id="cofe-fig1">
<a class="reference internal image-reference" href="../_images/COFe_fig1.jpg"><img alt="" class="align-center" src="../_images/COFe_fig1.jpg" style="width: 600px;" />
</a>
<figcaption>
<p><span class="caption-number">Fig. 24 </span><span class="caption-text">Small cluster used for SSC calculations (left) and (right) Normalized polar scan of the C(1s) at 1202 eV for [100] and [1-10] azimths.</span><a class="headerlink" href="#cofe-fig1" title="Link to this image">#</a></p>
</figcaption>
</figure>
<div class="sd-tab-set docutils">
<input checked="checked" id="sd-tab-item-0" name="sd-tab-set-0" type="radio">
<label class="sd-tab-label" for="sd-tab-item-0">
<i class="fa-solid fa-circle-question"></i> Quiz</label><div class="sd-tab-content docutils">
<p>Download <a class="reference download internal" download="" href="../_downloads/179b010d01a3689041dba01413ac667b/COFe.py"><span class="xref download myst">this script</span></a> and write the body of the function <code class="docutils literal notranslate"><span class="pre">create_cluster</span></code>. The function should return a
small cluster of 5 Fe atoms with the CO molecule adsorbed like in figure <a class="reference internal" href="#cofe-fig2"><span class="std std-numref">Fig. 25</span></a> below. The function
will accept 4 keyword arguments to control the adsorption geometry.</p>
<figure class="align-default" id="cofe-fig2">
<a class="reference internal image-reference" href="../_images/COFe_fig2.jpg"><img alt="CO-Fe adsorption geometry" class="align-center" src="../_images/COFe_fig2.jpg" style="width: 600px;" />
</a>
<figcaption>
<p><span class="caption-number">Fig. 25 </span><span class="caption-text">Adsorption geometry of carbon monoxide on Fe(001).</span><a class="headerlink" href="#cofe-fig2" title="Link to this image">#</a></p>
</figcaption>
</figure>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Remember to use the <a class="reference external" href="https://wiki.fysik.dtu.dk/ase/ase/build/build.html#ase.build.bulk"><code class="docutils literal notranslate"><span class="pre">ase.build.bulk</span></code></a>, the <a class="reference external" href="https://msspec.cnrs.fr/faq/hemispherical_cluster/hemispherical_cluster.html#hemispherical-cluster-faq"><code class="docutils literal notranslate"><span class="pre">msspec.utils.hemispherical_cluster</span></code></a> and the <a class="reference external" href="https://wiki.fysik.dtu.dk/ase/ase/build/surface.html#ase.build.add_adsorbate"><code class="docutils literal notranslate"><span class="pre">ase.build.add_adsorbate</span></code></a>
functions.</p>
</div>
</div>
</div>
<div class="toggle docutils container">
<p>Here is the code of the <code class="docutils literal notranslate"><span class="pre">create_cluster</span></code> function</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">create_cluster</span><span class="p">(</span><span class="n">height</span><span class="o">=</span><span class="mf">1.</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="mi">45</span><span class="p">,</span> <span class="n">phi</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">bond_length</span><span class="o">=</span><span class="mf">1.15</span><span class="p">):</span>
<span class="c1"># Fill the body of this function. The &#39;cluster&#39; object in built according to</span>
<span class="c1"># values provided by the keyword arguments:</span>
<span class="c1"># height (in angströms): the &#39;z&#39; distance between the Fe surface and the C atom</span>
<span class="c1"># theta and phi (in degrees): the polar and azimuthal orientation of the CP molecule</span>
<span class="c1"># (theta=0° aligns the molecule withe the surface normal</span>
<span class="c1"># phi=0° corresponds to the [100] direction of iron)</span>
<span class="c1"># bond_length (in angströms): the C-O distance</span>
<span class="hll"> <span class="n">iron</span> <span class="o">=</span> <span class="n">bulk</span><span class="p">(</span><span class="s1">&#39;Fe&#39;</span><span class="p">,</span> <span class="n">cubic</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span><span class="hll"> <span class="n">cluster</span> <span class="o">=</span> <span class="n">hemispherical_cluster</span><span class="p">(</span><span class="n">iron</span><span class="p">,</span> <span class="n">diameter</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">planes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">emitter_plane</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
</span><span class="hll">
</span><span class="hll"> <span class="n">t</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">theta</span><span class="p">)</span>
</span><span class="hll"> <span class="n">p</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">radians</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span>
</span><span class="hll">
</span><span class="hll"> <span class="n">z</span> <span class="o">=</span> <span class="n">bond_length</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
</span><span class="hll"> <span class="n">x</span> <span class="o">=</span> <span class="n">bond_length</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
</span><span class="hll"> <span class="n">y</span> <span class="o">=</span> <span class="n">bond_length</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
</span><span class="hll"> <span class="n">CO</span><span class="o">=</span><span class="n">Atoms</span><span class="p">(</span><span class="s1">&#39;CO&#39;</span><span class="p">,</span><span class="n">positions</span><span class="o">=</span><span class="p">[(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">),(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">,</span><span class="n">z</span><span class="p">)])</span>
</span><span class="hll">
</span><span class="hll"> <span class="n">add_adsorbate</span><span class="p">(</span><span class="n">cluster</span><span class="p">,</span><span class="n">CO</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="n">height</span><span class="p">)</span>
</span>
<span class="c1"># Keep those 2 lines at the end of your function</span>
<span class="c1"># Store some information in the cluster object</span>
<span class="n">cluster</span><span class="o">.</span><span class="n">info</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">adsorbate</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;theta&#39;</span><span class="p">:</span> <span class="n">theta</span><span class="p">,</span> <span class="s1">&#39;phi&#39;</span><span class="p">:</span> <span class="n">phi</span><span class="p">,</span> <span class="s1">&#39;height&#39;</span><span class="p">:</span> <span class="n">height</span><span class="p">,</span>
<span class="s1">&#39;bond_length&#39;</span><span class="p">:</span> <span class="n">bond_length</span><span class="p">})</span>
</pre></div>
</div>
</div>
<p>Now that the <code class="docutils literal notranslate"><span class="pre">create_cluster</span></code> function is done, look at the rest of the script. The next function is called <code class="docutils literal notranslate"><span class="pre">compute_polar_scan</span></code> and will obviously be used to compute the <span class="math notranslate nohighlight">\(\theta\)</span>-scan of the C1s for a given cluster geometry.
Finally there is the <em>Main part</em> that is built in two sections:</p>
<ol class="arabic simple">
<li><p>A section containing nested <em>for loops</em></p></li>
<li><p>A final section for <em>R-Factor analysis</em></p></li>
</ol>
<div class="sd-tab-set docutils">
<input checked="checked" id="sd-tab-item-1" name="sd-tab-set-1" type="radio">
<label class="sd-tab-label" for="sd-tab-item-1">
<i class="fa-solid fa-circle-question"></i> Quiz</label><div class="sd-tab-content docutils">
<ol class="arabic simple">
<li><p>Complete the nested for loops in section 1) in order to compute polar scans for CO molecule tilted from 45° to 60° with a 1° step and aligned either along the [100] direction of Fe, 30° from this direction or along [110]. The adsorption height is 0.6 Å and the bond length is 1.157 Å.</p></li>
<li><p>What is the best <span class="math notranslate nohighlight">\((\theta, \phi)\)</span> according to the R-Factor analysis</p></li>
</ol>
</div>
</div>
<div class="toggle docutils container">
<p>Here are the code of the nested <em>for loops</em></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">###############################################################################</span>
<span class="c1"># Main part</span>
<span class="c1">###############################################################################</span>
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span> <span class="c1"># polar angles and calculated cross_sections will be appended</span>
<span class="c1"># to this list after each &#39;compute_polar_scan&#39; call</span>
<span class="n">parameters</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;theta&#39;</span><span class="p">:</span> <span class="p">[],</span> <span class="s1">&#39;phi&#39;</span><span class="p">:</span> <span class="p">[]}</span> <span class="c1"># and corresponding parameters will also</span>
<span class="c1"># be stored in this dictionary</span>
<span class="c1"># 1) Run calculations for different geometries</span>
<span class="hll"><span class="k">for</span> <span class="n">theta</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">45</span><span class="p">,</span> <span class="mi">60</span><span class="p">,</span> <span class="mi">1</span><span class="p">):</span>
</span><span class="hll"> <span class="k">for</span> <span class="n">phi</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">45</span><span class="p">]:</span>
</span> <span class="c1"># Create the cluster</span>
<span class="hll"> <span class="n">cluster</span> <span class="o">=</span> <span class="n">create_cluster</span><span class="p">(</span><span class="n">theta</span><span class="o">=</span><span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="o">=</span><span class="n">phi</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
</span><span class="hll"> <span class="n">bond_length</span><span class="o">=</span><span class="mf">1.157</span><span class="p">)</span>
</span> <span class="c1"># Compute</span>
<span class="hll"> <span class="n">data</span> <span class="o">=</span> <span class="n">compute_polar_scan</span><span class="p">(</span><span class="n">cluster</span><span class="p">)</span>
</span>
<span class="c1"># Update lists of results and parameters</span>
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">theta</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span>
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">cross_section</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span>
<span class="n">parameters</span><span class="p">[</span><span class="s1">&#39;theta&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">theta</span><span class="p">)</span>
<span class="n">parameters</span><span class="p">[</span><span class="s1">&#39;phi&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span>
</pre></div>
</div>
<p>Runing the code gives the following result. The CO molecule belongs to the (100), (010), (-100), (0-10) planes of iron and is tilted by 55° from the surface normal (<em>ie</em> 35° from the surface itself).</p>
<figure class="align-default" id="cofe-comparison">
<a class="reference internal image-reference" href="../_images/Comparison.png"><img alt="R-Factor result" class="align-center" src="../_images/Comparison.png" style="width: 600px;" />
</a>
<figcaption>
<p><span class="caption-number">Fig. 26 </span><span class="caption-text">Best polar scan according to R-Factor analysis.</span><a class="headerlink" href="#cofe-comparison" title="Link to this image">#</a></p>
</figcaption>
</figure>
</div>
<p>MsSpec uses 12 different R-Factors formula to compare the calculted curve to the experimental data. The set of parameters giving the best agreement according to the majority of those 12 R-factors is assumed to be the best solution. Here are the R-factors formula used in MsSpec</p>
<figure class="align-default" id="rfactors-formula">
<a class="reference internal image-reference" href="../_images/formula.jpg"><img alt="R-Factor result" class="align-center" src="../_images/formula.jpg" style="width: 800px;" />
</a>
<figcaption>
<p><span class="caption-number">Fig. 27 </span><span class="caption-text">The 12 R-Factors used in MsSpec. The Pendrys R-Factor is n°11.</span><a class="headerlink" href="#rfactors-formula" title="Link to this image">#</a></p>
</figcaption>
</figure>
<div class="sd-tab-set docutils">
<input checked="checked" id="sd-tab-item-2" name="sd-tab-set-2" type="radio">
<label class="sd-tab-label" for="sd-tab-item-2">
<i class="fa-solid fa-circle-question"></i> Quiz</label><div class="sd-tab-content docutils">
<p>How many R-Factors do agree that <span class="math notranslate nohighlight">\((\theta,\phi)=(55,0)\)</span> gives the best agreement ?</p>
</div>
</div>
<div class="toggle docutils container">
<p>6 R-factors out of 12 do agree that <em>variable set n°30</em> gives the best agreement. The set n°30 corresponds to
<span class="math notranslate nohighlight">\(\theta=55°\)</span> and <span class="math notranslate nohighlight">\(\phi=0°\)</span>.</p>
<figure class="align-default" id="results">
<a class="reference internal image-reference" href="../_images/results1.png"><img alt="results" class="align-center" src="../_images/results1.png" style="width: 800px;" />
</a>
<figcaption>
<p><span class="caption-number">Fig. 28 </span><span class="caption-text">The number of R-Factors for which the parameter set (in abscissa) gives the best agreement.</span><a class="headerlink" href="#results" title="Link to this image">#</a></p>
</figcaption>
</figure>
</div>
</section>
</section>
<script type="text/x-thebe-config">
{
requestKernel: true,
binderOptions: {
repo: "binder-examples/jupyter-stacks-datascience",
ref: "master",
},
codeMirrorConfig: {
theme: "abcdef",
mode: "python"
},
kernelOptions: {
name: "python3",
path: "./Activity09"
},
predefinedOutput: true
}
</script>
<script>kernelName = 'python3'</script>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
<a class="left-prev"
href="../Activity08/Activity08.html"
title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Activity 8: Inequivalent emitters and the XPD of a substrate</p>
</div>
</a>
<a class="right-next"
href="../Activity10/Activity10.html"
title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Activity 10: Parallelization and multi-processing in MsSpec</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
</div>
</footer>
</div>
<div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage">
<i class="fa-solid fa-list"></i> Contents
</div>
<nav class="bd-toc-nav page-toc">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#the-unusual-tilt-of-co-molecule-on-fe-001">The unusual tilt of CO molecule on Fe(001)</a></li>
</ul>
</nav></div>
</div></div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By Sylvain Tricot
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2023.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>