TD-DFT simulations of K-edge resonant inelastic X-ray scattering within the restricted subspace approximation †

This work describes a scheme for simulations of resonant inelastic X-ray scattering (RIXS) cross-sections by applying the restricted subspace approximation (RSA) to linear response time-dependent density functional theory (TD-DFT). A pragmatic truncation of the orbital spaces leads to a consistent description of core-and valence-excited states, thus enabling computations of RIXS in a near black-box fashion. The method is tested by comparison to experimental data from the literature, focusing on the case of aqueous 2-thiopyridone


Introduction
Resonant Inelastic X-ray Scattering 1 (RIXS) is a widely used experimental probe for investigations of the local electronic structure in complex systems.RIXS is chemically appealing for its ability to probe the decay from the occupied orbitals, reaching valence excited states, often not accessible in the UV range.Its inherent dependence on the photon polarization also allows for examinations of the symmetry of occupied orbitals.Furthermore, since the spectral resolution is not limited by the large core-hole lifetime broadening, it can deliver information on the nuclear motion and associated potential energy surfaces through a vibrational substructure of electronic transitions.Recent studies ranging from isolated molecules, [2][3][4][5] molecules in solution, [6][7][8][9] fluctuating networks in liquid phase 10 and to correlated materials 11,12 demonstrate its versatility.RIXS also draws substantial interest for its applicability in pump-probe spectroscopies, [13][14][15][16][17] specially in the context of modern X-ray Free Electron Laser experiments.
Extracting chemical and physical insight from such intricate spectroscopies, however, often relies on an extensive computational effort in terms of electronic structure and spectral simulations.To that end, several theoretical approaches for simulating X-ray spectra have been developed, their capabilities and applications have been recently reviewed, 18 and only a schematic overview is given here.Pertaining to wave function based methods, RIXS spectra have been computed via the restricted active space second order perturbation theory 14,19,20 (RASPT2), multi-reference configurational interaction, 21 and the complex polarization propagator approach implemented for both an ADC 22 as well as an CCSD reference, 23 to list a few examples.As for Kohn-Sham based methods, RIXS simulations have largely relied on the one-electron picture based on orbitals optimized via the transition-potential method 24 or by the maximum-overlap-method (MOM). 25Also, the DFT based restricted open-shell configuration interaction singles (ROCIS) method has been developed for treating X-ray spectra of transition metal systems. 26,27In contrast, the application of standard linear-response time-dependent DFT (LR-TD-DFT) to RIXS has been largely unexplored and remains limited to a few isolated instances. 28his journal is © the Owner Societies 2021 In this work we investigate the applicability of LR-TD-DFT within the Restricted Subspace Approximation 29 (RSA) to K-edge RIXS spectroscopy.A consistent description of both core-and valence-excited states is achieved by a pragmatic truncation of the orbital spaces, thus enabling computations of RIXS crosssections in a near black-box fashion.Moreover, the efficiency of TD-DFT allows to tackle systems larger than those feasible with wave function based methods, while leading to a better description of valence excited states than one-electron DFT approaches.
We also demonstrate that although TD-DFT notoriously leads to very poor excitation energies for excited states in the X-ray region, often deviating by 10-20 eV, RIXS spectra of near quantitative accuracy can be obtained on the chemically relevant energy loss scale.More specifically, as long as TD-DFT produces a qualitatively correct intermediate core-state the quality of the RIXS spectrum can be expected to be comparable to that of the typical UV-Vis absorption spectrum.This stems from the fact that the final states in RIXS are valence excited states, which TD-DFT can often describe with reasonable accuracy. 30n the following sections, we briefly recollect the general theory of RIXS and RSA-TD-DFT, followed by a detailed exploration of the framework based on the RIXS spectrum of 2-thiopyridone and its conjugated base.Then a longer series of molecules is investigated where multiple experimental instances from the literature are used as reference.Furthermore, the applicability of TD-DFT to the simulation of high-resolution RIXS data is addressed by wave packet simulations of the spectra of H 2 O, O 2 and liquid acetone.Lastly, the concluding remarks are presented.

