Convert to jupyter book

This commit is contained in:
Sylvain Tricot 2025-06-27 16:01:49 +02:00
parent 0886bdc512
commit a26622a278
20 changed files with 3926 additions and 26 deletions

View File

@ -22,34 +22,112 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"id": "07a04c8c-a268-481a-8f1b-14878ed771b5",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1dc57d2ee20b4192b4bd4866b23d1fd1",
"version_major": 2,
"version_minor": 0
},
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4b8abba5c2984e43a644c4d448a4ea26",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<html>\n",
" <head>\n",
" <title>ASE atomic visualization</title>\n",
" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://www.x3dom.org/release/x3dom.css\"></link>\n",
" <script type=\"text/javascript\" src=\"https://www.x3dom.org/release/x3dom.js\"></script>\n",
" </head>\n",
" <body>\n",
" <X3D width=\"400px\"; height=\"300px\";>\n",
"\n",
"<!--Inserting Generated X3D Scene-->\n",
"<scene>\n",
" <viewpoint position=\"0 0 3.052956\">\n",
" <group/>\n",
" </viewpoint>\n",
" <transform translation=\"-0.0 -0.0 -0.0\">\n",
" <group>\n",
" <group>\n",
" <transform translation=\"0 0 0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.0 0.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0 0 0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.0 0.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" </group>\n",
" <group>\n",
" <transform translation=\"0.0 0.0 0.119262\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"1.0 0.051 0.051\"/>\n",
" </appearance>\n",
" <sphere radius=\"0.66\"/>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.763239 -0.477047\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"1.0 1.0 1.0\"/>\n",
" </appearance>\n",
" <sphere radius=\"0.31\"/>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 -0.763239 -0.477047\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"1.0 1.0 1.0\"/>\n",
" </appearance>\n",
" <sphere radius=\"0.31\"/>\n",
" </shape>\n",
" </transform>\n",
" </group>\n",
" </group>\n",
" </transform>\n",
"</scene>\n",
"<!--End of Inserted Scene-->\n",
"\n",
" </X3D>\n",
" </body>\n",
"</html>\n",
"\n"
],
"text/plain": [
"HBox(children=(NGLWidget(), VBox(children=(Dropdown(description='Show', options=('All', 'O', 'H'), value='All'…"
"<IPython.core.display.HTML object>"
]
},
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
@ -63,7 +141,7 @@
"# Only for jupyter\n",
"import nglview\n",
"from functools import partial\n",
"view = partial(view, viewer='ngl')\n",
"view = partial(view, viewer='x3d')\n",
"\n",
"# Create a water molecule\n",
"water = molecule('H2O')\n",
@ -96,8 +174,7 @@
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true,
"source_hidden": true
"outputs_hidden": true
},
"scrolled": true
},
@ -460,6 +537,12 @@
"> <i class=\"fa fa-info-circle\"></i> **Note**:\n",
"> As the cluster will contain fewer atoms, the emitter index will be different\n",
"\n",
"```{note}\n",
"This is a note\n",
"```\n",
"\n",
"\n",
"\n",
"What do you conclude ?"
]
},
@ -470,8 +553,7 @@
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true,
"source_hidden": true
"outputs_hidden": true
}
},
"outputs": [
@ -606,7 +688,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.13"
}
},
"nbformat": 4,

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
data_image0
_chemical_formula_structural Cu26
_chemical_formula_sum "Cu26"
_cell_length_a 14.4
_cell_length_b 14.4
_cell_length_c 7.2
_cell_angle_alpha 90.0
_cell_angle_beta 90.0
_cell_angle_gamma 90.0
_space_group_name_H-M_alt "P 1"
_space_group_IT_number 1
loop_
_space_group_symop_operation_xyz
'x, y, z'
loop_
_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Cu Cu1 1.0 0.25 0.5 0.37500000000000017 1.0000
Cu Cu2 1.0 0.25 0.5 0.8750000000000001 1.0000
Cu Cu3 1.0 0.3750000000000001 0.37500000000000017 0.37500000000000017 1.0000
Cu Cu4 1.0 0.5 0.24999999999999992 0.37500000000000017 1.0000
Cu Cu5 1.0 0.5 0.37500000000000017 0.12499999999999996 1.0000
Cu Cu6 1.0 0.3750000000000001 0.37500000000000017 0.8750000000000001 1.0000
Cu Cu7 1.0 0.5 0.24999999999999992 0.8750000000000001 1.0000
Cu Cu8 1.0 0.5 0.37500000000000017 0.625 1.0000
Cu Cu9 1.0 0.3750000000000001 0.5 0.12499999999999996 1.0000
Cu Cu10 1.0 0.3750000000000001 0.6249999999999999 0.37500000000000017 1.0000
Cu Cu11 1.0 0.5 0.5 0.37500000000000017 1.0000
Cu Cu12 1.0 0.5 0.6249999999999999 0.12499999999999996 1.0000
Cu Cu13 1.0 0.3750000000000001 0.5 0.625 1.0000
Cu Cu14 1.0 0.3750000000000001 0.6249999999999999 0.8750000000000001 1.0000
Cu Cu15 1.0 0.5 0.5 0.8750000000000001 1.0000
Cu Cu16 1.0 0.5 0.6249999999999999 0.625 1.0000
Cu Cu17 1.0 0.5 0.7500000000000003 0.37500000000000017 1.0000
Cu Cu18 1.0 0.5 0.7500000000000003 0.8750000000000001 1.0000
Cu Cu19 1.0 0.6249999999999999 0.37500000000000017 0.37500000000000017 1.0000
Cu Cu20 1.0 0.6249999999999999 0.37500000000000017 0.8750000000000001 1.0000
Cu Cu21 1.0 0.6249999999999999 0.5 0.12499999999999996 1.0000
Cu Cu22 1.0 0.6249999999999999 0.6249999999999999 0.37500000000000017 1.0000
Cu Cu23 1.0 0.7500000000000003 0.5 0.37500000000000017 1.0000
Cu Cu24 1.0 0.6249999999999999 0.5 0.625 1.0000
Cu Cu25 1.0 0.6249999999999999 0.6249999999999999 0.8750000000000001 1.0000
Cu Cu26 1.0 0.7500000000000003 0.5 0.8750000000000001 1.0000

