ePSproc: Post-processing suite for ePolyScat electron-molecule scattering calculations

ePSproc provides codes for post-processing results from ePolyScat (ePS), a suite of codes for the calculation of quantum scattering problems, developed and released by Luchesse \&co-workers (Gianturco et al. 1994)(Natalense and Lucchese 1999)(R. R. Lucchese and Gianturco 2016). ePS is a powerful computational engine for solving scattering problems, but its inherent complexity, combined with additional post-processing requirements, ranging from simple visualizations to more complex processing involving further calculations based on ePS outputs, present a significant barrier to use for most researchers. ePSproc aims to lower this barrier by providing a range of functions for reading, processing and plotting outputs from ePS. Since ePS calculations are currently finding multiple applications in AMO physics (see below), ePSproc is expected to have significant reuse potential in the community, both as a basic tool-set for researchers beginning to use ePS, and as a more advanced post-processing suite for those already using ePS. ePSproc is currently written for Matlab/Octave, and distributed via Github: https://github.com/phockett/ePSproc.


INTRODUCTION
The ePolyScat (ePS) suite, developed and released by Lucchese & co-workers (Gianturco et al. 1994) ) (R. R. , provides an open source software tool to the AMO physics community for the calculation of a range of quantum scattering problems. At heart, the codes use a Schwinger variational method to solve the continuum electron wavefunction, for a given scattering potential and continuum energy. ePS is written in Fortran 90, and makes use of MPI for parallel processing. The code is modular, with an input file consisting of a range of commands to define the specific calculation(s) of interest, and typically produces a monolitic output file, consistent with the traditional style of quantum chemistry software (e.g. Gamess, Gaussian etc.). Some additional processing tools, and supplementary output file options, are available to the user. User interaction is at the command line or via text files. ePSproc, a suite of codes for post-processing of ePS outputs, aims to provide existing, or potential, ePS users with tools for: • Parsing of ePS output files and extraction of segments/data of interest.
• Visualization of ePS calculation results.
• Additional post-processing, based on the raw matrix elements.
The workflow for ePolyScat and ePSproc is illustrated in figure 1, and the full range of the current functionality of ePSproc is given in table I, including some future aims. Full details of each function can be found in the source code and documentation.
ePSproc evolved from the use of ePS for a variety of calculations, in particular for molecular and laboratory frame photoelectron angular distributions, and high-harmonic generation (Wörner et al. 2010) (Bertrand et al. 2012); these works were, in turn, typically based on prior publications from ePS contributors developing the underlying computational methods, e.g. (Toffoli et al. 2007) (Le et al. 2009). In all cases, ePS was utilized to calculate dipole matrix elements for a specific problem, and significant post-processing was required to produce the desired results. These various computations resulted in a range of Matlab scripts and functions, for both basic and advanced processing of ePS outputs. In this context "basic" functionality consists of visualization of ePS results, and post-processing of the output data in a manner similar to other tools within the ePS suite (e.g. basic frame transformations), while "advanced" functionality consists of making use of the raw matrix elements in further computations (e.g. laboratory frame angular distributions for aligned molecular ensembles (Hockett 2015), Wigner time-delays ) (Hockett 2016)). Aspects of these various existing, and carefully tested, codes have now been consolidated into ePSproc.
The first release of ePSproc (v1.0.0) is aimed at photoionization problems. In this release, ePS output files are parsed, and the user can then plot photoionization cross-sections and molecular frame photoelectron angular distributions (MF-PADs). The former are taken directly from the ePS output, while the latter incorporates processing of the dipole matrix elements output by ePS for calculation of the molecular frame photoelectron scattering distributions for any arbitrary light polarization and molecular frame alignment, as specified by the user. The formalism employed is detailed in the following section.
Future releases of ePSproc will include calculations for a wider range of cases, including time-dependent aligned distributions and high-harmonic generation. A port of the software to the Python language, for a true open-source implementation, is also planned.

FORMALISM
Molecular frame photoelectron angular distributions (MFPADs) can be defined as per eqns. 1-3 of ref. (Toffoli et al. 2007):   klm and dipole operatord µ . The wavefunctions are indexed by irreducible representation (i.e. symmetry) by the labels p i and p f , with components µ i and µ f respectively; l, m are angular momentum components, µ is the projection of the polarization into the MF (from a value µ 0 in the LF). Each choice of energy and irreducible representation (and components thereof) corresponds to a single scattering calculation in ePolyScat, and produces a set of matrix elements I (c) l,m,µ , where (c) denotes that the results correspond to a single scattering calculation, and the matrix elements are again expanded in the spherical basis quantum numbers l, m, µ. These are the raw matrix elements which ePSproc works with.
• T piµi,p f µ f µ0 (θk, φk, θn, φn) is the full matrix element (expanded in polar coordinates) in the MF, wherek denotes the direction of the photoelectron k-vector, andn the direction of the polarization vector n of the ionizing light. Note that the summation over components {l, m, µ} is coherent, and hence phase sensitive.

Function
Implemented Details ePSproc_read Y Read information from main ePS output file. Reads details of molecular geometry, scattering energies, cross-sections (GetCro segments) and raw matrix elements (DumpIdy segments).
ePSproc_MFPAD Y Calculate MFPADs for all input sets of matrix elements, for a given polarization state and geometry (Toffoli et al. 2007).
ePSproc_NO2_MFPADs_demo Y Basic script for running the example/benchmark calculations.
ePSproc_AFPAD N Calculate aligned frame (AF) PADs for a given molecular axis distribution (Hockett 2015).
ePSproc_HHG N Calculate recombination matrix elements for use in HHG calculations (Le et al. 2009). • I µ0 (θk, φk, θn, φn) is the final (observable) MFPAD, for a polarization µ 0 and summed over all symmetry components of the initial and final states, µ i and µ f . Note that this sum can be expressed as an incoherent summation, since these components are (by definition) orthogonal.
• g pi is the degeneracy of the state p i .
The laboratory frame photoelectron angular distribution (LFPAD) for a single molecular orientation can be similarly defined: Which is similar to eqn. 2, except with an additional rotation matrix element to rotate the spherical harmonics into the LF (defined by the polarization vector of the incident radiation), with components m 0 .
As defined above, ePSproc works from the raw matrix elements, defined in sets corresponding to a single scattering calculation output from ePolyScat, I (c) l,m,µ . Application of the equations above, defined in terms of operations on each set of matrix elements and summation over sets, allows computation of the MF and LFPADs for any desired polarization geometry. Similar formalisms can be applied to obtain related quantities, such as recombination matrix elements for high harmonic generation, or Wigner ionization time-delays.

QUALITY CONTROL
As well as the existing scientific publications listed above, which indicate the lineage of the current suite, the release version of ePSproc has been carefully tested for the generation of MFPADs against benchmark calculations provided by R.R. Lucchese (one of the original ePS authors, as described above), based on calculations originally published in ref. (Toffoli et al. 2007). An overview of the testing and results is provided in figure 4.
For the testing procedure, input matrix elements for ePSproc were obtained from an ePS calculation (version E3), running under Ubuntu LTS 14. The electronic structure inputs for this calculation were the sample N O 2 Gaussian output, provided with the ePS.E3 release (R. R. Lucchese and Gianturco 2016), although a new ePS input file (including matrix element output via DumpIdy commands) was created for this computation (see figure 1 for visualization of this workflow). Benchmark results, provided by R.R. Lucchese, originated from the output of the ePS OrientCro routine (which provides a data-file of angle-resolved cross-sections, expanded as harmonics, for a given polarization state), and were post-processed using Matlab code also provided by R.R. Lucchese. The resulting (θ, φ) gridded data was then plotted ( figure 4(b)). The reprocessing was verified against the previously published results, figure 4(a).
The new calculations, with post-processing in ePSproc, are shown in figure 4(c), and were directly compared to the (reprocessed) benchmark results via numerical subtraction; the results of this comparison are shown in figure 4(d), indicating agreement with the benchmark calculations to 10 −9 . In this case, the comparison is very good, although it is of note that  this testing does not differentiate between differences in the raw ePS outputs (which could arise for many reasons, both computational and due to differences in the input files) and differences in the post-processing.
The ePSproc results shown were obtained on an 64-bit Intel Core I7 system, running Matlab R2010b under Ubuntu LTS release 14, and similar verification has been successfully obtained using a 64-bit Intel Core I5 system, running Matlab R2015a under Windows 7. (The results have not been verified with Octave at the current time.) The current release of ePSproc includes the required ePS output file and demo script to reproduce the benchmark post-processing, and should be the first test run by a new user (users running ePS can, additionally, test the ePS portion of the benchmark calculations, via changes to the ePS input file). The demo calculation also provides the opportunity for the user to further test ePSproc post-processing and visualization by, for instance, testing alternative polarization geometries. Additional details are provided in the documentation accompanying ePSproc.
we will examine the MFPAD in the coordinate vided by the symmetry axes of the C 2v NO 2 mol- Fig. 3 we show the orientation used in the theoretlations, which has the molecule in the yz plane and m below the O atoms in the z direction. Using this n, we also give in Fig. 3 the initial orbitals from will consider ionization in this study, the 4a 1 and sion with z-polarized light being the most dramatic.

