.. include:: /substitutions.rst .. _example_Fe2O3: ================================== Example system: Fe₂O₃(1−102)-(1×1) ================================== Hematite (`ɑ`-Fe₂O₃) is one of the most common, naturally occurring iron oxides. Its surfaces are popular model systems for (single-atom) catalysis :cite:p:`kraushoferAtomicscaleStructureHematite2018,franceschiModelSystemPhotocatalysis2020`, photocatalysis and the study of mineral–water interfaces. The :math:`(1\bar{1}02)` surface — also referred to as :math:`(012)`, or r-cut — exhibits two stable terminations under :term:`UHV` conditions: a stoichiometric, bulk-truncated, (1×1) termination, and a reduced (2×1) reconstruction :cite:p:`kraushoferAtomicscaleStructureHematite2018`. Here we use the bulk-truncated (1×1) surface as an example system of an oxide surface with medium complexity and will compare experimental |LEED-IV| data with a theory calculation in ViPErLEED. This example is a simplified version of the example calculation shown in the main ViPErLEED paper :cite:p:`viperleedCalc`. For more details on the full calculation, see the paper and the supplementary information. .. todo:: add citation for supplementary information .. only:: html All input files needed to follow along on your own machine can be found :download:`here`. .. only:: not html You can download the input files to follow along in the online version of the documentation at `viperleed.org `__. .. tip:: If you are new to ViPErLEED, check out :ref:`this tutorial` first, which explains how to set up a calculation in more detail. .. note:: If you want to follow along on your own machine, note that the calculation may take *a long time* to complete. On a modern 48-core machine, each looped structure optimization took about 6–10 hours to finish. .. _sec_fe2o3_intro: Introduction ============ To set up the calculation, we need to start from a structure model of the (1×1) surface in the POSCAR format. We can easily build this ourselves from a (`ɑ`-Fe₂O₃) bulk structure. For this example, we use the structure by :cite:t:`maslenSynchrotronXrayStudy1994`, which can be found on the `Crystallography Open Database (entry 2101167) `_. .. warning:: Bulk structures can be found in various online databases, but you should be careful to choose a model with the correct **experimental** lattice parameters (as determined by :term:`XRD`). Lattice parameters from, e.g., :term:`DFT` calculations may be off by ~1%, which will strongly affect the |R factor|. Lattice parameters are not accessible in the :ref:`tensor-LEED approximation`, but they can be optimized in a :ref:`full-dynamic optimization`. To go from the hexagonal bulk unit cell to the unit cell for the :math:`(1\bar{1}02)` surface, we need to apply a suitable change of basis .. math:: (\mathbf{a}', \mathbf{b}', \mathbf{c}') = (\mathbf{a},\mathbf{b},\mathbf{c}) P, with .. math:: P = \frac{1}{3} \begin{pmatrix} 3 & 1 & 2 \\ 0 & 2 & 4 \\ 0 & -1 & 1 \end{pmatrix} . In :term:`VESTA`, you can do this by selecting :menuselection:`Edit --> Edit Data --> Unit cell --> Transform`. To avoid problems later on, it is useful to also delete the unit cell symmetry before applying a transformation. You can do that by pressing the :guilabel:`Remove symmetry` button in :menuselection:`Edit --> Edit Data --> Unit cell`. When applying the transformation, VESTA may prompt you and ask what to do with the atoms in the new unit cell. Make sure to choose :guilabel:`Search atoms in the new unit-cell and add them as new sites`. The unit-cell transformation will introduce duplicate atoms, which can be deleted using the :guilabel:`Remove duplicate atoms` button in :menuselection:`Edit --> Structure parameters`. To create a suitable surface slab (as expected by ViPErLEED), we can then replicate the unit cell along |c| and (optionally) remove the topmost layer to create a vacuum interface. In VESTA you can do this by applying a transformation that "stretches" the cell in the |c| direction. You may have to use the "Initialize current matrix" button first to apply the transformation to the previously transformed unit cell. Use .. math:: \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 2 \end{pmatrix} to make the slab twice as thick along |c|. Choose again :guilabel:`Search atoms in the new unit-cell and add them as new sites`. You can then add a vacuum gap by applying the same transformation again, this time not adding any new atoms (choose :guilabel:`Do nothing` in the prompt). This is not strictly required by ViPErLEED, but makes it easier to recognize which layer is our surface. Our starting POSCAR file contains 40 atoms in total, which corresponds to four repeat units (layers) of 4 Fe and 6 O atoms each. See :numref:`fig_Fe2O3_layers` for a side view of the structure. PARAMETERS and VIBROCC ====================== As in the previous examples, we begin with a simple :ref:`PARAMETERS` file (\ :numref:`list_fe2o3_parameters`). .. _list_fe2o3_parameters: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/PARAMETERS :language: console :caption: PARAMETERS for `ɑ`-Fe₂O₃\ :math:`(1\overline{1}02)`-(1×1). The settings concerning global parameters and the :ref:`VIBROCC` file have been discussed in detail elsewhere [see, e.g., the :ref:`Ag(100) example`]. In particular, we specify the parameter :ref:`BULK_LIKE_BELOW` with a suitable value (0.35 for the POSCAR file constructed in the :ref:`sec_fe2o3_intro`). ViPErLEED will use it to derive the values of the :ref:`BULK_REPEAT`, :ref:`LAYER_CUTS`, and :ref:`N_BULK_LAYERS` parameters, as shown in section :ref:`sec_fe2o3_init` below. We also use the :ref:`sitedef` parameter to define which sites should be treated separately by ViPErLEED. In this case, we declare two ``surf``\ ace sites for iron and oxygen, selecting the two topmost atoms of each species. These atoms will be assigned dedicated vibrational amplitudes and electron–atom scattering phase shifts (see file :ref:`PHASESHIFTS`). All remaining atoms are automatically given a ``def``\ :spelling:ignore:`ault` label instead. Note also that we set the :ref:`beamincidence` parameter to :math:`\phi=90°` to match the input structure with the crystal orientation used in the experiment. This setting won't have any effect initially, since the polar angle is set to :math:`\theta = 0°`. However, we will optimize :math:`\theta` later on, at which point the value of :math:`\phi` will be important. To set initial vibrational amplitudes for the surface atoms, we can either supply a :ref:`VIBROCC` file, or let ViPErLEED calculate them based on the Debye temperature of the sample. In this case, we set the Debye temperature and experiment temperature via the :ref:`T_DEBYE`, :ref:`T_EXPERIMENT` parameters. Note that this Debye temperature was chosen based on literature values and an previous optimization run. For more details, see the main ViPErLEED publication. .. _sec_fe2o3_init: Initialization ============== We can now run the initialization to check if all input files are interpreted correctly. If so, the :ref:`log` should look similar to :numref:`list_fe2o3_init_log`. .. _list_fe2o3_init_log: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/log_init.txt :language: console :caption: Log file after initialization for `ɑ`-Fe₂O₃\ :math:`(1\overline{1}02)`-(1×1). The initialization log shows that the input files are interpreted correctly and that the right plane group (``pg[0 1]``) is detected. It also shows that the bulk structure and repeat vector have been identified. This is reflected in the PARAMETERS file, which should now contain additional lines as in :numref:`list_fe2o3_auto_parameters`. .. _list_fe2o3_auto_parameters: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/PARAMETERS_bulk_detected :language: console :caption: PARAMETERS after initialization. The detected layers and bulk repeat vector are also shown in :numref:`fig_Fe2O3_layers` for clarity. .. _fig_Fe2O3_layers: .. figure:: /_static/paper_figures/Hematite-Layers_embedded.svg :width: 60% :align: center Visualization of the crystal structure with highlighted layers, and the bulk repeat vector. Fe atoms are depicted as large yellow spheres, O atoms as small red ones. This figure is taken from the first ViPErLEED paper :cite:p:`viperleedCalc`. At this stage, before proceeding, you should always check the detected bulk structure and spacing, as it is crucial for the calculation. To help with this, ViPErLEED provides the files :ref:`POSCAR_bulk and POSCAR_bulk_appended`. The former contains the crystal structure of the bulk as detected by ViPErLEED; the latter contains the surface slab with additional bulk layers appended to it. You can visualize these files in VESTA to check if the bulk structure is as you expect. In particular, one should make sure that the bulk stoichiometry for ``POSCAR_bulk``, and the bulk layer spacing for ``POSCAR_bulk_appended``, are correct. Reference calculation and structure optimization ================================================ If the initialization ran without errors, we can proceed to the reference calculation and structure optimization. You can find more details about what happens in each section of a ViPErLEED |LEED-IV| calculation :ref:`here`. In short, the :ref:`reference calculation` performs a full-dynamic LEED calculation to generate |IV| curves for the input structure. |IV| curves are very sensitive to the exact atomic positions and vibrational amplitudes. Because of this, it is necessary to optimize the structure to get the best fit to the experimental |IV| data. The reference calculation is the starting point for this optimization, but full-dynamic calculations are computationally too expensive for the optimization, which requires a large number of iterations. We can perform the optimization in a computationally more efficient way by using a perturbative approach, where we calculate the effect of small changes to the input structure. This is done in the :ref:`delta-amplitudes calculation` and :ref:`structure optimization`. To run these sections, we also need to specify which parameters we want to vary (i.e., the parameter space). We do this by providing a :ref:`DISPLACEMENTS` file, as in :numref:`list_fe2o3_displacements_1`. .. _list_fe2o3_displacements_1: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/DISPLACEMENTS_L1-2_looped :language: console :caption: DISPLACEMENTS Here, we specify that we want to optimize the atomic out-of-plane positions of all atoms in the first and second layer from −0.05 Å to +0.05 Å in steps of 0.01 Å. At the same time, we also optimize the vibrational amplitudes of the surface atoms. We subsequently turn to the in-plane position of the atoms in the first two layers. Note also the ```` and ```` tags at the beginning and end of the file, which indicate that these steps should be repeated until convergence. For more details on the syntax, see the page on the :ref:`DISPLACEMENTS` file. We can now start the calculation by setting the :ref:`RUN` parameter to ``1-3 1`` and starting |calc| again. This will execute the reference calculation, the delta-amplitude calculation and the looped structure optimization in order. By appending the ``1`` to the ``1-3``, we also tell ViPErLEED to finish with a second reference calculation of the optimized structure. Once finished, you can check the log files to see if the calculation ran without errors. You can also find the final |R factor| at the end of the log file (see the extract in :numref:`list_fe2o3_log_search_1`). .. _list_fe2o3_log_search_1: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/log_search_1.txt :language: console :caption: Final log :numref:`fig_Fe2O3_search_progress_1` shows the evolution of the |R factor| during the optimization process. The initial |R factor| (:math:`R_\mathrm{P}\approx0.78`) is very high. This is not unusual when starting from a totally unrelaxed, bulk-truncated structure, as multiple iterations of reference calculation and structure optimizations are usually necessary for convergence. .. _fig_Fe2O3_search_progress_1: .. figure:: /_static/example_systems/Fe2O3(012)-(1x1)/figures/Search-report-first_optimization.svg :width: 70% :align: center Upper half of page 1 for the ``Search-progress.pdf`` file for the first optimization run of `ɑ`-Fe₂O₃\ :math:`(1\overline{1}02)`-(1×1). .. note:: You may also notice that the |R factor| for the second reference calculation is quite different from the |R factor| obtained at the end of the structure optimization. This is to be expected, as the perturbative tensor-LEED approximation used in the structure optimization is only valid for small changes to the structure. The final reference calculation removes this error and gives a more accurate |R factor|. Optimizing the incidence angle ============================== In our case, the |R factor| has improved significantly after the first structure optimization, but is still far from a good fit at :math:`R_\mathrm{P} \approx 0.40`. This is because our measurement was performed on a UHV manipulator that does not have enough degrees of freedom in rotation to perfectly align the sample with the LEED optics. We thus know that we need to optimize the incidence angle of the electron beam to get a closer correspondence between the experimental and calculated |IV| curves. The incidence angle is not a parameter that is accessible in the tensor-LEED approximation. In ViPErLEED, we can instead optimize the incidence angle using a full-dynamic optimization, which optimizes a parameter by performing a full-dynamic reference calculation at each iteration. To do this, we need to edit the PARAMETERS file (see :numref:`list_fe2o3_opt_theta_params`) to set :ref:`RUN=6` and provide the ``OPTIMIZE`` parameter to specify which parameter we want to optimize. .. _list_fe2o3_opt_theta_params: .. literalinclude :: /_static/example_systems/Fe2O3(012)-(1x1)/PARAMETERS_optimize_theta :language: console :caption: PARAMETERS, with OPTIMIZE specified for the polar incidence angle :math:`\theta` of the primary electron beam. Here, we set the initial step size to 1° and convergence criterion to 0.1°. After running the calculation, we find a minimum at about :math:`\theta \approx 0.87°` which already reduces the |R factor| to about :math:`R_\mathrm{P} \approx 0.22`. We can also see that the |IV| curves, and consequently the |R factor|, are very sensitive to the incidence angle in the :ref:`FD_Optimization.pdf` and :ref:`FD_Optimization_beams.pdf` files (see :numref:`fig_Fe2O3_fd_opt_theta_values` and :numref:`fig_Fe2O3_fd_opt_theta_beams`). .. _fig_Fe2O3_fd_opt_theta_values: .. figure:: /_static/example_systems/Fe2O3(012)-(1x1)/figures/FD_Optimization.svg :width: 70% :align: center |R factor| as a function of the polar incidence angle as shown in :ref:`FD_Optimization.pdf`. .. _fig_Fe2O3_fd_opt_theta_beams: .. figure:: /_static/example_systems/Fe2O3(012)-(1x1)/figures/FD_Optimization_beam_(1,1).svg :width: 70% :align: center |IV| curves for beam (1|1) as shown in :ref:`FD_Optimization_beams.pdf`. .. note:: If the incidence angle is off-normal, it is advisable to optimize it relatively early on, before performing structural optimization deeper into the surface. Otherwise, the error in the |IV| curves may incorrectly be compensated by moving the atoms relative to the incident beam, which will result in incorrect positions relative to the bulk. This becomes more likely if bulklike layers contribute only weakly to the |IV| curves, i.e., when optimizing layers far below the surface. Refining the structure ====================== After optimizing the incidence angle, we can perform another structure optimization to refine the structure. To do this, we again provide a :ref:`DISPLACEMENTS` file to specify the range of parameters we want to optimize. We can then run the calculation by setting the :ref:`RUN` parameter back to ``1-3 1``. Note also that we should now remove or comment out the ``OPTIMIZE`` parameter, as the superfluous parameter will raise a warning otherwise. At this point, the best strategy to achieve the optimal fit is generally not known *a priori*, and the process may involve some trial and error. In particular, you may need to play around with multiple iterations of coarse- and fine-grained structure optimizations, and possibly also adjust the :ref:`convergence parameters`. In this case, we found that by first performing another looped structure optimization for the first two layers (atoms ``* L1-2``), and then adding the third-layer atoms (atoms ``* L1-3``) to the optimization, we could reliably reduce the |R factor| to about :math:`R_\mathrm{P} \approx 0.16`.\ [#]_ For reference, the final |R factor| obtained by in the more detailed calculation discussed in the main ViPErLEED paper was :math:`R_\mathrm{P} = 0.1537`. .. [#] Optimizing all three layers right away with the default convergence parameters caused the |R factor| to get trapped in a local minimum.