General theory of resonant inelastic X-ray scattering
Resonant inelastic X-ray scattering, also called X-ray Raman spectroscopy, is a coherent scattering process where the system is excited by a X-ray photon into a short-lived core-excited state which continuously decays onto the manifold of valence excited states, as well as the ground state. 1 A diagram is shown in Fig. 1 with a depiction of the process.Atomic units are used for all equations.
The general equation for the double differential RIXS crosssection reads 1 where o and o 0 are the incoming and outgoing photon frequencies, respectively.o f0 = (e f À e 0 )/ h is the transition frequency between the initial state and final state.And where is a Lorentzian function with HWHM G.The scattering amplitude F f is given by the Kramers-Heisenberg equation, here we ignore the Thomson scattering term, as well as the rotating wave term, and since we are concerned with soft X-ray transitions we will apply the dipole approximation e iqÁRn = 1, and ignore the frequency pre-factors in eqn (1) where |ni represents a full state of the system including the multi-electronic wave function and the nuclear wave function, e and e 0 are the incoming and outgoing photon polarization, r is the electric dipole operator (the electron charge being e 1) and G i is the core-hole lifetime broadening of the i-th state.The RIXS cross-section is proportional to |F f | 2 and therefore it depends on the following four-dimensional tensor where m a mn = hm|m a |ni = hm|r a |ni are the transition dipole matrix elements and a,b,g,d A {x,y,z}.Here, we have neglected intermediate state interference, reducing the sum to the diagonal terms.This is valid for the purpose of the present paper as only transitions involving well isolated core-excited states are considered.
If we had a molecule fixed in space this would give the RIXS cross-section for any arbitrary relative angle between the transition dipole moments and the photons.However, in routine experiments we have fixed measuring angles and polarizations, along with randomly oriented molecules.Therefore, we need to average over orientations.Using now the general RIXS average equation for a fixed scattering angle 1 we may write sðo 0 ; o; yÞ ¼ 1 30 Commonly in RIXS experiments, the polarization vector of the scattered photon is not detected.Therefore, we must average the cross-section further, replacing cos 2 y by cos 2 y ¼ 1=2 1 À ðk 0 Á eÞ 2 À Á , defining cos w = k 0 Áe, where w is the angle between the incoming polarization and the detection direction.This yields the final expression sðo 0 ; o; wÞ ¼ 1 30 Subspace-restricted linear response TD-DFT Time-dependent density functional theory is the most widely used theory to compute the excited states of molecular systems.
In practice, the excited states are obtained by solving the linear response equations, based on a single Slater determinant constructed from the ground state Kohn-Sham orbitals in the presence of an infinitesimally small oscillatory electromagnetic perturbation with frequency o.These equations, called the Casida equations, can be compactly written in matrix form as 30 where the sub-matrices A and B are given as where e denotes the orbital energies, and the i, j indices in the two-electron integrals denote occupied orbitals while a, b denote unoccupied orbitals.These equations are written for a hybrid functional with c HF denoting the amount of Hartree-Fock exchange included, and f xc is the exchange-correlation kernel of the functional.The problem is further simplified by adopting the Tamm-Dancoff 31 approximation, in which the off-diagonal B sub-matrix is neglected.Finally, the eigenvalue problem is routinely solved employing implementations based on the iterative Davidson's algorithm. 32n order to reach the core-excited states, typically, one projects eqn (8) onto an orbital subspace, [33][34][35] this procedure is also referred to as the core-valence separation (CVS) approximation, 18,36 this approach entails the restriction of the indices i, j in eqn (9) to include only the core-hole orbitals, while the indices a, b run over the full set of virtual orbitals.The main motivation for this constraint is reducing the required number of roots that are needed to reach the core-excited states.This approach has been very successful in the description of the X-ray absorption spectra (XAS) of many systems, 18 correctly capturing the bound core-excited states and the lowest resonances embedded in the continuum.It should be noted, however, that due to the selfinteraction error and core-hole relaxation effects, 34,[37][38][39][40] the excitation energies provided by TD-DFT often deviate from the experiment in the order of tens of electronvolts.
Naturally, the approach outlined above does not yield the necessary final states for the simulation of RIXS spectra.To that end, one needs to compute the manifold of valence excited states as well.Therefore, we propose a different subspace restriction scheme, namely instead of restricting the donor orbital subspace, we shall constrain the acceptor orbital space in the response equations.This is done bearing in mind the goal of achieving a computationally-feasible number of roots for the description of both core-and valence-excited states.Such a seemingly drastic approximation can be motivated by the observation that the resonant scattering contribution to the total emission spectrum is only dominant for the lowest-lying core-excited states.As the excitation energy is tuned beyond the core-ionization threshold, the scattering cross-section is overtaken by the non-resonant emission process.Furthermore, restricting the virtual space in TD-DFT has been proposed early on as a means for tackling states for adsorbed molecules as well as molecules in solution, [41][42][43] and it has been shown to also be a suitable route to obtaining excited states energies, 29 geometries 44 and vibrational frequencies 45 of large systems.Virtual space restriction has also been successfully used in RIXS simulations at the L-edge of transition metal complexes within the multi-configurational Kohn-Sham ROCIS method. 27ence, by solving the response equations with restricted donor and acceptor orbital spaces, one can obtain a full set of orthogonal valence-and core-excited states suitable for the calculation of the transition dipole moments necessary for specifying the Kramers-Heisenberg amplitudes in eqn (5).Fig. 2 shows a schematic of the orbital spaces used, where the donor space is made up by the core orbitals and the relevant occupied orbitals, and the acceptor space contains the lower lying unoccupied orbitals.To describe the orbital spaces, we define the array with the number of orbitals in the subspaces (N c ,N o ,N u ), where c, o, u denote core, occupied and unoccupied.
This journal is © the Owner Societies 2021 native orbital window and the orbital rotation features of Orca.All calculations employed the RIJCOSX 48 approximation with a fine integration grid GridX7, which greatly reduces the computational cost of the calculations.Geometries were optimized using the PBEh-3c 49 compound method.The TD-DFT simulations were performed using the def2-TZVP(-f) basis set using the Coulomb fitting auxiliary basis def2/J.The PBE0 50 exchange-correlation functional on the GRID5 option was used, if not specified differently.Additional details and sample input files are shown in the ESI.† The spectra were computed using the core-hole lifetime broadenings (HWHM) for nitrogen G = 0.06 eV, oxygen G = 0.08 eV and carbon G = 0.05 eV.The lineshape of the spectra were modeled by a Gaussian function with HWHM of 0.8 eV for best comparison with the experimental data.

