OCS orbs 8 - 11 ePS results processing + AF-BLMs

11/06/21 PH

Quick look at initial ePS results for orbs 8 - 11, 1eV step size, LF and AF results.

TODO:

  • Fix orb numering issue! (See note below.)
  • AF normalisation not correct here, due to doubly-degenerate state? Summing over 'it' not working correctly either, needs a debug (or missing some settings...?).

For methods: https://epsproc.readthedocs.io/en/dev/demos/ePSproc_class_demo_161020.html

Setup

In [1]:
!hostname
jake
In [2]:
!conda env list
# conda environments:
#
base                     /home/paul/anaconda3
baseBK-280321            /home/paul/anaconda3/envs/baseBK-280321
ePSproc-v1.2             /home/paul/anaconda3/envs/ePSproc-v1.2
ePSproc-v1.2-dev      *  /home/paul/anaconda3/envs/ePSproc-v1.2-dev
epsdev                   /home/paul/anaconda3/envs/epsdev
epsman                   /home/paul/anaconda3/envs/epsman
fibre-sim                /home/paul/anaconda3/envs/fibre-sim
frog                     /home/paul/anaconda3/envs/frog
matlab                   /home/paul/anaconda3/envs/matlab
tmo-dev                  /home/paul/anaconda3/envs/tmo-dev

In [3]:
import sys
import os
from pathlib import Path
import numpy as np
# import epsproc as ep
import xarray as xr

import matplotlib.pyplot as plt

from datetime import datetime as dt
timeString = dt.now()

import epsproc as ep

# Plotters
from epsproc.plot import hvPlotters

# Multijob class dev code
from epsproc.classes.multiJob import ePSmultiJob

hvPlotters.setPlotters(width = 700, snsStyle='whitegrid')
* sparse not found, sparse matrix forms not available. 
* natsort not found, some sorting functions not available. 
* plotly not found, plotly plots not available. 
* pyevtk not found, VTK export not available. 
In [4]:
# For class, above settings don't take, not sure why, something to do with namespaces/calling sequence?
# Overriding snsStyle does work however... although NOT CONSISTENTLY????
# AH, looks like ordering matters - set_style LAST (.set seems to override)
import seaborn as sns

sns.set(rc={'figure.figsize':(10,6)})  # Set figure size in inches
sns.set_context("paper")
sns.set_style("whitegrid")  # Set plot style
sns.set_palette("Paired")   # Set colour mapping

# Try direct fig type setting for PDF output figs
from IPython.display import set_matplotlib_formats
# set_matplotlib_formats('png', 'pdf')
set_matplotlib_formats('svg', 'pdf')
In [5]:
# xr.set_options(display_style='html')

Load data

In [6]:
# # Scan for subdirs, based on existing routine in getFiles()

fileBase = Path('/home/paul/ePS/OCS/OCS_survey')  # Data dir on Stimpy
In [7]:
# TODO: fix orb label here, currently relies on (different) fixed format

data = ePSmultiJob(fileBase, verbose = 0)

data.scanFiles()
data.jobsSummary()
*** Warning: Missing records, expected 64, found 48.
*** Warning: Found 16 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 64, found 48.
*** Warning: Found 16 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 64, found 48.
*** Warning: Found 16 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 64, found 48.
*** Warning: Found 16 blank sets of matrix elements, symmetries ['A2']
Found 4 directories, with 8 files.

*** Job orb11 details
Key: orb11
Dir /home/paul/ePS/OCS/OCS_survey/orb11, 2 file(s).
{   'batch': 'ePS OCS, batch OCS_survey, orbital orb11',
    'event': ' orb 11 ionization, basic survey run.',
    'orbE': -11.358032524748,
    'orbLabel': '# OCS, orb 11 ionization, basic survey run.'}

*** Job orb9 details
Key: orb9
Dir /home/paul/ePS/OCS/OCS_survey/orb9, 2 file(s).
{   'batch': 'ePS OCS, batch OCS_survey, orbital orb9',
    'event': 'orb 9 (E1/P) ionization, basic survey run.',
    'orbE': -18.348637593286,
    'orbLabel': 'E1/P'}