View File

@ -0,0 +1,47 @@
data_image0
_chemical_formula_structural Cu22
_chemical_formula_sum "Cu22"
_cell_length_a 14.4
_cell_length_b 14.4
_cell_length_c 7.2
_cell_angle_alpha 90.0
_cell_angle_beta 90.0
_cell_angle_gamma 90.0
_space_group_name_H-M_alt "P 1"
_space_group_IT_number 1
loop_
_space_group_symop_operation_xyz
'x, y, z'
loop_
_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Cu Cu1 1.0 0.25 0.5 0.37500000000000017 1.0000
Cu Cu2 1.0 0.25 0.5 0.8750000000000001 1.0000
Cu Cu3 1.0 0.37500000000000017 0.37500000000000017 0.37500000000000017 1.0000
Cu Cu4 1.0 0.5 0.24999999999999992 0.37500000000000017 1.0000
Cu Cu5 1.0 0.37500000000000017 0.37500000000000017 0.8750000000000001 1.0000
Cu Cu6 1.0 0.5 0.24999999999999992 0.8750000000000001 1.0000
Cu Cu7 1.0 0.5 0.37500000000000017 0.625 1.0000
Cu Cu8 1.0 0.37500000000000017 0.6249999999999999 0.37500000000000017 1.0000
Cu Cu9 1.0 0.5 0.5 0.37500000000000017 1.0000
Cu Cu10 1.0 0.37500000000000017 0.5 0.625 1.0000
Cu Cu11 1.0 0.37500000000000017 0.6249999999999999 0.8750000000000001 1.0000
Cu Cu12 1.0 0.5 0.5 0.8750000000000001 1.0000
Cu Cu13 1.0 0.5 0.6249999999999999 0.625 1.0000
Cu Cu14 1.0 0.5 0.7500000000000003 0.37500000000000017 1.0000
Cu Cu15 1.0 0.5 0.7500000000000003 0.8750000000000001 1.0000
Cu Cu16 1.0 0.6249999999999999 0.37500000000000017 0.37500000000000017 1.0000
Cu Cu17 1.0 0.6249999999999999 0.37500000000000017 0.8750000000000001 1.0000
Cu Cu18 1.0 0.6249999999999999 0.6249999999999999 0.37500000000000017 1.0000
Cu Cu19 1.0 0.7500000000000003 0.5 0.37500000000000017 1.0000
Cu Cu20 1.0 0.6249999999999999 0.5 0.625 1.0000
Cu Cu21 1.0 0.6249999999999999 0.6249999999999999 0.8750000000000001 1.0000
Cu Cu22 1.0 0.7500000000000003 0.5 0.8750000000000001 1.0000

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,47 @@
from ase.build import bulk
from msspec.calculator import MSSPEC
from msspec.utils import hemispherical_cluster, get_atom_index, cut_plane
import numpy as np
from matplotlib import pyplot as plt
Ag = bulk('Ag', cubic=True)
Ag.rotate((1,1,1), (0,0,1), rotate_cell=True)
Ag.rotate(15, 'z', rotate_cell=True)
cluster = hemispherical_cluster(Ag, diameter=20, emitter_plane=0)
cluster = cut_plane(cluster, z=-4.8)
cluster.emitter = get_atom_index(cluster, 0,0,0)
cluster[cluster.emitter].symbol = 'Sb'
cluster.edit()
calc = MSSPEC(spectroscopy='PED', algorithm='inversion')
calc.set_atoms(cluster)
calc.source_parameters.theta = 0
calc.source_parameters.phi = 0
calc.detector_parameters.angular_acceptance = 1
calc.detector_parameters.average_sampling = 'low'
calc.muffintin_parameters.interstitial_potential = 0
data = calc.get_phi_scan(level='4d', theta=40, phi=np.linspace(0,240,121), kinetic_energy=45)
# normalize data between [0,1]
dset = data[0]
dset.cross_section -= dset.cross_section.min()
dset.cross_section /= dset.cross_section.max()
# Add experimental data points in the dataset
x, y = np.loadtxt('data.txt').T
dset.add_columns(experiment=y)
# Add points to view
view = dset.views[0]
view.select('phi', 'experiment', legend='Exp. data')
data.view()
calc.shutdown()