Proof of principle: the RIXS of 2-thiopyridone
Nitrogen K-edge RIXS of the heterocyclic compound 2-thiopyridone (2-TP) will serve as the principal test case for the TD-DFT based method to simulate RIXS spectra presented here.Experimental data for scattering through the nitrogen 1sp* resonance for different nitrogen protonation states in aqueous environments are available. 14Additionally, simulations of the nitrogen K-edge RIXS cross-sections on a RASPT2 level of theory were performed in previous studies.Hence, 2-TP allows to investigate the applicability of our method and will let us determine the impact of subspace restriction and choice of exchange-correlation functional on the results of the simulations.In addition we will be able to compare our results to the simulations performed on the RASPT2 level of theory.Furthermore, the impact of solute-solvent interactions on the computed RIXS cross-sections will be discussed.

General applicability of the method
The results of our spectrum simulations for scattering through the N 1sp* resonance for 2-TP in its different protonation states are presented in Fig. 3.The spectrum of the protonated 2-TP species contains spectral lines which have been attributed to RIXS final states characterised by a hole in molecular orbitals located dominantly on the pyridine ring.In contrast the deprotonated species 2-TP À exhibits an additional intense RIXS channel at 5 eV energy loss resulting from transitions between a nitrogen based lone pair orbital into the nitrogen 1s hole.All transitions are well captured in the TD-DFT based simulation of the spectra and the matching of transition intensities is improved compared to the RASPT2 simulations especially for the protonated 2-TP species.This improvement originates from the inclusion of more orbitals in the donor space, as well as from the explicit inclusion of solvent water molecules in the proximity of the 2-TP molecule (see next paragraph).Additionally, the transition energies between the ground and the valence excited states are very well described by the TD-DFT simulation.This results in accurate peak positions for the RIXS transitions on an energy loss scale, so they do not require an energy shift of the simulated RIXS spectra, which is required for other computational methods.

Explicit solvation
For small to medium sized organic molecules, both geometry optimizations, as well as the TD-DFT simulations within the proposed orbital restriction scheme can be performed efficiently, enabling the impact of solute-solvent interactions on the RIXS transitions to be studied through the inclusion of explicit solvent molecules in the TD-DFT simulation.Both the occupied, as well as the unoccupied solvent valence orbitals are included in the donor and the acceptor space.In Fig. 4, we present a comparison for RIXS  simulations of 2-TP and 2-TP À considering solvation implicitly through a polarizable continuum model (CPCM) and additionally with explicit solvation through three water molecules allowing for hydrogen bond formation at the nitrogen and the sulfur site, in agreement with molecular dynamics simulations by Norell et al. 51 (see ESI †).We see that the inclusion of the solvent improves the agreement of the spectrum 2-TP À with the experimental data mainly for the strong lone-pair resonance at 5 eV energy loss.The slight energy underestimation in the exclusive CPCM simulation is compensated through the inclusion of hydrogen bonding solute-solvent interaction in the explicit solvation model.The energetically higher lying transitions are only mildly affected, as they correspond to transitions between p-orbitals in the pyridine ring and the nitrogen 1s core hole.Depending on the solvent, this approach leads to a drastic increase the number of roots necessary to account for all core to valence as well as valence to valence transitions.In our case, the number of roots increased from 360 to 600 to reach the core states for the spaces (1,18,20) and (1,30,20) for the exclusive CPCM and the explicit solvation model.Each of the explicitly considered solvent molecules thus increases the number of roots to be computed by k Â N u , where k is the number of occupied valence orbitals per solvent molecule.

Functional dependence
Results obtained with TD-DFT are expected to display a dependence on the exchange-correlation functional employed.Here we briefly address this question where it pertains to the quality of the RIXS spectrum of our showcase systems, however a full benchmark is beyond the scope of the present article.In Fig. 5 we compare the simulated RIXS spectra for a group of selected functionals, namely the pure functional PBE, the global-hybrids PBE0, 50 B3LYP, M06 and M06-2X, 52 the range-corrected CAM-B3LYP and the range-and dispersion-corrected oB97X-V. 53The peak positions for the most intense transition of 2-TP À are listed in Table 1 to enable a quantitative comparison.It can be seen that HF exchange is crucial for a correct description of the involved states, with PBE yielding the worst peak positions and comparatively worse intensities.Peak positions are also slightly worse for the two rangecorrected functional considered.Overall, the agreement for the global-hybrids for the system considered is near-quantitative, but it can be argued to be marginally in favor of PBE0.

Impact of constrained orbital spaces on spectral intensities
Fig. 6a depicts the effect of our orbital constraint scheme on the description of the X-ray induced transitions.We compare the spectra of different (1,30,N u ) spaces to the one of the (1,0,À1) space.The latter contains the nitrogen 1s level as the only donating and all virtual orbitals as accepting orbitals, which represents the conventional way to simulate X-ray absorption spectra with TD-DFT employing the CVS.The extent of the absorption spectra in Fig. 5a is strongly dependent on the size of the acceptor space.The low energy transitions, here the nitrogen 1sp* transitions, as well as the transitions at the onset of the continuum absorption up to 406 eV remain nearly unaffected even under strong orbital restriction down to N u Z 20.RIXS through energetically higher lying transitions is usually superimposed with the non-resonant X-ray emission spectrum formed by valence to core transitions in the core-ionized molecule.Therefore, we focus here on simulations for energetically lower lying, well isolated core-excited states.Excluding the lower lying unoccupied valence orbitals might even be considered to model scattering through higher lying core-excited states.If the acceptor space is reduced even further to (1,30,5), only the nitrogen 1sp* is described accurately.
Let us focus on the RIXS simulations for excitation at the p*-resonances of the two systems in the different spaces in Fig. 6b.We compare the spectra for the largest space (1,30,35)  to the ones of the reduced spaces (1,30,20) and (1,30,5).The impact of the space reduction on the RIXS spectrum via the lowest resonance is not as pronounced as the one on the X-ray absorption spectrum.This is because the core-excited state filters the accessible final states in the RIXS process.One can thus reduce the number of roots being computed, by simply contracting the subspace N u to the core-excitations of interest.In the case of the investigated p*-resonance, states characterised by excitations into the LUMO orbital have the dominant contribution to the RIXS spectrum.As a result, even the (1,30,5) space yields reasonable qualitative agreement between the experimental and the theoretical RIXS spectra.The agreement is only qualitative, as the description of both the core and valence excited states is deteriorated by the restriction of the acceptor space.This lack of multi-configurational description of the states is not present for the (1,30,20) and (1,30,35) space.Additionally, the inclusion of higher lying core-excited state resonances has a negligible impact on the shape of the spectra for the two spaces.The amplitude for scattering through these states in the Kramers-Heisenberg formula (eqn (3)) for incident photon energies tuned to the p*-resonance is minimal.
Restricting the subspace of occupied valence orbitals, as illustrated in Fig. 6c, generally deteriorates the quality of the RIXS spectrum.Transitions between deep lying occupied valence orbitals and the lowest unoccupied molecular orbital are not considered as final states of the RIXS process.Therefore, the RIXS intensity at high energy losses is not modeled correctly.The authors recommend to include all occupied valence orbitals in the active space and rather reduce the acceptor space in computationally expensive cases, e.g. if heavy elements are present in the studied system or a large number of solvent molecules are treated explicitly.In general the number of roots needed to reach the core-excited states is given by the product N o Â N v .Table 2 lists the number of roots for the approximations presented in Fig. 6.

Improvements regarding frozen orbital based RIXS schemes
In the proposed approach both the energy and the character of the valence and core-excited states is affected by the contribution of different excited state determinants to the roots resulting from the TD-DFT treatment of the photo-induced transitions.To estimate the effect of the accurate treatment of the excited states, we compare the results of our simulation to ones performed within the frozen orbital approximation.
In the frozen orbital approximation, the photo-absorption and emission processes are expected to affect exclusively the orbitals changing occupation during the transitions, fully neglecting relaxation effects in the core-excited state.In this approximation the transition dipole matrix elements between the many-electron states in eqn (3) contract to the moments between the involved orbitals.This scheme to approximate the RIXS cross-section can be employed using Kohn-Sham orbitals from a ground state DFT simulation of the electronic structure of a system.
In Fig. 7 the RIXS simulations in the two frameworks are compared for scattering through the N 1sp* state of 2-TP and 2-TP À .The frozen orbital scheme considers decay from all occupied valence orbitals, as well as from the p*-orbital, populated in the excitation step of the RIXS process.It yields qualitative agreement between the detected transitions for both considered functionals PBE and PBE0.Mainly the transition energies are not modeled correctly, i.e. the transition energies are underestimated for the PBE functional, which can also be seen from the values given in Table 1.
The transfer from single electron excitations to excited states with mixed excitation character in the TD-DFT framework only mildly affects the spectra for the PBE functional.Naturally, the use of the hybrid PBE0 functional in the frozen orbital approximation yields an overestimation of the transition energies as in this case the orbital energies are no longer a good approximation for the excited state energies.In contrast, the RSA-TD-DFT RIXS simulations for the PBE0 functional yield an accurate description of both transition energies, as well as peak intensities.

Application to electronic structure analysis at soft X-ray K-edges
To present additional cases, in which our simulation scheme can be used to investigate molecular electronic structure, we present results of the RIXS simulations for different molecules in the gas and liquid phase, as well as in aqueous solutions in Fig. 8.The experimental spectra for the different systems were extracted from the figures in the publications specified in the figure-caption, if not declared differently below.Exclusively, RIXS spectra for dominant excitation at the energetically lowest lying core excited state are investigated.The experimental spectra are shifted by the incident energy stated in the different studies to compare to the simulated spectra on an energy loss scale.The polarization of the exciting radiation with respect to the detection direction is accounted for through the angle w defined in eqn (7).The RSA-TD-DFT calculations were set up for each molecule including the relevant core-orbitals along with all occupied valence orbitals in the donor space, while the 20 lowest virtual orbitals were included in the acceptor space.
We consider scattering through core-excited states characterised by the 8a 0 orbital of methanol in the gas phase, both at the carbon and the oxygen K-edge based on the experimental data by Benkert et al. 55 The excellent agreement of both peak intensities and positions between the simulated and the experimental RIXS spectra allows for clear assignment of the detected transitions.As expected, the profile of the transition at an energy loss of 7 eV in the oxygen K-edge RIXS spectrum is not modeled correctly in our static RIXS model.As Benkert et al. concluded from their comparison to deuterated methanol, the RIXS transition is strongly affected by the dissociation process the |2a 00À1 8a 01 i state.In a subsequent study by Vaz da Cruz et al. it could be shown that the splitting of the aforementioned transition is caused by a substantial spectral contribution of  This journal is © the Owner Societies 2021 decay processes in the dissociated fragments, conserving the kinetic energy upon dissociation. 59Based on a fully quantumdynamical treatment of the dissociation processes the spectral contribution of the so called molecular band on the low energy loss side of the peak, corresponding to scattering in the intact molecule, could be separated from the quasi-atomic peak at the high energy loss side, which results from scattering to the electronic ground state of the dissociated fragments.Similar agreement is obtained for gas-phase water in the comparison between the experimental spectra upon scattering through the |1s O À1 4a 1 1 i state by Weinhardt et al., 56 who provided the experimental spectrum, and the theoretical simulations.Again the only qualitative agreement between the experimental and theoretical spectra results form the static treatment of the scattering process.In the comparison to deuterated water by Weinhardt et al. 56 and the following ultra high-resolution RIXS investigations, 2,19,60,61 it could be shown that ultrafast dissociation has a strong impact on RIXS intensity profiles at the |1s O À1 4a 1 1 i resonance and causes the same substructure of the lowest detected transition as in methanol through the contribution of the quasi-atomic peak.
For acetone, dimethylsulfoxide (DMSO) and acetonitrile presented by Dierker et al. 57 RIXS spectra are available for horizontal and vertical polarization, allowing us to evaluate the capability of simulating the polarization anisotropy according to eqn (7).The simulations consider solvation implicitly through a polarizable continuum model for the different liquids.The spectral signatures, as well as the polarization anisotropy are modeled excellently.Differences in peak positions can probably be ascribed to the neglect of explicit solvation and core-excited state dynamics in the simulations.
For aqueous ammonia we achieve qualitative agreement in comparison to the data by Weinhardt et al. 58 In their study both the peak shapes and relative peak intensities are strongly affected by deuteration of the system, reflecting the large impact of core-excited state dynamics on the spectrum.Also, hydrogen bonding effects can be expected to play an important role in the spectrum of ammonia, as already evidenced in the XAS, 62 which further accounts for the discrepancy.
Finally, we compare our simulations for excitation at the p*-resonance of the deprotonated nitrogen site in the imidazole ring of aqueous histidine in neutral conditions.The spectrum is extracted from the data set presented by Eckert et al. 6 The agreement between the experimental and the simulated spectrum is quantitative.Exclusively the vibrational progression at the elastic line at 0 eV energy loss is not modeled as it is the case for the systems discussed previously.
All presented cases reflect the need to consider explicit solvation and more importantly core-excited state dynamics to achieve quantitative agreement between the experimental spectra and the simulations.Ways to consider the dynamical aspect of the scattering process to model both the electronically elastic and inelastic transitions in the presented RSA-TD-DFT framework are discussed in the following section.

The role of core-excited nuclear dynamics
It is well established that RIXS signals are particularly sensitive to ultra-fast geometric distortions that can happen in the coreexcited states, 1 more strictly the RIXS profile is dependent on the difference between the potential energy surfaces between the states involved in the scattering process.Nuclear dynamics also often lead to violation of the electronic quadrupole selection rules in polyatomic systems. 1,63,64Furthermore, a growing effort is being devoted to the development of RIXS as a technique to study vibrational excitations and dynamics in molecules, 2,59,65,66 liquids and solutions, 10,67,68 as well as in solids. 11,69Therefore, it is important to discuss how nuclear dynamics effects can be incorporated into the framework discussed in the previous sections.This will be done by revisiting the high-resolution RIXS spectra of gas-phase H 2 O, 2 molecular Oxygen 66 and liquid acetone. 67The calculations will consider TD-DFT core-excited states computed with the PBE, PBE0 and M06-2X as a proxy systematic series on the increase of the fraction of HF exchange in the functional, from 0% to 25% and 56% respectively.Additionally, the equivalent core-hole approximation, henceforth called Z + 1, Fig. 8 Comparison between experimental K-edge RIXS of gas phase methanol 55 and water, 56 liquid acetone, dimethylsulfoxide and acetonitrile, 57 as well as aqueous ammonia 58 and neutral histidine (lowest p* core excited state) 6 and the results of the RSA-TD-DFT scheme to simulate electronic RIXS transitions.The experimental spectra are offset with respect to the simulations.The polarization of the incident X-ray radiation is considered through the angle w defined in eqn (7).The edges i.e. carbon, oxygen and nitrogen are abbreviated by their initials.
will be considered as a reference point, as it has been shown to be a robust and straightforward way of estimating core-hole induced relaxation. 70,71All vibrationally resolved spectra were computed using the time-dependent wave packet implementation of the Kramers-Heisenberg amplitudes as described by Vaz da Cruz et al. 59 Nuclear dynamics in gas-phase H 2 O Water is a prime example of the effect of nuclear dynamics on X-ray spectra.The vibrationally resolved spectra of water have been carefully studied in previous investigations, specifically excitations to different intermediate states lead to an interesting mode selectivity,2,60 namely excitation from the O 1s orbital into the 4a 1 valence orbital leads to an ultra-fast dissociation of the OH bond, while excitation to the 2b 2 orbital drives the system along the symmetric stretching coordinate.Although modecoupling is crucial for the correct description of the coreexcited dynamics in water, 2 it has been demonstrated by Eckert et al. 61 that in water the RIXS cross-section can be described by an effective one-dimensional Hamiltonian along the driven mode.We will adopt this approximation here.
In Fig. 9a the potential energy curve (PEC) along the OH bond of the water molecule, for the ground state (GS) and lowest core-excited state |O 1s À1 4a 1 1 i are shown for different functionals.A PEC computed within the Z + 1 approximation computed with the PBE0 functional and the high-quality RASPT2 potentials from ref. 2 and 19 are also shown.The curves were computed with a (1,4,20) orbital space using either a restricted or unrestricted Kohn-Sham ground state reference, denoted as RKS and UKS, respectively.The behaviour of the potential energy curves is qualitatively correct for the UKS calculations, up to the Coulson-Fisher (CF) point, [72][73][74] beyond this point unphysical kinks are observed due to spin-contamination in the ground-state reference determinant.
We observe a very strong sensitivity of the quality of the coreexcited potential energy curve on the choice of functional, with the behaviour ranging from a quasi-bound state up to the correct dissociative behaviour.In this context, the fraction of Hartree-Fock exchange included in the functional seems to be the main attribute responsible for the observed changes.The Z + 1 approximation, on the other hand, leads to a more robust behaviour of the PEC, with the caveat that it leads to an incorrect dissociation limit, when compared to the RASPT2 reference, due to spurious interactions with the additional electron in the core shell.
In Fig. 9b The computed vibrationally resolved RIXS spectra are compared to high-resolution experimental data from ref. 2 and 61.Although all functionals lead to a qualitatively correct spectrum two main factors seem to be the most disparaging, namely the intensity distribution of the vibrational progression and the position of the atomic-peak.The intensity distribution of the vibrational peaks is determined by the evolution of the nuclear wave packet in the core-excited state, being very sensitive to the gradient near the vertical transition point.Hence we see that the shallower potential computed by PBE leads to much lower intensity for higher energy vibrational losses and an absent atomic peak.On the other hand the steeper curve computed with M06-2X shows much higher intensity near the 44 eV losses, being actually over-estimated with respect to the RASPT2 reference.The spectrum computed with the Z + 1 approximation shows a better intensity distribution, however, as mentioned has an incorrect atomic-peak 2,19 position.The vibronic XAS spectra for each functional are shown in the ESI.† We turn our attention now to the second core-excited state of water, namely the one arising from excitation of the O 1s electron into the 2b 2 orbital, henceforth denoted by |O 1s À1 2b 1 2 i.The computed potentials are shown in Fig. 10.In this case, we have a bound core-excited state which is driven along the symmetric stretching coordinate q s , again we notice a large sensitivity on the functional choice, with the core-excited state minimum displacement being heavily affected by the HF exchange fraction, with a higher fraction of HF exchange leading to a larger core-excited state displacement.In this figure the curve labelled as Z + 1 refers to the lowest TD-DFT root computed for the ground state of the FH 2 equivalent core system.From the spectra shown in Fig. 10b we see that the resulting RIXS spectra are highly sensitive to the quality of the intermediate state potential.It should be noted that even though the core-excited PEC computed with M06-2X displays a significant shift, it leads to a qualitatively incorrect intensity distribution since the force constant of the potential is too high.This is because the RIXS spectrum is highly sensitive to lifetime vibrational interference (LVI) effects. 1,75The spectrum computed with the Z + 1 approximation in this case is still superior to the TD-DFT ones, however it is still too steep and shows a larger displacement than the RASPT2 reference.It should be added that for simplicity of comparison, the bending mode was neglected in the simulations, which accounts for the missing resonances seen between the stretching peaks in the experimental spectrum.The vibronic XAS spectra for each functional are shown in the ESI.†