*** Job orb10 details
Key: orb10
Dir /home/paul/ePS/OCS/OCS_survey/orb10, 2 file(s).
{   'batch': 'ePS OCS, batch OCS_survey, orbital orb10',
    'event': 'orb 10 (A1/S) ionization, basic survey run.',
    'orbE': -17.325489478934,
    'orbLabel': 'A1/S'}

*** Job orb8 details
Key: orb8
Dir /home/paul/ePS/OCS/OCS_survey/orb8, 2 file(s).
{   'batch': 'ePS OCS, batch OCS_survey, orbital orb8',
    'event': 'orb 8 (A1/S) ionization, basic survey run.',
    'orbE': -21.513321787412,
    'orbLabel': 'A1/S'}
In [14]:
# Fix labels for plots
for key in data.data.keys():
    data.data[key]['jobNotes']['orbLabel'] = key
    
In [ ]:
 

System properties

Note orbital numbering in table below:

  • Orb is Gamess file output orbital numbering, but energy but not grouped by degeneracy.
  • OrbGrp is grouped numbering by degeneracy, also used by ePolyScat, and will be used for labels etc. below.

BUT - file names are 0-indexed (oops), so give OrbGrp-1 here. Sorry.

In [8]:
data.molSummary()
*** Molecular structure
*** Molecular orbital list (from ePS output file)
EH = Energy (Hartrees), E = Energy (eV), NOrbGrp, OrbGrp, GrpDegen = degeneracies and corresponding orbital numbering by group in ePS, NormInt = single centre expansion convergence (should be ~1.0).
props Sym EH Occ E NOrbGrp OrbGrp GrpDegen NormInt
orb
1 S -91.9901 2.0 -2503.178121 1.0 1.0 1.0 0.660569
2 S -20.6748 2.0 -562.589964 1.0 2.0 1.0 0.963189
3 S -11.4451 2.0 -311.437034 1.0 3.0 1.0 0.999998
4 S -8.9936 2.0 -244.728321 1.0 4.0 1.0 0.951187
5 S -6.6764 2.0 -181.674098 1.0 5.0 1.0 0.993503
6 P -6.6721 2.0 -181.557089 1.0 6.0 2.0 0.978550
7 P -6.6721 2.0 -181.557089 2.0 6.0 2.0 0.978550
8 S -1.5373 2.0 -41.832064 1.0 7.0 1.0 0.998241
9 S -1.0876 2.0 -29.595103 1.0 8.0 1.0 0.997329
10 S -0.7906 2.0 -21.513322 1.0 9.0 1.0 0.999269
11 P -0.6743 2.0 -18.348638 1.0 10.0 2.0 0.999887
12 P -0.6743 2.0 -18.348638 2.0 10.0 2.0 0.999887
13 S -0.6367 2.0 -17.325489 1.0 11.0 1.0 0.998566
14 P -0.4174 2.0 -11.358033 1.0 12.0 2.0 0.998839
15 P -0.4174 2.0 -11.358033 2.0 12.0 2.0 0.998839
*** Warning: some orbital convergences outside single-center expansion convergence tolerance (0.01):
[[1.         0.66056934]
 [2.         0.96318872]
 [4.         0.95118653]
 [6.         0.9785498 ]
 [7.         0.9785498 ]]

Plot cross-sections and betas

These are from ePolyScat's getCro function, and are LF (unaligned ensemble) results. This provides a good, if general, overview.

Overview (all symmetries, length gauge) vs. Eke

In [15]:
# Comparitive plot over datasets (all symmetries only)
Etype = 'Eke'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
In [16]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)

Overview (all symmetries, length gauge) vs. Ehv

Same results as above, Ehv scale.

In [18]:
# Comparitive plot over datasets (all symmetries only)
Etype = 'Ehv'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
In [19]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)

AF-$\beta_{LM}$

Current status: almost working, but issue with combining degenerate symmetry components.

Results correct for A1 cases, and relative values and trends should be correct for E1 symmetries.

In [26]:
# Set ADMs for increasing alignment...
tPoints = 4
# inputADMs = np.asarray([[0,0,0, *np.ones(10)], [2,0,0, *np.linspace(0,1,tPoints)], [4,0,0, *np.linspace(0,0.5,tPoints)]])
inputADMs = [[0,0,0, *np.ones(tPoints)], [2,0,0, *np.linspace(0,1,tPoints)], [4,0,0, *np.linspace(0,0.5,tPoints)]]

