# ePSproc LF/AF function verification & tests¶

- 10/09/20 v5 AF code now working and verified.
- 27/08/20 v4 Revisiting again, updates to normalisation with degen factor. Now getting correct \(\beta\) values, still some possible issues with total XS however.
- 06/07/20 v3 Updated plotting codes & added AF tests.
- 26/06/20 v2
- 19/06/20 v1

For LF and AF calculations, trying to get to the bottom of issues with magnitudes and/or phases and/or formalism differences with raw ePS matrix elements.

## Formalism¶

Test cases:

- ePS matrix elements with formalism from [1], for LF cross-sections and \(\beta_{2}\). Formalism with Clebsch-Gordan (CG) terms.
- ePSproc AF calculations, for LF cross-sections and \(\beta_{2}\) in isotropic case (or other terms in general cases). Usual 3j-symbol based formalism.

The AF calculations should reduce to the LF case for an isotropic ensemble, and both cases should match the “direct” ePS `GetCro`

outputs (LF). Hopefully this should clear up any outstanding issues with normalisation, units, scale-factors, phase conventions etc. For details of the AF code, see the method dev notes.

(For MF verification, see the MFPADs and associated :math:beta_{LM}` <https://epsproc.readthedocs.io/en/dev/demos/ePSproc_BLM_calc_demo_Sept2019.html#Benchmark-vs.->`__ notebooks, where the numerics are verified for the NO2 test case, although the total cross-sections may still have issues (for more discussion, see the Matlab code release software paper). The geometric tensor version of the MF calculations is also verified against the same test case.)

[1] *Cross section and asymmetry parameter calculation for sulfur 1s photoionization of SF6*, A. P. P. Natalense and R. R. Lucchese, J. Chem. Phys. 111, 5344 (1999), http://dx.doi.org/10.1063/1.479794

[2] Reid, Katharine L., and Jonathan G. Underwood. “Extracting Molecular Axis Alignment from Photoelectron Angular Distributions.” The Journal of Chemical Physics 112, no. 8 (2000): 3643. https://doi.org/10.1063/1.480517.

[3] Underwood, Jonathan G., and Katharine L. Reid. “Time-Resolved Photoelectron Angular Distributions as a Probe of Intramolecular Dynamics: Connecting the Molecular Frame and the Laboratory Frame.” The Journal of Chemical Physics 113, no. 3 (2000): 1067. https://doi.org/10.1063/1.481918.

[4] Stolow, Albert, and Jonathan G. Underwood. “Time-Resolved Photoelectron Spectroscopy of Non-Adiabatic Dynamics in Polyatomic Molecules.” In Advances in Chemical Physics, edited by Stuart A. Rice, 139:497–584. Advances in Chemical Physics. Hoboken, NJ, USA: John Wiley & Sons, Inc., 2008. https://doi.org/10.1002/9780470259498.ch6.

### Formalism: LF case with CG terms¶

As given in ref. [1]. This is now implemented in implemented in ``ePSproc.lfblmGeom` <https://epsproc.readthedocs.io/en/dev/modules/epsproc.geomFunc.lfblmGeom.html>`__. NOTE - that the \(M\) term here is an MF projection term, and should be summed over for the final LF result.

The matrix elements \(I_{\mathbf{k},\hat{n}}^{(L,V)}\) of Eqs. (8) and (9) can be expanded in terms of the \(X_{lh}^{p\mu}\) functions of Eq. (7) as\(^{14}\)

{[}Note here the final term gives polarization (dipole) terms, with \(l=1\), \(h=v\), corresponding to a photon with one unit of angular momentum and projections \(v=-1,0,1\), correlated with irreducible representations \(p_{v}\mu_{v}\).{]}

The differential cross section is given by

where the asymmetry parameter can be written as\(^{14}\)

and the \((l'lm'm|L'M')\) are the usual Clebsch–Gordan coefficients. The total cross section is

where c is the speed of light.

Additional notes:

- In the current numerics, the XS is defined as \(\beta_0\) calculated as per above, for \(L=0\), or as \(1/3*\sum_{p\mu lhv}|I_{\mathbf{k},\hat{n}}^{(L,V)}|^{2}\). These are identical.
- The normalisation factors of 1/3 and 1/5 appear to be \(1/(2L+1)\) (or other degeneracy - possibly symmetry) terms - TBC.
- Computing \(\beta_0\) with the full formalism gives the correct values here, while using the matrix elements directly requires the additional 1/3 normalisation term.
- For \(\beta_2\), the 1/5 term is required in both cases.

### AF formalism¶

The original (full) form for the AF equations, as implemented in ``ePSproc.afblm` <https://epsproc.readthedocs.io/en/dev/modules/epsproc.AFBLM.html>`__ (NOTE - there are some corrections to be made here, which are not yet implemented in the base code, but are now in the geometric version):

Where \(I_{l,m,\mu}^{p_{i}\mu_{i},p_{f}\mu_{f}}(E)\) are the energy-dependent dipole matrix elements, and \(A_{Q,S}^{K}(t)\) define the alignment parameters.

In terms of the geometric parameters, this can be rewritten as:

See the method dev notebook for more details. Both methods gave the same results for N2 test cases, so are at least consistent, but do not currently match ePS GetCro outputs for the LF case.

### Numerics¶

In both LF and AF cases, the numerics tested herein are based on the geometric tensor expansion code, which has been verified for the MF case as noted above (for PADs at a single energy).

A few additional notes on the implementations…

- The matrix elements used are taken from the DumpIdy output segments of the ePS output file, which provide “phase corrected and properly normalized dynamical coefs”.
- The matrix elements output by ePS are assumed to correspond to \(I_{lhv}^{p\mu(L,V)}\) as defined above.
- The Scale Factor (SF) “to sqrt Mbarn” output with the matrix elements is assumed to correspond to the \(\frac{4\pi^{2}}{3c}E\) term defined above, plus any other required numerical factors (\(4\pi\) terms and similar).
- The SF is energy dependent, but not continuum (or partial wave) dependent.
- If correct, then using matrix elements * scale factor, should give correct results (as a function of \(E\)), while omitting the scale factor should still give correct PADs at any given \(E\), but incorrect total cross-section and energy scaling.
- This may be incorrect, and some other assumptions are tested herein.
- EDIT: now verified as \(SF*\sqrt(4*pi)\) to match LF/GetCro cross-section results.

- The AF and LF case should match for an isotropic distribution, defined as \(A^{0}_{0,0}=1\). Additional normalisation required here…?
- A factor of \(\sqrt{(2K+1)}/8\pi^2\) might be required for correct normalisation, although shouldn’t matter in this case. (See eqn. 47 in [4].)
- For the LF case, as defined above, conversion from Legendre-normalised \(\beta\) to spherical harmonic normalised \(\beta\) is required for comparison with the AF formalism, where \(\beta^{Sph}_{L,0} = \sqrt{(2L+1)/4\pi}\beta^{Lg}\)

### Status¶

09/09/20 - AF code now working correctly, and verified herein, ePSproc v1.2.5-dev.

## Set up¶

```
[1]:
```

```
# Imports
import numpy as np
import pandas as pd
import xarray as xr
# Special functions
# from scipy.special import sph_harm
import spherical_functions as sf
import quaternion
# Performance & benchmarking libraries
# from joblib import Memory
# import xyzpy as xyz
import numba as nb
# Timings with ttictoc or time
# https://github.com/hector-sab/ttictoc
# from ttictoc import TicToc
import time
# Package fns.
# For module testing, include path to module here
import sys
import os
if sys.platform == "win32":
modPath = r'D:\code\github\ePSproc' # Win test machine
else:
modPath = r'/home/femtolab/github/ePSproc/' # Linux test machine
sys.path.append(modPath)
import epsproc as ep
# TODO: tidy this up!
from epsproc.util import matEleSelector
from epsproc.geomFunc import geomCalc, geomUtils
from epsproc.geomFunc.lfblmGeom import lfblmXprod
# Plotters
from epsproc.plot import hvPlotters
```

```
* pyevtk not found, VTK export not available.
```

```
[2]:
```

```
hvPlotters.setPlotters()
# import bokeh
# import holoviews as hv
# hv.extension('bokeh')
```