IV. VECTOR CORRELATION METHOD FOR DISSOCIATIVE PHOTOIONIZATION OF NO 2
In the study of dissociative photoionization ͑DPI͒ of the NO 2 molecule, leading to the production of one NO + or O + puted MFPADs for ionization at a photon energy of 14.4 eV leading to the ͑1a 2 ͒ −1 b 3 A 2 state of NO 2 + . The scales of the axes are given in units molecule is oriented in the yz plane with the C 2 symmetry axis coinciding with the z axis. The MFPADs are given for light linearly polarized in z directions as shown, with the resulting symmetry type of the wave function for the continuum electron indicated in the parentheses. FPAD in the coordinate es of the C 2v NO 2 moltion used in the theoretecule in the yz plane and e z direction. Using this the initial orbitals from n this study, the 4a 1 and photoelectron by the molecular ion potential. The shapes of the MFPADs in the case of ionization from the 4a 1 orbital at a photon energy of 22 eV shown in Fig. 5 indicate a propensity for ejection of the photoelectron in the direction of the orientation of the lone pair on the O atoms. This is very reminiscent of the direction of ejection of the photoelectron predicted in the ionization of the O lone pair in CO. 41 This propensity is seen for all three polarization directions shown in Fig. 5, with the case of the photoemission with z-polarized light being the most dramatic.

IV. VECTOR CORRELATION METHOD FOR DISSOCIATIVE PHOTOIONIZATION OF NO 2
In the study of dissociative photoionization ͑DPI͒ of the NO 2 molecule, leading to the production of one NO + or O + t a photon energy of 14.4 eV leading to the ͑1a 2 ͒ −1 b 3 A 2 state of NO 2 + . The scales of the axes are given in units ane with the C 2 symmetry axis coinciding with the z axis. The MFPADs are given for light linearly polarized in resulting symmetry type of the wave function for the continuum electron indicated in the parentheses.
Redistribution subject to AIP license or copyright; see http://jcp.aip.org/about/rights_and_permissions described as an xy orbital. For the x-polarized light, the outgoing wave should be predominately x 2 y in character and that is reflected in the strong peaks in the intensity in the ±ŷ directions. The shape for the z-polarized light is clearly seen as an l = 3 distribution coming from the xyz expected symmetry obtained from the product of the orbital and photon angular momenta. The one surprising MFPAD is that found in the case of the y-polarized light. In this case the expected xy 2 symmetry is not seen, instead a strong xz symmetry is found. This must then be attributed to strong scattering of the photoelectron by the molecular ion potential. The shapes of the MFPADs in the case of ionization from the 4a 1 orbital at a photon energy of 22 eV shown in Fig. 5 indicate a propensity for ejection of the photoelectron in the direction of the orientation of the lone pair on the O atoms. This is very reminiscent of the direction of ejection of the photoelectron predicted in the ionization of the O lone pair in CO. 41 This propensity is seen for all three polarization directions shown in Fig. 5, with the case of the photoemission with z-polarized light being the most dramatic.

IV. VECTOR CORRELATION METHOD FOR DISSOCIATIVE PHOTOIONIZATION OF NO 2
In the study of dissociative photoionization ͑DPI͒ of the NO 2 molecule, leading to the production of one NO + or O + ding to the ͑1a 2 ͒ −1 b 3 A 2 state of NO 2 + . The scales of the axes are given in units oinciding with the z axis. The MFPADs are given for light linearly polarized in wave function for the continuum electron indicated in the parentheses.

IP license or copyright; see http://jcp.aip.org/about/rights_and_permissions
this is just the inverse of the rotation R M given above so that n = − M , n = M , and n = − − M . The photoionization dynamics is contained in the matrix elements I lm p i i ,p f f ͑E͒, for photoionization of a molecular state ⌿ i p i i with spatial degeneracy g p i leading to a final g p f -degenerate ion state ⌿ f p f f , with d the th spherical component of the dipole operator and with the same phase convention as in Ref. 17. klm ͑−͒ is the ͑l , m͒ partial wave component of the continuum orbital, subject to the appropriate boundary conditions. 17