ADMs = ep.setADMs(ADMs = inputADMs)
ep.lmPlot(ADMs, xDim='t');
No handles with labels found to put in legend.
Plotting data (No filename), pType=a, thres=0.01, with Seaborn
In [27]:
# Compute AFBLMs for aligned case
data.AFBLM(AKQS = ADMs, selDims = {'Type':'L'})
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
/home/paul/anaconda3/envs/ePSproc-v1.2-dev/lib/python3.7/site-packages/xarray/core/nputils.py:223: RuntimeWarning: All-NaN slice encountered
  result = getattr(npmodule, name)(values, axis=axis, **kwargs)
In [28]:
data.padPlot(dataType='AFBLM', selDims = {'Labels':'z'}, pStyle='grid', reducePhi='sum', facetDims=['t', 'Eke'])
Using default sph betas.
Summing over dims: {'it'}
Grid plot: # OCS, orb 11 ionization, basic survey run., dataType: AFBLM, plotType: a
Using default sph betas.
Summing over dims: {'it'}
Grid plot: E1/P, dataType: AFBLM, plotType: a
Using default sph betas.
Summing over dims: set()
Grid plot: A1/S, dataType: AFBLM, plotType: a
Using default sph betas.
Summing over dims: set()
Grid plot: A1/S, dataType: AFBLM, plotType: a

Note plot ordering above == file read order:

  • Top: Orb 11 (HOMO)
  • 2nd: Orb 9
  • 3rd: Orb 10
  • 4th: Orb 8

Top two are E1/P symmetries, bottom two A1/S.

Checks

In [17]:
# Betas vs. Gauge
data.plotGetCro(pType='BETA', Etype=Etype)
In [ ]:
 

Versions

In [122]:
# print(data.jobInfo['ePolyScat'][0])
# print('Run: ' + jobInfo['Starting'][0].split('at')[1])
In [29]:
import scooby
scooby.Report(additional=['epsproc', 'xarray', 'jupyter'])
Out[29]:
Fri Jun 11 12:02:59 2021 EDT
OS Linux CPU(s) 64 Machine x86_64
Architecture 64bit Environment Jupyter
Python 3.7.5 (default, Oct 25 2019, 15:51:11) [GCC 7.3.0]
epsproc 1.3.0-dev xarray 0.14.0 jupyter Version unknown
numpy 1.17.3 scipy 1.3.1 IPython 7.9.0
matplotlib 3.1.3 scooby 0.5.6
Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
In [30]:
# Check current Git commit for local ePSproc version
!git -C {Path(ep.__file__).parent} branch
!git -C {Path(ep.__file__).parent} log --format="%H" -n 1
* dev
  master
16cfad26e658b740f267baa89d1550336b0134bf
In [31]:
# Check current remote commits
!git ls-remote --heads git://github.com/phockett/ePSproc
16cfad26e658b740f267baa89d1550336b0134bf	refs/heads/dev
82d12cf35b19882d4e9a2cde3d4009fe679cfaee	refs/heads/master
69cd89ce5bc0ad6d465a4bd8df6fba15d3fd1aee	refs/heads/numba-tests
ea30878c842f09d525fbf39fa269fa2302a13b57	refs/heads/revert-9-master

Env

In [32]:
!hostname
jake
In [33]:
!conda env list
# conda environments:
#
base                     /home/paul/anaconda3
baseBK-280321            /home/paul/anaconda3/envs/baseBK-280321
ePSproc-v1.2             /home/paul/anaconda3/envs/ePSproc-v1.2
ePSproc-v1.2-dev      *  /home/paul/anaconda3/envs/ePSproc-v1.2-dev
epsdev                   /home/paul/anaconda3/envs/epsdev
epsman                   /home/paul/anaconda3/envs/epsman
fibre-sim                /home/paul/anaconda3/envs/fibre-sim
frog                     /home/paul/anaconda3/envs/frog
matlab                   /home/paul/anaconda3/envs/matlab
tmo-dev                  /home/paul/anaconda3/envs/tmo-dev

In [ ]: