epsproc.geomFunc.afblmGeom module

epsproc.geomFunc.afblmGeom.AFwfExp(matE, AKQS=None, thres=0.01, thresDims='Eke', selDims={'Type': 'L', 'it': 1})[source]

Implement (approximate) LF/AF wavefunction expansion,

\[\begin{split}\begin{equation} ^{AF}T_{\mu_{0}}^{p_{i}\mu_{i},p_{f}\mu_{f}}(\hat{k}_{L})=8\pi^{2}\sum_{K,Q,S}\sum_{l,m,\mu,\Lambda}A_{Q,S}^{K}I_{l,m,\mu}^{p_{i}\mu_{i},p_{f}\mu_{f}}(E)(-1)^{m-\Lambda}(-1)^{\mu-\mu_{0}}(-1)^{Q-S}\left(\begin{array}{ccc} l & 1 & K\\ -m & -\mu & -Q \end{array}\right)\left(\begin{array}{ccc} l & 1 & K\\ -\Lambda & -\mu_{0} & -S \end{array}\right)Y_{l\Lambda}^{*}(\hat{k}_{M}) \end{equation}\end{split}\]

Where each component is defined by fns. in :py:module:`epsproc.geomFunc.geomCalc` module.

01/02/21 version 1, this is pretty rough and ready, and possibly not correct.

See http://localhost:8888/lab/tree/SLAC/angular_streaking/AF_wavefns_method_dev_050121.ipynb for dev notes.

epsproc.geomFunc.afblmGeom.afblmXprod(matEin, QNs=None, AKQS=None, EPRX=None, p=[0], BLMtable=None, BLMtableResort=None, lambdaTerm=None, polProd=None, AFterm=None, thres=0.01, thresDims='Eke', selDims={'Type': 'L'}, sumDims=['mu', 'mup', 'l', 'lp', 'm', 'mp', 'S-Rp'], sumDimsPol=['P', 'R', 'Rp', 'p'], symSum=True, degenDrop=True, SFflag=False, SFflagRenorm=False, BLMRenorm=1, squeeze=False, phaseConvention='E', basisReturn='BLM', verbose=0, **kwargs)[source]

Implement \(\beta_{LM}^{AF}\) calculation as product of tensors.

