# 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.

epsproc.geomFunc.afblmGeom.afblmXprod(matEin, QNs=None, AKQS=None, EPRX=None, p=, BLMtable=None, BLMtableResort=None, lambdaTerm=None, polProd=None, AFterm=None, thres=0.01, thresDims='Eke', selDims={'Type': 'L'}, sqThres=True, dropThres=True, 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.

24/11/22 Added sqThres = True, dropThres = True for use with INITIAL matEleSelector() call only - in some cases may get issues with dim drops here otherwise.

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.

Dev code:

Parameters
• matE (Xarray) – Xarray containing matrix elements, with QNs (l,m), as created by readMatEle()

• settings (*** Optional calculation) –

• 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)

SFflagbool, default = False

Multiply input matrix elements by complex scale-factor if true.

SFflagRenormbool, default = False

Renorm output BLMs by complex scale-factor if true.

BLMRenormint, default = 1

Set different BLM renorm conventions. If 1 renorm by B00. See code for further details.

sqThresbool, default = True

Used for initial matrix element threholding call only. Default = True as previous code, but can cause issues in custom cases (usually accidentally dropping singleton mu coord). Added 24/11/22

dropThresbool, default = True

Used for initial matrix element threholding call only. Default = True as previous code, but can cause issues in custom cases (usually accidentally dropping singleton mu coord). Added 24/11/22

squeezebool, 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)

QNsnp.array, optional, default = None

List of QNs as generated by genllpMatE(). Will be generated if not passed.

AKQSXarray, optional, default = None

Alignment parameters, as set by setADMs(). Defaults to isotropic case if not passed.

EPRXXarray, optional, default = None

E-field parameters, as generated by EPR(). Defaults to normalised/unity field, pol = p (below).

plist or array, optional, default = 

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, BLMtableResortXarrays, optional, default = None

Beta calculation parameters, as defined by geomCalc.betaTerm(). BLMtableResort includes phase settings & param renaming as herein.

lambdaTermXarray, optional, default = None

Lambda term parameters, as defined by geomCalc.MFproj()

AFtermXarray, optional, default = None

Alignment term as defined by geomCalc.deltaLMKQS()

polProdXarray, optional, default = None

Polarization tensor as defined by EPRXresort * lambdaTermResort * AFterm

phaseConventionoptional, str, default = ‘E’

Set phase conventions with epsproc.geomCalc.setPhaseConventions(). To use preset phase conventions, pass existing dictionary.

basisReturnoptional, 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.

**kwargs, unused but allows for arb basis dict unpack and passing from other functions.

Returns

• Xarray – Set of AFBLM calculation results

• dict – Dictionary of basis functions, only if basisReturn != ‘BLM’ (see basisReturn paramter notes).

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.