B. MFPADs for NO 2
Next we will examine the MFPAD in the coordinate frame provided by the symmetry axes of the C 2v NO 2 molecule. In Fig. 3 we show the orientation used in the theoretical calculations, which has the molecule in the yz plane and the N atom below the O atoms in the z direction. Using this orientation, we also give in Fig. 3 the initial orbitals from which we will consider ionization in this study, the 4a 1 and 1a 2 orbitals. The 1a 2 orbital is essentially a lone pair orbital primarily composed of p x orbitals on the O atoms with the orbital having a node in the plane of the molecule. The 4a 1 orbital is primarily a lone-pair orbital composed of sp hybrids on the O atoms that are pointed away from the N atom, with some 2s contribution on the N atom.
The MFPAD for ionization from the 1a 2 orbital at a photon energy of 14.4 eV as computed using Eq. ͑1͒ is given in Fig. 4 for light linearly polarized in the x, y, and z directions leading to electrons in the kb 2 , kb 1 , and ka 2 continua, respectively. The shape of the MFPADs can be qualitatively understood by a simple consideration of the angular momentum composition of the initial orbitals as seen in their nodal structure and the angular momentum and corresponding nodes contributed by the various polarizations of the light. 40 In the case of the 1a 2 orbital, the initial orbital can be best described as an xy orbital. For the x-polarized light, the outgoing wave should be predominately x 2 y in character and that is reflected in the strong peaks in the intensity in the ±ŷ directions. The shape for the z-polarized light is clearly seen as an l = 3 distribution coming from the xyz expected symmetry obtained from the product of the orbital and photon angular momenta. The one surprising MFPAD is that found in the case of the y-polarized light. In this case the expected xy 2 symmetry is not seen, instead a strong xz symmetry is found. This must then be attributed to strong scattering of the photoelectron by the molecular ion potential.
The shapes of the MFPADs in the case of ionization from the 4a 1 orbital at a photon energy of 22 eV shown in Fig. 5 indicate a propensity for ejection of the photoelectron in the direction of the orientation of the lone pair on the O atoms. This is very reminiscent of the direction of ejection of the photoelectron predicted in the ionization of the O lone pair in CO. 41 This propensity is seen for all three polarization directions shown in Fig. 5, with the case of the photoemission with z-polarized light being the most dramatic.

IV. VECTOR CORRELATION METHOD FOR DISSOCIATIVE PHOTOIONIZATION OF NO 2
In the study of dissociative photoionization ͑DPI͒ of the NO 2 molecule, leading to the production of one NO + or O + FIG. 3. Three dimensional representations of the primary hole orbitals for the two ion states considered in this study. The molecule is oriented in the yz plane; the C 2 symmetry axis coincides with the z axis, with the N atom below the O atoms in the z direction. Each row shows the results for a different polarization geometry, x, y and z, corresponding to continuum symmetries Γe = b2, b1, a2 respectively. See main text for further details.

OPERATING SYSTEM
Any OS capable of running Matlab or Octave. File parsing currently makes use of Windows or Linux command-line tools for searches, so may require small modification for other operating systems.
(3) REUSE POTENTIAL As detailed above, the use of ePS has recently become widespread, with users in a range of related areas of AMO physics. It is anticipated that many of these users would find a use for ePSproc. Potential new users will, hopefully, find that the bar to entry for ePS is lowered since, at a basic level, ePSproc provides an easy, and well-tested, methodology for bringing raw matrix elements from ePS into Matlab. This provides a rapid and transparent means of analyzing and visualizing ePS results, and removes the requirement for researchers to develop and test their own post-processing techniques. Beyond this, there are a range of potential usage cases, from the basic exploration of MFPADs in order to build physical intuition, to more detailed and extensive computations considering, e.g. molecular dynamics, aligned ensembles, HHG, etc. (see table  I for some examples). In release 1.0.0 of ePSproc only MFPAD calculations are implemented, and additional usage cases will be incorporated in future releases. The applications listed in table I have already been developed, but still require code rationalization and integration into ePSproc before release. It is anticipated that users will also develop post-processing routines for other usage cases, making use of the low-level ePS I/O and computational functions implemented in ePSproc, and these additions could be incorporated into future releases to further extend the capabilities of the code.
Additional future plans to extend ePSproc include the creation of a library of sample calculations (initially based on the publications cited above), and porting the code to a fully open-source framework, probably the python language.
User support for ePSproc can be obtained directly from the author, via the project GitHub page or by email.