5. Browser Calculator
5.1. Interactive Phase Shift Calculator
This browser-based calculator uses WebAssembly to run the Fortran phase shift calculation code directly in your browser — no installation required.
Note
If the calculator doesn’t load in the embedded view above, please use the “Open Calculator in New Tab” button or access it directly at calculator/index.html.
5.2. Features
The browser calculator supports three phase shift calculation methods:
- Relativistic (phsh_rel)
Full Dirac equation treatment with spin-orbit coupling. Best for heavy elements (Z > 30) where relativistic effects are significant.
- Cavity LEED (phsh_cav)
Traditional cavity method using Loucks grid. Suitable for standard LEED-IV analysis.
- Williams Method (phsh_wil)
A.R. Williams’ phase shift calculation approach. Alternative method for comparison.
5.3. Supported Elements
All elements from Hydrogen (Z=1) to Uranium (Z=92) are supported, with presets available for common surface science elements:
Metals: Cu, Ag, Au, Ni, Fe, Pt, Pd, Al
Semiconductors: Si, Ge, GaAs
Adsorbates: C, N, O, S
5.4. Output Formats
Calculated phase shifts can be exported in several formats:
- CLEED Format
Standard format for the CLEED package (Georg Held’s implementation).
- ViPErLEED Format
Compatible with the Vienna Package for LEED analysis.
- CSV Format
Comma-separated values for use in spreadsheets or custom analysis.
5.5. Command-Line Alternative
For batch processing or integration into scripts, see the Running
page for command-line usage of the phsh programs.
5.6. Technical Details
The browser calculator works by:
Compiling the original Fortran code (
libphsh.f) to WebAssembly using EmscriptenUsing MEMFS (in-memory filesystem) to handle Fortran file I/O
Providing a JavaScript API wrapper for browser interaction
Rendering results with Chart.js for interactive visualization
When WebAssembly is not available (unsupported browser or build issues), the calculator falls back to a demo mode with synthetic phase shift data.
5.7. Virtual Filesystem Contract
The WebAssembly build uses MEMFS (an in-memory filesystem) with fixed file paths for inputs and outputs. These paths are part of the public API and are especially useful when driving calculations from notebooks (e.g., Jupyter + Pyodide) or other custom tooling:
Inputs -
/input/atorb.i— atorb input (charge density setup) -/input/mufftin.o— optional potential override -/input/phsh.i— phase shift inputOutputs -
/output/atorb.o— charge density output -/output/phasout.o— phase shift output -/output/dataph.o— phase shift diagnostics -/output/inpdat.o— input echo data
Roadmap: the Fortran routines currently use fixed filenames. We plan to refactor them to accept configurable filenames while keeping these defaults for backwards compatibility.
5.8. See Also
Running — Command-line phase shift programs
Installing the phaseshifts package — Installation instructions
Introduction — Background on LEED and phase shifts