View File

@ -0,0 +1,121 @@
0.000000000000000000e+00 2.273853352828327234e-01
2.000000000000000000e+00 2.135876322898652424e-01
4.000000000000000000e+00 1.925265592281927285e-01
6.000000000000000000e+00 1.852631891594877511e-01
8.000000000000000000e+00 1.852631891594877511e-01
1.000000000000000000e+01 1.831705825411805155e-01
1.200000000000000000e+01 1.636929472985219347e-01
1.400000000000000000e+01 1.279608696063064543e-01
1.600000000000000000e+01 1.040430509934481690e-01
1.800000000000000000e+01 3.015378633541379930e-02
2.000000000000000000e+01 4.106459224097607462e-03
2.200000000000000000e+01 1.971550450495464929e-02
2.400000000000000000e+01 7.007532033757153667e-02
2.600000000000000000e+01 1.904879553613253451e-01
2.800000000000000000e+01 3.101513022088481231e-01
3.000000000000000000e+01 4.052906495585950619e-01
3.200000000000000000e+01 3.678644926959027672e-01
3.400000000000000000e+01 3.036757937102613214e-01
3.600000000000000000e+01 2.214720340001324062e-01
3.800000000000000000e+01 2.247878029385593501e-01
4.000000000000000000e+01 2.837024903561691791e-01
4.200000000000000000e+01 3.445713059080361962e-01
4.400000000000000000e+01 4.114147115795538934e-01
4.600000000000000000e+01 5.600722856829548624e-01
4.800000000000000000e+01 6.969212581381016847e-01
5.000000000000000000e+01 8.189179738707677014e-01
5.200000000000000000e+01 9.080765164985155069e-01
5.400000000000000000e+01 9.562807225028111535e-01
5.600000000000000000e+01 9.888241305894533983e-01
5.800000000000000000e+01 9.881336668388966959e-01
6.000000000000000000e+01 9.873660563005683954e-01
6.200000000000000000e+01 9.916558998680982118e-01
6.400000000000000000e+01 9.856319679487668406e-01
6.600000000000000000e+01 9.620117644994009565e-01
6.800000000000000000e+01 8.930029985027734263e-01
7.000000000000000000e+01 8.002870246239043306e-01
7.200000000000000000e+01 6.744921153732785779e-01
7.400000000000000000e+01 5.336319385472689802e-01
7.600000000000000000e+01 3.958859203876436417e-01
7.800000000000000000e+01 3.306385960364682242e-01
8.000000000000000000e+01 2.830681723233798852e-01
8.200000000000000000e+01 2.157622815497834690e-01
8.400000000000000000e+01 2.239956241155102445e-01
8.600000000000000000e+01 3.126826811826061703e-01
8.800000000000000000e+01 3.836092948935748703e-01
9.000000000000000000e+01 3.974940023194180050e-01
9.200000000000000000e+01 2.890294760518045125e-01
9.400000000000000000e+01 1.681544424688440620e-01
9.600000000000000000e+01 5.857273428081174321e-02
9.800000000000000000e+01 1.843518927289370876e-02
1.000000000000000000e+02 3.948951199063644064e-03
1.020000000000000000e+02 5.411750728699640106e-02
1.040000000000000000e+02 1.168717046133502524e-01
1.060000000000000000e+02 1.428170265275016670e-01
1.080000000000000000e+02 1.770817723162995683e-01
1.100000000000000000e+02 1.852631891594877511e-01
1.120000000000000000e+02 1.827670619818080600e-01
1.140000000000000000e+02 1.840805289029476266e-01
1.160000000000000000e+02 2.023203439358092770e-01
1.180000000000000000e+02 2.289994175203227400e-01
1.200000000000000000e+02 2.320430725945487604e-01
1.220000000000000000e+02 2.174983315399919570e-01
1.240000000000000000e+02 1.903085890797567015e-01
1.260000000000000000e+02 1.848716692115463522e-01
1.280000000000000000e+02 1.870838533508997481e-01
1.300000000000000000e+02 1.808923414647976846e-01
1.320000000000000000e+02 1.656061876352601381e-01
1.340000000000000000e+02 1.324214968752658039e-01
1.360000000000000000e+02 8.695118016262873284e-02
1.380000000000000000e+02 1.854769500506061805e-02
1.400000000000000000e+02 0.000000000000000000e+00
1.420000000000000000e+02 2.910410785429527400e-02
1.440000000000000000e+02 1.010188969127969877e-01
1.460000000000000000e+02 2.301799776698615074e-01
1.480000000000000000e+02 3.527565800906127258e-01
1.500000000000000000e+02 3.915987019538648140e-01
1.520000000000000000e+02 3.464073994570029402e-01
1.540000000000000000e+02 2.694669793425982229e-01
1.560000000000000000e+02 2.158017450989128672e-01
1.580000000000000000e+02 2.275203421614326316e-01
1.600000000000000000e+02 3.068773854027863068e-01
1.620000000000000000e+02 3.571336959618095497e-01
1.640000000000000000e+02 4.706879815526597843e-01
1.660000000000000000e+02 6.409924085632153767e-01
1.680000000000000000e+02 7.767958277474236173e-01
1.700000000000000000e+02 8.699880758924664059e-01
1.720000000000000000e+02 9.465309757532142099e-01
1.740000000000000000e+02 9.812603702158622099e-01
1.760000000000000000e+02 9.992196602416892892e-01
1.780000000000000000e+02 9.917162779443612353e-01
1.800000000000000000e+02 9.978245891628175768e-01
1.820000000000000000e+02 1.000000000000000000e+00
1.840000000000000000e+02 9.875604662057533289e-01
1.860000000000000000e+02 9.483868703110428511e-01
1.880000000000000000e+02 8.713195437307523772e-01
1.900000000000000000e+02 7.743174871902573919e-01
1.920000000000000000e+02 6.499028625508473933e-01
1.940000000000000000e+02 5.133872820820232219e-01
1.960000000000000000e+02 3.854633893596886574e-01
1.980000000000000000e+02 3.197097892137605313e-01
2.000000000000000000e+02 2.625546271582531732e-01
2.020000000000000000e+02 2.180674059888806082e-01
2.040000000000000000e+02 2.313545375136863425e-01
2.060000000000000000e+02 3.256001393270981925e-01
2.080000000000000000e+02 3.901136262892592188e-01
2.100000000000000000e+02 4.105052902445402441e-01
2.120000000000000000e+02 3.039702372835895727e-01
2.140000000000000000e+02 1.592176621398869174e-01
2.160000000000000000e+02 6.314946746536785616e-02
2.180000000000000000e+02 1.766902523683577114e-02
2.200000000000000000e+02 1.012551589503468512e-02
2.220000000000000000e+02 5.641599939516841328e-02
2.240000000000000000e+02 1.259411667024434578e-01
2.260000000000000000e+02 1.520177453041229865e-01
2.280000000000000000e+02 1.775272950156810414e-01
2.300000000000000000e+02 1.829980737518577261e-01
2.320000000000000000e+02 1.838471170106117103e-01
2.340000000000000000e+02 1.827520612175190795e-01
2.360000000000000000e+02 2.068282879012685871e-01
2.380000000000000000e+02 2.265482926355094906e-01
2.400000000000000000e+02 2.403459956284773325e-01

