from msspec.calculator import MSSPEC
@@ -564,7 +564,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity04/Activity04_light.html b/msspecbook/_build/html/Activity04/Activity04_light.html
index 9fc0a5d..35ee458 100644
--- a/msspecbook/_build/html/Activity04/Activity04_light.html
+++ b/msspecbook/_build/html/Activity04/Activity04_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity05/Activity05.html b/msspecbook/_build/html/Activity05/Activity05.html
index 135c185..f90422f 100644
--- a/msspecbook/_build/html/Activity05/Activity05.html
+++ b/msspecbook/_build/html/Activity05/Activity05.html
@@ -32,7 +32,7 @@
-
+
@@ -1145,7 +1145,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity05/Activity05_light.html b/msspecbook/_build/html/Activity05/Activity05_light.html
index 7db25b2..9304e4e 100644
--- a/msspecbook/_build/html/Activity05/Activity05_light.html
+++ b/msspecbook/_build/html/Activity05/Activity05_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity06/Activity06.html b/msspecbook/_build/html/Activity06/Activity06.html
index f0f55fe..420ec97 100644
--- a/msspecbook/_build/html/Activity06/Activity06.html
+++ b/msspecbook/_build/html/Activity06/Activity06.html
@@ -32,7 +32,7 @@
-
+
@@ -377,7 +377,7 @@ document.write(`
The create_clusters
function will build clusters with increasing number of planes, with the emitter being in the deepest plane for each cluster.
The function compute
will compute the azimuthal scan for a given cluster.
-The analysis
function will sum the intensity from each plane for a given temperature. This will be the substrate total signal (more on this in the Activity 7: Large clusters and path filtering section). The function will also compute the anisotropy (equation () ).
+The analysis
function will sum the intensity from each plane for a given temperature. This will be the substrate total signal (more on this in the Activity 7: Large clusters and path filtering section). The function will also compute the anisotropy (equation (1) ).
MsSpec can introduce temperature effects in two ways: either by using the Debye Waller model or by doing an average over the phase shifts. We will explore the latter in this example.
Regardless of the option chosen to model temperature effects, we need to define mean square displacement (MSD) values of the atoms in our cluster. We will use the Debye model for this. The MSD is defined as follows:
@@ -389,7 +389,7 @@ document.write(`
-Fig. 16 Variation of MSD for copper versus temperature using equation ()
+Fig. 16 Variation of MSD for copper versus temperature using equation (2)
@@ -764,7 +764,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity06/Activity06_light.html b/msspecbook/_build/html/Activity06/Activity06_light.html
index 17b4442..caf7f86 100644
--- a/msspecbook/_build/html/Activity06/Activity06_light.html
+++ b/msspecbook/_build/html/Activity06/Activity06_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity07/Activity07.html b/msspecbook/_build/html/Activity07/Activity07.html
index 16825ee..e88f267 100644
--- a/msspecbook/_build/html/Activity07/Activity07.html
+++ b/msspecbook/_build/html/Activity07/Activity07.html
@@ -32,7 +32,7 @@
-
+
@@ -369,7 +369,7 @@ document.write(`
Quiz
Create a cluster of Si(001) with the emitter in the subsurface, 40 Å diameter with 2 planes (since atoms below the emitter can be ignored at high kinetic energies).
-For an emitter in the subsurface, we can use single scattering (see Activity 5: Multiple scattering in the forward scattering regime ). How many paths would be generated for this calculation ?
+For an emitter in the subsurface, we can use single scattering (see Activity 5: Multiple scattering in the forward scattering regime ). How many paths would be generated for this calculation ?
Same question for an emitter in the 7th plane. If we were able to treat each scattering path within only 1 µs. How long would be such calculation ?
@@ -656,7 +656,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity07/Activity07_light.html b/msspecbook/_build/html/Activity07/Activity07_light.html
index 1af2520..e9d6f8e 100644
--- a/msspecbook/_build/html/Activity07/Activity07_light.html
+++ b/msspecbook/_build/html/Activity07/Activity07_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity08/Activity08.html b/msspecbook/_build/html/Activity08/Activity08.html
index e85f416..3361ebf 100644
--- a/msspecbook/_build/html/Activity08/Activity08.html
+++ b/msspecbook/_build/html/Activity08/Activity08.html
@@ -32,7 +32,7 @@
-
+
@@ -354,14 +354,14 @@ document.write(`
Activity 8: Inequivalent emitters and the XPD of a substrate
-XPD can be used to study the adsorption of atoms or molecules on surfaces (Activity 3 ), or atomic substitutions on surfaces (Activity 2 ). In this case, modeling is relatively straightforward, since only one emitter atom is involved.
-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 ).
+
XPD can be used to study the adsorption of atoms or molecules on surfaces (Activity 3 ), or atomic substitutions on surfaces (Activity 2 ). In this case, modeling is relatively straightforward, since only one emitter atom is involved.
+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 ).
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.
Let’s take a look at how this is done on the following example.
The Aluminium Nitride (AlN) polarity
In this example, we will compute polar diagrams of an aluminum nitride substrate.
-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 below.
+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 below.
See also
based on this paper from V. Lebedev et al.
@@ -374,7 +374,7 @@ This is the key to computing the total photodiffraction signal of a substrat
Fig. 21 AlN hexagonal lattice. Left) N polarity with nitrogen terminated surface and AlN4 tetrahedrons pointing downward. Right) Al polarity with aluminium terminated surface and AlN4 tetrahedrons pointing upward
-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 (Fig. %s
).
+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 (Fig. 22 ).
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.
@@ -383,13 +383,13 @@ This is the key to computing the total photodiffraction signal of a substrat
Fig. 22 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. ).
-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 Fig. %s
).
+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 Fig. 22 ).
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.
Quiz
-
Using the crystal view in Fig. %s
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 ?
+
Using the crystal view in Fig. 21 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 ?
@@ -406,7 +406,7 @@ This is the key to computing the total photodiffraction signal of a
substrat
Quiz
-
Download this script and fill in the lines indicated by the comments “FILL HERE”. Run the calculation and check that you are reproducing polar scan of Fig. %s
.
+
Download this script and fill in the lines indicated by the comments “FILL HERE”. Run the calculation and check that you are reproducing polar scan of Fig. 22 .
@@ -653,7 +653,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity08/Activity08_light.html b/msspecbook/_build/html/Activity08/Activity08_light.html
index 235d639..2166976 100644
--- a/msspecbook/_build/html/Activity08/Activity08_light.html
+++ b/msspecbook/_build/html/Activity08/Activity08_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity09/Activity09.html b/msspecbook/_build/html/Activity09/Activity09.html
index deba493..f10ada1 100644
--- a/msspecbook/_build/html/Activity09/Activity09.html
+++ b/msspecbook/_build/html/Activity09/Activity09.html
@@ -32,7 +32,7 @@
-
+
@@ -377,7 +377,7 @@ document.write(`
Quiz
Download this script and write the body of the function create_cluster
. The function should return a
-small cluster of 5 Fe atoms with the CO molecule adsorbed like in figure Fig. %s
below. The function
+small cluster of 5 Fe atoms with the CO molecule adsorbed like in figure Fig. 27 below. The function
will accept 4 keyword arguments to control the adsorption geometry.
@@ -596,7 +596,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity09/Activity09_light.html b/msspecbook/_build/html/Activity09/Activity09_light.html
index 6febb6e..e845f56 100644
--- a/msspecbook/_build/html/Activity09/Activity09_light.html
+++ b/msspecbook/_build/html/Activity09/Activity09_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity10/Activity10.html b/msspecbook/_build/html/Activity10/Activity10.html
index 2d40df8..8693d4b 100644
--- a/msspecbook/_build/html/Activity10/Activity10.html
+++ b/msspecbook/_build/html/Activity10/Activity10.html
@@ -32,7 +32,7 @@
-
+
@@ -405,7 +405,7 @@ can be changed).
Quiz
-
In the paper discussed in Activity 9: Comparing simulation and experiment with R-factors , experimental values of the anisotropy suggest an adsorption height between 0.2 and 0.6 Å. Modify the script to add another sweep for variying the adsorption height of the CO molecule.
+
In the paper discussed in Activity 9: Comparing simulation and experiment with R-factors , experimental values of the anisotropy suggest an adsorption height between 0.2 and 0.6 Å. Modify the script to add another sweep for variying the adsorption height of the CO molecule.
@@ -521,7 +521,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/Activity10/Activity10_light.html b/msspecbook/_build/html/Activity10/Activity10_light.html
index d984fb8..8c7bb1b 100644
--- a/msspecbook/_build/html/Activity10/Activity10_light.html
+++ b/msspecbook/_build/html/Activity10/Activity10_light.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/Activity11/Activity11.html b/msspecbook/_build/html/Activity11/Activity11.html
index 3b854cd..2d4ae80 100644
--- a/msspecbook/_build/html/Activity11/Activity11.html
+++ b/msspecbook/_build/html/Activity11/Activity11.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/Activity01/Activity01_light.ipynb b/msspecbook/_build/html/_sources/light/Activity01_light.ipynb
similarity index 100%
rename from msspecbook/Activity01/Activity01_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity01_light.ipynb
diff --git a/msspecbook/Activity02/Activity02_light.ipynb b/msspecbook/_build/html/_sources/light/Activity02_light.ipynb
similarity index 100%
rename from msspecbook/Activity02/Activity02_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity02_light.ipynb
diff --git a/msspecbook/Activity03/Activity03_light.ipynb b/msspecbook/_build/html/_sources/light/Activity03_light.ipynb
similarity index 100%
rename from msspecbook/Activity03/Activity03_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity03_light.ipynb
diff --git a/msspecbook/Activity04/Activity04_light.ipynb b/msspecbook/_build/html/_sources/light/Activity04_light.ipynb
similarity index 100%
rename from msspecbook/Activity04/Activity04_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity04_light.ipynb
diff --git a/msspecbook/Activity05/Activity05_light.ipynb b/msspecbook/_build/html/_sources/light/Activity05_light.ipynb
similarity index 100%
rename from msspecbook/Activity05/Activity05_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity05_light.ipynb
diff --git a/msspecbook/Activity06/Activity06_light.ipynb b/msspecbook/_build/html/_sources/light/Activity06_light.ipynb
similarity index 100%
rename from msspecbook/Activity06/Activity06_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity06_light.ipynb
diff --git a/msspecbook/Activity07/Activity07_light.ipynb b/msspecbook/_build/html/_sources/light/Activity07_light.ipynb
similarity index 100%
rename from msspecbook/Activity07/Activity07_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity07_light.ipynb
diff --git a/msspecbook/Activity08/Activity08_light.ipynb b/msspecbook/_build/html/_sources/light/Activity08_light.ipynb
similarity index 100%
rename from msspecbook/Activity08/Activity08_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity08_light.ipynb
diff --git a/msspecbook/Activity09/Activity09_light.ipynb b/msspecbook/_build/html/_sources/light/Activity09_light.ipynb
similarity index 100%
rename from msspecbook/Activity09/Activity09_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity09_light.ipynb
diff --git a/msspecbook/Activity10/Activity10_light.ipynb b/msspecbook/_build/html/_sources/light/Activity10_light.ipynb
similarity index 100%
rename from msspecbook/Activity10/Activity10_light.ipynb
rename to msspecbook/_build/html/_sources/light/Activity10_light.ipynb
diff --git a/msspecbook/_build/html/backmatter.html b/msspecbook/_build/html/backmatter.html
index 3d37122..179d249 100644
--- a/msspecbook/_build/html/backmatter.html
+++ b/msspecbook/_build/html/backmatter.html
@@ -32,7 +32,7 @@
-
+
diff --git a/msspecbook/_build/html/genindex.html b/msspecbook/_build/html/genindex.html
index 5ae814b..380b68b 100644
--- a/msspecbook/_build/html/genindex.html
+++ b/msspecbook/_build/html/genindex.html
@@ -31,7 +31,7 @@
-
+
@@ -335,7 +335,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/intro.html b/msspecbook/_build/html/intro.html
index 0396a08..4c0d706 100644
--- a/msspecbook/_build/html/intro.html
+++ b/msspecbook/_build/html/intro.html
@@ -32,7 +32,7 @@
-
+
@@ -430,7 +430,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/light/Activity01_light.html b/msspecbook/_build/html/light/Activity01_light.html
new file mode 100644
index 0000000..a24bfb6
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity01_light.html
@@ -0,0 +1,875 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 1: Getting started — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 1: Getting started
+
+
+
+
+
+
+
+
+
+
+Activity 1: Getting started
+MsSpec is a Fortran code with two components: Phagen (Written by R. Natoli) and Spec (written by D. Sébilleau). Phagen computes the phase shifts of the electronic wave propagating in the matter on a spherical harmonics basis. Spec uses those phase shifts to compute the multiple scattering process and simulate the intensity of different electronic spectroscopies.
+In the most recent version of MsSpec, the program is interfaced with python (https://msspec.cnrs.fr/ ), allowing for much more flexibility and interplay with other simulation techniques.
+
+Building atomic systems
+MsSpec works in the cluster approach. Building such a cluster for a calculation is a fundamental step.
+We use the python Atomic Simulation Environment (ASE) for this.
+ASE is a set of tools and Python modules for setting up, manipulating, running, visualizing and analyzing atomistic simulations.
+Building atomic systems, structures… is pretty straightforward:
+
+
+
+
+Barebone script for MsSpec
+MsSpec can simulate different electronic spectroscopies like PED, AED, LEED, EXAFS, APECS and more will be included in the forthcoming version. However, it is really well-suited for PhotoElectron Diffraction simulation, and the python interface is only fully available for it at the moment. Since PED covers all the MsSpec features and concepts, we will focus on this technique.
+There are typically 3 steps to follow to get a result with MsSpec:
+
+Create a cluster
+Create an ASE calculator
+Run the simulation
+
+
+PED polar scan for Cu(001)
+download the cu.py python script and the copper.cif file. Put those files in the same folder. You can run your first MsSpec calculation by typing in a terminal:
+
+Here is the content of the script file:
+
+
+
+
+
+Cu(2p) polar scan for the copper cluster above
+
+
+
+
+
+Shaping a cluster
+
+
+
+ Quiz
+
Based on the previous *.cif file, create a new cluster without the deepest plane and run the same calculation for the same emitter
+
+
Note
+
Use the cluster.edit()
method to interactively remove atoms…
+
As the cluster will contain fewer atoms, the emitter index will be different
+
+
What do you conclude ?
+
+
+The number of atoms used for the calculation greatly impact the calculation time and memory. Most of the time, a cluster is shaped as an hemisphere to minimize the number of atoms to take into account
+
+
+
+
+
+
+Cu(2p) polar scan for the hemispherical cluster.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity02_light.html b/msspecbook/_build/html/light/Activity02_light.html
new file mode 100644
index 0000000..b1ad2d0
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity02_light.html
@@ -0,0 +1,1463 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 2: Setting up the “experiment” — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 2: Setting up the “experiment”
+
+
+
+
+
+
+
+
+
+
+Activity 2: Setting up the “experiment”
+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.
+For example, to define the angle of the incoming light with respect to the sample normal direction, you will use
+# (assuming your calculator variable is calc)
+# e.g: Incoming X-Ray light is 30° from the sample normal
+calc . source_parameters . theta = 30
+
+
+
+Sb-induced smooth growth of Ag on Ag(111) example
+To see how some parameters - not related to the cluster shape - may change the results, we will look at the effect of two parameters:
+
+The source direction
+The inner potential of the sample
+
+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.
+Let’s look at the effect of those parameters on the following example.
+The idea is to use low energy photoelectron diffraction to see the substitution of Ag by Sb atoms on the surface plane.
+
+
+Building the cluster
+Let’s start by building the cluster. You can copy/paste directly the code from this page to your text editor or you can download the script SbAg.py . You will also need the data.txt file.
+
+
+
+Compute an azimuthal scan
+Now create a calculator and configure experimental parameters
+Finally, add those lines to compute the \(\phi\) -scan (in orange) and compare it to the experimental data (in blue).
+
+
+
+
+Azimuthal (\(\phi\) ) scan for Sb(4d) emitter in the top layer of Ag(111) at 45 eV kinetic energy.
+
+
+The agreement is not satisfactory although most of the features may be identified.
+
+
+
+ Quiz
+
Try to change the source direction and the inner potential of Ag to better match the experiment…
+
+
Note
+
The cluster is smaller than it should for size convergence, but the calculation would take too much memory for this example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity03_light.html b/msspecbook/_build/html/light/Activity03_light.html
new file mode 100644
index 0000000..fc6bfb5
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity03_light.html
@@ -0,0 +1,624 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 3: Adsorbates and the single scattering approach — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 3: Adsorbates and the single scattering approach
+
+
+
+
+
+
+
+
+
+
+Activity 3: Adsorbates and the single scattering approach
+Photoelectron diffraction is widely used to study the adsorption of atoms or molecules on a crystalline surface. Photoelectrons from adsorbates are scattered by the underlying surface, carrying information about the adsorption site, bond length and/or molecule orientation…. Thanks to a simulation, such information becomes quantitative with a high degree of accuracy.
+Calculations of the multiple scattering using matrix inversion have the great advantage of being exact, including all scattering paths. On the other hand, memory consumption soon becomes a problem as the kinetic energy and number of atoms to be considered increase. As an approximation, it is possible to only consider a single scattering from the emitter to any atom in the cluster. This approximation is extremely computationally fast and can give satisfactory results for adsorbates. We’ll see later that this approach is rather too simplistic for most cases.
+
+Oxygen on Rh(001)
+In a paper published in 1998, T. Gerber et al. used the quite high backscattering factor of Rhodium atoms to probe the distance of Oxygen atoms adsorbed on a Rhodium surface. Some electrons coming from Oxygen atoms are ejected toward the Rhodium surface. They are then backscattered and interfere with the direct signal comming from Oxygen atoms (see the figure below). They demonstrated both experimentally and numerically with a sinle scattering computation that this lead to a very accurate probe of adsorbed species that can be sensitive to bond length changes of the order of \(\pm 0.02 \mathring{A}\) .
+
+
+
+
+
+Interferences produced by the backscattering effect
+
+
+
+Computing the scattering factor
+To illustrate that photoelectrons emitted by Oxygen adsorbates towards the Rhodium surface can be backscattered, we will start by computing the scattering factor for both O and Rh atoms.
+
+
+
+ Quiz
+
By using the Atoms
class of the ase
package, try to build a O-Rh chain where atoms are 4 Å apart. Here is the begining of the script. Try to complete the line of code and view your two-atoms chain.
+
from ase import Atoms
+from ase.visualize import view
+
+# Create an atomic chain O-Rh
+cluster = Atoms ( ... # Fill this line
+
+
+
+
+
+
+
+As previously, we create a calculator, we attach our 2 atoms cluster to this calculator and we define the first atom in the chain as the emitter
+
+
+
+ Quiz
+
We use the get_scattering_factors
method (see its documentation) to compute the scattering factors at 723 eV.
+
How large is the backscattering factor of Rhodium with respect to that of Oxygen ?
+
+
+
+
+Interferences due to backscattering
+Let an Oxygen atom (in red) being adsorbed at a distance \(z_0\) of an fcc site of the Rh(111) surface.
+
+
+
+
+Small cluster used for the calculation.
+
+
+We will compute for different values of the adsorption height \(z_0\) .
+
+
+
+ Quiz
+
Complete the script below to compute the (\(\theta,\phi\) ) scan of the photodiffraction of O(1s) adsorbed on a fcc site on Rh(111) surface.
+
As proposed in the comments, add a loop to vary the adsorption height of Oxygen between 1.10 and 1.65 Å.
+What is the bond length difference between to intensity maxima ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity04_light.html b/msspecbook/_build/html/light/Activity04_light.html
new file mode 100644
index 0000000..04684be
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity04_light.html
@@ -0,0 +1,519 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 4: From single scattering to multiple scattering — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 4: From single scattering to multiple scattering
+
+
+
+
+
+
+
+
+
+
+Activity 4: From single scattering to multiple scattering
+In the previous activity , we saw that simple single scattering calculations (SSC) can be used to simulate photodiffraction diagrams with good accuracy. The approximation works fine when the emitting atom is very close to the surface.
+However, the SSC approach is no longer suitable for deeper emitter atoms, where multiple scattering effects come into play. In this activity, we will focus on a major consequence of multiple scattering: the defocusing effect .
+The defocusing effect is presented in the figure below for a chain of nickel atoms. Although purely illustrative, understanding multiple scattering in atomic chains is fundamental because they are found in many situations, such as in particular directions of a crystal or in molecules of various lengths.
+
+
+
+
+The defocusing effect dur to multiple scattering in an atomic chain of Ni atoms.
+
+
+In 1989, M.-L Xu, J.J. Barton and M.A. Van Hove studied these multiple scattering effects on atomic chains (see their paper below ).
+In the spirit of figure 3 of their paper, we will create 3 atomic chains of Ni atoms (2, 3 and 5 atoms) tilted by 45° and we will compare the intensity of the forward scattering peak for single scattering and for full multiple scattering.
+
+
+Polar scans of Ni atomic chains
+
+Building a chain of atoms
+Start by creating a simple chain of 2 Ni atoms: an emitter and a scatterer in the [101] direction.
+
+
Tip
+
Nickel is fcc with lattice parameter \(a\) =3.499 Å. Use the Atoms
class of ase
like in the previous activity …
+
+
if you need help to start…
+
from msspec.calculator import MSSPEC
+from ase import Atoms
+
+symbol = ... # The kind of atom for the chain
+a = ... # The distance bewteen 2 atoms
+ # in [101] direction
+
+chain = Atoms ( ... , positions = [ ... ])
+chain . rotate ( ... )
+chain . edit ()
+
+
+
+
+
+
+
+
+
+ Quiz
+
Create an MSSPEC
calculator with expansion
algortithm and set the scattering_order
=1 to compute a polar scan of the Ni(3s) in single scattering. How is varying the height of the peak at 45° (along the chain) if you increase the number of atoms in the chain ?
+
Repeat the same experiment with inversion
algorithm for having the full multiple scattering result. What do you observe ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity05_light.html b/msspecbook/_build/html/light/Activity05_light.html
new file mode 100644
index 0000000..f575a4c
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity05_light.html
@@ -0,0 +1,1082 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 5: Multiple scattering in the forward scattering regime — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 5: Multiple scattering in the forward scattering regime
+
+
+
+
+
+
+
+
+
+
+Activity 5: Multiple scattering in the forward scattering regime
+In photoelectron diffraction, it is well known that for high photoelectron kinetic energy (typically > 900 eV), the scattering factor is strongly peaked in the forward direction. It means that photoelectrons are almost not deviated after a scattering event.
+Peaks of intentisity are then usually observed for dense atomic directions of the sample. This is the forward scattering approximation .
+For such high kinetic energy, multiple scattering is needed to accurately describe the measured intensity, but the matrix inversion algorithm cannot be used since the memory needed for storing the matrix itself would be generally too large. The matrix will contain
+\((N \times (L_{max}+1)^2)^2\) elements of complex type with double precision (64 bits) where \(N\) is the number of atoms and \(L_{max}\) is the number of spherical harmonics used to expand the electron wave around each atomic center. As the kinetic energy increases, the mean free path (MFP) of the photoelectron is larger and the number of atoms in the cluster has to be greater. Lmax also increases with the kinetic energy.
+
+
+
+ Quiz
+
Try to evaluate how much memory you would need for this matrix for a hemispherical cluster of copper 15 angströms thick (1 MFP) for \(L_{max} = 25\) ?
+
+
+
+
+
+Show code cell content
+Hide code cell content
+
+
+
+
+
+This is too much memory. We will use another algorithm available in MsSpec: The Rehr-Albers series expansion . We already used that algorithm in activity 3 for the single scattering approach. But this time, we will explore a bit more the effect of the scattering order > 1
+
+PED of the 1T-TiSe2 surface
+Let us try to model the Ti2p XPD pattern of the transition metal dichalcogenide 1T-TiSe2 .
+
+
+Creating the TiSe2 cluster
+Start by creating a small cluster of 1T-TiSe2 using the mx2
function of ase.build
and the hemispherical_cluster
function of msspec.utils
.
+
+
+
+
+Structure of 1T-TiSe2 (\(a_0=b_0=3.535\) Å, \(c_0=6.004\) Å, \(d=3.450\) Å, \(D=2.554\) Å)
+
+
+
+
+
+ Quiz
+
Complete the code snipet provided below (or here ) to create a small TiSe2 cluster with Ti emitter in the 2nd plane:
+
+
+
+
+
+Effect of the scattering order
+Use the line belows to create a calculator and compute a \(\theta\) -\(\phi\) scan of the Ti(2p)
+
+
+
+ Quiz
+
Compute a scan for an emitter in the first trilayer and in the second trilayer for scattering orders from 1 (single scattering) to 3 in order to complete the figure below.
+What do you conclude about the value of the calc.calculation_parameters.scattering_order
?
+
+
+
+
+\(\theta\) -\(\phi\) scan of Ti(2p) at 1030 eV kinetic energy for an emitter in the first trilayer (left column) and in the second trilayer (right column). Each row correspond to a growing value for the calc.calculation_parameters.scattering_order
parameter (from 1 to 5).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity06_light.html b/msspecbook/_build/html/light/Activity06_light.html
new file mode 100644
index 0000000..c519960
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity06_light.html
@@ -0,0 +1,512 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 6: Effect of the temperature — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 6: Effect of the temperature
+
+
+
+
+
+
+
+
+
+
+Activity 6: Effect of the temperature
+
+Surface and bulk effects of the temperature
+In this example, we will look at the effects of the temperature on the X-Ray photoelectron diffraction from a copper substrate. We will base our python script on a paper published in 1986 by R. Trehan and S. Fadley. In their work, they performed azimutal scans of a copper(001) surface at 2 different polar angles: one at grazing incidence and one at 45° for incresing temperatures from 298K to roughly 1000K.
+For each azimutal scan, they looked at the anisotropy of the signal, that is:
+
+() \[\frac{I_{max} - I_{min}}{I_{max}}=\frac{\Delta I}{I_{max}}\]
+This value is representative of how clear are the modulations of the signal. They also proposed single scattering calculations that reproduced well these results.
+We will reproduce this kind of calculations to introduce the parameters that control the vibrational damping.
+
+
+The script
+Since we want to distinguish between bulk (low polar angles, \(\theta = 45°\) in the paper) and surface effects (large polar angles, \(\theta = 83°\) in the paper), we need to compute scans for different emitters and different depths in the cluster.
+The script contains 3 functions:
+
+The create_clusters
function will build clusters with increasing number of planes, with the emitter being in the deepest plane for each cluster.
+The function compute
will compute the azimuthal scan for a given cluster.
+The analysis
function will sum the intensity from each plane for a given temperature. This will be the substrate total signal (more on this in the Activity 7: Large clusters and path filtering section). The function will also compute the anisotropy (equation () ).
+
+MsSpec can introduce temperature effects in two ways: either by using the Debye Waller model or by doing an average over the phase shifts. We will explore the latter in this example.
+Regardless of the option chosen to model temperature effects, we need to define mean square displacement (MSD) values of the atoms in our cluster. We will use the Debye model for this. The MSD is defined as follows:
+
+() \[<U_j^2(T)> = \frac{3\hbar^2 T}{M K_B \Theta_D^2}\]
+where \(\hbar\) is the reduce Planck’s constant, \(T\) is the temperature, \(M\) is the mass of the atom, \(k_B\) is the Boltzmann’s constant and \(\Theta_D\) is the Debye temperature of the sample.
+To get an idea of the typical order of magnitude for MSD, the figure below plots the values of MSD for copper for temperatures ranging from 300 K to 1000 K.
+
+
+
+
+Variation of MSD for copper versus temperature using equation ()
+
+
+
+
+
+ Quiz
+
With the help of the MsSpec documentation and the second paragraph p6791 of the article cited above ,
+complete the hilighted lines in the following script to compute the anisotropy of Cu(2p) \(\phi\) -scans for polar angle \(\theta\) =45° and 83°.
+
How is varying the anisotropy versus the temperature. How can you qualitatively explain this variation ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity07_light.html b/msspecbook/_build/html/light/Activity07_light.html
new file mode 100644
index 0000000..f18fe51
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity07_light.html
@@ -0,0 +1,530 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 7: Large clusters and path filtering — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 7: Large clusters and path filtering
+
+
+
+
+
+
+
+
+
+
+Activity 7: Large clusters and path filtering
+So far you have seen that multiple scattering calculations with MsSpec can use two different algorithms: matrix inversion or Rehr Albers series expansion . When matrix inversion becomes impossible because the kinetic energy is too high and the number of atoms is too large, serial expansion is the alternative. This algorithm requires very little memory but it processes the scattering paths sequentially, which can lead to very long calculation times.
+In this activity, we will explore how to configure MsSpec to reduce this calculation time to compute the signal from a deep emitter in Si(001).
+
+
+
+The number of scattering paths
+To fix the idea, we will first evaluate how many scattering paths we need to compute for an emitter in the subsurface (2nd plane) or in the bulk (7th plane) of a Si(001) cluster.
+
+
+
+ Quiz
+
Create a cluster of Si(001) with the emitter in the subsurface, 40 Å diameter with 2 planes (since atoms below the emitter can be ignored at high kinetic energies).
+
+For an emitter in the subsurface, we can use single scattering (see Activity 5: Multiple scattering in the forward scattering regime ). How many paths would be generated for this calculation ?
+Same question for an emitter in the 7th plane. If we were able to treat each scattering path within only 1 µs. How long would be such calculation ?
+
+
+
Note
+
Remember that
+
+for an emitter in plane \(p\) , the scattering order has to be at least the number of planes above
the emitter
+The number of scattering paths of order \(n\) corresponds to the number of possibilities of arranging up to \(n\) atoms (taking order into account).
+
+
+
+
+
+
+Paths filtering in MsSpec
+As you may expect, not all paths contribute significantly to the total intensity. This is why we can filter out some scattering paths and drastically reduce the computation time. MsSpec offers several filters for this. The 3 most common filters are:
+
+the forward_scattering
filter which allows all paths where each scattering angle is within a cone of defined aperture
+the backward_scattering
filter which is similar to the previous one but for backscattering direction
+the distance
filter which rejects all paths longer than a threshold distance
+
+The following figure illustrate the effect of theses filters on scattering paths
+
+
+
+
+Some examples of scattering paths with forward_scattering
, backward_scattering
and distance
filters selected. The accepted forward angle is 45°, the accepted backscattering angle is 20° and the threshold distance is \(6a_0\) where \(a_0\) is the lattice parameter. Note that the yellow path is rejected but if the off_cone_events
option is set to a value > 1, then it could have been accepted.
+
+
+
+
+Application to a deep plane in a Si(001) sample
+The following script will compute the contribution of a Si(2p) atom in the 4th plane of a Si(001) cluster at scattering order 3.
+Taking into account all scattering paths took 15 minutes to compute.
+
+
+
+
+ Quiz
+
The following script is almost completed, try to define path filtering options (no backscattering, accept all paths with forward angles < 40° and reject paths longer than the diameter of the cluster).
+
+How long was your calculation ?
+How does it compare to the calculation with all scattering paths up to order 3 ?
+What is the proportion of scattering paths of order 3 that were actually taken into account ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity08_light.html b/msspecbook/_build/html/light/Activity08_light.html
new file mode 100644
index 0000000..524faf1
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity08_light.html
@@ -0,0 +1,506 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 8: Inequivalent emitters and the XPD of a substrate — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 8: Inequivalent emitters and the XPD of a substrate
+
+
+
+
+
+
+
+
+
+
+Activity 8: Inequivalent emitters and the XPD of a substrate
+XPD can be used to study the adsorption of atoms or molecules on surfaces (Activity 3 ), or atomic substitutions on surfaces (Activity 2 ). In this case, modeling is relatively straightforward, since only one emitter atom is involved.
+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 ).
+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.
+Let’s take a look at how this is done on the following example.
+
+The Aluminium Nitride (AlN) polarity
+In this example, we will compute polar diagrams of an aluminum nitride substrate.
+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 below.
+
+
+
+
+
+AlN hexagonal lattice. Left) N polarity with nitrogen terminated surface and AlN4 tetrahedrons pointing downward. Right) Al polarity with aluminium terminated surface and AlN4 tetrahedrons pointing upward
+
+
+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 (Fig. %s
).
+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.
+
+
+
+
+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. ).
+
+
+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 Fig. %s
).
+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.
+
+
+
+ Quiz
+
Using the crystal view in Fig. %s
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 ?
+
+
+
+
+
+ Quiz
+
Download this script and fill in the lines indicated by the comments “FILL HERE”. Run the calculation and check that you are reproducing polar scan of Fig. %s
.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity09_light.html b/msspecbook/_build/html/light/Activity09_light.html
new file mode 100644
index 0000000..92e2bc8
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity09_light.html
@@ -0,0 +1,531 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 9: Comparing simulation and experiment with R-factors — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 9: Comparing simulation and experiment with R-factors
+
+
+
+
+
+
+
+
+
+
+Activity 9: Comparing simulation and experiment with R-factors
+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.
+R-factors (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.
+
+The unusual tilt of CO molecule on Fe(001)
+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\(\pm\) 2° in <100> azimuthal directions. The molecule is bonded to the Fe surface by the carbon atom and the adsorption height was estimated to be \(\sim\) 0.6 Å.
+
+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.
+
+
+
+
+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.
+
+
+
+
+
+ Quiz
+
Download this script and write the body of the function create_cluster
. The function should return a
+small cluster of 5 Fe atoms with the CO molecule adsorbed like in figure Fig. %s
below. The function
+will accept 4 keyword arguments to control the adsorption geometry.
+
+
+
+
+Adsorption geometry of carbon monoxide on Fe(001).
+
+
+
+
+
+Now that the create_cluster
function is done, look at the rest of the script. The next function is called compute_polar_scan
and will obviously be used to compute the \(\theta\) -scan of the C1s for a given cluster geometry.
+Finally there is the Main part that is built in two sections:
+
+A section containing nested for loops
+A final section for R-Factor analysis
+
+
+
+
+ Quiz
+
+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 Å.
+What is the best \((\theta, \phi)\) according to the R-Factor analysis
+
+
+
+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
+
+
+
+
+The 12 R-Factors used in MsSpec. The Pendry’s R-Factor is n°11.
+
+
+
+
+
+ Quiz
+
How many R-Factors do agree that \((\theta,\phi)=(55,0)\) gives the best agreement ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/light/Activity10_light.html b/msspecbook/_build/html/light/Activity10_light.html
new file mode 100644
index 0000000..a99e674
--- /dev/null
+++ b/msspecbook/_build/html/light/Activity10_light.html
@@ -0,0 +1,493 @@
+
+
+
+
+
+
+
+
+
+
+
Activity 10: Parallelization and multi-processing in MsSpec — MsSpec Tour
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Activity 10: Parallelization and multi-processing in MsSpec
+
+
+
+
+
+
+
+
+
+
+Activity 10: Parallelization and multi-processing in MsSpec
+As you can see from the previous examples, a complete simulation may require several multiple scattering calculations, for instance to calculate the total intensity of a substrate or to optimize the geometry of a system. As the calculations are often time consuming, it can be useful to distribute these tasks over several processors to make the most of hardware resources.
+Although MsSpec is not fully parallelized, the code does offer a number of features, which we will explore here.
+
+Matrix inversion parallelization
+When available during installation, MsSpec will link with the system lapack library. It will be used to invert the matrix in the inversion
option of the MsSpec calculator
. To allow MsSpec to use this shared memory parallelism, you need to set the number of cores to be used in the OMP_NUM_THREADS
environment variable.
+You can set this variable just for the execution of your script. For example:
+ $ OMP_NUM_THREADS = 12 python my_script.py
+
+
+will use 12 cores for inverting the matrix in your script.
+It is also possible to set environment variable inside your python script.
+import os
+
+os . environ [ 'OMP_NUM_THREADS' ] = 12
+
+
+It may be useful for technical reasons or to use different number of cores in some parts of your script.
+
+
+Process-based parallelism
+Another kind of parallelization used in MsSpec is multiprocessing. Quite often, you need to run different independent calculations. MsSpec provides a simple looper that can be useful for multiprocessing. Let’s demonstrate it with the previous example CO/Fe(001).
+This script is the multiprocessed version of the previous one. You can see that the previous nested for loops are now replaced by some declarative content (lines 63-67) and the definition of a process
function (whose name
+can be changed).
+With the msspec.looper
package, the user define Sweep
objects that are parameters of the calculation or of the cluster. The process
function must accept as many arguments as parameters to sweep (+ the **kwargs
).
+A Looper
object is created (line 76) and the process
function is set to its pipeline
attribute (line 77). When MsSpec will run the looper
, it will combine all parameters values to unique individual sets and MsSpec will distribute the calculations over the number of processors specified in the ncpu
option.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/msspecbook/_build/html/objects.inv b/msspecbook/_build/html/objects.inv
index 27ef00d..f5b9827 100644
Binary files a/msspecbook/_build/html/objects.inv and b/msspecbook/_build/html/objects.inv differ
diff --git a/msspecbook/_build/html/reports/light/Activity01_light.err.log b/msspecbook/_build/html/reports/light/Activity01_light.err.log
new file mode 100644
index 0000000..f8cb99b
--- /dev/null
+++ b/msspecbook/_build/html/reports/light/Activity01_light.err.log
@@ -0,0 +1,69 @@
+Traceback (most recent call last):
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 154, in wrapped
+ asyncio.get_running_loop()
+RuntimeError: no running event loop
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/jupyter_cache/executors/utils.py", line 58, in single_nb_execution
+ executenb(
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/nbclient/client.py", line 1319, in execute
+ return NotebookClient(nb=nb, resources=resources, km=km, **kwargs).execute()
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 158, in wrapped
+ return loop.run_until_complete(inner)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/opt/pyenv/versions/3.11.3/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
+ return future.result()
+ ^^^^^^^^^^^^^^^
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/nbclient/client.py", line 709, in async_execute
+ await self.async_execute_cell(
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/nbclient/client.py", line 1062, in async_execute_cell
+ await self._check_raise_for_error(cell, cell_index, exec_reply)
+ File "/opt/msspec/msspec_venv/lib/python3.11/site-packages/nbclient/client.py", line 918, in _check_raise_for_error
+ raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
+nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
+------------------
+from ase.io import read
+from ase.visualize import view
+from msspec.calculator import MSSPEC
+
+
+cluster = read('copper.cif')
+# view the cluster
+view(cluster, viewer='x3d')
+------------------
+
+
+[31m---------------------------------------------------------------------------[39m
+[31mFileNotFoundError[39m Traceback (most recent call last)
+[36mCell[39m[36m [39m[32mIn[3][39m[32m, line 6[39m
+[32m 2[39m [38;5;28;01mfrom[39;00m[38;5;250m [39m[34;01mase[39;00m[34;01m.[39;00m[34;01mvisualize[39;00m[38;5;250m [39m[38;5;28;01mimport[39;00m view
+[32m 3[39m [38;5;28;01mfrom[39;00m[38;5;250m [39m[34;01mmsspec[39;00m[34;01m.[39;00m[34;01mcalculator[39;00m[38;5;250m [39m[38;5;28;01mimport[39;00m MSSPEC
+[32m----> [39m[32m6[39m cluster = [43mread[49m[43m([49m[33;43m'[39;49m[33;43mcopper.cif[39;49m[33;43m'[39;49m[43m)[49m
+[32m 7[39m [38;5;66;03m# view the cluster[39;00m
+[32m 8[39m view(cluster, viewer=[33m'[39m[33mx3d[39m[33m'[39m)
+
+[36mFile [39m[32m/opt/msspec/msspec_venv/lib/python3.11/site-packages/ase/io/formats.py:808[39m, in [36mread[39m[34m(filename, index, format, parallel, do_not_split_by_at_sign, **kwargs)[39m
+[32m 806[39m [38;5;28;01mif[39;00m index [38;5;129;01mis[39;00m [38;5;28;01mNone[39;00m:
+[32m 807[39m index = -[32m1[39m
+[32m--> [39m[32m808[39m [38;5;28mformat[39m = [38;5;28mformat[39m [38;5;129;01mor[39;00m [43mfiletype[49m[43m([49m[43mfilename[49m[43m,[49m[43m [49m[43mread[49m[43m=[49m[38;5;28;43misinstance[39;49m[43m([49m[43mfilename[49m[43m,[49m[43m [49m[38;5;28;43mstr[39;49m[43m)[49m[43m)[49m
+[32m 810[39m io = get_ioformat([38;5;28mformat[39m)
+[32m 811[39m [38;5;28;01mif[39;00m [38;5;28misinstance[39m(index, ([38;5;28mslice[39m, [38;5;28mstr[39m)):
+
+[36mFile [39m[32m/opt/msspec/msspec_venv/lib/python3.11/site-packages/ase/io/formats.py:983[39m, in [36mfiletype[39m[34m(filename, read, guess)[39m
+[32m 980[39m [38;5;28;01mreturn[39;00m ext
+[32m 982[39m [38;5;28;01mif[39;00m orig_filename == filename:
+[32m--> [39m[32m983[39m fd = [43mopen_with_compression[49m[43m([49m[43mfilename[49m[43m,[49m[43m [49m[33;43m'[39;49m[33;43mrb[39;49m[33;43m'[39;49m[43m)[49m
+[32m 984[39m [38;5;28;01melse[39;00m:
+[32m 985[39m fd = orig_filename [38;5;66;03m# type: ignore[assignment][39;00m
+
+[36mFile [39m[32m/opt/msspec/msspec_venv/lib/python3.11/site-packages/ase/io/formats.py:612[39m, in [36mopen_with_compression[39m[34m(filename, mode)[39m
+[32m 609[39m [38;5;28;01mreturn[39;00m lzma.open(filename, mode)
+[32m 610[39m [38;5;28;01melse[39;00m:
+[32m 611[39m [38;5;66;03m# Either None or unknown string[39;00m
+[32m--> [39m[32m612[39m [38;5;28;01mreturn[39;00m [38;5;28;43mopen[39;49m[43m([49m[43mfilename[49m[43m,[49m[43m [49m[43mmode[49m[43m)[49m
+
+[31mFileNotFoundError[39m: [Errno 2] No such file or directory: 'copper.cif'
+
diff --git a/msspecbook/_build/html/search.html b/msspecbook/_build/html/search.html
index b0b0582..62150af 100644
--- a/msspecbook/_build/html/search.html
+++ b/msspecbook/_build/html/search.html
@@ -30,7 +30,7 @@
-
+
@@ -347,7 +347,7 @@ By Sylvain Tricot
- © Copyright 2023.
+ © Copyright 2025.
diff --git a/msspecbook/_build/html/searchindex.js b/msspecbook/_build/html/searchindex.js
index 1e0a5b4..899eec2 100644
--- a/msspecbook/_build/html/searchindex.js
+++ b/msspecbook/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"alltitles": {"Activity 10: Parallelization and multi-processing in MsSpec": [[18, null], [19, null]], "Activity 11: Spectral radius and convergence": [[20, null]], "Activity 1: Getting started": [[0, null], [1, null]], "Activity 2: Setting up the \u201cexperiment\u201d": [[2, null], [3, null]], "Activity 3: Adsorbates and the single scattering approach": [[4, null], [5, null]], "Activity 4: From single scattering to multiple scattering": [[6, null], [7, null]], "Activity 5: Multiple scattering in the forward scattering regime": [[8, null], [9, null]], "Activity 6: Effect of the temperature": [[10, null], [11, null]], "Activity 7: Large clusters and path filtering": [[12, null], [13, null]], "Activity 8: Inequivalent emitters and the XPD of a substrate": [[14, null], [15, null]], "Activity 9: Comparing simulation and experiment with R-factors": [[16, null], [17, null]], "Application to a deep plane in a Si(001) sample": [[12, "application-to-a-deep-plane-in-a-si-001-sample"], [13, "application-to-a-deep-plane-in-a-si-001-sample"]], "Barebone script for MsSpec": [[0, "barebone-script-for-msspec"], [1, "barebone-script-for-msspec"]], "Building a chain of atoms": [[6, "building-a-chain-of-atoms"], [7, "building-a-chain-of-atoms"]], "Building atomic systems": [[0, "building-atomic-systems"], [1, "building-atomic-systems"]], "Building the cluster": [[2, "building-the-cluster"], [3, "building-the-cluster"]], "Compute an azimuthal scan": [[2, "compute-an-azimuthal-scan"], [3, "compute-an-azimuthal-scan"]], "Computing the scattering factor": [[4, "computing-the-scattering-factor"], [5, "computing-the-scattering-factor"]], "Creating the TiSe2 cluster": [[8, "creating-the-tise2-cluster"], [9, "creating-the-tise2-cluster"]], "Effect of the scattering order": [[8, "effect-of-the-scattering-order"], [9, "effect-of-the-scattering-order"]], "Final word": [[21, null]], "Future developpements": [[21, "future-developpements"]], "How to install MsSpec": [[21, "how-to-install-msspec"]], "Interferences due to backscattering": [[4, "interferences-due-to-backscattering"], [5, "interferences-due-to-backscattering"]], "Matrix inversion parallelization": [[18, "matrix-inversion-parallelization"], [19, "matrix-inversion-parallelization"]], "Our work": [[21, "our-work"]], "Oxygen on Rh(001)": [[4, "oxygen-on-rh-001"], [5, "oxygen-on-rh-001"]], "PED of the 1T-TiSe
2 surface": [[8, "ped-of-the-1t-tise2-surface"], [9, "ped-of-the-1t-tise2-surface"]], "PED polar scan for Cu(001)": [[0, "ped-polar-scan-for-cu-001"], [1, "ped-polar-scan-for-cu-001"]], "Paths filtering in MsSpec": [[12, "paths-filtering-in-msspec"], [13, "paths-filtering-in-msspec"]], "Polar scans of Ni atomic chains": [[6, "polar-scans-of-ni-atomic-chains"], [7, "polar-scans-of-ni-atomic-chains"]], "Process-based parallelism": [[18, "process-based-parallelism"], [19, "process-based-parallelism"]], "Sb-induced smooth growth of Ag on Ag(111) example": [[2, "sb-induced-smooth-growth-of-ag-on-ag-111-example"], [3, "sb-induced-smooth-growth-of-ag-on-ag-111-example"]], "Shaping a cluster": [[0, "shaping-a-cluster"], [1, "shaping-a-cluster"]], "Solution\u2026": [[0, null], [2, null], [4, null], [4, null], [6, null], [6, null], [8, null], [8, null], [10, null], [12, null], [12, null], [14, null], [14, null], [16, null], [16, null], [16, null], [18, null]], "Surface and bulk effects of the temperature": [[10, "surface-and-bulk-effects-of-the-temperature"], [11, "surface-and-bulk-effects-of-the-temperature"]], "The Aluminium Nitride (AlN) polarity": [[14, "the-aluminium-nitride-aln-polarity"], [15, "the-aluminium-nitride-aln-polarity"]], "The number of scattering paths": [[12, "the-number-of-scattering-paths"], [13, "the-number-of-scattering-paths"]], "The script": [[10, "the-script"], [11, "the-script"]], "The unusual tilt of CO molecule on Fe(001)": [[16, "the-unusual-tilt-of-co-molecule-on-fe-001"], [17, "the-unusual-tilt-of-co-molecule-on-fe-001"]], "Welcome to this small MsSpec tour": [[22, null]], "if you need help to start\u2026": [[6, null], [7, null]]}, "docnames": ["Activity01/Activity01", "Activity01/Activity01_light", "Activity02/Activity02", "Activity02/Activity02_light", "Activity03/Activity03", "Activity03/Activity03_light", "Activity04/Activity04", "Activity04/Activity04_light", "Activity05/Activity05", "Activity05/Activity05_light", "Activity06/Activity06", "Activity06/Activity06_light", "Activity07/Activity07", "Activity07/Activity07_light", "Activity08/Activity08", "Activity08/Activity08_light", "Activity09/Activity09", "Activity09/Activity09_light", "Activity10/Activity10", "Activity10/Activity10_light", "Activity11/Activity11", "backmatter", "intro"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinxcontrib.bibtex": 9}, "filenames": ["Activity01/Activity01.ipynb", "Activity01/Activity01_light.ipynb", "Activity02/Activity02.ipynb", "Activity02/Activity02_light.ipynb", "Activity03/Activity03.ipynb", "Activity03/Activity03_light.ipynb", "Activity04/Activity04.ipynb", "Activity04/Activity04_light.ipynb", "Activity05/Activity05.ipynb", "Activity05/Activity05_light.ipynb", "Activity06/Activity06.ipynb", "Activity06/Activity06_light.ipynb", "Activity07/Activity07.ipynb", "Activity07/Activity07_light.ipynb", "Activity08/Activity08.ipynb", "Activity08/Activity08_light.ipynb", "Activity09/Activity09.ipynb", "Activity09/Activity09_light.ipynb", "Activity10/Activity10.ipynb", "Activity10/Activity10_light.ipynb", "Activity11/Activity11.ipynb", "backmatter.md", "intro.md"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [2, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "0": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19], "00": [14, 15], "0001": [14, 15], "001": [10, 11, 18, 19], "004": [8, 9], "006": [12, 13], "01": 12, "010": 16, "02": [4, 5], "045": 6, "05": 4, "0f": [10, 11], "1": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "10": [0, 1, 2, 4, 5, 14, 15, 16, 17, 22], "100": [10, 11, 16, 17], "1000": [10, 11], "1000k": [10, 11], "101": [6, 7], "1030": [8, 9], "1083": 14, "11": [14, 16, 17], "110": [16, 17], "111": [4, 5], "114": 12, "12": [16, 17, 18, 19], "1202": [16, 17], "121": [2, 3], "1382": [12, 13], "14": [10, 11], "1407": 14, "147176": [12, 13], "15": [2, 3, 8, 9, 12, 13, 16], "1525": 12, "157": [16, 17, 18, 19], "1986": [10, 11], "1989": [6, 7, 16, 17], "1998": [4, 5], "1999": [14, 15], "1e": [12, 13], "1e12": [8, 9], "2": [0, 1, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "20": [2, 3, 12, 13, 14], "2012": [8, 9, 10, 11], "2022": [12, 13], "207": [14, 15], "22": 2, "240": [2, 3], "25": [8, 9, 14], "256": [12, 13], "27": [10, 11], "28": [12, 13], "298k": [10, 11], "2d": [8, 9], "2f": 4, "2p": [0, 1, 8, 9, 10, 11, 12, 13, 14, 15], "2p3": [0, 1], "3": [0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 22], "30": [2, 3, 12, 13, 14, 16, 17], "300": [10, 11], "32": [14, 15], "34": [10, 11], "343": 10, "35": [14, 16], "39": [6, 7], "3f": [8, 9], "3rd": [0, 1], "4": [0, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "40": [2, 3, 12, 13], "400": [10, 11], "43": [12, 13], "45": [2, 3, 6, 7, 10, 11, 12, 13, 16, 17, 18, 19], "450": [8, 9], "499": [6, 7], "4d": [2, 3], "5": [2, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 22], "50": [18, 19], "500": [14, 15], "51": [10, 11], "535": [8, 9], "54": [12, 13], "55": [2, 3, 16, 17], "554": [8, 9], "560": [10, 11], "58": [14, 15], "59": [14, 15], "6": [2, 8, 9, 12, 14, 16, 17, 18, 19, 22], "60": [8, 9, 16, 17, 18, 19], "606": [8, 9], "63": [16, 17, 18, 19], "64": [8, 9], "65": [4, 5], "67": [18, 19], "685": [8, 9], "6a_0": [12, 13], "7": [10, 11, 14, 15, 22], "70": [8, 9, 14], "72": [14, 15], "723": [4, 5], "739": 12, "76": [18, 19], "77": [18, 19], "8": [2, 3, 4, 5, 8, 9, 22], "80": [6, 12, 13, 14], "81": [4, 5], "83": [10, 11], "9": [10, 18, 19, 22], "90": [12, 13], "900": [8, 9], "945": 12, "975": 14, "98": [10, 11], "A": [4, 5, 6, 7, 10, 11, 16, 17, 18, 19], "AED": [0, 1], "ASE": [0, 1, 2, 3, 4, 5, 8, 9], "As": [0, 1, 4, 5, 8, 9, 12, 13, 14, 15, 18, 19], "But": [8, 9], "By": [4, 5], "For": [2, 3, 6, 8, 9, 10, 11, 12, 13, 18, 19], "If": [12, 13], "In": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "It": [2, 3, 8, 9, 14, 15, 16, 17, 18, 19], "Not": 0, "On": [4, 5], "One": 12, "Or": [0, 1], "The": [0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19], "There": [0, 1], "These": [14, 15], "To": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 18, 19], "With": [10, 11, 12, 13, 18, 19], "_": 14, "__main__": [10, 11], "__name__": [10, 11], "_plotopt": [10, 11], "a_0": [8, 9, 12, 13], "abl": [12, 13], "about": [4, 5, 8, 9], "abov": [0, 1, 4, 8, 10, 11, 12, 13], "abscissa": 16, "absorb": [10, 11, 14], "accept": [12, 13, 16, 17, 18, 19], "access": [14, 15], "accord": [16, 17], "account": [0, 1, 8, 9, 12, 13], "accur": [4, 5, 8, 9, 16, 17], "accuraci": [4, 5, 6, 7], "act": [2, 3], "activ": 22, "actual": [10, 11, 12, 13], "ad": [4, 5, 14], "add": [2, 3, 4, 5, 10, 11, 12, 13, 14, 18, 19], "add_adsorb": [4, 5, 16, 17], "add_column": [2, 3, 10, 11, 12, 13, 14], "add_dset": [10, 11, 14], "add_view": [10, 11, 14], "adjust": [16, 17], "adsorb": [16, 17, 22], "adsorpt": [4, 5, 14, 15, 16, 17, 18, 19], "advantag": [4, 5], "after": [8, 9, 16], "agit": 10, "agre": [16, 17], "agreement": [2, 3, 16, 17], "al": [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17], "al_al": 14, "al_kalpha": [10, 11, 12, 13, 14], "al_n": 14, "al_plan": 14, "al_sid": 14, "alber": [8, 9, 12, 13, 14, 15], "algorithm": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "algortithm": [6, 7], "align": [2, 3, 8, 9, 16, 17], "all": [0, 1, 4, 5, 6, 10, 11, 12, 13, 14, 15, 18, 19, 22], "all_t": [10, 11], "all_theta": [10, 11], "all_z": [4, 5], "allow": [0, 1, 12, 13, 18, 19], "almost": [8, 9, 12, 13, 14, 15], "along": [6, 7, 16, 17], "alreadi": [8, 9], "also": [2, 3, 8, 9, 10, 11, 16, 18, 19], "altern": [12, 13], "although": [2, 3, 6, 7, 18, 19], "altitud": 4, "aluminum": [14, 15], "amplitud": [14, 15], "an": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19], "analysi": [10, 11, 14, 16, 17], "analyz": [0, 1], "angl": [2, 3, 10, 11, 12, 13, 14, 15, 16, 18, 19], "angstrom": 4, "angstr\u00f6m": [8, 9, 16, 18], "angular_accept": [2, 3, 10, 11, 14], "ani": [4, 5], "anisotropi": [10, 11, 18, 19], "anisotropy_dset": [10, 11], "anisotropy_view": [10, 11], "anneal": [14, 15], "annular": 4, "anoth": [8, 9, 18, 19], "apart": [4, 5], "apec": [0, 1], "apertur": [12, 13], "append": [10, 11, 14, 16], "approach": [0, 1, 6, 7, 8, 9, 22], "approxim": [4, 5, 6, 7, 8, 9], "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "arang": [4, 6, 10, 11, 12, 13, 14, 16], "arbitrarili": [10, 11], "argument": [16, 17, 18, 19], "aris": 14, "around": [8, 9, 14, 15], "arrai": [10, 11], "arrang": [12, 13], "articl": [10, 11], "ase": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17], "assum": [2, 3, 12, 14, 15, 16, 17], "atom": [2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "atomist": [0, 1], "attach": [4, 5], "attempt": [10, 11], "attribut": [2, 3, 18, 19], "author": [14, 15], "autoscal": [10, 11, 14], "avail": [0, 1, 8, 9, 18, 19], "averag": [10, 11], "average_sampl": [2, 3, 10, 11, 14], "averaged_tl": [10, 11, 12, 13], "axi": [8, 9], "azimth": [16, 17], "azimut": [10, 11], "azimuth": [10, 11, 14, 15, 16, 17, 18, 19], "b": [2, 3, 6, 7, 10, 11], "b_0": [8, 9], "backscatt": [6, 12, 13], "backward_scatt": [12, 13], "bar": 14, "barton": [6, 7], "base": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "basi": [0, 1], "beamlin": 2, "becaus": [6, 7, 12, 13], "becom": [4, 5, 12, 13], "been": [12, 13], "begin": [4, 5], "being": [4, 5, 10, 11], "belong": 16, "below": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "best": [16, 17], "better": [2, 3], "between": [0, 2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 18, 19], "bewteen": [6, 7], "bit": [8, 9], "black": [18, 19], "blue": [2, 3, 12], "bodi": [16, 17], "boltzmann": [10, 11], "bond": [4, 5, 16, 17], "bond_length": [16, 18, 19], "both": [4, 5, 6, 10, 11, 14, 15], "bright": 4, "bring": 22, "build": [4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "built": [16, 17], "bulk": [0, 1, 2, 3, 12, 13, 14, 16, 17], "c": [8, 9, 10, 11, 14, 16, 17], "c1": [16, 17], "c_0": [8, 9], "calc": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14], "calc_": [18, 19], "calcul": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "calculation_paramet": [2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14], "calculationparamet": [10, 11], "calcult": [16, 17], "call": [16, 17], "can": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "cancel": 6, "cannot": [8, 9], "carbon": [16, 17], "carri": [4, 5], "case": [4, 5, 14, 15], "categori": [2, 3], "cell": [2, 3, 8, 9, 14, 15], "center": [4, 8, 9], "chain": [4, 5], "chang": [2, 3, 4, 5, 10, 11, 18, 19], "check": [14, 15], "chosen": [10, 11], "cif": [0, 1], "circl": 4, "cite": [10, 11], "class": [4, 5, 6, 7], "clear": [10, 11], "close": [6, 7, 12], "cluster": [4, 5, 10, 11, 14, 15, 16, 17, 18, 19, 22], "cnr": [0, 1], "co": [18, 19], "code": [0, 1, 2, 3, 4, 5, 8, 9, 12, 13, 16, 18, 19], "col_nam": [10, 11], "col_valu": [10, 11], "column": [8, 9, 14], "com": [4, 5], "combin": [18, 19], "come": [4, 5, 6, 7, 10], "comment": [4, 5, 14, 15, 18, 19], "common": [10, 11, 12, 13], "commonli": [16, 17], "compar": [2, 3, 6, 7, 12, 13, 18, 19, 22], "comparison": [0, 2, 3, 12, 13], "complet": [4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19], "complex": [8, 9], "compon": [0, 1], "comput": [0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "computation": [4, 5], "compute_polar_scan": [16, 17, 18, 19], "concept": [0, 1, 22], "conclud": [0, 1, 8, 9], "cone": [12, 13], "configur": [2, 3, 12, 13], "consequ": [6, 7], "consid": [4, 5], "constant": [8, 9, 10, 11], "construct": [4, 5], "consum": [18, 19], "consumpt": [4, 5], "contain": [0, 1, 2, 3, 8, 9, 10, 11, 16, 17], "content": [0, 1, 18, 19], "contrast": [14, 15], "contribut": [0, 12, 13], "control": [10, 11, 14, 15, 16, 17], "converg": [2, 3, 8], "convert": [18, 19], "copi": [2, 3, 14, 16], "copper": [0, 1, 8, 9, 10, 11], "core": [14, 15, 18, 19], "correctli": [2, 3], "correspond": [8, 9, 12, 13, 14, 15, 16], "could": [12, 13], "cover": [0, 1], "cp": 16, "creat": [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 16, 18, 19], "create_clust": [10, 11, 14, 16, 17, 18, 19], "cristal": [14, 15], "cross_sect": [2, 3, 10, 11, 12, 13, 14, 16, 18, 19], "cruguel": [2, 3], "cryst": [14, 15], "crystal": [6, 7, 14, 15], "crystallin": [4, 5], "crystallograph": [14, 15, 16, 17], "crystallograpph": [14, 15], "crystalstructur": 14, "cu": [10, 11], "cubic": [0, 1, 2, 3, 10, 11, 12, 13, 16], "curv": [12, 16, 17], "cut_plan": [2, 3], "cylindr": [10, 11, 12, 13], "d": [0, 1, 4, 8, 9, 10, 11, 14, 18, 19], "damp": [10, 11], "dark": 4, "data": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19], "datafram": [18, 19], "dataset": [2, 3, 10, 11], "deby": [10, 11], "debye_temperatur": [10, 11], "declar": [18, 19], "decreas": 10, "deeper": [6, 7, 8, 14, 15], "deepest": [0, 1, 10, 11], "def": [10, 11, 14, 16, 18, 19], "defin": [2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 18, 19], "definit": [18, 19], "defocus": [6, 7], "degre": [4, 5, 10, 11, 14, 16, 18, 19], "delta": [10, 11], "demonstr": [4, 5, 14, 15, 16, 17, 18, 19], "dens": [8, 9], "depth": [10, 11], "der": [8, 9], "describ": [8, 9], "detail": [10, 11], "detector_paramet": [2, 3, 10, 11, 14], "determin": [14, 15], "deviat": [8, 9], "df": [18, 19], "diagram": [6, 7, 14, 15], "diamet": [2, 3, 10, 11, 12, 13, 14, 16], "dichalcogenid": [8, 9], "dict": [10, 11, 18, 19], "dictionari": 16, "differ": [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "difficulti": 22, "diffract": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 22], "direct": [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17], "directli": [0, 1, 2, 3], "discreap": 14, "discuss": [18, 19], "disord": 10, "displac": [10, 11], "displai": [0, 1, 16, 17], "distanc": [4, 5, 6, 7, 12, 13, 14, 15, 16], "distance_cutoff": 12, "distinguish": [10, 11], "distribut": [18, 19], "do": [0, 1, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17], "document": [4, 5, 10, 11], "doe": [12, 13, 18, 19], "done": [14, 15, 16, 17], "doubl": [8, 9], "download": [0, 1, 2, 3, 14, 15, 16, 17], "downward": [14, 15], "drastic": [12, 13], "dset": [2, 3, 4, 10, 11, 14, 18, 19], "due": [10, 14, 15], "dur": [6, 7], "dure": [14, 15, 18, 19], "e": [2, 3], "e_0": 4, "each": [2, 3, 8, 9, 10, 11, 12, 13, 16], "eas": [2, 3], "easier": [18, 19], "edit": [0, 1, 6, 7, 14], "editor": [2, 3], "effect": [2, 3, 4, 5, 6, 7, 12, 13, 22], "either": [10, 11, 16, 17], "eject": [4, 5], "electron": [0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 22], "element": [8, 9, 14, 15], "elif": 14, "els": [10, 11, 14], "emiss": [4, 10], "emit": [4, 5, 6, 7, 14, 15], "emitt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 22], "emitter_plan": [0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 16], "emitter_tag": [8, 9, 14], "end": 16, "energi": [2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15], "enough": 6, "enumer": [4, 14], "environ": [0, 1, 18, 19], "equal": 0, "equat": [10, 11], "escap": [2, 3], "especi": 14, "estim": [10, 16, 17], "et": [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17], "ev": [2, 3, 4, 5, 8, 9, 10, 14, 15, 16, 17], "evalu": [8, 9, 12, 13], "event": [8, 9], "exact": [4, 5], "exaf": [0, 1], "exampl": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "except": 14, "exchang": [14, 15], "exchange_correl": [10, 11], "execut": [18, 19], "exhibit": [14, 15], "exit": 14, "exp": [2, 3], "expand": [8, 9], "expans": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], "expect": [10, 12, 13, 14, 15], "experi": [6, 7, 18, 19, 22], "experiment": [2, 3, 4, 5, 14, 15, 16, 17, 18, 19], "explain": [10, 11], "explor": [8, 9, 10, 11, 12, 13, 18, 19, 22], "extra": [10, 11], "extract": [16, 17], "extrem": [4, 5], "f": [8, 9, 10, 11, 18, 19], "face": [14, 15], "fact": 6, "factor": [8, 9, 18, 19, 22], "fadlei": [10, 11], "far": [12, 13], "fast": [4, 5], "fcc": [4, 5, 6, 7, 8, 9], "fcc111": [4, 5], "fe": [18, 19], "featur": [0, 1, 2, 3, 14, 15, 18, 19, 22], "few": 12, "fewer": [0, 1], "fig": [14, 15, 16, 17], "figur": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "file": [0, 1, 2, 3], "fill": [4, 5, 14, 15, 16], "filter": [10, 11, 14, 15, 22], "final": [2, 3, 16, 17], "final_st": [12, 13], "find": [16, 17], "fine": [6, 7], "first": [0, 1, 4, 5, 8, 9, 12, 13], "fix": [12, 13], "flexibl": [0, 1], "float": [10, 11], "focu": [0, 1, 6, 7, 22], "folder": [0, 1, 18, 19], "follow": [0, 1, 2, 3, 10, 11, 12, 13, 14, 15, 16, 17], "format": [4, 10, 11, 14], "former": 2, "formula": [8, 9, 12, 16, 17], "forthcom": [0, 1], "fortran": [0, 1], "forward": [6, 7, 12, 13, 22], "forward_angl": [12, 14], "forward_scatt": [12, 13, 14], "found": [6, 7, 14, 15], "fr": [0, 1], "frac": [10, 11], "free": [8, 9, 10, 11], "fring": 4, "from": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "fromkei": [10, 11], "full": [6, 7], "fulli": [0, 1, 18, 19], "function": [8, 9, 10, 11, 16, 17, 18, 19], "fundament": [0, 1, 6, 7], "futur": [18, 19], "g": [2, 3], "gap": [8, 9], "gener": [2, 8, 9, 12, 13], "geometr": [14, 15], "geometri": [2, 16, 17, 18, 19], "gerber": [4, 5], "get": [10, 11, 12, 14, 15, 18, 19, 22], "get_aln_tags_plan": 14, "get_atom_index": [0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14], "get_clust": 14, "get_paramet": [10, 11], "get_phi_scan": [2, 3, 10, 11], "get_scattering_factor": [4, 5], "get_theta_phi_scan": [4, 5, 8, 9], "get_theta_scan": [0, 1, 6, 12, 13, 14], "give": [4, 5, 6, 14, 15, 16, 17], "given": [2, 10, 11, 16, 17], "good": [6, 7], "graze": [10, 11], "great": [4, 5], "greater": [8, 9], "greatli": [0, 1], "greber": [4, 5], "group": [2, 3], "grow": [8, 9, 22], "growth": [14, 15], "gtrsim": [14, 15], "gui": [0, 1, 2, 3], "h": [2, 3], "h2o": [0, 1], "ha": [6, 8, 9, 12, 13], "half": [10, 11], "hand": [4, 5, 16, 17], "hardwar": [18, 19], "harmon": [0, 1, 8, 9], "have": [4, 5, 6, 7, 12, 13, 14, 15], "hbar": [10, 11], "hdf5": [12, 13], "height": [4, 5, 6, 7, 16, 17, 18, 19], "help": [8, 9, 10, 11], "hemispher": [0, 1, 8, 9], "hemispherical_clust": [0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 16, 17], "here": [0, 1, 4, 5, 8, 9, 14, 15, 16, 17, 18, 19], "hexagon": [14, 15], "high": [4, 5, 6, 8, 9, 12, 13], "highli": [14, 15], "hilight": [10, 11], "hollow": [16, 17], "hove": [6, 7], "how": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 22], "howev": [0, 1, 6, 7], "http": [0, 1], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "i_": [10, 11], "ic": 14, "idea": [2, 3, 10, 11, 12, 13], "identifi": [2, 3], "ie": 16, "ignor": [12, 13], "illustr": [4, 5, 6, 7, 12, 13], "imax": [10, 11], "imin": [10, 11], "impact": [0, 1], "import": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 19], "imposs": [12, 13], "incid": [10, 11], "includ": [0, 1, 4, 5], "incoher": [14, 15], "incom": [2, 3], "increas": [4, 5, 6, 7, 8, 9, 10, 11, 12], "incres": [10, 11], "independ": [18, 19], "index": [0, 1, 12, 13], "indic": [4, 5, 14, 15], "individu": [18, 19], "inequival": [8, 9, 22], "info": [10, 11, 14, 16], "inform": [4, 5, 10, 11, 16, 17], "inner": [2, 3], "inner_potenti": 2, "inset": [14, 15], "insid": [2, 3, 18, 19], "instal": [18, 19], "instanc": [18, 19], "int": [8, 9], "intenisti": 14, "intens": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19], "intentis": [8, 9], "interact": [0, 1], "interfac": [0, 1], "intern": [2, 3], "interplai": [0, 1], "interstitial_potenti": [2, 3, 10, 11], "introduc": [10, 11], "invas": [14, 15], "invers": [0, 1, 4, 5, 6, 7, 8, 9, 12, 13], "invert": [18, 19], "involv": [14, 15], "io": [0, 1], "iodata": [12, 13], "iron": 16, "its": [4, 5, 18, 19], "itself": [8, 9, 16], "j": [6, 7, 12, 13, 14, 15], "just": [18, 19], "k": [10, 11], "k_b": [10, 11], "ke": 14, "keep": 16, "kei": [14, 15, 18, 19], "keyerror": 14, "keyword": [16, 17], "kind": [6, 7, 8, 10, 11, 18, 19], "kinet": [2, 3, 4, 5, 6, 8, 9, 12, 13, 14, 15], "kinetic_energi": [2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14], "known": [8, 9], "kuznetsov": [8, 9], "kwarg": [18, 19], "l": [6, 7], "l_": [8, 9], "lambda_": 10, "lapack": [18, 19], "larg": [2, 3, 4, 5, 8, 9, 10, 11, 14, 22], "larger": [8, 9], "last": [4, 5], "later": [4, 5], "latter": [10, 11], "lattic": [6, 7, 8, 9, 12, 13, 14, 15], "layer": [2, 3, 10], "lead": [4, 5, 12, 13], "learn": 22, "least": [12, 13], "lebedev": [14, 15], "leed": [0, 1], "left": [8, 9, 14, 15, 16, 17], "legend": [2, 3, 10, 11, 12, 13, 14], "len": [4, 10, 11], "length": [4, 5, 6, 7, 12, 13, 16, 17], "let": [2, 3, 4, 5, 8, 9, 14, 15, 18, 19], "lett": [4, 5, 16, 17], "level": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15], "librari": [18, 19], "light": [2, 3], "like": [0, 1, 6, 7, 8, 9, 16, 17], "line": [2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 18, 19], "link": [18, 19], "linspac": [2, 3, 10, 11], "list": [4, 5, 16, 18, 19], "littl": [12, 13], "ll": [4, 5], "lmax": [8, 9], "load": [12, 13], "loadtxt": [2, 3], "local": [14, 15], "locat": [0, 1, 14, 15], "long": [12, 13], "longer": [6, 7, 12, 13], "look": [2, 3, 10, 11, 14, 15, 16, 17], "loop": [4, 5, 16, 17, 18, 19], "looper": [18, 19], "loss": 10, "low": [2, 3, 10, 11], "lower": [10, 11], "lure": 2, "m": [6, 7, 8, 9, 10, 11, 12], "magic": [18, 19], "magnitud": [10, 11], "mai": [2, 3, 12, 13, 14, 18, 19], "main": [14, 15, 16, 17], "major": [6, 7, 16, 17], "make": [18, 19], "mani": [6, 7, 12, 13, 14, 15, 16, 17, 18, 19], "manipul": [0, 1], "manual": [10, 11], "marker": [10, 11], "mass": [10, 11], "match": [2, 3], "materi": [2, 3, 8, 9], "mathr": [4, 5], "matplotlib": [0, 1, 2, 3], "matrix": [4, 5, 8, 9, 12, 13], "matter": [0, 1], "max": [2, 3, 8, 9, 10, 11, 14], "maxima": [4, 5], "mean": [8, 9, 10, 11], "mean_free_path": [10, 11], "mean_square_vibr": [12, 13], "measur": [8, 9], "medium": 14, "memori": [0, 1, 2, 3, 4, 5, 8, 9, 12, 13, 18, 19], "metal": [8, 9], "method": [0, 1, 4, 5], "metrial": 2, "mfp": [8, 9], "middl": [0, 1], "min": [2, 3, 10, 11, 14], "minim": [0, 1], "minut": [12, 13], "miss": [2, 3], "model": [2, 3, 8, 9, 10, 11, 14, 15, 16, 17, 22], "modifi": [18, 19], "modul": [0, 1, 10, 11], "molecul": [0, 1, 4, 5, 6, 7, 14, 15, 18, 19], "moment": [0, 1], "monoxid": [16, 17], "more": [0, 1, 8, 9, 10, 11], "most": [0, 1, 2, 3, 4, 5, 12, 13, 18, 19], "msc": 6, "msd": [10, 11], "msspec": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 16, 17], "mt_radiu": [12, 13], "much": [0, 1, 2, 3, 8, 9, 10, 11], "muffintin_paramet": [2, 3, 10, 11], "multi": [8, 9, 22], "multipl": [0, 1, 4, 5, 10, 11, 12, 13, 18, 19, 22], "multiprocess": [18, 19], "must": [18, 19], "mutlipl": 6, "mx2": [8, 9], "my_filt": 12, "my_script": [18, 19], "n": [8, 9, 12, 13, 14, 15, 16, 17], "n_al": 14, "n_n": 14, "n_plane": 14, "n_side": 14, "name": [18, 19], "natoli": [0, 1], "ncpu": [18, 19], "nd": [8, 9, 12, 13], "ndif": [8, 9], "nearest": [14, 15], "need": [2, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "neighbor": [14, 15], "neighbour": [14, 15], "nest": [16, 17, 18, 19], "new": [0, 1], "next": [16, 17], "nickel": [6, 7], "nitrogen": [14, 15], "no_filt": [12, 13], "non": [14, 15], "none": [4, 5, 6, 8, 9, 10, 11, 14], "normal": [2, 3, 16, 17], "note": [12, 13], "now": [2, 3, 14, 16, 17, 18, 19], "np": [2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19], "nplane": [10, 11, 14], "num": 18, "number": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 14, 16, 18, 19], "numer": [4, 5], "numpi": [2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14], "o": [4, 5, 10, 11, 16, 18, 19], "object": [2, 3, 10, 11, 14, 16, 18, 19], "observ": [6, 7, 8, 9], "obvious": [16, 17], "off_cone_ev": [12, 13, 14], "offer": [12, 13, 18, 19, 22], "often": [18, 19], "omp_num_thread": [18, 19], "one": [6, 10, 11, 12, 13, 14, 15, 18, 19], "ones": 10, "onli": [0, 1, 4, 5, 6, 12, 13, 14, 15], "onto": [16, 17], "optim": [18, 19], "option": [10, 11, 12, 13, 18, 19], "orang": [2, 3, 12], "order": [4, 5, 10, 11, 12, 13, 16, 17], "orient": [2, 3, 4, 5, 16], "origin": [14, 15], "other": [0, 1, 4, 5], "our": [4, 5, 10, 11], "out": [6, 12, 13, 16], "output": [18, 19], "over": [4, 5, 10, 11, 18, 19], "ow": 6, "p": [12, 13, 16], "p1654": [4, 5], "p1760": [8, 9], "p266": [14, 15], "p283": [16, 17], "p6784": [10, 11], "p6785": [10, 11], "p6791": [10, 11], "p8275": [6, 7], "packag": [4, 5, 18, 19], "page": [2, 3], "panda": [18, 19], "paper": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "paragraph": [10, 11], "parallel": 22, "paramet": [2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19], "part": [16, 17, 18, 19], "particular": [6, 7], "past": [2, 3], "path": [4, 5, 8, 9, 10, 11, 14, 15, 22], "path_filt": [12, 13, 14], "pattern": [8, 9, 14, 15], "peak": [6, 7, 8, 9, 14], "ped": [4, 5, 6, 10, 11, 12, 13, 14], "pendri": [16, 17], "perform": [10, 11, 22], "phagen": [0, 1], "phase": [0, 1, 10, 11], "phenom": [12, 13], "phi": [2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19], "photodiffract": [4, 5, 6, 7, 14, 15], "photoelectron": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 22], "photoemiss": [14, 15], "phy": [2, 3, 4, 5, 6, 7, 10, 11, 16, 17], "physic": [10, 11], "pi": [8, 9], "pipelin": [18, 19], "plai": [6, 7], "planck": [10, 11], "plane": [0, 1, 2, 3, 8, 9, 10, 11, 14, 15, 16], "plot": [0, 1, 10, 11], "plt": [0, 1, 2, 3], "pm": [4, 5, 16, 17], "point": [2, 3, 14, 15], "polar": [2, 3, 4, 10, 11, 12, 16, 17], "pop": [4, 5, 18, 19], "popup": [2, 3, 4], "posit": [4, 6, 7, 16], "possibl": [4, 5, 12, 13, 16, 17, 18, 19], "potenti": [2, 3, 10, 11], "practic": [10, 11], "precis": [8, 9, 16, 17], "preiou": [8, 9], "present": [6, 7], "pretti": [0, 1], "previou": [0, 1, 6, 7, 12, 13, 14, 15, 18, 19], "previous": [4, 5], "print": [8, 9, 14], "probe": [4, 5, 14, 15], "problem": [4, 5], "process": [0, 1, 12, 13, 22], "processor": [18, 19], "produc": [4, 5], "program": [0, 1], "project": 4, "pronounc": 10, "propag": [0, 1], "proport": [12, 13], "propos": [4, 5, 10, 11], "provid": [8, 9, 16, 18, 19], "publish": [4, 5, 10, 11, 14, 15], "pure": [6, 7], "put": [0, 1, 4, 5], "py": [0, 1, 2, 3, 18, 19], "pyplot": [0, 1, 2, 3], "python": [0, 1, 10, 11, 18, 19], "qualit": [10, 11], "quantit": [4, 5], "question": [12, 13], "quick": [14, 15], "quit": [4, 5, 18, 19], "quiz": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "r": [0, 1, 8, 9, 10, 11, 14, 18, 19, 22], "r16061": [2, 3], "ra_cutoff": [12, 13], "radian": 16, "radiu": [8, 9], "rai": [2, 3, 10, 11], "rang": [6, 8, 9, 10, 11, 14], "rather": [4, 5], "ratio": [14, 15], "rd": [0, 12], "read": [0, 1], "real": [10, 11], "realli": [0, 1], "reason": [18, 19], "recent": [0, 1], "red": [4, 5], "reduc": [10, 11, 12, 13], "ref": 2, "refer": [2, 3], "refract": [2, 3], "regardless": [10, 11], "regim": [12, 13, 22], "rehr": [8, 9, 12, 13, 14, 15], "reject": [12, 13], "rel": [10, 11, 14, 15], "relat": [2, 3, 12, 13], "reliabl": [16, 17], "rememb": [12, 13, 16, 17], "remov": [0, 1, 2, 3], "repeat": [6, 7], "replac": [18, 19], "repres": [4, 10, 11], "represent": 4, "reproduc": [10, 11, 14, 15, 16, 17], "requir": [12, 13, 18, 19], "reshap": [18, 19], "resourc": [18, 19], "respect": [2, 3, 4, 5, 14, 15], "rest": [16, 17], "resulst": [18, 19], "result": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 16, 17, 18, 19], "retriev": [10, 11, 14], "return": [10, 11, 14, 16, 17, 18, 19], "rev": [2, 3, 4, 5, 6, 7, 10, 11, 16, 17], "rhodium": [4, 5], "right": [8, 9, 14, 15, 16, 17], "rotat": [2, 3, 6, 7, 8, 9, 14], "rotate_cel": [2, 3, 8, 9], "roughli": [10, 11], "row": [8, 9], "run": [0, 1, 14, 15, 16, 18, 19], "rune": 16, "sa73": 2, "saiki": [16, 17], "same": [0, 1, 6, 7, 12, 13, 14, 15], "sampl": [2, 3, 8, 9, 10, 11], "satisfactori": [2, 3, 4, 5], "save": 0, "saw": [6, 7], "sbag": [2, 3], "scan": [4, 5, 8, 9, 10, 11, 12, 14, 15, 16, 17], "scatter": [0, 1, 10, 11, 14, 15, 16, 17, 18, 19, 22], "scattering_ord": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "sci": [8, 9], "script": [2, 3, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19], "se": [8, 9], "second": [8, 9, 10, 11, 12], "section": [10, 11, 16, 17], "see": [2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 16, 17, 18, 19], "seen": [12, 13, 14, 15], "select": [2, 3, 10, 11, 12, 13, 14], "sensit": [4, 5], "sequenti": [12, 13], "seri": [8, 9, 12, 13, 14, 15], "serial": [12, 13], "set": [0, 1, 6, 7, 10, 11, 12, 13, 14, 16, 17, 18, 19, 22], "set_atom": [0, 1, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14], "set_plot_opt": [6, 10, 11, 14], "sever": [12, 13, 18, 19], "shape": [2, 3, 4, 10, 11, 12, 13, 18, 19], "share": [14, 15, 18, 19], "shift": [0, 1, 10, 11], "short": [14, 15], "should": [2, 3, 8, 16, 17], "show": [0, 1, 14, 15], "shutdown": [2, 3, 10, 11], "side": [14, 15, 16, 17], "signal": [0, 4, 5, 10, 11, 12, 13, 14, 15], "signific": [2, 3], "significantli": [12, 13], "silver": [2, 3], "sim": [10, 16, 17], "similar": [12, 13], "simpl": [6, 7, 10, 11, 16, 17, 18, 19], "simplist": [4, 5], "simul": [0, 1, 4, 5, 6, 7, 14, 18, 19, 22], "sin": [10, 16], "sinc": [0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 22], "singl": [8, 9, 10, 11, 12, 13, 16, 17, 22], "sinl": [4, 5], "site": [4, 5, 16, 17], "situat": [6, 7], "size": [2, 3, 4, 5, 8, 12], "sketch": [14, 15], "small": [2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 17], "smaller": [2, 3], "snipet": [8, 9], "so": [4, 5, 12, 13], "softwar": 22, "solut": 17, "some": [0, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19], "soon": [4, 5], "sourc": [2, 3], "source_paramet": [2, 3, 10, 11, 12, 13, 14], "spec": [0, 1], "speci": [4, 5], "specif": [2, 3], "specifi": [18, 19], "spectrosc": [12, 13], "spectroscopi": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 22], "spectroscopy_paramet": [12, 13], "spheric": [0, 1, 8, 9], "spirit": [6, 7], "sqrt": 6, "squar": [10, 11], "ssc": [6, 7, 16, 17], "start": [2, 3, 4, 5, 8, 9, 18, 19, 22], "state": [14, 15], "step": [0, 1, 2, 3, 16, 17, 18, 19], "stereograph": 4, "stop": [18, 19], "store": [8, 9, 10, 11, 16], "straightforward": [0, 1, 14, 15], "strongest": [14, 15], "strongli": [8, 9], "structur": [0, 1, 8, 9, 10], "studi": [4, 5, 6, 7, 14, 15], "substitut": [2, 3, 14, 15], "substrat": [10, 11, 18, 19, 22], "substrate_dset": 14, "subsurfac": [12, 13], "suggest": [18, 19], "suit": [0, 1], "suitabl": [6, 7, 14, 15], "sum": [10, 11, 14, 15], "sum_": 12, "surf": [8, 9], "surfac": [2, 3, 4, 5, 6, 7, 14, 15, 16, 17], "surround": [14, 15], "sweep": [18, 19], "sweep_index": [18, 19], "symbol": [2, 3, 6, 7], "symmetri": [14, 15], "synchrotron": 2, "system": [18, 19], "s\u00e9billeau": [0, 1], "t": [2, 3, 4, 5, 10, 11, 16], "tag": [8, 9, 14], "take": [0, 1, 2, 3, 8, 9, 12, 13, 14, 15], "taken": [12, 13, 14, 15], "task": [16, 17, 18, 19], "tb": [8, 9], "technic": [18, 19], "techniqu": [0, 1, 22], "temp": [2, 3], "temperatur": [14, 15, 22], "termin": [0, 1, 14, 15], "tetrahedron": [14, 15], "text": [2, 3], "th": [12, 13], "than": [2, 3, 10, 11, 12, 13], "thank": [4, 5], "thei": [4, 5, 6, 7, 10, 11], "them": 0, "theori": 22, "thermal": 10, "theses": [12, 13], "theta": [2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19], "theta_d": [10, 11], "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "thick": [8, 9], "those": [0, 1, 2, 3, 16, 17], "threshold": [12, 13], "through": 22, "thu": [14, 15], "ti": [8, 9], "ti2p": [8, 9], "tilt": [6, 7, 18, 19], "time": [0, 1, 8, 9, 12, 13, 18, 19], "titl": [4, 10, 11, 14], "tl_threshold": [12, 13], "tmatrix_paramet": [10, 11, 12, 13], "tmp_data": 14, "to_dict": [18, 19], "togeth": 22, "too": [2, 3, 4, 5, 8, 9, 12, 13, 14], "took": [12, 13], "tool": [0, 1, 14, 15], "top": [2, 3, 4], "total": [0, 10, 11, 12, 13, 14, 15, 18, 19], "toward": [4, 5], "transit": [8, 9], "treat": [12, 13], "trehan": [10, 11], "tricot": [12, 13], "trilay": [8, 9], "true": [0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 16], "try": [2, 3, 4, 5, 8, 9, 12, 13, 14, 16, 17], "two": [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 16, 17], "txt": [2, 3], "type": [0, 1, 8, 9], "typic": [0, 1, 8, 9, 10, 11], "u": [8, 9], "u_j": [10, 11], "unambigu": [14, 15], "underli": [4, 5], "understand": [6, 7], "uniqu": [18, 19], "unit": [8, 9, 18, 19], "up": [0, 1, 12, 13, 22], "updat": [10, 11, 14, 16], "upward": [14, 15], "us": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "use_debye_model": [10, 11], "useful": [8, 9], "user": [18, 19], "usual": [8, 9], "utf8": [12, 13], "util": [0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 16, 17], "v": [8, 9, 14, 15], "vacuum": 8, "valu": [4, 5, 8, 9, 10, 11, 12, 13, 16, 18, 19], "van": [6, 7, 8, 9], "vari": [4, 5, 6, 7, 10, 11], "variabl": [2, 3, 16, 18, 19], "variat": [4, 10, 11], "varii": [18, 19], "variou": [4, 6, 7, 22], "veri": [4, 5, 6, 7, 12, 13], "version": [0, 1, 18, 19], "versu": [10, 11, 14, 15], "vibrat": [10, 11], "vibration_sc": [10, 11], "vibrational_damp": [10, 11, 12, 13], "view": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15], "visual": [0, 1, 2, 3, 4, 5, 8, 9], "volum": [8, 9, 14, 15], "wa": [12, 13, 16, 17], "waal": [8, 9], "wai": [10, 11], "waller": [10, 11], "want": [10, 11, 14, 15], "water": [0, 1], "wave": [0, 1, 4, 8, 9], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22], "well": [0, 1, 8, 9, 10, 11, 14], "were": [12, 13, 14, 15], "what": [0, 1, 4, 5, 6, 7, 8, 9, 12, 13, 16, 17], "when": [2, 3, 6, 7, 10, 12, 13, 18, 19], "where": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "which": [4, 12, 13, 16, 18, 19], "whose": [12, 13, 18, 19], "why": [12, 13], "wide": [4, 5], "withe": 16, "within": [12, 13], "without": [0, 1, 12, 13], "work": [0, 1, 6, 7, 10, 11, 14, 15], "would": [2, 3, 8, 9, 12, 13], "write": [16, 17], "written": [0, 1], "wurtzit": 14, "x": [2, 3, 10, 11, 16], "x_alpha_r": [10, 11], "xlabel": [10, 11, 14], "xpd": [8, 9, 22], "xraysourc": [10, 11, 12, 13, 14], "xu": [6, 7], "y": [2, 3, 6, 16], "yellow": [12, 13], "ylabel": [10, 11, 14], "ylim": 6, "you": [0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 22], "your": [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 16, 18, 19], "z": [2, 3, 4, 5, 8, 9, 16], "z0": 4, "z_0": [4, 5], "zi": 4, "\u00b5": [12, 13], "\u00e5": [4, 5, 6, 7, 8, 9, 12, 13, 16, 17, 18, 19]}, "titles": ["Activity 1: Getting started", "Activity 1: Getting started", "Activity 2: Setting up the \u201cexperiment\u201d", "Activity 2: Setting up the \u201cexperiment\u201d", "Activity 3: Adsorbates and the single scattering approach", "Activity 3: Adsorbates and the single scattering approach", "Activity 4: From single scattering to multiple scattering", "Activity 4: From single scattering to multiple scattering", "Activity 5: Multiple scattering in the forward scattering regime", "Activity 5: Multiple scattering in the forward scattering regime", "Activity 6: Effect of the temperature", "Activity 6: Effect of the temperature", "Activity 7: Large clusters and path filtering", "Activity 7: Large clusters and path filtering", "Activity 8: Inequivalent emitters and the XPD of a substrate", "Activity 8: Inequivalent emitters and the XPD of a substrate", "Activity 9: Comparing simulation and experiment with R-factors", "Activity 9: Comparing simulation and experiment with R-factors", "Activity 10: Parallelization and multi-processing in MsSpec", "Activity 10: Parallelization and multi-processing in MsSpec", "Activity 11: Spectral radius and convergence", "Final word", "Welcome to this small MsSpec tour"], "titleterms": {"001": [0, 1, 4, 5, 12, 13, 16, 17], "1": [0, 1], "10": [18, 19], "11": 20, "111": [2, 3], "1t": [8, 9], "2": [2, 3, 8, 9], "3": [4, 5], "4": [6, 7], "5": [8, 9], "6": [10, 11], "7": [12, 13], "8": [14, 15], "9": [16, 17], "The": [10, 11, 12, 13, 14, 15, 16, 17], "activ": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "adsorb": [4, 5], "ag": [2, 3], "aln": [14, 15], "aluminium": [14, 15], "an": [2, 3], "applic": [12, 13], "approach": [4, 5], "atom": [0, 1, 6, 7], "azimuth": [2, 3], "backscatt": [4, 5], "barebon": [0, 1], "base": [18, 19], "build": [0, 1, 2, 3, 6, 7], "bulk": [10, 11], "chain": [6, 7], "cluster": [0, 1, 2, 3, 8, 9, 12, 13], "co": [16, 17], "compar": [16, 17], "comput": [2, 3, 4, 5], "converg": 20, "creat": [8, 9], "cu": [0, 1], "deep": [12, 13], "developp": 21, "due": [4, 5], "effect": [8, 9, 10, 11], "emitt": [14, 15], "exampl": [2, 3], "experi": [2, 3, 16, 17], "factor": [4, 5, 16, 17], "fe": [16, 17], "filter": [12, 13], "final": 21, "forward": [8, 9], "from": [6, 7], "futur": 21, "get": [0, 1], "growth": [2, 3], "help": [6, 7], "how": 21, "induc": [2, 3], "inequival": [14, 15], "instal": 21, "interfer": [4, 5], "invers": [18, 19], "larg": [12, 13], "matrix": [18, 19], "molecul": [16, 17], "msspec": [0, 1, 12, 13, 18, 19, 21, 22], "multi": [18, 19], "multipl": [6, 7, 8, 9], "need": [6, 7], "ni": [6, 7], "nitrid": [14, 15], "number": [12, 13], "order": [8, 9], "our": 21, "oxygen": [4, 5], "parallel": [18, 19], "path": [12, 13], "ped": [0, 1, 8, 9], "plane": [12, 13], "polar": [0, 1, 6, 7, 14, 15], "process": [18, 19], "r": [16, 17], "radiu": 20, "regim": [8, 9], "rh": [4, 5], "sampl": [12, 13], "sb": [2, 3], "scan": [0, 1, 2, 3, 6, 7], "scatter": [4, 5, 6, 7, 8, 9, 12, 13], "script": [0, 1, 10, 11], "set": [2, 3], "shape": [0, 1], "si": [12, 13], "simul": [16, 17], "singl": [4, 5, 6, 7], "small": 22, "smooth": [2, 3], "solut": [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], "spectral": 20, "start": [0, 1, 6, 7], "sub": [8, 9], "substrat": [14, 15], "surfac": [8, 9, 10, 11], "system": [0, 1], "temperatur": [10, 11], "thi": 22, "tilt": [16, 17], "tise": [8, 9], "tise2": [8, 9], "tour": 22, "unusu": [16, 17], "up": [2, 3], "welcom": 22, "word": 21, "work": 21, "xpd": [14, 15], "you": [6, 7]}})
\ No newline at end of file
+Search.setIndex({"alltitles": {"Activity 10: Parallelization and multi-processing in MsSpec": [[9, null]], "Activity 1: Getting started": [[0, null]], "Activity 2: Setting up the \u201cexperiment\u201d": [[1, null]], "Activity 3: Adsorbates and the single scattering approach": [[2, null]], "Activity 4: From single scattering to multiple scattering": [[3, null]], "Activity 5: Multiple scattering in the forward scattering regime": [[4, null]], "Activity 6: Effect of the temperature": [[5, null]], "Activity 7: Large clusters and path filtering": [[6, null]], "Activity 8: Inequivalent emitters and the XPD of a substrate": [[7, null]], "Activity 9: Comparing simulation and experiment with R-factors": [[8, null]], "Application to a deep plane in a Si(001) sample": [[6, "application-to-a-deep-plane-in-a-si-001-sample"]], "Barebone script for MsSpec": [[0, "barebone-script-for-msspec"]], "Building a chain of atoms": [[3, "building-a-chain-of-atoms"]], "Building atomic systems": [[0, "building-atomic-systems"]], "Building the cluster": [[1, "building-the-cluster"]], "Compute an azimuthal scan": [[1, "compute-an-azimuthal-scan"]], "Computing the scattering factor": [[2, "computing-the-scattering-factor"]], "Creating the TiSe2 cluster": [[4, "creating-the-tise2-cluster"]], "Effect of the scattering order": [[4, "effect-of-the-scattering-order"]], "Interferences due to backscattering": [[2, "interferences-due-to-backscattering"]], "Matrix inversion parallelization": [[9, "matrix-inversion-parallelization"]], "Oxygen on Rh(001)": [[2, "oxygen-on-rh-001"]], "PED of the 1T-TiSe
2 surface": [[4, "ped-of-the-1t-tise2-surface"]], "PED polar scan for Cu(001)": [[0, "ped-polar-scan-for-cu-001"]], "Paths filtering in MsSpec": [[6, "paths-filtering-in-msspec"]], "Polar scans of Ni atomic chains": [[3, "polar-scans-of-ni-atomic-chains"]], "Process-based parallelism": [[9, "process-based-parallelism"]], "Sb-induced smooth growth of Ag on Ag(111) example": [[1, "sb-induced-smooth-growth-of-ag-on-ag-111-example"]], "Shaping a cluster": [[0, "shaping-a-cluster"]], "Solution\u2026": [[0, null], [1, null], [2, null], [2, null], [3, null], [3, null], [4, null], [4, null], [5, null], [6, null], [6, null], [7, null], [7, null], [8, null], [8, null], [8, null], [9, null]], "Surface and bulk effects of the temperature": [[5, "surface-and-bulk-effects-of-the-temperature"]], "The Aluminium Nitride (AlN) polarity": [[7, "the-aluminium-nitride-aln-polarity"]], "The number of scattering paths": [[6, "the-number-of-scattering-paths"]], "The script": [[5, "the-script"]], "The unusual tilt of CO molecule on Fe(001)": [[8, "the-unusual-tilt-of-co-molecule-on-fe-001"]], "Welcome to this small MsSpec tour": [[10, null]], "if you need help to start\u2026": [[3, null]]}, "docnames": ["Activity01/Activity01", "Activity02/Activity02", "Activity03/Activity03", "Activity04/Activity04", "Activity05/Activity05", "Activity06/Activity06", "Activity07/Activity07", "Activity08/Activity08", "Activity09/Activity09", "Activity10/Activity10", "intro"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1}, "filenames": ["Activity01/Activity01.ipynb", "Activity02/Activity02.ipynb", "Activity03/Activity03.ipynb", "Activity04/Activity04.ipynb", "Activity05/Activity05.ipynb", "Activity06/Activity06.ipynb", "Activity07/Activity07.ipynb", "Activity08/Activity08.ipynb", "Activity09/Activity09.ipynb", "Activity10/Activity10.ipynb", "intro.md"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [1, 4, 5, 6, 7, 8, 9], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "00": 7, "0001": 7, "001": [5, 9], "004": 4, "006": 6, "01": 6, "010": 8, "02": 2, "045": 3, "05": 2, "0f": 5, "1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "10": [0, 1, 2, 7, 8, 10], "100": [5, 8], "1000": 5, "1000k": 5, "101": 3, "1030": 4, "1083": 7, "11": [7, 8], "110": 8, "111": 2, "114": 6, "12": [8, 9], "1202": 8, "121": 1, "1382": 6, "14": 5, "1407": 7, "147176": 6, "15": [1, 4, 6, 8], "1525": 6, "157": [8, 9], "1986": 5, "1989": [3, 8], "1998": 2, "1999": 7, "1e": 6, "1e12": 4, "2": [0, 2, 3, 5, 6, 7, 8, 9, 10], "20": [1, 6, 7], "2012": [4, 5], "2022": 6, "207": 7, "21": 7, "22": [1, 7], "240": 1, "25": [4, 7], "256": 6, "27": [5, 8], "28": 6, "298k": 5, "2d": 4, "2f": 2, "2p": [0, 4, 5, 6, 7], "2p3": 0, "3": [0, 3, 4, 5, 6, 7, 8, 9, 10], "30": [1, 6, 7, 8], "300": 5, "32": 7, "34": 5, "343": 5, "35": [7, 8], "39": 3, "3f": 4, "3rd": 0, "4": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10], "40": [1, 6], "400": 5, "43": 6, "45": [1, 3, 5, 6, 8, 9], "450": 4, "499": 3, "4d": 1, "5": [1, 3, 5, 6, 7, 8, 10], "50": 9, "500": 7, "51": 5, "535": 4, "54": 6, "55": [1, 8], "554": 4, "560": 5, "58": 7, "59": 7, "6": [1, 4, 6, 7, 8, 9, 10], "60": [4, 8, 9], "606": 4, "609": [], "610": [], "611": [], "612": [], "63": [8, 9], "64": 4, "65": 2, "67": 9, "685": 4, "6a_0": 6, "7": [5, 7, 10], "70": [4, 7], "72": 7, "723": 2, "739": 6, "76": 9, "77": 9, "8": [1, 2, 4, 10], "80": [3, 6, 7], "806": [], "807": [], "808": [], "81": 2, "810": [], "811": [], "83": 5, "9": [5, 9, 10], "90": 6, "900": 4, "945": 6, "975": 7, "98": 5, "980": [], "982": [], "983": [], "984": [], "985": [], "A": [2, 3, 5, 8, 9], "AED": 0, "ASE": [0, 1, 2, 4], "As": [0, 2, 4, 6, 7, 9], "But": 4, "By": 2, "For": [1, 3, 4, 5, 6, 9], "If": 6, "In": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "It": [1, 4, 7, 8, 9], "No": [], "Not": 0, "On": 2, "One": 6, "Or": 0, "The": [0, 1, 2, 3, 4, 9], "There": 0, "These": 7, "To": [0, 1, 2, 4, 5, 6, 9], "With": [5, 6, 9], "_": 7, "__main__": 5, "__name__": 5, "_plotopt": 5, "a_0": [4, 6], "abl": 6, "about": [2, 4], "abov": [0, 2, 4, 5, 6], "abscissa": 8, "absorb": [5, 7], "accept": [6, 8, 9], "access": 7, "accord": 8, "account": [0, 4, 6], "accur": [2, 4, 8], "accuraci": [2, 3], "act": 1, "activ": 10, "actual": [5, 6], "ad": [2, 7], "add": [1, 2, 5, 6, 7, 9], "add_adsorb": [2, 8], "add_column": [1, 5, 6, 7], "add_dset": [5, 7], "add_view": [5, 7], "adjust": 8, "adsorb": [8, 10], "adsorpt": [2, 7, 8, 9], "advantag": 2, "after": [4, 8], "agit": 5, "agre": 8, "agreement": [1, 8], "al": [1, 2, 3, 4, 6, 7, 8], "al_al": 7, "al_kalpha": [5, 6, 7], "al_n": 7, "al_plan": 7, "al_sid": 7, "alber": [4, 6, 7], "algorithm": [0, 2, 3, 4, 5, 6, 7], "algortithm": 3, "align": [1, 4, 8], "all": [0, 2, 3, 5, 6, 7, 9, 10], "all_t": 5, "all_theta": 5, "all_z": 2, "allow": [0, 6, 9], "almost": [4, 6, 7], "along": [3, 8], "alreadi": 4, "also": [1, 4, 5, 8, 9], "altern": 6, "although": [1, 3, 9], "altitud": 2, "aluminum": 7, "amplitud": 7, "an": [0, 2, 3, 4, 5, 6, 7, 9], "analysi": [5, 7, 8], "analyz": 0, "angl": [1, 5, 6, 7, 8, 9], "angstrom": 2, "angstr\u00f6m": [4, 8, 9], "angular_accept": [1, 5, 7], "ani": 2, "anisotropi": [5, 9], "anisotropy_dset": 5, "anisotropy_view": 5, "anneal": 7, "annular": 2, "anoth": [4, 9], "apart": 2, "apec": 0, "apertur": 6, "append": [5, 7, 8], "approach": [0, 3, 4, 10], "approxim": [2, 3, 4], "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "arang": [2, 3, 5, 6, 7, 8], "arbitrarili": 5, "argument": [8, 9], "aris": 7, "around": [4, 7], "arrai": 5, "arrang": 6, "articl": 5, "ase": [0, 1, 2, 3, 4, 5, 6, 7, 8], "assign": [], "assum": [1, 6, 7, 8], "atom": [1, 2, 4, 5, 6, 7, 8], "atomist": 0, "attach": 2, "attempt": 5, "attribut": [1, 9], "author": 7, "autoscal": [5, 7], "avail": [0, 4, 9], "averag": 5, "average_sampl": [1, 5, 7], "averaged_tl": [5, 6], "axi": 4, "azimth": 8, "azimut": 5, "azimuth": [5, 7, 8, 9], "b": [1, 3, 5], "b_0": 4, "backscatt": [3, 6], "backward_scatt": 6, "bar": 7, "barton": 3, "base": [0, 1, 2, 3, 4, 5, 6, 7, 8], "basi": 0, "beamlin": 1, "becaus": [3, 6], "becom": [2, 6], "been": 6, "begin": 2, "being": [2, 5], "belong": 8, "below": [2, 3, 4, 5, 6, 7, 8], "best": 8, "better": 1, "between": [0, 1, 2, 4, 5, 7, 8, 9], "bewteen": 3, "bit": 4, "black": 9, "blue": [1, 6], "bodi": 8, "boltzmann": 5, "bond": [2, 8], "bond_length": [8, 9], "both": [2, 3, 5, 7], "bright": 2, "bring": 10, "build": [2, 4, 5, 6, 7, 8], "built": 8, "bulk": [0, 1, 6, 7, 8], "c": [4, 5, 7, 8], "c1": 8, "c_0": 4, "calc": [0, 1, 2, 3, 4, 5, 6, 7], "calc_": 9, "calcul": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "calculation_paramet": [1, 2, 3, 4, 5, 6, 7], "calculationparamet": 5, "calcult": 8, "call": 8, "can": [0, 1, 2, 3, 5, 6, 7, 8, 9], "cancel": 3, "cannot": 4, "carbon": 8, "carri": 2, "case": [2, 7], "categori": 1, "cell": [1, 4, 7], "center": [2, 4], "chain": 2, "chang": [1, 2, 5, 9], "check": 7, "chosen": 5, "cif": 0, "circl": 2, "cite": 5, "class": [2, 3], "clear": 5, "close": [3, 6], "cluster": [2, 5, 7, 8, 9, 10], "cnr": 0, "co": 9, "code": [0, 1, 2, 4, 6, 8, 9], "col_nam": 5, "col_valu": 5, "column": [4, 7], "com": 2, "combin": 9, "come": [2, 3, 5], "comment": [2, 7, 9], "common": [5, 6], "commonli": 8, "compar": [1, 3, 6, 9, 10], "comparison": [0, 1, 6], "complet": [2, 4, 5, 6, 8, 9], "complex": 4, "compon": 0, "comput": [0, 3, 4, 5, 6, 7, 8], "computation": 2, "compute_polar_scan": [8, 9], "concept": [0, 10], "conclud": [0, 4], "cone": 6, "configur": [1, 6], "consequ": 3, "consid": 2, "constant": [4, 5], "construct": 2, "consum": 9, "consumpt": 2, "contain": [0, 1, 4, 5, 8], "content": [0, 9], "contrast": 7, "contribut": [0, 6], "control": [5, 7, 8], "converg": [1, 4], "convert": 9, "copi": [1, 7, 8], "copper": [0, 4, 5], "core": [7, 9], "correctli": 1, "correspond": [4, 6, 7, 8], "could": 6, "cover": 0, "cp": 8, "creat": [0, 1, 2, 3, 6, 8, 9], "create_clust": [5, 7, 8, 9], "cristal": 7, "cross_sect": [1, 5, 6, 7, 8, 9], "cruguel": 1, "cryst": 7, "crystal": [3, 7], "crystallin": 2, "crystallograph": [7, 8], "crystallograpph": 7, "crystalstructur": 7, "cu": 5, "cubic": [0, 1, 5, 6, 8], "curv": [6, 8], "cut_plan": 1, "cylindr": [5, 6], "d": [0, 2, 4, 5, 7, 9], "damp": 5, "dark": 2, "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "datafram": 9, "dataset": [1, 5], "deby": 5, "debye_temperatur": 5, "declar": 9, "decreas": 5, "deeper": [3, 4, 7], "deepest": [0, 5], "def": [5, 7, 8, 9], "defin": [1, 2, 4, 5, 6, 9], "definit": 9, "defocus": 3, "degre": [2, 5, 7, 8, 9], "delta": 5, "demonstr": [2, 7, 8, 9], "dens": 4, "depth": 5, "der": 4, "describ": 4, "detail": 5, "detector_paramet": [1, 5, 7], "determin": 7, "deviat": 4, "df": 9, "diagram": [3, 7], "diamet": [1, 5, 6, 7, 8], "dichalcogenid": 4, "dict": [5, 9], "dictionari": 8, "differ": [0, 1, 2, 5, 6, 7, 8, 9], "difficulti": 10, "diffract": [0, 1, 2, 4, 5, 7, 10], "direct": [1, 2, 3, 4, 6, 7, 8], "directli": [0, 1], "directori": [], "discreap": 7, "discuss": 9, "disord": 5, "displac": 5, "displai": [0, 8], "distanc": [2, 3, 6, 7, 8], "distance_cutoff": 6, "distinguish": 5, "distribut": 9, "do": [0, 3, 4, 5, 7, 8], "do_not_split_by_at_sign": [], "document": [2, 5], "doe": [6, 9], "done": [7, 8], "doubl": 4, "download": [0, 1, 7, 8], "downward": 7, "drastic": 6, "dset": [1, 2, 5, 7, 9], "due": [5, 7], "dur": 3, "dure": [7, 9], "e": 1, "e_0": 2, "each": [1, 4, 5, 6, 8], "eas": 1, "easier": 9, "edit": [0, 3, 7], "editor": 1, "effect": [1, 2, 3, 6, 10], "either": [5, 8], "eject": 2, "electron": [0, 2, 4, 6, 8, 10], "element": [4, 7], "elif": 7, "els": [5, 7], "emiss": [2, 5], "emit": [2, 3, 7], "emitt": [0, 1, 2, 3, 4, 5, 6, 10], "emitter_plan": [0, 1, 4, 5, 6, 7, 8], "emitter_tag": [4, 7], "end": 8, "energi": [1, 2, 3, 4, 5, 6, 7], "enough": 3, "enumer": [2, 7], "environ": [0, 9], "equal": 0, "equat": 5, "errno": [], "escap": 1, "especi": 7, "estim": [5, 8], "et": [1, 2, 3, 4, 6, 7, 8], "ev": [1, 2, 4, 5, 7, 8], "evalu": [4, 6], "event": 4, "exact": 2, "exaf": 0, "exampl": [5, 6, 7, 8, 9], "except": 7, "exchang": 7, "exchange_correl": 5, "execut": 9, "exhibit": 7, "exit": 7, "exp": 1, "expand": 4, "expans": [2, 3, 4, 5, 6, 7], "expect": [5, 6, 7], "experi": [3, 9, 10], "experiment": [1, 2, 7, 8, 9], "explain": 5, "explor": [4, 5, 6, 9, 10], "ext": [], "extra": 5, "extract": 8, "extrem": 2, "f": [4, 5, 9], "face": 7, "fact": 3, "factor": [4, 9, 10], "fadlei": 5, "far": 6, "fast": 2, "fcc": [2, 3, 4], "fcc111": 2, "fd": [], "fe": 9, "featur": [0, 1, 7, 9, 10], "few": 6, "fewer": 0, "fig": [7, 8], "figur": [2, 3, 4, 5, 6, 7, 8], "file": [0, 1], "filenam": [], "filenotfounderror": [], "filetyp": [], "fill": [2, 7, 8], "filter": [5, 7, 10], "final": [1, 8], "final_st": 6, "find": 8, "fine": 3, "first": [0, 2, 4, 6], "fix": 6, "flexibl": 0, "float": 5, "focu": [0, 3, 10], "folder": [0, 9], "follow": [0, 1, 5, 6, 7, 8], "format": [2, 5, 7], "former": 1, "formula": [4, 6, 8], "forthcom": 0, "fortran": 0, "forward": [3, 6, 10], "forward_angl": [6, 7], "forward_scatt": [6, 7], "found": [3, 7], "fr": 0, "frac": 5, "free": [4, 5], "fring": 2, "from": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10], "fromkei": 5, "full": 3, "fulli": [0, 9], "function": [4, 5, 8, 9], "fundament": [0, 3], "futur": 9, "g": 1, "gap": 4, "gener": [1, 4, 6], "geometr": 7, "geometri": [1, 8, 9], "gerber": 2, "get": [5, 6, 7, 9, 10], "get_aln_tags_plan": 7, "get_atom_index": [0, 1, 4, 5, 6, 7], "get_clust": 7, "get_ioformat": [], "get_paramet": 5, "get_phi_scan": [1, 5], "get_scattering_factor": 2, "get_theta_phi_scan": [2, 4], "get_theta_scan": [0, 3, 6, 7], "give": [2, 3, 7, 8], "given": [1, 5, 8], "good": 3, "graze": 5, "great": 2, "greater": 4, "greatli": 0, "greber": 2, "group": 1, "grow": [4, 10], "growth": 7, "gtrsim": 7, "guess": [], "gui": [0, 1], "h": 1, "h2o": 0, "ha": [3, 4, 6], "half": 5, "hand": [2, 8], "hardwar": 9, "harmon": [0, 4], "have": [2, 3, 6, 7], "hbar": 5, "hdf5": 6, "height": [2, 3, 8, 9], "help": [4, 5], "hemispher": [0, 4], "hemispherical_clust": [0, 1, 4, 5, 6, 7, 8], "here": [0, 2, 4, 7, 8, 9], "hexagon": 7, "high": [2, 3, 4, 6], "highli": 7, "hilight": 5, "hollow": 8, "hove": 3, "how": [1, 2, 3, 4, 5, 6, 7, 8, 10], "howev": [0, 3], "http": 0, "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "i_": 5, "ic": 7, "idea": [1, 5, 6], "identifi": 1, "ie": 8, "ignor": 6, "illustr": [2, 3, 6], "imax": 5, "imin": 5, "impact": 0, "import": [0, 1, 2, 3, 4, 5, 6, 7, 9], "imposs": 6, "incid": 5, "includ": [0, 2], "incoher": 7, "incom": 1, "increas": [2, 3, 4, 5, 6], "incres": 5, "independ": 9, "index": [0, 6], "indic": [2, 7], "individu": 9, "inequival": [4, 10], "info": [5, 7, 8], "inform": [2, 5, 8], "inner": 1, "inner_potenti": 1, "inset": 7, "insid": [1, 9], "instal": 9, "instanc": 9, "int": 4, "intenisti": 7, "intens": [0, 1, 2, 3, 4, 5, 6, 7, 9], "intentis": 4, "interact": 0, "interfac": 0, "intern": 1, "interplai": 0, "interstitial_potenti": [1, 5], "introduc": 5, "invas": 7, "invers": [0, 2, 3, 4, 6], "invert": 9, "involv": 7, "io": 0, "iodata": 6, "iron": 8, "isinst": [], "its": [2, 9], "itself": [4, 8], "j": [3, 6, 7], "just": 9, "k": 5, "k_b": 5, "ke": 7, "keep": 8, "kei": [7, 9], "keyerror": 7, "keyword": 8, "kind": [3, 4, 5, 9], "kinet": [1, 2, 3, 4, 6, 7], "kinetic_energi": [1, 2, 4, 5, 6, 7], "known": 4, "kuznetsov": 4, "kwarg": 9, "l": 3, "l_": 4, "lambda_": 5, "lapack": 9, "larg": [1, 2, 4, 5, 7, 10], "larger": 4, "last": 2, "later": 2, "latter": 5, "lattic": [3, 4, 6, 7], "layer": [1, 5], "lead": [2, 6], "learn": 10, "least": 6, "lebedev": 7, "leed": 0, "left": [4, 7, 8], "legend": [1, 5, 6, 7], "len": [2, 5], "length": [2, 3, 6, 8], "let": [1, 2, 4, 7, 9], "lett": [2, 8], "level": [0, 1, 2, 3, 4, 5, 6, 7], "lib": [], "librari": 9, "light": 1, "like": [0, 3, 4, 8], "line": [1, 2, 4, 5, 7, 8, 9], "link": 9, "linspac": [1, 5], "list": [2, 8, 9], "littl": 6, "ll": 2, "lmax": 4, "load": 6, "loadtxt": 1, "local": 7, "locat": [0, 7], "long": 6, "longer": [3, 6], "look": [1, 5, 7, 8], "loop": [2, 8, 9], "looper": 9, "loss": 5, "low": [1, 5], "lower": 5, "lure": 1, "lzma": [], "m": [3, 4, 5, 6], "magic": 9, "magnitud": 5, "mai": [1, 6, 7, 9], "main": [7, 8], "major": [3, 8], "make": 9, "mani": [3, 6, 7, 8, 9], "manipul": 0, "manual": 5, "marker": 5, "mass": 5, "match": 1, "materi": [1, 4], "mathr": 2, "matplotlib": [0, 1], "matrix": [2, 4, 6], "matter": 0, "max": [1, 4, 5, 7], "maxima": 2, "mean": [4, 5], "mean_free_path": 5, "mean_square_vibr": 6, "measur": 4, "medium": 7, "memori": [0, 1, 2, 4, 6, 9], "metal": 4, "method": [0, 2], "metrial": 1, "mfp": 4, "middl": 0, "min": [1, 5, 7], "minim": 0, "minut": 6, "miss": 1, "mode": [], "model": [1, 4, 5, 7, 8, 10], "modifi": 9, "modul": [0, 5], "molecul": [0, 2, 3, 7, 9], "moment": 0, "monoxid": 8, "more": [0, 4, 5], "most": [0, 1, 2, 6, 9], "msc": 3, "msd": 5, "msspec": [1, 2, 3, 4, 5, 7, 8], "msspec_venv": [], "mt_radiu": 6, "much": [0, 1, 4, 5], "muffintin_paramet": [1, 5], "multi": [4, 10], "multipl": [0, 2, 5, 6, 9, 10], "multiprocess": 9, "must": 9, "mutlipl": 3, "mx2": 4, "my_filt": 6, "my_script": 9, "n": [4, 6, 7, 8], "n_al": 7, "n_n": 7, "n_plane": 7, "n_side": 7, "name": 9, "natoli": 0, "ncpu": 9, "nd": [4, 6], "ndif": 4, "nearest": 7, "need": [1, 4, 5, 6, 7, 8, 9, 10], "neighbor": 7, "neighbour": 7, "nest": [8, 9], "new": 0, "next": 8, "nickel": 3, "nitrogen": 7, "no_filt": 6, "non": 7, "none": [2, 3, 4, 5, 7], "normal": [1, 8], "note": 6, "now": [1, 7, 8, 9], "np": [1, 2, 3, 4, 5, 6, 7, 8, 9], "nplane": [5, 7], "num": 9, "number": [0, 2, 3, 4, 5, 7, 8, 9], "numer": 2, "numpi": [1, 2, 3, 4, 5, 6, 7], "o": [2, 5, 8, 9], "object": [1, 5, 7, 8, 9], "observ": [3, 4], "obvious": 8, "off_cone_ev": [6, 7], "offer": [6, 9, 10], "often": 9, "omp_num_thread": 9, "one": [3, 5, 6, 7, 9], "ones": 5, "onli": [0, 2, 3, 6, 7], "onto": 8, "open": [], "open_with_compress": [], "opt": [], "optim": 9, "option": [5, 6, 9], "orang": [1, 6], "order": [2, 5, 6, 8], "orient": [1, 2, 8], "orig_filenam": [], "origin": 7, "other": [0, 2], "our": [2, 5], "out": [3, 6, 8], "output": 9, "over": [2, 5, 9], "ow": 3, "p": [6, 8], "p1654": 2, "p1760": 4, "p266": 7, "p283": 8, "p6784": 5, "p6785": 5, "p6791": 5, "p8275": 3, "packag": [2, 9], "page": 1, "panda": 9, "paper": [1, 2, 3, 4, 5, 6, 7, 8, 9], "paragraph": 5, "parallel": 10, "paramet": [1, 3, 4, 5, 6, 8, 9], "part": [8, 9], "particular": 3, "past": 1, "path": [2, 4, 5, 7, 10], "path_filt": [6, 7], "pattern": [4, 7], "peak": [3, 4, 7], "ped": [2, 3, 5, 6, 7], "pendri": 8, "perform": [5, 10], "phagen": 0, "phase": [0, 5], "phenom": 6, "phi": [1, 2, 4, 5, 6, 7, 8, 9], "photodiffract": [2, 3, 7], "photoelectron": [0, 1, 2, 4, 5, 7, 10], "photoemiss": 7, "phy": [1, 2, 3, 5, 8], "physic": 5, "pi": 4, "pipelin": 9, "plai": 3, "planck": 5, "plane": [0, 1, 4, 5, 7, 8], "plot": [0, 5], "plt": [0, 1], "pm": [2, 8], "point": [1, 7], "polar": [1, 2, 5, 6, 8], "pop": [2, 9], "popup": [1, 2], "posit": [2, 3, 8], "possibl": [2, 6, 8, 9], "potenti": [1, 5], "practic": 5, "precis": [4, 8], "preiou": 4, "present": 3, "pretti": 0, "previou": [0, 3, 6, 7, 9], "previous": 2, "print": [4, 7], "probe": [2, 7], "problem": 2, "process": [0, 6, 10], "processor": 9, "produc": 2, "program": 0, "project": 2, "pronounc": 5, "propag": 0, "proport": 6, "propos": [2, 5], "provid": [4, 8, 9], "publish": [2, 5, 7], "pure": 3, "put": [0, 2], "py": [0, 1, 9], "pyplot": [0, 1], "python": [0, 5, 9], "python3": [], "qualit": 5, "quantit": 2, "question": 6, "quick": 7, "quit": [2, 9], "quiz": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "r": [0, 4, 5, 7, 9, 10], "r16061": 1, "ra_cutoff": 6, "radian": 8, "radiu": 4, "rai": [1, 5], "rang": [3, 4, 5, 7], "rather": 2, "ratio": 7, "rb": [], "rd": [0, 6], "read": 0, "real": 5, "realli": 0, "reason": 9, "recent": 0, "red": 2, "reduc": [5, 6], "ref": 1, "refer": 1, "refract": 1, "regardless": 5, "regim": [6, 10], "rehr": [4, 6, 7], "reject": 6, "rel": [5, 7], "relat": [1, 6], "reliabl": 8, "rememb": [6, 8], "remov": [0, 1], "repeat": 3, "replac": 9, "repres": [2, 5], "represent": 2, "reproduc": [5, 7, 8], "requir": [6, 9], "reshap": 9, "resourc": 9, "respect": [1, 2, 7], "rest": 8, "resulst": 9, "result": [0, 1, 2, 3, 5, 6, 8, 9], "retriev": [5, 7], "return": [5, 7, 8, 9], "rev": [1, 2, 3, 5, 8], "rhodium": 2, "right": [4, 7, 8], "rotat": [1, 3, 4, 7], "rotate_cel": [1, 4], "roughli": 5, "row": 4, "run": [0, 7, 8, 9], "rune": 8, "sa73": 1, "saiki": 8, "same": [0, 3, 6, 7], "sampl": [1, 4, 5], "satisfactori": [1, 2], "save": 0, "saw": 3, "sbag": 1, "scan": [2, 4, 5, 6, 7, 8], "scatter": [0, 5, 7, 8, 9, 10], "scattering_ord": [2, 3, 4, 5, 6, 7], "sci": 4, "script": [1, 2, 6, 7, 8, 9], "se": 4, "second": [4, 5, 6], "section": [5, 8], "see": [1, 2, 3, 5, 6, 8, 9], "seen": [6, 7], "select": [1, 5, 6, 7], "sensit": 2, "sequenti": 6, "seri": [4, 6, 7], "serial": 6, "set": [0, 3, 5, 6, 7, 8, 9, 10], "set_atom": [0, 2, 3, 4, 5, 6, 7], "set_plot_opt": [3, 5, 7], "sever": [6, 9], "shape": [1, 2, 5, 6, 9], "share": [7, 9], "shift": [0, 5], "short": 7, "should": [1, 4, 8], "show": [0, 7], "shutdown": [1, 5], "side": [7, 8], "signal": [0, 2, 5, 6, 7], "signific": 1, "significantli": 6, "silver": 1, "sim": [5, 8], "similar": 6, "simpl": [3, 5, 8, 9], "simplist": 2, "simul": [0, 2, 3, 7, 9, 10], "sin": [5, 8], "sinc": [0, 4, 5, 6, 7, 10], "singl": [4, 5, 6, 8, 10], "sinl": 2, "site": [2, 8], "situat": 3, "size": [1, 2, 4, 6], "sketch": 7, "slice": [], "small": [1, 2, 4, 5, 7, 8], "smaller": 1, "snipet": 4, "so": [2, 6], "softwar": 10, "solut": [], "some": [0, 1, 2, 4, 5, 6, 7, 8, 9], "soon": 2, "sourc": 1, "source_paramet": [1, 5, 6, 7], "spec": 0, "speci": 2, "specif": 1, "specifi": 9, "spectrosc": 6, "spectroscopi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10], "spectroscopy_paramet": 6, "spheric": [0, 4], "spirit": 3, "sqrt": 3, "squar": 5, "ssc": [3, 8], "start": [1, 2, 4, 9, 10], "state": 7, "step": [0, 1, 8, 9], "stereograph": 2, "stop": 9, "store": [4, 5, 8], "str": [], "straightforward": [0, 7], "string": [], "strongest": 7, "strongli": 4, "structur": [0, 4, 5], "studi": [2, 3, 7], "substitut": [1, 7], "substrat": [5, 9, 10], "substrate_dset": 7, "subsurfac": 6, "suggest": 9, "suit": 0, "suitabl": [3, 7], "sum": [5, 7], "sum_": 6, "surf": 4, "surfac": [1, 2, 3, 7, 8], "surround": 7, "sweep": 9, "sweep_index": 9, "symbol": [1, 3], "symmetri": 7, "synchrotron": 1, "system": 9, "s\u00e9billeau": 0, "t": [1, 2, 5, 8], "tag": [4, 7], "take": [0, 1, 4, 6, 7], "taken": [6, 7], "task": [8, 9], "tb": 4, "technic": 9, "techniqu": [0, 10], "temp": 1, "temperatur": [7, 10], "termin": [0, 7], "tetrahedron": 7, "text": 1, "th": 6, "than": [1, 5, 6], "thank": 2, "thei": [2, 3, 5], "them": 0, "theori": 10, "thermal": 5, "theses": 6, "theta": [1, 2, 3, 4, 5, 6, 7, 8, 9], "theta_d": 5, "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "thick": 4, "those": [0, 1, 8], "threshold": 6, "through": 10, "thu": 7, "ti": 4, "ti2p": 4, "tilt": [3, 9], "time": [0, 4, 6, 9], "titl": [2, 5, 7], "tl_threshold": 6, "tmatrix_paramet": [5, 6], "tmp_data": 7, "to_dict": 9, "togeth": 10, "too": [1, 2, 4, 6, 7], "took": 6, "tool": [0, 7], "top": [1, 2], "total": [0, 5, 6, 7, 9], "toward": 2, "traceback": [], "transit": 4, "treat": 6, "trehan": 5, "tricot": 6, "trilay": 4, "true": [0, 1, 4, 5, 6, 7, 8], "try": [1, 2, 4, 6, 7, 8], "two": [0, 1, 2, 5, 6, 8], "txt": 1, "type": [0, 4], "typic": [0, 4, 5], "u": 4, "u_j": 5, "unambigu": 7, "underli": 2, "understand": 3, "uniqu": 9, "unit": [4, 9], "unknown": [], "up": [0, 6, 10], "updat": [5, 7, 8], "upward": 7, "us": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "use_debye_model": 5, "useful": 4, "user": 9, "usual": 4, "utf8": 6, "util": [0, 1, 4, 5, 6, 7, 8], "v": [4, 7], "vacuum": 4, "valu": [2, 4, 5, 6, 8, 9], "van": [3, 4], "vari": [2, 3, 5], "variabl": [1, 8, 9], "variat": [2, 5], "varii": 9, "variou": [2, 3, 10], "veri": [2, 3, 6], "version": [0, 9], "versu": [5, 7], "vibrat": 5, "vibration_sc": 5, "vibrational_damp": [5, 6], "view": [0, 1, 2, 3, 4, 5, 6, 7], "viewer": [], "visual": [0, 1, 2, 4], "volum": [4, 7], "wa": [6, 8], "waal": 4, "wai": 5, "waller": 5, "want": [5, 7], "water": 0, "wave": [0, 2, 4], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "well": [0, 4, 5, 7], "were": [6, 7], "what": [0, 2, 3, 4, 6, 8], "when": [1, 3, 5, 6, 9], "where": [2, 3, 4, 5, 6, 7], "which": [2, 6, 8, 9], "whose": [6, 9], "why": 6, "wide": 2, "withe": 8, "within": 6, "without": [0, 6], "work": [0, 3, 5, 7], "would": [1, 4, 6], "write": 8, "written": 0, "wurtzit": 7, "x": [1, 5, 8], "x3d": [], "x_alpha_r": 5, "xlabel": [5, 7], "xpd": [4, 10], "xraysourc": [5, 6, 7], "xu": 3, "y": [1, 3, 8], "yellow": 6, "ylabel": [5, 7], "ylim": 3, "you": [0, 1, 2, 4, 5, 6, 7, 9, 10], "your": [0, 1, 2, 5, 6, 8, 9], "z": [1, 2, 4, 8], "z0": 2, "z_0": 2, "zi": 2, "\u00b5": 6, "\u00e5": [2, 3, 4, 6, 8, 9]}, "titles": ["Activity 1: Getting started", "Activity 2: Setting up the \u201cexperiment\u201d", "Activity 3: Adsorbates and the single scattering approach", "Activity 4: From single scattering to multiple scattering", "Activity 5: Multiple scattering in the forward scattering regime", "Activity 6: Effect of the temperature", "Activity 7: Large clusters and path filtering", "Activity 8: Inequivalent emitters and the XPD of a substrate", "Activity 9: Comparing simulation and experiment with R-factors", "Activity 10: Parallelization and multi-processing in MsSpec", "Welcome to this small MsSpec tour"], "titleterms": {"001": [0, 2, 6, 8], "1": 0, "10": 9, "11": [], "111": 1, "1t": 4, "2": [1, 4], "3": 2, "4": 3, "5": 4, "6": 5, "7": 6, "8": 7, "9": 8, "The": [5, 6, 7, 8], "activ": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "adsorb": 2, "ag": 1, "aln": 7, "aluminium": 7, "an": 1, "applic": 6, "approach": 2, "atom": [0, 3], "azimuth": 1, "backscatt": 2, "barebon": 0, "base": 9, "build": [0, 1, 3], "bulk": 5, "chain": 3, "cluster": [0, 1, 4, 6], "co": 8, "compar": 8, "comput": [1, 2], "converg": [], "creat": 4, "cu": 0, "deep": 6, "developp": [], "due": 2, "effect": [4, 5], "emitt": 7, "exampl": 1, "experi": [1, 8], "factor": [2, 8], "fe": 8, "filter": 6, "final": [], "forward": 4, "from": 3, "futur": [], "get": 0, "growth": 1, "help": 3, "how": [], "induc": 1, "inequival": 7, "instal": [], "interfer": 2, "invers": 9, "larg": 6, "matrix": 9, "molecul": 8, "msspec": [0, 6, 9, 10], "multi": 9, "multipl": [3, 4], "need": 3, "ni": 3, "nitrid": 7, "number": 6, "order": 4, "our": [], "oxygen": 2, "parallel": 9, "path": 6, "ped": [0, 4], "plane": 6, "polar": [0, 3, 7], "process": 9, "r": 8, "radiu": [], "regim": 4, "rh": 2, "sampl": 6, "sb": 1, "scan": [0, 1, 3], "scatter": [2, 3, 4, 6], "script": [0, 5], "set": 1, "shape": 0, "si": 6, "simul": 8, "singl": [2, 3], "small": 10, "smooth": 1, "solut": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "spectral": [], "start": [0, 3], "sub": 4, "substrat": 7, "surfac": [4, 5], "system": 0, "temperatur": 5, "thi": 10, "tilt": 8, "tise": 4, "tise2": 4, "tour": 10, "unusu": 8, "up": 1, "welcom": 10, "word": [], "work": [], "xpd": 7, "you": 3}})
\ No newline at end of file
diff --git a/msspecbook/_config.yml b/msspecbook/_config.yml
index bc61402..70a385d 100644
--- a/msspecbook/_config.yml
+++ b/msspecbook/_config.yml
@@ -3,7 +3,9 @@
title: MsSpec Tour
author: Sylvain Tricot
+copyright: "2025"
logo: logo.jpg
+only_build_toc_files: true
# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
diff --git a/msspecbook/light/Activity01_light.ipynb b/msspecbook/light/Activity01_light.ipynb
new file mode 100644
index 0000000..2dc9bae
--- /dev/null
+++ b/msspecbook/light/Activity01_light.ipynb
@@ -0,0 +1,926 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "7e31b322-df55-44ed-9f29-6f6efa71eafe",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "# Activity 1: Getting started\n",
+ "\n",
+ "MsSpec is a Fortran code with two components: Phagen (Written by R. Natoli) and Spec (written by D. Sébilleau). Phagen computes the phase shifts of the electronic wave propagating in the matter on a spherical harmonics basis. Spec uses those phase shifts to compute the multiple scattering process and simulate the intensity of different electronic spectroscopies.\n",
+ "\n",
+ "In the most recent version of MsSpec, the program is interfaced with python (https://msspec.cnrs.fr/), allowing for much more flexibility and interplay with other simulation techniques.\n",
+ "\n",
+ "## Building atomic systems\n",
+ "\n",
+ "MsSpec works in the *cluster* approach. Building such a cluster for a calculation is a fundamental step.\n",
+ "We use the [python Atomic Simulation Environment (ASE)](https://wiki.fysik.dtu.dk/ase/) for this.\n",
+ "\n",
+ "ASE is a set of tools and Python modules for setting up, manipulating, running, visualizing and analyzing atomistic simulations.\n",
+ "Building atomic systems, structures... is pretty straightforward:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "07a04c8c-a268-481a-8f1b-14878ed771b5",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "remove-output"
+ ]
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "
"
+ ]
+ },
+ "execution_count": 1,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# To build a molecule with ASE\n",
+ "from ase.build import molecule\n",
+ "# To view\n",
+ "from ase.visualize import view\n",
+ "\n",
+ "# Create a water molecule\n",
+ "water = molecule('H2O')\n",
+ "# Display it\n",
+ "view(water)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "e09c7d97-eb35-49a7-b74a-9fb21a9a3aaf",
+ "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"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "view(water, viewer='x3d')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "94b690a2-52f0-43e4-953d-6e7519ac4e9c",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## Barebone script for MsSpec\n",
+ "\n",
+ "MsSpec can simulate different electronic spectroscopies like PED, AED, LEED, EXAFS, APECS and more will be included in the forthcoming version. However, it is really well-suited for PhotoElectron Diffraction simulation, and the python interface is only fully available for it at the moment. Since PED covers all the MsSpec features and concepts, we will focus on this technique.\n",
+ "\n",
+ "There are typically 3 steps to follow to get a result with MsSpec:\n",
+ "\n",
+ "1. Create a *cluster*\n",
+ "2. Create an ASE *calculator*\n",
+ "3. Run the simulation\n",
+ "\n",
+ "### PED polar scan for Cu(001)\n",
+ "\n",
+ "download the [cu.py](cu.py \"download\") python script and the [copper.cif](copper.cif \"download\") file. Put those files in the same folder. You can run your first MsSpec calculation by typing in a terminal:\n",
+ "\n",
+ "```shell\n",
+ "$ python cu.py\n",
+ "```\n",
+ "\n",
+ "Here is the content of the script file:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "da96a735-a028-4fe8-89ac-96f707323ae9",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "```{literalinclude} cu.py\n",
+ ":end-before: The \"emitter\"\n",
+ ":linenos:\n",
+ "```"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "6ddd72a9-8f32-484f-9a3e-9ab3a85945a4",
+ "metadata": {
+ "editable": true,
+ "scrolled": 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"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 1,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from ase.io import read\n",
+ "from ase.visualize import view\n",
+ "from msspec.calculator import MSSPEC\n",
+ "\n",
+ "\n",
+ "cluster = read('copper.cif')\n",
+ "# view the cluster\n",
+ "view(cluster, viewer='x3d')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a51b9284-ce53-48e2-bd4b-65fe3998cc33",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "```{literalinclude} cu.py\n",
+ ":start-at: The \"emitter\"\n",
+ ":lineno-match:\n",
+ "```\n",
+ ":::{figure-md} Cu-XPD\n",
+ " \n",
+ "\n",
+ "Cu(2p) polar scan for the copper cluster above\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "85c7dcac-9f0e-4a56-8077-c96f89865dcb",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## Shaping a cluster"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ff63b7cb-5e31-44f8-b81b-d05bf0c775c0",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Based on the previous *.cif file, create a new cluster without the deepest plane and run the same calculation for the same emitter\n",
+ "\n",
+ "```{note}\n",
+ "Use the `cluster.edit()` method to interactively remove atoms...\n",
+ "\n",
+ "As the cluster will contain fewer atoms, the emitter index will be different\n",
+ "```\n",
+ "\n",
+ "What do you conclude ?\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "102bfad0-f8ed-44ab-990f-9fb2eb5662b0",
+ "metadata": {
+ "editable": true,
+ "scrolled": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "hide-input"
+ ]
+ },
+ "source": [
+ "The number of atoms used for the calculation greatly impact the calculation time and memory. Most of the time, a cluster is shaped as an hemisphere to minimize the number of atoms to take into account"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "f7ecc1d0-097d-4199-822a-c564e9e94337",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "remove-output"
+ ]
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from msspec.calculator import MSSPEC\n",
+ "from msspec.utils import hemispherical_cluster, get_atom_index\n",
+ "from ase.build import bulk\n",
+ "from ase.visualize import view\n",
+ "\n",
+ "copper = bulk('Cu', cubic=True)\n",
+ "cluster = hemispherical_cluster(copper, planes=3, emitter_plane=2)\n",
+ "cluster.emitter = get_atom_index(cluster, 0,0,0)\n",
+ "\n",
+ "view(cluster)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "076f617d-599f-483d-b22c-38cebf41b28a",
+ "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"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "view(cluster, viewer='x3d')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4a71c734-8c73-49a2-9f27-12157841405c",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ ":::{figure-md} Cu-hemi\n",
+ " \n",
+ "\n",
+ "Cu(2p) polar scan for the hemispherical cluster.\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
+}
diff --git a/msspecbook/light/Activity02_light.ipynb b/msspecbook/light/Activity02_light.ipynb
new file mode 100644
index 0000000..68864fb
--- /dev/null
+++ b/msspecbook/light/Activity02_light.ipynb
@@ -0,0 +1,1178 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "88b65284-bdd1-4140-af28-526e77b9b4b6",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(exp-setup)=\n",
+ "# 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. You can copy/paste directly the code from this page to your text editor or you can download the script [SbAg.py](SbAg.py \"download\"). You will also need the [data.txt](data.txt \"download\") file."
+ ]
+ },
+ {
+ "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",
+ "::::"
+ ]
+ }
+ ],
+ "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
+}
diff --git a/msspecbook/light/Activity03_light.ipynb b/msspecbook/light/Activity03_light.ipynb
new file mode 100644
index 0000000..3632534
--- /dev/null
+++ b/msspecbook/light/Activity03_light.ipynb
@@ -0,0 +1,346 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "2aebc88d-0bb4-4d56-b7f6-977a66814229",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(ssc)=\n",
+ "# Activity 3: Adsorbates and the single scattering approach\n",
+ "\n",
+ "Photoelectron diffraction is widely used to study the adsorption of atoms or molecules on a crystalline surface. Photoelectrons from adsorbates are scattered by the underlying surface, carrying information about the adsorption site, bond length and/or molecule orientation…. Thanks to a simulation, such information becomes quantitative with a high degree of accuracy.\n",
+ "\n",
+ "Calculations of the multiple scattering using matrix inversion have the great advantage of being exact, including all scattering paths. On the other hand, memory consumption soon becomes a problem as the kinetic energy and number of atoms to be considered increase. As an approximation, it is possible to only consider a single scattering from the emitter to any atom in the cluster. This approximation is extremely computationally fast and can give satisfactory results for adsorbates. We’ll see later that this approach is rather too simplistic for most cases.\n",
+ "\n",
+ "## Oxygen on Rh(001)\n",
+ "In a paper published in 1998, T. Gerber *et al.* used the quite high backscattering factor of Rhodium atoms to probe the distance of Oxygen atoms adsorbed on a Rhodium surface. Some electrons coming from Oxygen atoms are ejected toward the Rhodium surface. They are then backscattered and interfere with the direct signal comming from Oxygen atoms (see the figure below). They demonstrated both experimentally and numerically with a sinle scattering computation that this lead to a very accurate probe of adsorbed species that can be sensitive to bond length changes of the order of {math}`\\pm 0.02 \\mathring{A}`.\n",
+ "\n",
+ ":::{seealso}\n",
+ "based on this paper from T. Greber *et al.* [Phys. Rev. Lett. **81**(8) p1654 (1998)](https://doi.org/10.1103/PhysRevLett.81.1654)\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a4cd32cd-b480-44b5-af38-b38e5979ce00",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ ":::{figure-md} RhO-fig\n",
+ " \n",
+ "\n",
+ "Interferences produced by the backscattering effect\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4f6bcc08-a54c-424a-a20c-cbdd0ce13ae2",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "### Computing the scattering factor\n",
+ "\n",
+ "To illustrate that photoelectrons emitted by Oxygen adsorbates towards the Rhodium surface can be backscattered, we will start by computing the scattering factor for both O and Rh atoms.\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "By using the [`Atoms`](https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms) class of the `ase` package, try to build a O-Rh chain where atoms are 4 Å apart. Here is the begining of the script. Try to complete the line of code and view your two-atoms chain.\n",
+ "\n",
+ "```python\n",
+ "from ase import Atoms\n",
+ "from ase.visualize import view\n",
+ "\n",
+ "# Create an atomic chain O-Rh\n",
+ "cluster = Atoms(... # Fill this line\n",
+ "```\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "55929980-7394-4a60-b554-376adce57dbf",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "remove-input"
+ ]
+ },
+ "outputs": [],
+ "source": [
+ "from ase import Atoms\n",
+ "from ase.visualize import view\n",
+ "\n",
+ "# Create an atomic chain O-Rh\n",
+ "cluster = Atoms(['O', 'Rh'], positions = [(0,0,0), (0,0,4.)])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "2f296e2c-2a34-4266-98a8-362ede072659",
+ "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"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "view(cluster, viewer='x3d')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "736d6d08-930e-4b4f-a3fd-599ef8463035",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "As previously, we create a calculator, we attach our 2 atoms cluster to this calculator and we define the first atom in the chain as the emitter\n",
+ "\n",
+ ":::{literalinclude} RhO_sf.py\n",
+ ":start-at: calc =\n",
+ ":end-at: emitter =\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "21763c63-9bd1-4e80-944a-9cf313894b89",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "We use the `get_scattering_factors` method [(see its documentation)](https://msspec.cnrs.fr/modules/calculator.html#calculator._PED.get_scattering_factors) to compute the scattering factors at 723 eV.\n",
+ "\n",
+ "How large is the backscattering factor of Rhodium with respect to that of Oxygen ?\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e7da60a3-b4e3-45ec-9d0e-62cb592f0687",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "### Interferences due to backscattering\n",
+ "\n",
+ "Let an Oxygen atom (in red) being adsorbed at a distance $z_0$ of an *fcc* site of the Rh(111) surface."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "68048f33-318d-400e-a815-769660f2b6c5",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "remove-input"
+ ]
+ },
+ "source": [
+ ":::{figure-md} Rho-fig2a\n",
+ " \n",
+ "\n",
+ "Small cluster used for the calculation.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d6145250-5548-49a6-8b50-0bb7c5b454da",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "We will compute for different values of the adsorption height $z_0$.\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Complete the [script below](RhO_tofill.py \"download\") to compute the ($\\theta,\\phi$) scan of the photodiffraction of O(1s) adsorbed on a *fcc* site on Rh(111) surface.\n",
+ "\n",
+ "```{literalinclude} RhO_tofill.py\n",
+ ":lineno-match:\n",
+ ":emphasize-lines: 6,8,12,13\n",
+ "```\n",
+ "\n",
+ "As proposed in the comments, add a loop to vary the adsorption height of Oxygen between 1.10 and 1.65 Å.\n",
+ "What is the bond length difference between to intensity maxima ?\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
+}
diff --git a/msspecbook/light/Activity04_light.ipynb b/msspecbook/light/Activity04_light.ipynb
new file mode 100644
index 0000000..46c64a8
--- /dev/null
+++ b/msspecbook/light/Activity04_light.ipynb
@@ -0,0 +1,147 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "d053c16f-22ca-44ce-a58d-03e73c1a5554",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(ssc2ms)=\n",
+ "# Activity 4: From single scattering to multiple scattering\n",
+ "\n",
+ "In the [previous activity](ssc), we saw that simple single scattering calculations (SSC) can be used to simulate photodiffraction diagrams with good accuracy. The approximation works fine when the emitting atom is very close to the surface.\n",
+ "However, the SSC approach is no longer suitable for deeper emitter atoms, where multiple scattering effects come into play. In this activity, we will focus on a major consequence of multiple scattering: *the defocusing effect*.\n",
+ "\n",
+ "The defocusing effect is presented in the [figure below](Ni-fig1) for a chain of nickel atoms. Although purely illustrative, understanding multiple scattering in atomic chains is fundamental because they are found in many situations, such as in particular directions of a crystal or in molecules of various lengths."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "12b10290-0b9b-497a-baba-e7ecb6543788",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ ":::{figure-md} Ni-fig1\n",
+ " \n",
+ "\n",
+ "The defocusing effect dur to multiple scattering in an atomic chain of Ni atoms.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b1b4c789-e62c-40cc-92a3-053e6a90d315",
+ "metadata": {},
+ "source": [
+ "In 1989, M.-L Xu, J.J. Barton and M.A. Van Hove studied these multiple scattering effects on atomic chains ([see their paper below](defocusing-paper)).\n",
+ "In the spirit of figure 3 of their paper, we will create 3 atomic chains of Ni atoms (2, 3 and 5 atoms) tilted by 45° and we will compare the intensity of the forward scattering peak for single scattering and for full multiple scattering."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4988e7d3-2ba3-470f-9676-8116348c30a1",
+ "metadata": {},
+ "source": [
+ "(defocusing-paper)=\n",
+ ":::{seealso}\n",
+ "based on this paper from M.-L. Xu *et al.*\n",
+ "[Phys. Rev. B **39** p8275 (1989)](https://doi.org/10.1103/PhysRevB.39.8275) \n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "011ef23b-5a76-410d-8d44-1c4a899e2a23",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## Polar scans of Ni atomic chains\n",
+ "\n",
+ "### Building a chain of atoms\n",
+ "\n",
+ "Start by creating a simple chain of 2 Ni atoms: an emitter and a scatterer in the [101] direction.\n",
+ "\n",
+ ":::{tip}\n",
+ "Nickel is *fcc* with lattice parameter $a$=3.499 Å. Use the [`Atoms`](https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms) class of `ase` like in the [previous activity](ssc)...\n",
+ "\n",
+ ":::{admonition} if you need help to start...\n",
+ ":class: dropdown\n",
+ "\n",
+ ":::{code} python\n",
+ "from msspec.calculator import MSSPEC\n",
+ "from ase import Atoms\n",
+ "\n",
+ "symbol = ... # The kind of atom for the chain\n",
+ "a = ... # The distance bewteen 2 atoms\n",
+ " # in [101] direction\n",
+ "\n",
+ "chain = Atoms(..., positions=[...])\n",
+ "chain.rotate(...)\n",
+ "chain.edit()\n",
+ ":::\n",
+ "\n",
+ ":::\n",
+ "\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c57f951-bfa7-435e-8e74-b3de11909768",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Create an `MSSPEC` calculator with `expansion` algortithm and set the `scattering_order`=1 to compute a polar scan of the Ni(3s) in single scattering. How is varying the height of the peak at 45° (along the chain) if you increase the number of atoms in the chain ?\n",
+ "\n",
+ "Repeat the same experiment with `inversion` algorithm for having the full multiple scattering result. What do you observe ?\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
+}
diff --git a/msspecbook/light/Activity05_light.ipynb b/msspecbook/light/Activity05_light.ipynb
new file mode 100644
index 0000000..4cdd460
--- /dev/null
+++ b/msspecbook/light/Activity05_light.ipynb
@@ -0,0 +1,842 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "ff0fc2d9-b53e-4d29-883b-6d6303d76eb2",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(forward-scattering)=\n",
+ "# Activity 5: Multiple scattering in the forward scattering regime"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7f10b898-4fc8-40fd-a477-05e736a5a255",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "In photoelectron diffraction, it is well known that for high photoelectron kinetic energy (typically > 900 eV), the scattering factor is strongly peaked in the forward direction. It means that photoelectrons are almost not deviated after a scattering event.\n",
+ "\n",
+ "Peaks of intentisity are then usually observed for dense atomic directions of the sample. This is the **forward scattering approximation**.\n",
+ "\n",
+ "For such high kinetic energy, multiple scattering is needed to accurately describe the measured intensity, but the matrix inversion algorithm cannot be used since the memory needed for storing the matrix itself would be generally too large. The matrix will contain\n",
+ "$(N \\times (L_{max}+1)^2)^2$ elements of complex type with double precision (64 bits) where $N$ is the number of atoms and $L_{max}$ is the number of spherical harmonics used to expand the electron wave around each atomic center. As the kinetic energy increases, the mean free path (MFP) of the photoelectron is larger and the number of atoms in the cluster has to be greater. Lmax also increases with the kinetic energy."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cc78443a-1d06-408a-91eb-33a56fe25ba3",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Try to evaluate how much memory you would need for this matrix for a hemispherical cluster of copper 15 angströms thick (1 MFP) for $L_{max} = 25$ ?\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "e6f5b739-bcbf-4a2f-9c51-5e409079392a",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": [
+ "hide-cell"
+ ]
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "606 atoms, 2.685 TB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "\n",
+ "# lattice constant of fcc copper\n",
+ "a = 3.6\n",
+ "# radius of the cluster\n",
+ "r = 15\n",
+ "# volume of the cluster\n",
+ "V = .5 * (4/3) * np.pi * r**3\n",
+ "# volume of the cell\n",
+ "v = a**3\n",
+ "# number of atoms in the unit cell\n",
+ "n = 4\n",
+ "# number of atoms in the cluster\n",
+ "N = int(V/v * n)\n",
+ "\n",
+ "Lmax = 25\n",
+ "M = (N * (Lmax+1)**2 )**2 * 2 * 64 / 8\n",
+ "print(f\"{N:d} atoms, {M/1e12:.3f} TB\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f53ecd7a-9202-40ec-a472-c5a2146587c9",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "This is too much memory. We will use another algorithm available in MsSpec: The *Rehr-Albers series expansion*. We already used that algorithm in activity 3 for the single scattering approach. But this time, we will explore a bit more the effect of the scattering order > 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f7e215cd-3468-4316-901d-27731ec3e61d",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## PED of the 1T-TiSe2 surface"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ed46b9b8-cd37-4531-9686-5c1d804e868e",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "Let us try to model the Ti2p XPD pattern of the transition metal dichalcogenide 1T-TiSe2 .\n",
+ "\n",
+ ":::{seealso}\n",
+ "based on this paper from M.V. Kuznetsov *et al.*\n",
+ "[Surf. Sci. **606** p1760–70 (2012)](https://doi.org/10.1016/j.susc.2012.06.008)\n",
+ ":::\n",
+ "\n",
+ "### Creating the TiSe{sub}`2` cluster\n",
+ "\n",
+ "Start by creating a small cluster of 1T-TiSe2 using the `mx2` function of `ase.build` and the `hemispherical_cluster` function of `msspec.utils`."
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "65562913-1336-476c-8dd7-0ade7a8a1b8b",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ ":::{figure-md} TiSe2-fig\n",
+ " \n",
+ "\n",
+ "Structure of 1T-TiSe2 ($a_0=b_0=3.535$ Å, $c_0=6.004$ Å, $d=3.450$ Å, $D=2.554$ Å)\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "849041c9-513f-4593-a4dd-fb3a495094fa",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Complete the code snipet provided below (or [here](TiSe2_1_tofill.py \"download\")) to create a small TiSe{sub}`2` cluster with Ti emitter in the 2{sup}`nd` plane:\n",
+ "\n",
+ "```{literalinclude} TiSe2_1_tofill.py\n",
+ ":lines: 1-29\n",
+ ":linenos:\n",
+ ":emphasize-lines: 7,11,15,26 \n",
+ "```\n",
+ "\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "b65b569e-242b-4fe9-9c87-ea90d80d9b44",
+ "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"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 1,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from ase.build import mx2\n",
+ "from ase.visualize import view\n",
+ "from msspec.calculator import MSSPEC\n",
+ "from msspec.utils import hemispherical_cluster, get_atom_index\n",
+ "\n",
+ "# Some usefull constants (a, c, d, D) for defining the structure\n",
+ "a=3.535;c=6.004;d=3.450;D=2.554\n",
+ "\n",
+ "# Create the TiSe2 trilayer\n",
+ "# use ase help for this function\n",
+ "TiSe2 = mx2(formula='TiSe2', kind='1T', a=a, thickness=d, size=(1, 1, 1), vacuum=None)\n",
+ "\n",
+ "# The preious cell is 2D, let's define the c-axis to take into account \n",
+ "# the Van der Waals gap between trilayers\n",
+ "TiSe2.cell[2] = [0, 0, c]\n",
+ "\n",
+ "# To be aligned like in the paper\n",
+ "TiSe2.rotate(60, 'z', rotate_cell=True)\n",
+ "\n",
+ "# Since the material is multi-elements, \"tag\" each inequivalent atom \n",
+ "# of the unit cell with a number. The \"Ti\" atom is tagged 0 and \"Se\" \n",
+ "# atoms are 1 and 2.\n",
+ "for i in range(3): \n",
+ " TiSe2[i].tag = i\n",
+ "\n",
+ "cluster = hemispherical_cluster(TiSe2, emitter_tag=0, emitter_plane=1, planes=5)\n",
+ "cluster.emitter = get_atom_index(cluster, 0, 0, 0)\n",
+ "view(cluster, viewer='x3d')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3b029e1b-6871-42ac-9cdd-65c583404e3d",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "### Effect of the scattering order\n",
+ "\n",
+ "Use the line belows to create a calculator and compute a $\\theta$-$\\phi$ scan of the Ti(2p)\n",
+ "\n",
+ "```{literalinclude} TiSe2_1_tofill.py\n",
+ " :start-at: Create a\n",
+ "```"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8169ad09-36b4-4f0a-b737-378e2f78b3df",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Compute a scan for an emitter in the first trilayer and in the second trilayer for scattering orders from 1 (single scattering) to 3 in order to complete the figure below.\n",
+ "What do you conclude about the value of the `calc.calculation_parameters.scattering_order` ?\n",
+ "\n",
+ "```{figure-md} results-fig\n",
+ " \n",
+ "\n",
+ "$\\theta$-$\\phi$ scan of Ti(2p) at 1030 eV kinetic energy for an emitter in the first trilayer (left column) and in the second trilayer (right column). Each row correspond to a growing value for the `calc.calculation_parameters.scattering_order` parameter (from 1 to 5).\n",
+ "```\n",
+ "\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
+}
diff --git a/msspecbook/light/Activity06_light.ipynb b/msspecbook/light/Activity06_light.ipynb
new file mode 100644
index 0000000..5c00252
--- /dev/null
+++ b/msspecbook/light/Activity06_light.ipynb
@@ -0,0 +1,118 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "c0a860db-0f72-4785-81f4-831e48b3a49f",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "# Activity 6: Effect of the temperature\n",
+ "\n",
+ "\n",
+ "## Surface and bulk effects of the temperature\n",
+ "\n",
+ "In this example, we will look at the effects of the temperature on the X-Ray photoelectron diffraction from a copper substrate. We will base our python script on a paper published in 1986 by R. Trehan and S. Fadley. In their work, they performed azimutal scans of a copper(001) surface at 2 different polar angles: one at grazing incidence and one at 45° for incresing temperatures from 298K to roughly 1000K.\n",
+ "\n",
+ "For each azimutal scan, they looked at the anisotropy of the signal, that is:\n",
+ "\n",
+ "```{math}\n",
+ ":label: eq-anisotropy\n",
+ "\\frac{I_{max} - I_{min}}{I_{max}}=\\frac{\\Delta I}{I_{max}}\n",
+ "```\n",
+ "\n",
+ "This value is representative of how clear are the *modulations* of the signal. They also proposed single scattering calculations that reproduced well these results.\n",
+ "\n",
+ "We will reproduce this kind of calculations to introduce the parameters that control the vibrational damping.\n",
+ "\n",
+ "(msd-paper)=\n",
+ ":::{seealso}\n",
+ "based on this paper from R. Trehan and C.S. Fadley\n",
+ "[Phys. Rev. B **34** p6784–98 (2012)](https://doi.org/10.1103/PhysRevB.34.6784)\n",
+ ":::\n",
+ "\n",
+ "### The script\n",
+ "\n",
+ "Since we want to distinguish between bulk (low polar angles, $\\theta = 45°$ in the paper) and surface effects (large polar angles, $\\theta = 83°$ in the paper), we need to compute scans for different emitters and different depths in the cluster.\n",
+ "\n",
+ "The script contains 3 functions:\n",
+ "1. The `create_clusters` function will build clusters with increasing number of planes, with the emitter being in the deepest plane for each cluster.\n",
+ "2. The function `compute` will compute the azimuthal scan for a given cluster.\n",
+ "3. The `analysis` function will sum the intensity from each plane for a given temperature. This will be the *substrate total signal* (more on this in the {ref}`path-filtering` section). The function will also compute the anisotropy (equation {eq}`eq-anisotropy`).\n",
+ "\n",
+ "MsSpec can introduce temperature effects in two ways: either by using the Debye Waller model or by doing an average over the phase shifts. We will explore the latter in this example.\n",
+ "\n",
+ "Regardless of the option chosen to model temperature effects, we need to define mean square displacement (MSD) values of the atoms in our cluster. We will use the Debye model for this. The MSD is defined as follows:\n",
+ "\n",
+ ":::{math}\n",
+ ":label: eq-debye\n",
+ " = \\frac{3\\hbar^2 T}{M K_B \\Theta_D^2}\n",
+ ":::\n",
+ "\n",
+ "where $\\hbar$ is the reduce Planck's constant, $T$ is the temperature, $M$ is the mass of the atom, $k_B$ is the Boltzmann's constant and $\\Theta_D$ is the Debye temperature of the sample.\n",
+ "\n",
+ "To get an idea of the typical order of magnitude for MSD, the figure below plots the values of MSD for copper for temperatures ranging from 300 K to 1000 K.\n",
+ "\n",
+ ":::{figure-md} msd-fig\n",
+ " \n",
+ "\n",
+ "Variation of MSD for copper versus temperature using equation {eq}`eq-debye`\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "69b8c17d-ab66-4092-a492-005f05d80495",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "With the help of the [MsSpec documentation](https://msspec.cnrs.fr/parameters.html) and the second paragraph p6791 of the [article cited above](#msd-paper),\n",
+ "complete the hilighted lines in the [following script](Cu_temperature.py \"download\") to compute the anisotropy of Cu(2p) $\\phi$-scans for polar angle $\\theta$=45° and 83°.\n",
+ "\n",
+ "How is varying the anisotropy versus the temperature. How can you qualitatively explain this variation ?\n",
+ "\n",
+ "```{literalinclude} Cu_temperature.py\n",
+ ":lineno-match:\n",
+ ":emphasize-lines: 40-41,44-48\n",
+ "```\n",
+ "\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
+}
diff --git a/msspecbook/light/Activity07_light.ipynb b/msspecbook/light/Activity07_light.ipynb
new file mode 100644
index 0000000..a768777
--- /dev/null
+++ b/msspecbook/light/Activity07_light.ipynb
@@ -0,0 +1,171 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "42cfa8b1-20d2-47e4-a1f0-161c4517df2c",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(path-filtering)=\n",
+ "# Activity 7: Large clusters and path filtering"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2f802e59-3ebc-4c5d-a034-42a706044d87",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "So far you have seen that multiple scattering calculations with MsSpec can use two different algorithms: *matrix inversion* or *Rehr Albers series expansion*. When matrix inversion becomes impossible because the kinetic energy is too high and the number of atoms is too large, serial expansion is the alternative. This algorithm requires very little memory but it processes the scattering paths sequentially, which can lead to very long calculation times.\n",
+ "\n",
+ "In this activity, we will explore how to configure MsSpec to reduce this calculation time to compute the signal from a deep emitter in Si(001).\n",
+ "\n",
+ "\n",
+ "\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2a2f7c01-3a7e-46d4-90aa-6ba2eada6337",
+ "metadata": {},
+ "source": [
+ "## The number of scattering paths\n",
+ "\n",
+ "To fix the idea, we will first evaluate how many scattering paths we need to compute for an emitter in the subsurface (2{sup}`nd` plane) or in the bulk (7{sup}`th` plane) of a Si(001) cluster."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0f78af28-335e-4f6b-9b98-929f9e6965f8",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Create a cluster of Si(001) with the emitter in the subsurface, 40 Å diameter with 2 planes (since atoms below the emitter can be ignored at high kinetic energies).\n",
+ "\n",
+ "1. For an emitter in the subsurface, we can use single scattering (see {ref}`forward-scattering`). How many paths would be generated for this calculation ?\n",
+ "\n",
+ "2. Same question for an emitter in the 7{sup}`th` plane. If we were able to treat each scattering path within only 1 µs. How long would be such calculation ?\n",
+ "\n",
+ "```{note}\n",
+ "Remember that \n",
+ "1. for an emitter in plane $p$, the scattering order has to be at least the number of planes `above` the emitter\n",
+ "2. The number of scattering paths of order $n$ corresponds to the number of possibilities of arranging up to $n$ atoms (taking order into account).\n",
+ "```\n",
+ "\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5de975f5-8f3d-432e-bfcc-8455bc50a862",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## Paths filtering in MsSpec\n",
+ "\n",
+ "As you may expect, not all paths contribute significantly to the total intensity. This is why we can filter out some scattering paths and drastically reduce the computation time. MsSpec offers several filters for this. The 3 most common filters are:\n",
+ "1. the `forward_scattering` filter which allows all paths where each scattering angle is within a cone of defined aperture\n",
+ "2. the `backward_scattering` filter which is similar to the previous one but for backscattering direction\n",
+ "3. the `distance` filter which rejects all paths longer than a threshold distance\n",
+ "\n",
+ "The following figure illustrate the effect of theses filters on scattering paths\n",
+ "\n",
+ ":::{figure-md} filters-fig\n",
+ " \n",
+ "\n",
+ "Some examples of scattering paths with `forward_scattering`, `backward_scattering` and `distance` filters selected. The accepted forward angle is 45°, the accepted backscattering angle is 20° and the threshold distance is $6a_0$ where $a_0$ is the lattice parameter. Note that the yellow path is rejected but if the `off_cone_events` option is set to a value > 1, then it could have been accepted.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "28aae2f7-2af9-4630-b89d-ab634725ad79",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "## Application to a deep plane in a Si(001) sample\n",
+ "\n",
+ "The following script will compute the contribution of a Si(2p) atom in the 4{sup}`th` plane of a Si(001) cluster at scattering order 3.\n",
+ "\n",
+ "Taking into account all scattering paths took 15 minutes to compute.\n",
+ "\n",
+ "(msd-paper)=\n",
+ ":::{seealso}\n",
+ "based on this paper from S. Tricot *et al.*\n",
+ "[J. Electron. Spectrosc. Relat. Phenom. **256** 147176 (2022)](https://doi.org/10.1016/j.elspec.2022.147176)\n",
+ ":::\n",
+ "\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "\n",
+ "The [following script](Si001.py \"download\") is almost completed, try to define path filtering options (no backscattering, accept all paths with forward angles < 40° and reject paths longer than the diameter of the cluster).\n",
+ "\n",
+ "```{literalinclude} Si001.py\n",
+ ":lineno-match:\n",
+ ":emphasize-lines: 37-41\n",
+ "```\n",
+ "\n",
+ "1. How long was your calculation ?\n",
+ "2. How does it compare to the calculation with **all** scattering paths up to order 3 ?\n",
+ "3. What is the proportion of scattering paths of order 3 that were actually taken into account ?\n",
+ "\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
+}
diff --git a/msspecbook/light/Activity08_light.ipynb b/msspecbook/light/Activity08_light.ipynb
new file mode 100644
index 0000000..427e495
--- /dev/null
+++ b/msspecbook/light/Activity08_light.ipynb
@@ -0,0 +1,147 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "2ff5929f-c066-496f-b078-0bbc2ab49428",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "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",
+ " \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 `).\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",
+ " \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 `).\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": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Using the crystal view in {numref}`Fig. %s ` 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": "82973b9c-bf0c-462a-8114-17ac1e83b799",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} 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 `.\n",
+ "\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
+}
diff --git a/msspecbook/light/Activity09_light.ipynb b/msspecbook/light/Activity09_light.ipynb
new file mode 100644
index 0000000..d6c71d1
--- /dev/null
+++ b/msspecbook/light/Activity09_light.ipynb
@@ -0,0 +1,150 @@
+{
+ "cells": [
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "aa43e0e7-0c18-4750-9e2b-3a48f106d2ca",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "(RFactor)=\n",
+ "# Activity 9: Comparing simulation and experiment with R-factors\n",
+ "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.\n",
+ "\n",
+ "*R-factors* (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.\n",
+ "\n",
+ "## The unusual tilt of CO molecule on Fe(001)\n",
+ "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$\\pm$2° in <100> azimuthal directions. The molecule is bonded to the Fe surface by the carbon atom and the adsorption height was estimated to be $\\sim$ 0.6 Å.\n",
+ "\n",
+ "(COFe-paper)=\n",
+ ":::{seealso}\n",
+ "based on this paper from R. S. Saiki *et al.*\n",
+ "[Phys. Rev. Lett. **63(3)** p283-6 (1989)](https://doi.org/10.1103/PhysRevLett.63.283)\n",
+ ":::\n",
+ "\n",
+ "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.\n",
+ "\n",
+ ":::{figure-md} COFe-fig1\n",
+ " \n",
+ "\n",
+ "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.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "91c03801-b46b-4844-8c89-655700419063",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "Download [this script](./COFe.py) and write the body of the function `create_cluster`. The function should return a \n",
+ "small cluster of 5 Fe atoms with the CO molecule adsorbed like in figure {numref}`Fig. %s ` below. The function\n",
+ "will accept 4 keyword arguments to control the adsorption geometry.\n",
+ "\n",
+ "```{figure-md} COFe-fig2\n",
+ " \n",
+ "\n",
+ "Adsorption geometry of carbon monoxide on Fe(001).\n",
+ "```\n",
+ "\n",
+ "```{note}\n",
+ "Remember to use the [`ase.build.bulk`](https://wiki.fysik.dtu.dk/ase/ase/build/build.html#ase.build.bulk), the [`msspec.utils.hemispherical_cluster`](https://msspec.cnrs.fr/faq/hemispherical_cluster/hemispherical_cluster.html#hemispherical-cluster-faq) and the [`ase.build.add_adsorbate`](https://wiki.fysik.dtu.dk/ase/ase/build/surface.html#ase.build.add_adsorbate) \n",
+ "functions.\n",
+ "```\n",
+ "\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c7697c4f-949b-4261-abaf-96eefaa9a6ba",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "Now that the `create_cluster` function is done, look at the rest of the script. The next function is called `compute_polar_scan` and will obviously be used to compute the $\\theta$-scan of the C1s for a given cluster geometry.\n",
+ "Finally there is the *Main part* that is built in two sections:\n",
+ "\n",
+ "1. A section containing nested *for loops*\n",
+ "2. A final section for *R-Factor analysis*\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "1. 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 Å.\n",
+ "2. What is the best $(\\theta, \\phi)$ according to the R-Factor analysis\n",
+ ":::\n",
+ "\n",
+ "::::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f7827b3c-0cac-42e2-a587-8b30ee3632b4",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "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\n",
+ "\n",
+ ":::{figure-md} rfactors-formula\n",
+ " \n",
+ "\n",
+ "The 12 R-Factors used in MsSpec. The Pendry's R-Factor is n°11.\n",
+ ":::\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "How many R-Factors do agree that $(\\theta,\\phi)=(55,0)$ gives the best agreement ?\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
+}
diff --git a/msspecbook/light/Activity10_light.ipynb b/msspecbook/light/Activity10_light.ipynb
new file mode 100644
index 0000000..f762b0e
--- /dev/null
+++ b/msspecbook/light/Activity10_light.ipynb
@@ -0,0 +1,102 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "38d3e621-e866-43e1-9c92-f473d1e755c0",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "# Activity 10: Parallelization and multi-processing in MsSpec"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1dccb5e3-1cd3-4732-a7ba-81a8a94c89dc",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "As you can see from the previous examples, a complete simulation may require several multiple scattering calculations, for instance to calculate the total intensity of a substrate or to optimize the geometry of a system. As the calculations are often time consuming, it can be useful to distribute these tasks over several processors to make the most of hardware resources.\n",
+ "Although MsSpec is not fully parallelized, the code does offer a number of features, which we will explore here.\n",
+ "\n",
+ "## Matrix inversion parallelization\n",
+ "\n",
+ "When available during installation, MsSpec will link with the system lapack library. It will be used to invert the matrix in the `inversion` option of the MsSpec `calculator`. To allow MsSpec to use this shared memory parallelism, you need to set the number of cores to be used in the `OMP_NUM_THREADS` environment variable.\n",
+ "\n",
+ "You can set this variable just for the execution of your script. For example:\n",
+ "\n",
+ "```sh\n",
+ "$ OMP_NUM_THREADS=12 python my_script.py\n",
+ "```\n",
+ "\n",
+ "will use 12 cores for inverting the matrix in your script.\n",
+ "\n",
+ "It is also possible to set environment variable inside your python script.\n",
+ "\n",
+ "```python\n",
+ "import os\n",
+ "\n",
+ "os.environ['OMP_NUM_THREADS'] = 12\n",
+ "```\n",
+ "\n",
+ "It may be useful for technical reasons or to use different number of cores in some parts of your script.\n",
+ "\n",
+ "## Process-based parallelism\n",
+ "\n",
+ "Another kind of parallelization used in MsSpec is multiprocessing. Quite often, you need to run different *independent* calculations. MsSpec provides a simple *looper* that can be useful for multiprocessing. Let's demonstrate it with the previous example CO/Fe(001).\n",
+ "\n",
+ "[This script](COFe_mp.py) is the multiprocessed version of the previous one. You can see that the previous nested for loops are now replaced by some declarative content (lines 63-67) and the definition of a `process` function (whose name \n",
+ "can be changed).\n",
+ "\n",
+ "With the `msspec.looper` package, the user define `Sweep` objects that are parameters of the calculation or of the cluster. The `process` function must accept as many arguments as parameters to sweep (+ the `**kwargs`).\n",
+ "\n",
+ "A `Looper` object is created (line 76) and the `process` function is set to its `pipeline` attribute (line 77). When MsSpec will run the `looper`, it will combine all parameters values to unique individual sets and MsSpec will distribute the calculations over the number of processors specified in the `ncpu` option.\n",
+ "\n",
+ ":::{literalinclude} COFe_mp.py\n",
+ ":lineno-start: 63\n",
+ ":linenos: true\n",
+ ":lines: 63-84\n",
+ ":::\n",
+ "\n",
+ "\n",
+ "::::{tab-set}\n",
+ "\n",
+ ":::{tab-item} Quiz\n",
+ "In the paper discussed in {ref}`RFactor`, experimental values of the anisotropy suggest an adsorption height between 0.2 and 0.6 Å. Modify the script to add another sweep for variying the adsorption height of the CO molecule.\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
+}