# ViPErLEED work segments

ViPErLEED operates using a set of self-contained work segments (see also the RUN parameter). The three main segments, following the logic of calculations using the tensor-LEED approximation, are:

Reference calculation: Full-dynamic LEED calculation, which outputs a set of theoretical beams for a given structure and the “Tensors”.

Delta-amplitudes calculation: The delta amplitudes specify how parameter changes affect the scattering amplitudes within the tensor-LEED approximation. This calculation is based on the tensors and a set of parameter variations specified by the user. The output of a delta-amplitudes calculation are the “Delta files”.

Structure search: Using the Delta files to vary the theoretical beams, looks for a set of parameters such that the \(R\) factor between the theoretical beams and a given set of experimental beams is minimized.

Which of these segments should be executed must be specified using the RUN parameter, using the segment numbers in the list above or a contraction of their names. More information on the allowed contractions are found in the documentation for RUN.

Besides these three main segments, there are also the following minor segments, which are inserted automatically during normal ViPErLEED execution when appropriate (but can also be explicitly selected via RUN):

Initialization: Always runs at the beginning. Reads and checks input files, runs symmetry search, generates derived input files if appropriate.

Superposition calculation: Automatically runs after the search. Generates a set of theoretical beams for the actual best-fit configuration based on the tensor-LEED approximation.

\(R\)-factor calculation: Automatically runs after the reference-calculation segment if an experimental-beams file is present, and after the superpos section. Calculates the \(R\) factor per beam and for the entire set of beams, and outputs an

`Rfactor_plots_<section>.pdf`

file.

Further specialized segments include:

Error calculation: Based on a given reference structure (i.e., after a reference calculation), calculates one-dimensional error curves for variation of a single parameter. Effectively, this produces delta amplitudes for variations of a single parameter, and outputs the \(R\) factor for every single configuration along that axis.

Full-dynamic optimization: Optimizes parameters that are not accessible to the tensor-LEED approximation, like BEAM_INCIDENCE, V0_IMAG, or unit-cell scaling. This is achieved by performing multiple full-dynamic (i.e., “reference”) calculations (but without producing Tensor files). The behavior is controlled by the OPTIMIZE parameter.

The pages listed above cover normal operation, in which the theoretical beams correspond to only one surface structure. If multiple structures coexist on the sample, the same segments need to be executed, but their behavior is somewhat different, as described in

Domain calculations: Reference calculations are run separately for the different domains (if necessary) and delta amplitudes are generated independently. The search then combines the optimization of the different structures — weighted by their area fraction — for the best overall \(R\) factor with respect to the experimental beam set.