View File

@ -0,0 +1,620 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "2aebc88d-0bb4-4d56-b7f6-977a66814229",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# 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 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 gives satisfactory results for adsorbates. Well 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}`."
]
},
{
"cell_type": "markdown",
"id": "a4cd32cd-b480-44b5-af38-b38e5979ce00",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
":::{figure-md} RhO-fig\n",
"<img src=\"RhO_fig0.jpg\" alt=\"RhO\" width=\"300px\" align=\"center\">\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": [
"By using the Atoms class of the ase package, try to build a O-Rh chain where atoms are 0.4 nm apart\n",
"\n",
"*unfold to see the answer*"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "55929980-7394-4a60-b554-376adce57dbf",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"hide-cell"
]
},
"outputs": [
{
"data": {
"text/html": [
"<html>\n",
" <head>\n",
" <title>ASE atomic visualization</title>\n",
" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://www.x3dom.org/release/x3dom.css\"></link>\n",
" <script type=\"text/javascript\" src=\"https://www.x3dom.org/release/x3dom.js\"></script>\n",
" </head>\n",
" <body>\n",
" <X3D width=\"400px\"; height=\"300px\";>\n",
"\n",
"<!--Inserting Generated X3D Scene-->\n",
"<scene>\n",
" <viewpoint position=\"0 0 8.0\">\n",
" <group/>\n",
" </viewpoint>\n",
" <transform translation=\"-0.0 -0.0 -0.0\">\n",
" <group>\n",
" <group>\n",
" <transform translation=\"0 0 0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.0 0.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0 0 0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.0 0.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0 0 0\"/>\n",
" </appearance>\n",
" <lineset vertexCount=\"5\">\n",
" <coordinate point=\"0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0\"/>\n",
" </lineset>\n",
" </shape>\n",
" </transform>\n",
" </group>\n",
" <group>\n",
" <transform translation=\"0.0 0.0 0.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"1.0 0.051 0.051\"/>\n",
" </appearance>\n",
" <sphere radius=\"0.66\"/>\n",
" </shape>\n",
" </transform>\n",
" <transform translation=\"0.0 0.0 4.0\">\n",
" <shape>\n",
" <appearance>\n",
" <material diffuseColor=\"0.039 0.49 0.549\"/>\n",
" </appearance>\n",
" <sphere radius=\"1.42\"/>\n",
" </shape>\n",
" </transform>\n",
" </group>\n",
" </group>\n",
" </transform>\n",
"</scene>\n",
"<!--End of Inserted Scene-->\n",
"\n",
" </X3D>\n",
" </body>\n",
"</html>\n",
"\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"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.)])\n",
"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"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "b1f01f60-7d46-49f3-9653-57e6f8f2be02",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-output"
]
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"'NoneType' object has no attribute 'upper'\n",
"'integrals' is ignored since the 'spinpol' global parameter is set to False. Enable spin polarization in the constructor of your Calculator if you want to use this option.\n",
"The sample temperature was set, but will be ignored since 'use_debye_model' parameter is False.\n",
"The sample Debye temperature was set, but will be ignored since 'use_debye_model' parameter is False.\n",
"You must define the absorber before setting the atoms to thecalculator.\n"
]
}
],
"source": [
"from msspec.calculator import MSSPEC\n",
"\n",
"calc = MSSPEC(spectroscopy='PED')\n",
"calc.set_atoms(cluster)\n",
"cluster.emitter = 0"
]
},
{
"cell_type": "markdown",
"id": "21763c63-9bd1-4e80-944a-9cf313894b89",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"We use the *get_scattering_factors* method to compute the scattering factors at 723 eV"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7706c659-5b62-427b-94ca-d3e890582e46",
"metadata": {
"collapsed": true,
"editable": true,
"jupyter": {
"outputs_hidden": true
},
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-output"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" _________________________________________________________________\n",
"\n",
" PHAGEN\n",
" _________________________________________________________________\n",
"\n",
" -----------------------------------------------------------------\n",
" parameters for this xpd calculation:\n",
" -----------------------------------------------------------------\n",
" edge= k \n",
" potype= hedin norman= stdcrm absorber= 1\n",
" coor= angs emin= 53.14 Ry emax= 53.14 Ry\n",
" delta= 0.300 Ry gamma= 0.00 Ry eftri= 0.000 Ry\n",
" cip= 0.00 Ry lmaxt= 19 charelx: ex\n",
" ionization state : neutral\n",
" relativistic corrections of type: nr\n",
" final state potential generated internally\n",
"\n",
"\n",
" Computes the T-matrix and radial matrix elements \n",
"\n",
"\n",
" coordinates in angstroms Radii\n",
" -----------------------------------------------------------------\n",
" O 8 0.0000 0.0000 0.0000 0.0000 0.0000\n",
" Rh 45 0.0000 0.0000 4.0000 0.0000 0.0000\n",
" -----------------------------------------------------------------\n",
"\n",
"\n",
" ** enter calphas **\n",
" ---\n",
" total energy for atom in ground state \n",
" total energy for atom with a hole in k edge\n",
" calculated ionization energy for edge k = 545.41802450847172 eV\n",
" ---\n",
" calculated ionization potential (ryd) = 40.104265383081511 \n",
" ---\n",
" \n",
" \n",
" symmetrizing coordinates... \n",
"\n",
"\n",
" symmetrized atomic coordinates of cluster \n",
"\n",
" position\n",
" atom no. x y z eq\n",
"\n",
" 1 osph 0 0.0000 0.0000 0.0000 0\n",
" 2 O 8 0.0000 0.0000 -6.4179 0\n",
" 3 Rh 45 0.0000 0.0000 1.1410 0\n",
"\n",
" computing muffin tin potential and phase shifts\n",
" generating core state wavefunction \n",
" generating final potential (complex hedin-lundqvist exchange) \n",
" MT radii for Hydrogen atoms determined by stdcrm unless other options are specified\n",
"\n",
" -----------------------------------------------------------------\n",
" i rs(i) i=1,natoms \n",
" 1 10.94 2 3.04 3 4.52\n",
" N.B.: Order of atoms as reshuffled by symmetry routines \n",
" -----------------------------------------------------------------\n",
"\n",
" input value for coulomb interst. potential = -0.69999999999999996 \n",
" and interstitial rs = 3.0000000000000000 \n",
" lower bound for coulomb interst. potential = -9.0265383897774280E-003\n",
" and for interst. rs = 7.1645607045202233 \n",
"\n",
" lmax assignment based on l_max = r_mt * k_e + 2\n",
" where e is the running energy\n",
" optimal lmax chosen according to the running energy e for each atom\n",
"\n",
"\n",
" number of centers= 2\n",
"\n",
" starting potentials and/or charge densities written to file 13\n",
" symmetry information generated internally\n",
" symmetry information written to file 14\n",
"\n",
"\n",
" core initial state of type: 1s1/2\n",
"\n",
" fermi level = -0.06986\n",
"\n",
"\n",
" generating t_l (for030) and atomic cross section (for050)\n",
" corewf: fnisx = 0.99960409001060369 \n",
" writing atomic orbital energies\n",
" orbital energy (Ryd eV) 1s -41.398732282531711 -563.22973375300819 \n",
" orbital energy (Ryd eV) 2s -2.5058958613249085 -34.092712046217287 \n",
" orbital energy (Ryd eV) 2p1/2 -1.2046159289785867 -16.388799162324261 \n",
" orbital energy (Ryd eV) 2p3/2 -1.2524515821366835 -17.039603201642745 \n",
"\n",
" using overlapped potential to search for core states of photoabsorber\n",
"\n",
" calculating non relativistic core states\n",
" ------------------------------\n",
" energy of core state = -42.185368888826872 for orbital =1s \n",
" n. of zeros found: 0 expected: 0\n",
"\n",
" calculating relativistic core states\n",
" energy of core state = -42.238351573130871 for orb =1s \n",
" n. of zeros found: 0 expected: 0\n",
" -------------------------------\n",
" density of the valence charge (au^{-3} 2.7365838297823178E-003\n",
" rs_v corresponding to valence density (au) 4.4350742743021581 \n",
" valence plasmon energy (in eV) 4.4646221434201410 \n",
"\n",
" gamma = 0.000000 rsint = 15.696380\n",
"\n",
" check in subroutine cont\n",
" order of neighb. -- symb. -- dist. from absorber\n",
" \n",
" 2 Rh 7.5589045018313126 \n",
" -----------------------------------------------------------------\n",
" 1 O 0.000000\n",
" 2 Rh 7.558905\n",
" 1 O 0.000000\n",
" 2 Rh 7.558905\n",
" \n",
" irho = 2 entering vxc to calculate energy dependent exchange\n",
" energy dependent vcon = (-6.82152172101615703E-003,1.67511733431198982E-002) at energy 53.139499999999998 \n",
" check ionization potential: 40.104265383081511 \n",
" \n",
" \n",
" value of the mean free path:\n",
" -----------------------------------------------------------------\n",
" average mean free path in the cluster : mfp = 30.25827 angstrom at energy 53.13950\n",
"\n",
" -----------------------------------------------------------------\n",
" \n",
" calculating atomic t-matrix elements atm(n)\n",
" check orthogonality between core and continuum state\n",
" scalar product between core and continuum state = (-4.41068611043292647E-002,-8.76975637885601326E-004)\n",
" --- sqrt(xe/pi) = (1.5233278454390002,-1.20034309405237769E-004)\n",
"\n",
"\n",
" ** phagen terminated normally ** \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"**********************************************************************************\n",
"********************* *********************\n",
"********************* *********************\n",
"********************* spec input file *********************\n",
"********************* *********************\n",
"********************* *********************\n",
"**********************************************************************************\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" CRYSTAL STRUCTURE : \n",
"\n",
"\n",
"\n",
"\n",
" 1.000 0 A,IBAS\n",
"\n",
"\n",
"\n",
" TYPE OF CALCULATION : POLAR PHOTOELECTRON DIFFRACTION\n",
"\n",
"\n",
"\n",
" TYPE OF CALCULATION : SCATTERING FACTOR\n",
"\n",
"\n",
"\n",
" PhD EXPERIMENTAL PARAMETERS : \n",
"\n",
"\n",
"\n",
"\n",
" 0 0 0 ISPIN,IDICHR,IPOL\n",
" 1s 2 0 LI,S-O,INITL,I_SO\n",
" 0 1 0 1 IPHI,ITHETA,IE,IFTHET\n",
" 1 577 1 577 NPHI,NTHETA,NE,NFTHET\n",
" 0.00 -360.00 723.00 0.500 PHI0,THETA0,E0,R0\n",
" 0.00 0.00 723.00 -1.000 PHI1,THETA1,EFIN,R1\n",
" -55.00 0.00 1253.60 THLUM,PHILUM,ELUM\n",
" 1 0 0.00 0 IMOD,IMOY,ACCEPT,ICHKDIR\n",
"\n",
"\n",
"\n",
" CALCULATION PARAMETERS : \n",
"\n",
"\n",
"\n",
"\n",
" 0 3 0 0 NO,NDIF,ISPHER,I_GR\n",
" 0 1 1.000 0.000 I_REN,N_REN,REN_R,REN_I\n",
" 0 0 0 0 ISFLIP,IR_DIA,ITRTL,I_TEST\n",
" 1 1 NEMET,IEMET(NEMET)\n",
" 0 1 100 0.00 ISOM,NONVOL,NPATH,VINT\n",
" 0 1 0 0 IFWD,NTHOUT,I_NO,I_RA\n",
" 0 20.00 0 20.00 N_RA(NAT),THFWD(NAT),IBWD(NAT),THBWD(NAT)\n",
" 0 20.00 0 20.00 N_RA(NAT),THFWD(NAT),IBWD(NAT),THBWD(NAT)\n",
" 0 2 0.0100 1 IPW,NCUT,PCTINT,IPP\n",
" 0 10.00 ANG ILENGTH,RLENGTH,UNLENGTH\n",
" 0 1 1 1 IDWSPH,ISPEED,IATT,IPRINT\n",
" 0 420.000 293.000 1.20 IDCM,TD,T,RSJ\n",
" 2 15.00 ILPM,XLPM0\n",
" 0.00000 0.00000 UJ2(NAT) : SUBSTRATE\n",
"\n",
"\n",
"\n",
" <<<<<<<<<< AS THE CALCULATION HAS MORE THAN 250 POINTS, SOME OUTPUTS HAVE BEEN SUPRESSED >>>>>>>>>>\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" MAXIMAL VALUES OF L FOR THE 2 PROTOTYPICAL ATOMS : \n",
"\n",
"\n",
" 24 35\n",
"\n",
"\n",
" ---> CHECK FOR ZEROS IN THE TL FILE TO REDUCE THE AMOUNT OF COMPUTING :\n",
"\n",
"\n",
" (ONLY THE MATRIX ELEMENTS NON ZERO TO THE FIRST 9 DECIMAL DIGITS ARE KEPT)\n",
"\n",
"\n",
" ENERGY POINT No 1\n",
"\n",
" PROTOTYPICAL ATOM No 1 INITIAL LMAX = 24 FINAL LMAX = 24\n",
" PROTOTYPICAL ATOM No 2 INITIAL LMAX = 35 FINAL LMAX = 35\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" CALCULATION OF THE SCATTERING FACTOR DONE\n"
]
}
],
"source": [
"# compute the scattering factor\n",
"data = calc.get_scattering_factors(level='1s', kinetic_energy=723)"
]
},
{
"cell_type": "markdown",
"id": "14d39e21-eee0-411b-8347-25e932075c83",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"How large is the backscattering factor of Rhodium with respect to that of Oxygen ?\n",
"\n",
"```{toggle}\n",
"\n",
":::{figure-md} SF-fig\n",
"<img src=\"RhO_fig1.jpg\" alt=\"Scattering factors\" width=\"600px\" align=\"center\">\n",
"\n",
"Polar representation of the scattering factor\n",
":::\n",
"\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "9d18ecc3-27a7-4f4d-98ae-7ff1c309bbfb",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": []
},
{
"cell_type": "markdown",
"id": "4ff0c14f-b2f6-47c6-91f4-9edc7ee7260d",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"```{toggle}\n",
"\n",
":::{figure-md} stereo-fig\n",
"<img src=\"RhO_fig2b.gif\" alt=\"Scattering factors\" width=\"600px\" align=\"center\">\n",
"\n",
"Stereographic projections of O(1s) emission at {math}`E_0` = 723 eV for an oxygen atom \n",
"on top of a fcc site of 3 Rh atoms at various altitudes {math}`z_0`\n",
":::\n",
"\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1e0b2cc9-bfd6-4abf-81b0-629c4d122141",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

32
msspecbook/_config.yml Normal file
View File

@ -0,0 +1,32 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html
title: My sample book
author: The Jupyter Book Community
logo: logo.png
# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force
# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex
# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib
# Information about where the book exists on the web
repository:
url: https://github.com/executablebooks/jupyter-book # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional)
# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: False
use_repository_button: False

9
msspecbook/_toc.yml Normal file
View File

@ -0,0 +1,9 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html
format: jb-book
root: intro
chapters:
- file: Activity01/Activity01
- file: Activity02/Activity02
- file: Activity03/Activity03

11
msspecbook/intro.md Normal file
View File

@ -0,0 +1,11 @@
# Welcome to your Jupyter Book
This is a small sample book to give you a feel for how book content is
structured.
It shows off a few of the major file types, as well as some sample content.
It does not go in-depth into any particular topic - check out [the Jupyter Book documentation](https://jupyterbook.org) for more information.
Check out the content pages bundled with this sample book to see more.
```{tableofcontents}
```

BIN
msspecbook/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -0,0 +1,3 @@
jupyter-book
matplotlib
numpy