Multidip 1.0
Multi-photon matrix elements
Loading...
Searching...
No Matches
multidip.f90
Go to the documentation of this file.
1! Copyright 2020
2!
3! For a comprehensive list of the developers that contributed to these codes
4! see the UK-AMOR website.
5!
6! This file is part of UKRmol-out (UKRmol+ suite).
7!
8! UKRmol-out is free software: you can redistribute it and/or modify
9! it under the terms of the GNU General Public License as published by
10! the Free Software Foundation, either version 3 of the License, or
11! (at your option) any later version.
12!
13! UKRmol-out is distributed in the hope that it will be useful,
14! but WITHOUT ANY WARRANTY; without even the implied warranty of
15! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16! GNU General Public License for more details.
17!
18! You should have received a copy of the GNU General Public License
19! along with UKRmol-out (in source/COPYING). Alternatively, you can also visit
20! <https://www.gnu.org/licenses/>.
21!
22!> \mainpage
23!>
24!> \brief Calculate multi-photon dipole elements
25!> \author J Benda
26!> \date 2020
27!>
28!> \section info Description
29!>
30!> Computes the multi-photon transition elements of a given order and the corresponding generalized
31!> cross section. Proceeeds in the following way (see also the call graph in \ref multidip):
32!> 1. The required data are read from specified K-matrix files (see \ref multidip_io::read_kmatrices)
33!> and the RMT molecular_data file (see \ref multidip_io::read_molecular_data).
34!> The K-matrix files should ideally contain the full K-matrices, i.e. including the closed
35!> channel contributions at the R-matrix radius. This can be achieved by setting `IKTYPE = 1`
36!> in R-solve. When only the (default) open-open K-matrices are used, there is a possibility
37!> of below-threshold spurious spikes in the cross sections for multi-channel calculations.
38!> 2. For all intermediate orders, the intermediate states are calculated at all scattering energies
39!> (see \ref multidip_routines::solve_intermediate_state).
40!> 3. The final stationary photoionization wave function is calculated at all scattering energies
41!> (see \ref multidip_routines::extract_dipole_elements).
42!> 4. Transition matrix elements and photoionisation cross section are obtained
43!> (see \ref multidip_routines::calculate_pw_transition_elements).
44!>
45!> While the implemented method works for an arbitrary perturbation order, there are some caveats that restrict
46!> the applicability of this program:
47!> 1. Asymptotic series is used in place of Coulomb-Hankel functions, which does not work
48!> well close to thresholds.
49!> 2. For (N + M)-photon ionisation, i.e. when M photons are absorbed in the continuum, the
50!> asymptotic complexity is proportional to O(M!). This practically restricts the tractable
51!> orders to at most 4 absorptions in the continuum.
52!>
53!> Multidip can either reuse existing photoionization wave function coefficient files written by RSOLVE
54!> (see \ref multidip_io::read_wfncoeffs) or calculate the wave function coefficients on the fly
55!> (see \ref multidip_routines::apply_Ak_coefficients_multidip).
56!>
57!>
58!> \section cmd Command line options
59!>
60!> The program understands the following command line options:
61!> \verbatim
62!> --help display brief help and exit
63!> --input FILE use FILE as the input file (instead of standard input)
64!> --test run the internal sanity checks and exit
65!> \endverbatim
66!>
67!> \section params Input parameters
68!>
69!> When the command line option `--input` is not used, MULTIDIP will read the input parameters from the
70!> standard input. The input consists of the input namelist `&mdip`, which is expected to have the following form:
71!>
72!> \verbatim
73!> &mdip
74!> order = 2, ! two-photon transitions
75!>
76!> rmt_data = 'molecular_data', ! name of the molecular RMT data file (default is 'molecular_data')
77!>
78!> lusct = 800,801,802,803, ! photoionization Ak coefficient files to read (optional)
79!> lukmt = 190,191,192,194, ! K-matrix files to read (ideally, should be produced in RSOLVE with IKTYPE = 1)
80!> nkset = 1,1,1,1, ! which set from the K-matrix file to use (default is to use the first set)
81!> lubnd = 500, ! unit with inner region expansion coefficients produced by BOUND (optional)
82!>
83!> polar(:,1) = (0,0),(0,0),(1,0), ! polarisation of the first absorbed photon (default is 0, i.e. average over polarisations)
84!> polar(:,2) = (0,0),(0,0),(1,0), ! polarisation of the second absorbed photon (default is 0, i.e. average over polarisations)
85!>
86!> omega(1) = 0, ! fixed energy in a.u. of the first absorbed photon or 0 for auto (default is 0)
87!> omega(2) = 0, ! fixed energy in a.u. of the second absorbed photon or 0 for auto (default is 0)
88!>
89!> first_IP = 0, ! override ground state energy to yield given IP in a.u. (default is 0 = not used)
90!> rasym = 100, ! asymptotic radius for analytic integration of Coulomb integrals (default 100)
91!> verbose = .false., ! print detailed information about the execution (default is .false.)
92!> mpiio = .false., ! run in HPC mode (requires MPI and ScaLAPACK, default is .false.)
93!> gpu = .false., ! calculate R-matrices on GPU (requires OpenCL and CLBlast, default is .false.)
94!>
95!> lab_polar = 1,1 !lab-frame polarisations of the involved photons (default is linear, i.e. 0,0)
96!> lu_pw_dipoles = 410 !if order == 1 then the partial wave dipoles will be written to files
97!> ! fort.41X, where X = MGVN, in RSOLVE format.
98!> /
99!> \endverbatim
100!>
101!> The complete list of possible parameters and their default values are listed in documentation of the module \ref multidip_params.
102!>
103!> The code will use the irreducible representations specified by the K-matrix files. These need to be present also in the
104!> file *molecular_data*. The user is responsible for providing all relevant K-matrix files (irreducible representations)
105!> for the specified photon polarisations. Otherwise, the results may be wrong. The order of the Ak-files and K-matrices
106!> has to be the same, but does not follow any specific scheme. However, the first K-matrix file given in `lukmt` defines
107!> the symmetry of the initial state.
108!>
109!> The inner region expansion of the initial state may be provided as the output file of BOUND by means of the keyword `lubnd`.
110!> This expansion is then automatically continued to the outer region by MULTIDIP and taken in account in further calculations.
111!> This increases the computational complexity in the same way as raising the amount of absorbed photons by one. If no bound
112!> state coefficients are provided, the program will simply use the lower-energy inner region eigenstate in the symmetry specified
113!> by the first K-matrix file.
114!>
115!> The polarisation of \f$ k \f$-th photon is given as three complex-valued components of a unit Cartesian vector:
116!> \f$ (\mathrm{Re}\,\epsilon_x^{(k)}, \mathrm{Im}\,\epsilon_x^{(k)}),
117!> (\mathrm{Re}\,\epsilon_y^{(k)}, \mathrm{Im}\,\epsilon_y^{(k)}),
118!> (\mathrm{Re}\,\epsilon_z^{(k)}, \mathrm{Im}\,\epsilon_z^{(k)}) \f$.
119!> When a polarisation vector has only real components (as in the above example), some compilers (like ifort, but not gfortran)
120!> will allow omission of the parentheses and specifying just the real part. When polarisation of some photon is specified as zero,
121!> no partial wave multipole moments will be written to files at the end of the calculation.
122!>
123!> Some fixed absorbed photon energies can be specified on input using the `omega` parameter. There must always be at least one
124!> photon with variable energy (corresponds to `omega = 0`). The energies of the variable-energy photons will be then equally
125!> assigned so that the total energy of the system corresponds to the total energies on input (in the K-matrix files). By default
126!> `omega = 0` for all photons, so all photons have variable energy and will correspond to the same wave length.
127!>
128!> If non-zero, the parameter `rasym` defines the asymptotic radius. It has to be larger than the radius of the inner region.
129!> Radial integrals of Coulomb functions are integrated numerically between the inner region boundary and this radius,
130!> while asymptotic expansion and analytic integration is used from the asymptotic radius to infinity. The value of 100 atomic
131!> units is typically a good choice. Note that numerical integration is implemented only for two-photon processes and this
132!> parameter will be presently ignored for higher-order processes.
133!>
134!> \section outputs Output files
135!>
136!> When the polarisations of the photons are given, the program produces the file *gen_photo_xsec.txt* with the generalized cross
137!> section for oriented molecule. The first column is the energy of the first photon in eV, the second column is the total cross
138!> section in atomic units (area^N time^(N-1)), further columns are partial cross sections associated with transition to a
139!> specific final ionic state. See \ref multidip_routines::calculate_pw_transition_elements for details.
140!>
141!> Likewise, if all photon polarisations are given, the full partial wave N-photon transition matrix elements will be written to
142!> files *pwdip-M-(I,L,M).txt* and *pwdip-M-(I,L,M)+cphase.txt*, where M is the irreducible representation (0-based), I is
143!> the (1-based) index of the residual ion, and L and M are the angular momentum quantum numbers of the emitted electron's partial
144!> wave. The file with "+cphase" ending contains the additional partial wave phase factors
145!> \f$ \mathrm{i}^\ell \exp(-\mathrm{i} \sigma_\ell) \f$. The first column
146!> of these files is the real part of the matrix element, the second is the imaginary part. The total energies are not present,
147!> but correspond to the same energies as given by the input K-matrix files.
148!>
149!> Irrespective of the polarisations in the input namelist, MULTIDIP will produce the files *gen_<n>photo_beta_<L>.txt* with the
150!> parameters \f$ \beta_L \f$ of the molecular-orientatio-averaged photoelectron angular distribution,
151!> \f[
152!> \frac{\mathrm{d}\sigma^{(p_1\dots p_n)}}{\mathrm{d}\Omega}
153!> = \frac{1}{4\pi} \beta_0 \left(1 + \beta_1 P_1(\cos\theta) + \dots + \beta_{2n} P_{2n}(\cos\theta) \right) ,
154!> \f]
155!> where \f$ \beta_0 = \sigma^{(p_1\dots p_n)} \f$ is the integrated partial cross section and \f$ \beta_{L > 0} \f$
156!> is the dimensionless asymmetry parameter for angular momentum \f$ L \f$. Currently, the laboratory-frame polarisations
157!> \f$ p_1,\dots,p_n \f$ are all hardcoded to zero (linear polarisation). Files that would contain zeros only are not written.
158!> The layout of these files is the same as of *gen_photo_xsec.txt*.
159!>
160!> Finally, if some fully custom processing of the raw transition dipoles is required, it is possible to let them MULTIDIP write all
161!> to disk by use of the keyword `raw`. When set to the string "xyz" or "sph" or "both", raw transition dipoles in the selected
162!> angular basis will be written to files *rawdip-CHAIN-(I,L,M).txt*. Here "CHAIN" will be the absorption history of the transition,
163!> for instance "xx" if that raw dipole corresponds to absorption of two x-polarized photons in the Cartesian basis, or "mp0" if it
164!> corresponds to absorption of \f$ m = 0 \f$, \f$ m = +1 \f$ and \f$ m = -1 \f$ photons in the spherical basis. The first absorbed
165!> photon corresponds to the right-most index, as is customary in the typical bra-ket notation. The files contain
166!> real and imaginary parts of the dipoles for all scattering energies. The utility programs \ref multidip_smooth_rawdips and
167!> \ref multidip_rabitt_delays work with these files.
168!>
169!>
170!> \section opts Configuration options
171!>
172!> | CMake option | default value |
173!> | --- | --- |
174!> | `WITH_CLBLAST` | `OFF` |
175!> | `WITH_GSL` | `OFF` |
176!> | `WITH_MMAP` | `ON` |
177!> | `SCALAPACK_LIBRARIES` | (empty) |
178!>
179!> This program can optionally use special functions (the complex gamma function, Coulomb functions and the confluent
180!> hypergeometric functions) from the GNU Scientific Library instead of the UKRmol-out library. For that, pass the
181!> option `-D WITH_GSL=ON` to CMake during configuration.
182!>
183!> When configured with the `-D WITH_MMAP=ON` option, the inner region dipole matrices will not be read
184!> into memory, but only mapped into virtual memory. (This requires presence of such functionality
185!> in GBTOlib.)
186!>
187!> This program benefits from optimized and/or threaded BLAS. Some sections of the code are also explicitly threaded (using
188!> OpenMP). Moreover, when compiled with the MPI support (this is controlled by GBTOlib level), the loop over energies
189!> (as well as some other pieces of the code) will be distributed among the parallel images in the round-robin fashion.
190!>
191!> When the support for parallel MPI is enabled during compilation, it is also possible to enable use of MPI-IO and ScaLAPACK.
192!> MPI-IO is used to read the large inner region dipole matrices. ScaLAPACK is used to redistribute solutions and to multiply them
193!> with the inner dipoles. This MPI-IO/ScaLAPACK support will be compiled in if the option `SCALAPACK_LIBRARIES` is passed to
194!> CMake, and the code will be activated by setting `mpiio = .true.` in the program's input namelist.
195!>
196!> The computation of R-matrices (R = w^T [E - H]^(-1) w), which is dominated by the multiplication of large constant real boundary
197!> amplitude matrices to produce a much smaller output matrix, can be offloaded to a GPU. This requires compiling UKRmol-out with
198!> the library CLBlast by specifying `WITH_CLBLAST=ON` and also `CLBLAST_INCLUDE_DIRS` and `CLBLAS_LIBRARIES` when running CMake.
199!> The actual GPU mode is then enabled by specifying `gpu = .true.` in the input namelist. In serial mode the OpenCL platform and
200!> OpenCL device index to use (both default 0) can be set by the environment variables `OCL_PLATFORM` and `OCL_DEVICE`. In parallel
201!> mode the latter variable is ignored and the parallel processes are associated with the available OpenCL devices within the
202!> selected platform in the round-robin way.
203!>
204program multidip
205
207
208 implicit none
209
210 call multidip_main
211
212end program multidip
program multidip
Definition multidip.f90:204
Main MULTIDIP routines.
subroutine multidip_main
MULTIDIP main subroutine.