\[\begin{eqnarray} \beta_{L,-M}^{\mu_{i},\mu_{f}} & =(-1)^{M} & \sum_{P,R',R}{[P]^{\frac{1}{2}}}{E_{P-R}(\hat{e};\mu_{0})}\sum_{l,m,\mu}\sum_{l',m',\mu'}(-1)^{(\mu'-\mu_{0})}{\Lambda_{R'}(\mu,P,R')B_{L,-M}(l,l',m,m')}I_{l,m,\mu}^{p_{i}\mu_{i},p_{f}\mu_{f}}(E)I_{l',m',\mu'}^{p_{i}\mu_{i},p_{f}\mu_{f}*}(E)\sum_{K,Q,S}\Delta_{L,M}(K,Q,S)A_{Q,S}^{K}(t) \end{eqnarray}\]

Where each component is defined by fns. in :py:module:`epsproc.geomFunc.geomCalc` module.

04/05/22 Added **kwargs, unused but allows for arb basis dict unpack and passing from other functions. May want to pipe back to Full basis return however.

06/08/21 Added basic handling for degenerate states, including degenDrop option.
Updated docs, but still rather messy!
27/07/21 Removed eulerAngs & RX input options, since these are redundant (and lead to confusion here!).
For cases where E-field and alignment distribution are rotated, set AKQS in rotated frame, see https://epsproc.readthedocs.io/en/latest/tests/ePSproc_frame_rotation_tests_Dec2019.html Also removed selDims={‘it’:1}, which can result in issues! In current code, adding ‘it’ to sumDims doesn’t work (dim issues somewhere), so may be best to treat independently…?

03/05/21 Tidying up a bit & improving/wrapping for fitting use (inc. basis function reuse).

10/09/20 Verified (but messy) version, with updated defaults.

01/09/20 Verified (but messy) version, including correct renormalisation routines.

15/06/20 In progress! Using mfblmXprod() as template, with just modified lambda term, and new alignment term, to change.

For basic use see the docs: https://epsproc.readthedocs.io/en/dev/demos/ePSproc_class_demo_161020.html#Compute-LF/AF-beta_{LM}-and-PADs

Dev code:

  • matE (Xarray) – Xarray containing matrix elements, with QNs (l,m), as created by readMatEle()
  • Optional calculation settings (***) –
  • selDims (dict, default = {'Type':'L'}) – Selection parameters for calculations, may be be checked and appened herein.
  • sumDims (list, default = ['mu', 'mup', 'l','lp','m','mp','S-Rp']) – Main summation dims, will be checked herein.
  • sumDimsPol (list, default = ['P','R','Rp','p']) – Additional polarization summation dims.
  • symSum (bool, default = True) – Sum over symmetries sets (=={Cont, Targ, Total}) if true.
  • degenDrop (bool) – Flag to set dropping of degenerate components.
  • thres (float, default = 1e-2) – Set threshold value, used to set input matrix elements and again for outputs.
  • thresDims (str, default = 'Eke') – Set threshold dimension (set to be contiguous).
  • verbose (bool or int) – Print output?

*** Optional renormalisation settings (mainly for testing only)

SFflag : bool, default = False
Multiply input matrix elements by complex scale-factor if true.
SFflagRenorm : bool, default = False
Renorm output BLMs by complex scale-factor if true.
BLMRenorm : int, default = 1
Set different BLM renorm conventions. If 1 renorm by B00. See code for further details.
squeeze : bool, default = False
Squeeze output array after thresholding? Note: this may cause dim issues if True.

*** Optional input data/basis functions (mainly for fitting routine use)

QNs : np.array, optional, default = None
List of QNs as generated by genllpMatE(). Will be generated if not passed.
AKQS : Xarray, optional, default = None
Alignment parameters, as set by setADMs(). Defaults to isotropic case if not passed.
EPRX : Xarray, optional, default = None
E-field parameters, as generated by EPR(). Defaults to normalised/unity field, pol = p (below).
p : list or array, optional, default = [0]
Specify polarization terms p. Possibly currently only valid for p=0, TBC See https://epsproc.readthedocs.io/en/latest/methods/geometric_method_dev_260220_090420_tidy.html#E_{P,R}-tensor
BLMtable, BLMtableResort : Xarrays, optional, default = None
Beta calculation parameters, as defined by geomCalc.betaTerm(). BLMtableResort includes phase settings & param renaming as herein.
lambdaTerm : Xarray, optional, default = None
Lambda term parameters, as defined by geomCalc.MFproj()
AFterm : Xarray, optional, default = None
Alignment term as defined by geomCalc.deltaLMKQS()
polProd : Xarray, optional, default = None
Polarization tensor as defined by EPRXresort * lambdaTermResort * AFterm
phaseConvention : optional, str, default = ‘E’
Set phase conventions with epsproc.geomCalc.setPhaseConventions(). To use preset phase conventions, pass existing dictionary.
basisReturn : optional, str, default = “BLM”
  • ‘BLM’ return Xarray of results only.
  • ‘Full’ return Xarray of results + basis set dictionary as set during the run.
  • ‘Product’, as full, but minimal basis set with products only.
  • ‘Results’ or ‘Legacy’ direct return of various calc. results Xarrays.
  • Xarray – Set of AFBLM calculation results
  • dict – Dictionary of basis functions, only if basisReturn != ‘BLM’ (see basisReturn paramter notes).


Cross-section outputs now set as:

  • XSraw = direct AF calculation output.
  • XSrescaled = XSraw * sqrt(4pi)
  • XSiso = direct sum over matrix elements

Where XSrescaled == XSiso == ePS GetCro output for isotropic distribution. Optionally set SFflag = True to multiply by (complex) scale-factor.