State-resolved gamma calculations (legacy)
17/07/24
For legacy calculations, making use of state-to-state \(\gamma\) and \(C\) parameters, some basic routines are available in :py:module:epsproc.geomCalc.gamma.
These currently:
Read gamma params from file (as generated by legacy C-codes).
Note there are various flavours of the C-codes, and currently need cleaning up.
Testing with NH3 version
ion_rot_gamma_nh3_4d_NS.c, which includes 1-photon density matrix and symmetry selection rules in output; spin is also neglected (terms coupling \(S\) are omitted.)TODO: tidy codes & generalise.
Implement multiplication by matrix elements & density matrix for \(\beta_{L,M}\) computations.
TODO: implement conversion from standard matE format to PD table required here.
In this case, the parameters and computations are defined as per Refs. [1,2], in particular Ref. [2], Sect 3.1:
This form allows for:
Angular momentum transfer between initial (\(_i\)) and final (\(_+\)) states, with transfer terms denoted by subscript \(t\).
Modulation by initial \(M\)-state distribution, expressed as a density matrix \(\boldsymbol{\rho}_{M_{i}M_{i}'}\).
Cf. aligned-frame case, which assumes a decoupled rotational wavepacket, and is derived from a sum over \(J,M\) states (see Ref. [3] for further details).
Refs:
Hockett, Paul. 2009. “Photoionization Dynamics of Polyatomic Molecules.” PhD Thesis, University of Nottingham. http://eprints.nottingham.ac.uk/10857/.
———. 2018. Quantum Metrology with Photoelectrons, Volume 1: Foundations. IOP Publishing. https://doi.org/10.1088/978-1-6817-4684-5.
Stolow, Albert, and Jonathan G. Underwood. 2008. “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. https://doi.org/10.1002/9780470259498.ch6.
Gamma calc demo
[1]:
# Load functions
from epsproc.geomFunc.gamma import gammaIO, gammaCalc
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
* sparse not found, sparse matrix forms not available.
* natsort not found, some sorting functions not available.
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh.
* pyevtk not found, VTK export not available.
[2]:
# Load gamma data from file
fileIn = "g_0-0_2-1_1-0_o.dat"
gammaDF = gammaIO.readGamma(fileIn)
# Data is set to a DataFrame
gammaDF
[2]:
| gamma | betaTerm | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| L | M | l1 | lambda1 | ml1 | l2 | lambda2 | ml2 | ||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 1.000000 |
| 2 | 0 | 0 | 0 | 0 | 2 | -2 | 0 | 0.015923 | 1.000000 |
| -1 | 0 | 0.019114 | 1.000000 | ||||||
| 0 | 0 | 0.003930 | 1.000000 | ||||||
| 1 | 0 | 0.019114 | 1.000000 | ||||||
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 6 | 0 | 4 | 2 | 0 | 4 | 2 | 0 | 0.000617 | 0.504273 |
| 0 | 0 | 4 | 2 | 1 | 4 | 2 | 1 | 0.000386 | 1.000000 |
| 2 | 0 | 4 | 2 | 1 | 4 | 2 | 1 | 0.000386 | 0.493677 |
| 4 | 0 | 4 | 2 | 1 | 4 | 2 | 1 | 0.000386 | 0.242757 |
| 6 | 0 | 4 | 2 | 1 | 4 | 2 | 1 | 0.000386 | -0.025214 |
684 rows × 2 columns
[3]:
# Calculate beta parameters from these params.
# This requires matrix elements.
# If not set, arb or random values can be used.
dfSum, dfProd = gammaCalc.betaCalc(gammaDF, rand=True, phase=False)
# Sum output gives BLM from product and renormalised values
dfSum
[3]:
| gamma | betaTerm | matE1 | matE2 | BLMprod | BLMnorm | ||
|---|---|---|---|---|---|---|---|
| L | M | ||||||
| 0 | 0 | 0.210977 | 103.000000 | 47.167213 | 47.167213 | 0.027442 | 1.000000 |
| 2 | 0 | 0.277857 | 140.730561 | 96.711602 | 96.711602 | 0.023076 | 0.840880 |
| 4 | 0 | 0.079515 | 52.213380 | 97.808344 | 97.808344 | -0.007107 | -0.258995 |
| 6 | 0 | 0.012194 | -5.528349 | 75.498799 | 75.498799 | -0.010809 | -0.393870 |
[4]:
# Full product DataFrame is also returned for further use
# This includes all quantum numbers & associated values
dfProd
[4]:
| gamma | betaTerm | matE1 | matE2 | BLMprod | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| l2 | lambda2 | l1 | lambda1 | L | M | ml1 | ml2 | |||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 1.000000 | 0.248337 | 0.248337 | 0.004568 |
| 2 | -2 | 2 | 0 | 0 | 0 | 0.015923 | 1.000000 | 0.018315 | 0.248337 | 0.000072 | ||
| -1 | 2 | 0 | 0 | 0 | 0.019114 | 1.000000 | 0.167871 | 0.248337 | 0.000797 | |||
| 0 | 2 | 0 | 0 | 0 | 0.003930 | 1.000000 | 0.608245 | 0.248337 | 0.000594 | |||
| 1 | 2 | 0 | 0 | 0 | 0.019114 | 1.000000 | 0.099173 | 0.248337 | 0.000471 | |||
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 4 | 2 | 4 | 2 | 6 | 0 | 0 | 0 | 0.000617 | 0.504273 | 0.598510 | 0.598510 | 0.000111 |
| 0 | 0 | 1 | 1 | 0.000386 | 1.000000 | 0.598510 | 0.598510 | 0.000138 | ||||
| 2 | 0 | 1 | 1 | 0.000386 | 0.493677 | 0.598510 | 0.598510 | 0.000068 | ||||
| 4 | 0 | 1 | 1 | 0.000386 | 0.242757 | 0.598510 | 0.598510 | 0.000034 | ||||
| 6 | 0 | 1 | 1 | 0.000386 | -0.025214 | 0.598510 | 0.598510 | -0.000003 |
684 rows × 5 columns
[ ]:
Versions
[5]:
import scooby
scooby.Report(additional=['epsproc', 'holoviews', 'hvplot', 'xarray', 'matplotlib', 'bokeh'])
[5]:
| Wed Jul 17 15:20:40 2024 EDT | |||||||
| OS | Linux | CPU(s) | 64 | Machine | x86_64 | Architecture | 64bit |
| RAM | 62.8 GiB | Environment | Jupyter | File system | btrfs | ||
| Python 3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:58:44) [GCC 11.3.0] | |||||||
| epsproc | 1.3.2-dev | holoviews | 1.16.2 | hvplot | 0.8.4 | xarray | 2022.3.0 |
| matplotlib | 3.5.3 | bokeh | 3.1.1 | numpy | 1.23.5 | scipy | 1.10.1 |
| IPython | 8.13.2 | scooby | 0.7.2 | ||||
[6]:
# Check current Git commit for local ePSproc version
import epsproc as ep
from pathlib import Path
!git -C {Path(ep.__file__).parent} branch
!git -C {Path(ep.__file__).parent} log --format="%H" -n 1
* 3d-AFPAD-dev
dev
master
cca05a5f38f65cad56742febbf315169e468210f
[7]:
# Check current remote commits
!git ls-remote --heads https://github.com/phockett/ePSproc
4997e25699241d232d922f68cf0e8216ac14e6ee refs/heads/3d-AFPAD-dev
18901ac6056324d6a2674396939fdcc373d35395 refs/heads/dependabot/pip/notes/envs/envs-versioned/idna-3.7
9d9eb4e1a20d4ff77d07af2ac782ba18c26e5dcc refs/heads/dependabot/pip/notes/envs/envs-versioned/jinja2-3.1.4
226759a58ebe96bf1a6df60ccd5efb0c449af3a7 refs/heads/dependabot/pip/notes/envs/envs-versioned/pillow-10.3.0
de0e271701949602ce7f170a9665e37b27d2401c refs/heads/dependabot/pip/notes/envs/envs-versioned/requests-2.32.0
4ff0ed84a1df2a3de4258ba7e49db1e47e6ac596 refs/heads/dependabot/pip/notes/envs/envs-versioned/scipy-1.11.1
120416a432b8da85b68912d0c424f47d77392434 refs/heads/dependabot/pip/notes/envs/envs-versioned/tornado-6.4.1
b50b0b946a1a7cb5b22c95d1e4cee120b22e6874 refs/heads/dependabot/pip/notes/envs/envs-versioned/tqdm-4.66.3
a96b411b4bbc911b35bf080b5e848dca655d0f1b refs/heads/dependabot/pip/notes/envs/envs-versioned/urllib3-1.26.19
fd9c621f0c91e05ffcb097f59e9d8d8b43c5fc23 refs/heads/dependabot/pip/scipy-1.11.1
7e4270370d66df44c334675ac487c87d702408da refs/heads/dev
1c0b8fd409648f07c85f4f20628b5ea7627e0c4e refs/heads/master
69cd89ce5bc0ad6d465a4bd8df6fba15d3fd1aee refs/heads/numba-tests
ea30878c842f09d525fbf39fa269fa2302a13b57 refs/heads/revert-9-master
baf0be0c962e8ab3c3df57c8f70f0e939f99cbd7 refs/heads/testDev