Molecular oxygen
We now focus on molecular oxygen, which was the first molecule to be measured with enough resolution to identify individual vibrational peaks in the RIXS spectrum. 66Fig. 11a shows the potentials computed for the GS and the core-excited  state arising from excitation from the 1s u to the half-filled 1p g orbital, denoted here by |1s u À1 1p g +1 i.We observe a reverse trend from the calculations for gas-phase water, where the pure functional PBE leads to the largest core-excited state displacement, while the M06-2X functional leads to the smallest.The Z + 1 leads to the most reasonable result in this case, showing a displacement very close to the one determined experimentally from the vibrationally resolved XAS. 76The behaviour of the PECs is clearly reflected in the RIXS spectrum.We see that all the TD-DFT potentials computed under-estimate the length of the vibrational progression.In contrast, the spectrum computed using the Z + 1 PEC leads to the most robust result, with respect to progression length and intensity distribution.The vibronic XAS spectra for each functional are shown in the ESI.† Excitation of the CQ Q QO stretching in acetone As a last example we examine the high-resolution RIXS spectrum of liquid acetone, which was first investigated by Sun et al. 67 Here we will consider the decays to the ground state and to the first excited state.Fig. 12a shows the potentials computed for the GS, lowest valence excited state and the |O 1s À1 p* 1 i core-excited state along the CO stretching coordinate q CO .In terms of the coreexcited displacement along the CO stretching coordinate, we see a similar trend to O 2 , where the magnitude of the displacement decreases with the fraction of HF exchange in the functional, with PBE yielding the largest geometric distortion.Once again, the Z + 1/PBE0 approximation leads to a reasonable result, and is a significant improvement over the RKS/PBE0 curve.The valence excited state for the hybrid functionals PBE0 and M06-2X was found to be rather similar, in contrast to the PBE functional, which leads to a shallower PEC.Similar behaviour is seen for the GS PEC.
Analysing the experimental and theoretical RIXS spectra in Fig. 12, we see that good agreement is reached for the spectra computed with Z + 1/PBE0 and PBE, both in terms of vibrational progression length and intensities, as well as the asymmetry of the lowest electronic band.Here it should be noted that all softmodes were neglected in the calculations, however a 0.075 eV HWHM broadening was added to the inelastic band, as deduced in ref. 67.The calculations using PBE0 and M06-2X lead to unsatisfactory agreement, with progressions that are too short, as well as an incorrect profile asymmetry for the inelastic band.It is also noteworthy to mention that the inclusion of the vibrational motion greatly improves the peak ratios between elastic and inelastic bands, initially computed for the low-res spectrum in Fig. 8.The vibronic XAS spectra for each functional are shown in the ESI.†

Conclusions
We have explored the application of RSA-TD-DFT to the simulation of RIXS spectra at the K-edge of light elements.The quality of the obtained spectra is near quantitative on the energy loss scale, in spite of the notoriously large errors associated with TD-DFT X-ray absorption transition energies.The convergence of the RIXS spectrum with respect to the truncation used in the RSA is found to be rapid, as also observed for UV-vis transitions. 29oreover, the RSA enables a consistent description of both coreand valence-excited states.This set of states can be used, in future applications, to simulate full RIXS planes and intermediate-state interference can be treated intrinsically.
The simulations of purely electronic RIXS transitions in the GS molecular geometry, within the described framework, are computationally inexpensive.This allows the simulation of molecules of medium size including important effects, such as hydrogen bonding interactions and quantum nuclear dynamics, which are more challenging to tackle within wave function based theories.The RSA can be set up in an automatized way without the necessity of expert-designed orbital spaces.Furthermore, the low computational cost also enables investigations in solution phase where sampling over fluctuating solvated structures might be important.
From the analysis of the functional dependence of the results it was found that global-hybrids lead to very good peak positions, on the energy loss scale, and we found PBE0 to be reasonably applicable across a wide range of systems.The functional choice becomes more nuanced when it comes to studying nuclear dynamics and high-resolution RIXS spectra.The results seem to indicate that 1s excitations to unoccupied orbitals of s character benefit from a higher fraction of Hartree-Fock exchange, while the opposite is observed for excitations into unoccupied p orbitals, which improve with a reduction of the amount of HF exchange.Nevertheless, the use of the Z + 1 approximation was found to be a more robust method of estimating core-induced nuclear dynamics at the DFT level, and can be efficiently combined with the transition dipole moments and final state potential energy surfaces computed at the RSA-TD-DFT level.In the present work we restricted the analysis to widely available functionals, but we expect that the application of shortrange corrected functionals 77 aimed specifically at X-ray spectroscopy could prove a worthwhile direction of investigation.
We envisage that the method described can become an additional tool in the fast-growing field of solution phase RIXS experiments.It can be easily implemented in most computational packages on the already existing TD-DFT routines, since it relies only on the ground state Kohn-Sham orbitals and a subspace restriction of the standard linear response equations.The low computational cost and ease of set-up allow non-expert users to simulate RIXS for both interpretative and predictive purposes.

