Logo

Getting started

  • Installation
  • Command-line tools
  • Background

viperleed.calc

  • viperleed calc
    • Installing tensor-LEED dependencies
    • Examples
    • Conventions
    • How to run
    • ViPErLEED work segments
      • Initialization
      • Reference calculation
      • Delta amplitudes
      • Search
        • Optimization algorithm
        • Structure search in ViPErLEED
      • Superpos
      • Domain calculations
      • Error calculation
      • Full-dynamic optimization
      • R factors
      • Bookkeeper
    • Files
    • Parameters
    • viperleed bookkeeper
    • Utilities

ViPErLEED ImageJ plugins

  • ViPErLEED ImageJ plugins

Hardware and measurements

  • Hardware

ViPErLEED Python API

  • ViPErLEED Python API
  • Appendix

Appendix

  • Citing ViPErLEED
  • References
  • Glossary
  • License
  • Notes for developers
ViPErLEED
  • viperleed.calc
  • ViPErLEED work segments
  • Structure search
  • View page source
Previous Next

Structure search

The structure search (referred to as search in the code) is the third part of a tensor-LEED calculation as implemented in ViPErLEED (RUN = 3). It must follow a reference calculation and a delta-amplitudes calculation. It requires stored delta files to run. In almost all cases, it is the most computationally expensive part of a LEED-I(V) calculation. The complexity depends on the size of the parameter space defined in the DISPLACEMENTS file.

During the structure search, the optimization algorithm samples surface structures in the configuration space defined in DISPLACEMENTS. Diffraction intensities and the corresponding \(R\) factor are calculated for these structures based on combinations of the precomputed delta amplitudes. The optimization tries to find the combination of parameters yielding the smallest possible \(R\) factor.

The behavior of the structure-optimization algorithm is affected by multiple parameters (see search behaviour). See the section describing the DISPLACEMENTS file for details on the available options for geometric, vibration, and occupation displacements. There are some caveats to the structure optimization in tensor LEED in general, and to the implementation in TensErLEED in particular. See the section on structure search in tensor LEED for details.

Optimization algorithm

The rough \(R\)-factor surface [10] greatly limits the pool of applicable optimization algorithms. TensErLEED employs a modified random-sampling strategy with a down-step criterion, as described by Kottcke and Heinz [9]. The optimization is performed in parallel for a set of individuals (i.e., independent parameter combinations), defined in ViPErLEED by the SEARCH_POPULATION parameter. The initial configurations for the optimization are defined by SEARCH_START.

For each search step (called “generation”, based on the terminology of genetic algorithms), a new grid point in the parameter space is selected randomly, but based on a probability distribution centered on the current position. The \(R\) factor is calculated for the selected parameter combination and the new parameter set is accepted only if the \(R\) factor for the new configuration is smaller than for the previous configuration. The width of the probability distribution is determined by the current \(R\) factor, the number of displacements, and the gaussian flag of the SEARCH_CONVERGENCE parameter.

ViPErLEED enables more sophisticated control over the search process than is possible with TensErLEED alone. Different types of convergence criteria and an automatic scaling of the probability distribution can be set via SEARCH_CONVERGENCE. Furthermore, whenever partial convergence is reached, a portion of the search population can be dropped and reinitialized to escape from local minima. By default, the search population is partially reinitialized using a custom genetic algorithm (see SEARCH_CULL for details).

Structure search in ViPErLEED

The structure search in ViPErLEED is based on the corresponding section of TensErLEED. As with the other sections, ViPErLEED takes care of handling the input and output for the legacy code. The search is also the only part of ViPErLEED and TensErLEED that makes use of processes communicating via MPI, if available (highly recommended).

When a structure search is executed in ViPErLEED, the following main steps are performed before the actual calculation starts:

  1. The DISPLACEMENTS file is read and interpreted.

  2. The current delta files are loaded and checked for compatibility.

  3. The TensErLEED input files rf.info, PARAM, and search.steu are prepared based on the slab and on the EXPBEAMS file. (They are available for inspection among the supplementary files in the SUPP directory.)

  4. Based on the slab symmetry and the symmetry settings, symmetry-linked parameters are identified. The control.chem input file for TensErLEED is written.

  5. Based on the N_CORES parameter and on the presence of mpirun on the machine, the correct TensErLEED source files are collected. They are then compiled at run time (compilation information saved to SUPP/compile_logs/compile-search.log). When using early TensErLEED versions (< v1.7.4) the precompiled object files random_.o or MPIrandom_.o must be available at this stage. More information on compiling these files can be found in this part of the Installation section.

  6. The search log file search-<timestamp>.log is created. It will be filled with progress information as the search continues.

With the preparation finished, the TensErLEED search program is started (using mpirun, if available).

ViPErLEED periodically monitors the progress of the search, reporting the best \(R\) factor achieved up to that point and the number of sampled configurations. Based on the information read from the SD.TL file produced by TensErLEED, the Search-progress.pdf and Search-report.pdf files are generated and periodically updated. They provide a graphical overview of the progress of the structure search and of its convergence. Search-progress.pdf contains information related exclusively to the current TensErLEED structure optimization, i.e., one block in the DISPLACEMENTS file. ViPErLEED enables the user to chain or loop multiple TensErLEED structure optimizations (see the DISPLACEMENTS syntax for details). In that case, Search-report.pdf summarizes the overall progress, including all optimization runs.

Once all the convergence criteria (see SEARCH_CONVERGENCE) are met, the search is cleanly aborted, the results are processed, and the Search-progress.pdf and Search-report.pdf files are updated one last time with the final values. This concludes the structure-search section. ViPErLEED proceeds by first executing a Superposition calculation, then continuing to the next segment as defined in the RUN parameter (or it stops if there is none).

Tip

If the results of a structure optimization (or any other viperleed.calc execution) are unsatisfactory, you can discard them by calling the bookkeeper utility with the --discard flag.

Previous Next

© Copyright 2025, ViPErLEED developers.

Built with Sphinx using a theme provided by Read the Docs.