Fig. 2
Fig. 2 Diagram of the constrained orbital spaces used in the TD-DFT based RIXS simulations.

Fig. 4
Fig. 4 Explicit solvation.RIXS simulations for 2-TP and 2-TP À with a polarizable continuum model and explicit solvation with three water molecules.The theoretical spectra are compared to the experimental data from ref. 14.

Fig. 5
Fig.5Comparison between different functionals used in the presented TD-DFT RIXS scheme in a constrained orbital space(1,30,20) with one N 1s core, 30 occupied valence and 20 virtual orbitals for the molecules 2-TP and 2-TP À .The theoretical spectra are compared to the experimental data from ref.14.

Fig. 6
Fig. 6 Impact of the orbital restriction on the simulated X-ray spectra in comparison the experimental data for 2-TP from ref. 14 and 54.(a) Comparison between the conventional TD-DFT XAS scheme (1,0,À1) including one N 1s core-orbital and all virtual orbitals to generate the roots and the proposed constrained orbital space (1,N o ,N u ) including in contrast N o occupied valence and N u virtual orbitals.The theoretical spectra were shifted by 11.25 eV to overlap the p*-resonances of 2-TP with experimental partial fluorescence yield XAS spectra.(b) RIXS simulations for the spaces with a restricted number of unoccupied acceptor orbitals N u discussed in (a).(c) Impact of restrictions of the number of donating occupied orbitals N o in the RIXS simulations.

Fig. 7
Fig.7Performance of the presented TD-DFT RIXS scheme using the(1,30,20) space and in comparison to a RIXS scheme in the frozen orbital approximation for the functionals PBE (a) and PBE0 (b).The spectra are simulated for scattering through N 1sp* state of 2-TP and 2-TP À .The experimental data is taken from ref.14.

Fig. 9
Fig. 9 (a) Potential energy curves along the OH bond of water for the ground state (bottom) and |O 1s À1 4a 1 1 i core-excited state computed employing different functionals and methods.For comparability, the vertical transition point of all curves were matched to the one of the RKS/PBE0 PEC.The vertical transition point is marked by a dashed gray line, while the CF point is marked by a red dashed line.(b) Experimental vibrationally resolved RIXS spectrum of water 2 along with the theoretical spectra computed with the respective potential curves displayed in panel (a).

Fig. 10 (
Fig. 10 (a) Potential energy curves along the dimensionless symmetric stretching coordinate of water for the ground state (bottom) and |O 1s À1 2b 1 2 i core-excited state computed employing different functionals and methods.For comparability, the vertical transition point of all curves were matched to the one of the RKS/PBE0 PEC.The vertical transition point is marked by a dashed gray line.(b) Experimental vibrationally resolved RIXS spectrum of water 2 along with the theoretical spectra computed with the respective potential curves displayed in panel (a).

Fig. 11 (
Fig. 11 (a) Potential energy curves along change of internuclear distance in O 2 for the ground state (bottom) and |1s u À1 1p g +1 i core-excited state computed employing different functionals and methods.For comparability, the vertical transition point of all curves were matched to the one of the RKS/PBE0 PEC.The vertical transition point is marked by a dashed gray line.(b) Experimental vibrationally resolved RIXS spectrum of oxygen 66 along with the theoretical spectra computed with the respective potential curves displayed in panel (a).

Table 1
Dependence of the calculated final state energies for the most intense emission line of the explicitly solvated 2-TP À on the chosen exchange correlation functional in comparison to the experimental value.Values for a CPCM-only solvent model and the frozen orbital approximation are also stated xc-funct.e f À e 0 [eV] xc-funct.e f À e 0 [eV] xc-funct.e f À e 0 [eV]

Table 2
Number of roots needed to reach the lowest N K-edge coreexcited state for 2-TP using the def2-TZVP(-f) basis set.The first line refers to the case where no restrictions are imposed