{'fraction_non_alphanumeric': 0.03266480160762836, 'fraction_numerical': 0.009358130738011741, 'mean_word_length': 4.831016657093624, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Nonequilibrium Solvent Polarization Effects in Real-Time Electronic Dynamics of Solute Molecules Subject to Time-Dependent Electric Fields: A New Feature of the Polarizable Continuum Model

We develop an extension of the time-dependent equation-of-motion formulation of the polarizable continuum model (EOM-TDPCM) to introduce nonequilibrium cavity field effects in quantum mechanical calculations of solvated molecules subject to time-dependent electric fields. This method has been implemented in Octopus, a state-of-the-art code for real-space, real-time time-dependent density functional theory (RT-TDDFT) calculations. To show the potential of our methodology, we perform EOM-TDPCM/RT-TDDFT calculations of trans-azobenzene in water and in other model solvents with shorter relaxation times. Our results for the optical absorption spectrum of trans-azobenzene show (i) that cavity field effects have a clear impact in the overall spectral shape and (ii) that an accurate description of the solute shape (as the one provided within PCM) is key to correctly account for cavity field effects.


INTRODUCTION
The electronic and optical properties of a molecule embedded in a dielectric environment, such as a solvent, can be substantially different from those of its gas-phase counterpart. The presence of the molecule induces a polarization in the surrounding that in turn interacts with the molecule itself via the so-called reaction field. Additionally, if the molecule is subject to an external electric field, the effective field acting locally on the molecule (namely, the cavity field) contains another polarization contribution of the environment due to the applied field. 1 Hence, when simulating a solvated molecule interacting with any electromagnetic perturbation (e.g., light), both the reaction and cavity field effects must be considered.
A suitable framework to account for polarization effects in quantum-mechanical calculations of molecules surrounded by a dielectric environment is the polarizable continuum model (PCM). 2−5 Within PCM, (i) the environment is regarded as a continuum and infinite dielectric medium featuring a frequency-dependent dielectric function; (ii) the molecule is treated explicitly, that is, by considering its atomic structure, and generally within quantum mechanics; (iii) a void cavity hosts the molecule, conforming with its shape and separating it from the dielectric environment by a sharp interface; and (iv) the reaction-and cavity-field polarization of the medium are described in terms of apparent surface charge (ASC) densities sitting on the cavity surface that are induced by the molecule and the applied electric fields, respectively.
The PCM formulation can accommodate nonequilibrium effects in the molecule-environment dynamics when shifting from the electrostatic 2,5 to the time-dependent quasi-electrostatic 3,6−9 regime. However, until recently, nonequilibrium features were only accessible through the sudden excitation approximation, where the molecular density changes abruptly from the ground to the excited state. In response to this sudden excitation, the solvent degrees of freedom are crudely divided in two groups: the "slow" ones that are fully unable to adapt to the molecular density rearrangements, and the "fast" ones that follow instantaneously the molecular density evolution. Although, this slow/fast splitting of the environment polarization contributions represents a qualitatively correct scheme to treat nonequilibrium polarization effects, it neglects the fact that even the slow environment polarization (albeit dominated by its inertial character) has a finite relaxation time and can as well adjust to the molecular excitation in the long term. 2 Currently, a computationally convenient time-dependent extension of PCM (TDPCM) has made possible to study the real-time evolution of the molecular density subject to time-dependent quasi-electrostatic perturbations, together with the polarization of the external medium. 10−13 Such a TDPCM scheme introduces polarization fields that are history-dependent and not instantaneously in equilibrium with the molecule or the applied fields. These nonequilibrium polarization effects arise ultimately from the frequency-dependent dielectric function describing the environment, and they are physically linked to the fact that the environment takes a finite amount of time to react in response to the electrostatic perturbations, that is, the molecular density fluctuations and the applied fields. Mathematically, this formulation can be cast in terms of a set of equations of motion (EOM) for the ASCs dictating the evolution of the medium polarization in real-time. In the case of solvated molecules, EOM-TDPCM has been formulated for the reaction field; 13 however, a similar account for the cavity field is still missing.
On a different note, even though treating the reaction field within the quasi-electrostatic regime is generally pertinent, an equivalent description of the cavity field does not apply, in principle, when a molecule surrounded by a dielectric medium is irradiated with light. To overcome this limitation, in ref 14, cavity field effects have been rigorously tackled within classical electrodynamics, by using the full set of Maxwell equations to describe the cavity modification of electromagnetic fields traveling in a medium when impinging a vacuum cavity. Notwithstanding, under convenient gauges and the relevant long-wavelength limit, 14,28 the electrodynamics result has been brought to match the standard PCM account of the cavity field effects, 3−5 where an effective dipole of the embedded molecule interacts with the time-dependent electric field of the light wave.
The aim of this paper is to present an extension of EOM-TDPCM to consider nonequilibrium cavity field polarization effects for molecules embedded in an homogeneous dielectric medium, such as a solvent. This contribution represents a step further in considering more realistic solvent polarization effects. Nonequilibrium cavity field effects may impact, strongly and nontrivially, the electronic and optical properties obtained from real-time quantum mechanical simulations of solvated molecules, especially when at least some of the solvent degrees of freedom relax in a short time scale (0.1−1 of ps). Cavity field effects treated within the PCM framework enable us to consider in a more realistic manner complex molecules, where the solute shape departs strongly from symmetric shapes (such as a sphere or an ellipsoid) and furnishes quantitative an qualitative improvement over some standard descriptions for the cavity field, such as Onsager's model.
To show the potential of our methodology, we perform realspace real-time time-dependent density functional theory (TDDFT) simulations of solvated trans-azobenzene to assess the influence of the cavity field in the optical spectrum and time-dependent properties. The molecule of choice does not have spherical symmetry and is largely anisotropic. As a consequence, some of its relevant excited states feature transition dipoles oriented along different directions. trans-Azobenzene is, therefore, a good candidate to emphasize the nontrivial role of cavity field effects in changing the optical spectrum shape. We present results for the molecule immersed in water. Furthermore, to highlight the role of nonequilibrium cavity field effects, we provide comparison between the results obtained for the molecule solvated in water and in different fictitious solvents with faster orientational relaxation.
The present account is organized as follows. In section 2, we recall the PCM theory of cavity field effects for a molecule embedded in a dielectric environment. Section 2.1 is devoted to the electrostatics formulation of cavity field effects. In section 2.2, we extend the latter to tackle the case of timedependent electric fields in the long-wavelength limit and using the length gauge for the case of a molecule in solution. Section 2.3 introduces time-dependent quantum mechanics for electrons in a solvated molecule subject to an external electric field. Section 2.4 focuses on a specific time-dependent quantum-mechanics treatment, namely, real-time TDDFT (RT-TDDFT). In section 2.5, we obtain the expression for the full photoabsorption cross-section spectrum for solvated molecules, emphasizing cavity-field contributions and the ways to account for them through real-time propagation of an effective molecular dipole. Sections 2.2 and 2.5 are specific for the case of solvent, while the rest are rather general for any medium considered. In section 3, we present the computational details (section 3.1) and the results for the optical absorption spectra (section 3.2) of trans-azobenzene in water. Section 3.2 focuses on the cavity field and nonequilibrium cavity field effects in the optical absorption spectrum of transazobenzene. Finally, in section 4, we summarize the relevant points of the Article, and we stress the potential of our methodology for future and more accurate studies of molecules in solution.

PCM THEORY OF CAVITY FIELD EFFECTS
2.1. Electrostatics. Let us consider a static electric field applied to the solution. Far from the vacuum cavity hosting the solute, the dielectric representing the solvent is homogeneous and the electric field there is the Maxwell f ield, F M . 15 Close to and within the solute cavity, the electric field is locally modified by the presence of the cavity itself. Any distribution of charges placed inside the cavity (e.g., a molecule) is affected not only by the Maxwell field as if it were applied in an homogeneous medium but also by the medium polarization because of the cavity boundary. The effects of such electric field contribution supplementing the Maxwell field are called cavity field effects. To treat them within a PCM framework, one defines an effective electrostatic potential. 14 Such effective applied potential (that includes cavity field effects) acting on any distribution of charges, v C (r) to keep the nomenclature of ref 14, is the solution of a generalized Laplace problem, where the dielectric constant is position-dependent, with boundary conditions at the cavity surface and far from it (see refs 1, 2, and 5). The latter generalized Laplace problem can be equivalently written as a generalized Poisson problem, considering a fictitious distribution of charges ρ M (r) placed outside the vacuum cavity (however far from it) as the source of the Maxwell field. The PCM framework, 2 in particular, in its integral equation formalism (IEF) approach 16 allow us to solve this kind of Poisson problem. Ref 16 shows a detailed IEF-PCM formulation in the reaction field case that we followed thoroughly to obtain an analogous account for the cavity field case.
As it is customary within PCM framework, we split the solution of the aforementioned Poisson problem into two contributions, namely, 17 Here, the first contribution, v M (r), is the potential associated with the Maxwell field, whereas the remaining term, v cf (r), represents a polarization potential that solves the Laplace equation inside and outside the cavity and fulfills the boundary conditions from the original Poisson problem. Thence, v cf (r) is a so-called layer potential that can be written in terms of ASC density σ cf (r) located at the interface Γ, that is where dA(s) is the surface area element corresponding to s ∈ Γ. 2,16 Within the numerical strategy known as boundary element method (BEM), we consider a discrete (but fine) tessellation of the cavity surface and approximate the latter as 2 cf 1 cf tess tess (3) where N tess is the number of elements (tesserae) in Γ's tessellation, whereas s j , A j , and q cf j are the position, the surface area and the polarization point charge associated with the ith tessera.
IEF-PCM equations for the polarization charges {q cf j } in terms of the potential that induces them can be written as 2,16 (4) or in matrix form, , with j, k = 1, ..., N tess , is the PCM response matrix depending on the cavity shape, the tessellation of its surface, and the dielectric constant of the medium. 2,16 To get the cavity field PCM response matrix starting from our partition 1, we follow an analogous derivation to that laid down in ref 16 to obtain the reaction-field PCM response matrix. It yields with j, k = 1, ..., N tess , and n(s k ) is a unitary normal vector to the k-th tessera, pointing outward from the cavity. Matrices  i/e and  i/e are the BEM representation of Calderon operators in the IEF. 16 Heretofore, we have introduced very general definitions and, in particular, we have not assumed that the dielectric constant for the external medium is positionindependent, as it is for a typical solvent. Indeed any inhomogeneous external dielectric medium, with a positiondependent dielectric constant of its own, can be tackled in the same way provided that the  e and  e matrices are known, which is to say that the Green's function of the external generalized Poisson problem were found. 2,16 Particularizing to the solvent case, the PCM response matrix takes the form The cavity field PCM response matrices 5 and 7 differ from their reaction-field counterparts by two sign changes: one to the full expression and another one affecting the term   i inside the second (noninverted) bracket; both "−" for reaction-field and "+" for the cavity-field case (cf., eq 3 in ref 13). PCM response matrices for the reaction-and cavity-field cases are different because the source charges inducing the medium polarization are located in different regions of the space in each case, that is, inside the vacuum cavity for the reaction field and outside (in the external medium) for the cavity field.
Partition 1 is not the only starting point to solve the original generalized Laplace problem for the applied electrostatic potential within the PCM framework. In Appendix A.1, we develop, for a different partition, an alternative derivation to cavity field effects within PCM.
2.2. Electrodynamics in the Long-Wavelength Limit. In the previous section, we considered the static polarization response of a dielectric medium with a vacuum cavity due to an externally applied electrostatic field. Here, we study the dynamic polarization response of the medium because of a time-dependent electromagnetic field. This can be, for example, the electromagnetic field associated with a monochromatic light pulse probing the molecule in a specific spectroscopy.
Far from the cavity, in the solvent bulk, the electric field is again that proper for an homogeneous medium and is defined as the Maxwell field. Close to the molecule, we work in the long-wavelength limit and under the length-gauge, 14 so that locally the scalar Maxwell potential can be written as in the frequency domain. Within these assumptions, we may solve the generalized Poisson problem in the frequency domain, considering the complex dielectric function dependence on the frequency, that is, ϵ(r;ω) . We solve the latter by means of the PCM eq 4 and the polarization potential (eq 3). Let us focus on an external medium with the characteristics of a solvent (i.e., position-independent dielectric constant). In such a case, the PCM response matrix  ω ( ) cf is known in terms of the frequency-dependent dielectric function of the external medium (eq 7 with ϵ → ϵ(ω)). Hence, the PCM eq 4 holds in the frequency domain as To obtain the time-dependence of the polarization charges, we have to Fourier transform the latter PCM equation, that is, 13 The former expression is central in this work and reflects the physical meaning of the nonequilibrium cavity field effects. It shows that cavity field polarization chargesand therefore, the cavity fielddepend upon the full previous history of the Maxwell potential and not just on its values at the current time.

Journal of Chemical Theory and Computation
Article Debye EOM for the Cavity−Field Polarization Charges. In the case of a solvent described by Debye's dielectric model, the evolution of cavity field polarization chargesgoverned by the latter expressionscan be reformulated in terms of an EOM. Such EOM was derived by Corni, Pipolo, and Cammi in ref 13 for the reaction-field polarization charges. It is also valid for the cavity field polarization charges once the molecular potential is replaced by the Maxwell electric field and the proper propagation matrices are obtained from the new form of the PCM response matrix, see eq 7.
We recall that Debye's model represents the dielectric medium by a set of freely rotating point-like dipoles whose orientation is determined by random collisions and by the applied electric field. 19 Therefore, Debye's model captures the polarization response of the medium to an electric perturbation due to the orientational relaxation of the solvent molecules. Within Debye's model, the external medium is characterized by the complex dielectric function where τ D is the so-called Debye relaxation time, which is a physical measure of how fast the dielectric environment can adapt to the changes of the potential it is subject to. Mathematically, it interpolates between the static and dynamic dielectric constants in the limit of small and large relaxation time, ϵ 0 and ϵ d , respectively. The resulting EOM for the cavity field polarization charges in the Debye case is where Λ and τ are diagonal matrices. The only changes in the EOM propagation matrices for the cavity field with respect to reaction-field case (cf., ref 13) are located in the definition of  ϵ ( ) cf in eq 12; more explicitly, they are sign changes (i) to the full expression ("+" for "−"), and (ii) to the matrix Λ in the noninverted bracket ("−" for "+"). For a propagation with a finite Maxwell field switched-on at the initial time t = 0, q(0) = 0. If we consider a medium with an infinite relaxation time, we get The case of a Dirac delta time-dependence is special and it deserves a separated treatment (see Appendix A.4). Finally, the time-dependent equivalent of eq 3 is 2.3. Time-Dependent Quantum Mechanics. The timedependent effective electronic Hamiltonian of a molecule embedded in a dielectric environment and interacting with a probing electric field in the long-wavelength limit, using the length gauge and within the PCM framework is 14 is the Hamiltonian of the embedded molecule in absence of external fields, collecting the isolated molecule (in vacuo) Hamiltonian and the interaction with the polarization of the surrounding medium due to the molecule itself (reaction field). On the other hand, V̂C(t) = V̂M(t) + V̂c f (t) describes the interaction with the total electrostatic field acting on the molecule, including the interaction with the bare external field in the dielectric medium (Maxwell field) and with the polarization of the medium due to the applied electrostatic field (cavity field term). As long as the nuclei are fixed, the isolated molecule Hamiltonian Ĥm ol is time-independent. The time-dependent interaction Hamiltonian can be written as (16) where N e and {r i } are the number of electrons of the molecule and their position operators, respectively. Notice that the timedependent reaction-field potential, v rf (r,t), depends on the time-dependent molecular potential at any earlier time t′ < t. 2,13 These time-dependencies can be taken into account altogether by means of an EOM for polarization charges equivalent to that in eq 11 that only depends on the molecular potential at current times. 13 In eq 17, ρ mol (r,t) is the time-dependent molecular charge density, collecting electronic and nuclei contributions. 2 2.4. RT-TDDFT. In this Article, the quantum-mechanical description of the molecule embedded in a dielectric medium and interacting with an external electric field (including reaction and cavity field effects) is tackled at the level of DFT 20 and TDDFT. 21 Particularly, we use the Kohn−Sham (KS) approach within DFT, 22 justified by the Hohenberg−Kohn theorems, 23 and its time-dependent extension within TDDFT, justified by the Runge-Gross 24 and the van Leeuwen 25 theorems.
We start from the time-independent KS equations 20 and {ψ i (r,t)} are the time-dependent KS Hamiltonian and molecular orbitals, respectively, whereas ρ(r,t) is the timedependent electronic charge density. The adiabatic approximation for the exchange and correlation term of KS Hamiltonian is usually assumed, that is to say that ĥm ol (t) is a functional of the density at the current time, that is, ĥm ol [ρ(r,t)]. 21 However, the reaction-field term, v rf [ρ] (r,t), is instead intrinsically diabatic and it depends on the density at earlier times. 2 Provided that the solution for the starting time t = 0 is known, the propagation scheme 26 solves eq 20a. Within RT-TDDFT schemes using the adiabatic approximation, the initial KS orbitals are obtained from the time-independent KS equation (see eq 18a), that is, ψ i (r, 0) = ψ i (r).
2.5. Optical Absorption Spectrum of a Solvated Molecule. In this section, we find the photoabsorption cross-section of a solvated molecule, aiming at including and singling-out cavity field effects. In addition, we assume an electromagnetic plane wave impinging on the system as the source of photoabsorption processes. Furthermore, we assume to be in the long-wavelength limit (within the length-gauge) and in the linear regime. 27 The intensity of a monochromatic electromagnetic radiation with frequency ω traveling in a nonmagnetic medium is 28 where F M (ω) is the amplitude of the Maxwell field and n(ω) is the refraction index of the medium. We recall that Within our framework of assumptions, the rate of energy dissipation of a monochromatic electromagnetic radiation applied to the system can be written as 28 where ρ mol (r,ω) is the charge density of the molecule induced by the total potential v C (r,ω), both in the frequency domain (i.e., Fourier transformed from ρ mol (r,t) and v C (r,t), respectively), collecting the Maxwell and cavity field terms. Finally, the photoabsorption cross-section is the ratio between eqs 23 and 22, yielding Using partition 1 and v M (r,ω) = −F M (ω)·r in eq 24, we get where d mol cf (ω) is the dipole of the molecule induced by the total potential in the frequency domain. By incorporating a superscript "cf", we emphasize that the latter includes implicitly cavity field effects, but it is not the only source of them in the cross-section spectrum. We now focus on the term Σ cf (ω), which is the contribution to the cross-section coming from the polarization of the medium because of the Maxwell field and, henceforth, accounts explicitly for further cavity field effects. Using the expression of the potential v cf (r,ω) in terms of its sources σ cf (r,ω), we can write where v mol (s,ω) is the Fourier transform of the quantity defined in eq 17. The polarization charge density due to the Maxwell field, σ cf (s,ω), is a linear function of the Maxwell field, F M ; therefore, by applying Euler theorem for linear functions, we get 14 Using eq 27, we may write the complete cross-section as where d̅ mol (ω) = d mol cf (ω) + d(ω) is the effective induced dipole of the solvated molecule (external dipole in Onsager's nomenclature 1 ). We recall that the cross-section of a molecule without cavity field effects can be obtained from eq 24 replacing v C (r,ω) by v M (r,ω), yielding where d mol (ω) is the molecular dipole induced by the Maxwell field.
Notice that we can write the induced dipoles as where α ω ( ) is the frequency-dependent first-order polarizability tensor. The first superscript labels the observable under examination and the second superscript keeps track of the magnitude coupled with the perturbator. 21,29 In eqs 31a and 31b, we monitor different observables, namely, the induced molecular and effective dipole (second superscript d and d̅ , respectively), considering different interaction Hamil-

Journal of Chemical Theory and Computation
Article tonians as a perturbation, that is, V̂M(t) = −dm ol ·F M (t) and V̂C(t) = −d̂̅ mol ·F M (t) (first superscript d and d̅ ), respectively. In eq 31b, we fully consider cavity field effects, whereas in eq 31a, we do not.
From eqs 29 and 31b, we get for the cavity field case Performing an orientational average over all the possible field orientations, we get Analogously, for the case without cavity field effects, we have The key quantities in the optical spectra of eqs 33 and 34 are the polarizability tensors α ω ( ) dd and α ω ̅ ̅ ( ) d d with and without cavity field effects, respectively. The polarizability tensor components may be written as Particularly, we are interested only in the diagonal terms, since such are the components relevant for a photoabsorption cross section spectrum obtained from unpolarized light (see in eqs 33 and 34). We stress that d(ω) and d̅ (ω) are induced dipole moments, not permanent ones. We can write them using the Fourier transform from the time-domain as To obtain the optical spectrum, an impulsive electric field independent of the position and with a Dirac delta timedependence, that is, F M (r, t) = F M 0 δ(t) is often employed as a perturbator of the system. Being frequency-independent, the latter field is suitable to perturb equally all the dipole-allowed excitations of the system. Using this kind of external (Maxwell) electric field, we get the full expression for the polarizability tensor components as The time-dependent effective and bare molecular dipole moments are written as where d mol cf (t) is also computed from eq 38b in the case of a cavity-field time-dependent simulation, and The time-dependent convolution in eq 39a is unsuitable for an implementation due its high computational cost. Therefore, to compute this part of the cavity field contribution to the optical absorption spectrum we follow a different approach stemming from an alternative partition for the total electrostatic potential (see Appendix A.1, cf., eq 1), and described in the Appendix A.2.

RESULTS
3.1. Computational Details. To illustrate the operation of our methodology accounting for nonequilibrium cavity field effects within TDPCM, we perform RT-TDDFT simulations and compute the optical absorption spectrum of a case-study solvated system. We choose azobenzene in its trans configuration as a solute molecule. trans-Azobenzene geometry is planar, and it was optimized in vacuo at the DFT level. We work under the adiabatic local density approximation (LDA), and we use standard pseudopotentials consistent with the LDA exchange-correlation functional. The solvent is described using a Debye dielectric model with parameters τ D = 3.37 ps, ϵ 0 = 78.39, and ϵ d = 1.776, mimicking water. 30,31 We perform as well linear response TDDFT (LR-TDDFT) calculations of trans-azobenzene in vacuo to obtain the first-excited state transition dipole moment (TDM). To that aim, all the singleparticle transitions in an energy window of ∼10 eV about the Fermi energy are considered. Molecule-solvent interactions via the reaction field are always taken into account, regardless of the inclusion of cavity field effects or not. To carry out all computations, we use a modified version of Octopus (version 8.0) 32 (see Appendix A.5 for details on the implementation).
In our calculation, the real-space grid is built from interlocking spheres of 5 Å of radius centered at the atomic positions, with a spacing between grid points of 0.18 Å. The real-time simulations were performed for 15 fs with a time step of 1.5 as. We start the propagation of the KS orbitals from the ground state after applying a weak and impulsive external electric field with an amplitude of ∼5 × 10 −3 a.u.

Optical Absorption Spectrum with Cavity Field Effects.
In this section, we present the results for the optical absorption spectrum of trans-azobenzene in vacuo and in aqueous solution, focusing on cavity field effects.
As anticipated, we obtain the optical absorption spectrum of the solvated molecule by applying an impulsive electric field oriented along each of the three Cartesian directions. The averaged photoabsorption cross-section is calculated using eqs 33 and 34, respectively, if we consider cavity field effects or not. α ω ̅ ̅ ( ) In Figure 1, we show the results for the optical absorption spectra (strength function ∝ cross-section) for the molecule in vacuo and in solution, with and without cavity field effects. The first two panels contain the absorption spectra using an electric field in the plane of the molecule (see Figure 2). In the last panel, we plot the mean value of the absorption spectra in the three Cartesian directions.
In addition to the RT-TDDFT computations, we perform a LR-TDDFT calculation in vacuo to obtain the TDMs corresponding to the selected transitions A an B indicated in the lower panel of Figure 1. The TDM associated with the first optically active excited state (namely, transition A), can be directly computed from LR-TDDFT results, using the appropriate transition density, as d 0A = ∫ ρ 0A (r)r dr. (We drop the subscript "mol" for the sake of simplicity.) However, LR-TDDFT and RT-TDDFT spectra differ substantially in the high-frequency region, making difficult to match the absorption peaks and hence the underlying excitations. Therefore, to get the TDM associated with the high-energy transition B, d 0B , we follow a different path. To find the magnitude of d 0B , we use the fact that ratio between absorption peak strengths is where ΔE 0A and ΔE 0B are the excitation energies corresponding to excitations A and B, respectively, and α indicate Cartesian components x, y, z. We extract ΔE 0A and ΔE 0B from the average absorption spectrum (see Figure 1 bottom panel), whereas f AB,α is taken from the absorption spectra with the field along α direction (see Figure 1 top and middle panel for α = x, y); both quantities are obtained from RT-TDDFT calculations.
Using, in addition, the LR-TDDFT result for d 0A , we obtain | d 0B |. To get the direction of d 0B , that is, d 0B /|d 0B |, we use RT-TDDFT results directly. We extract the optical absorption cross section matrix Σ ij at the energy of the transition B, and we diagonalize it. For a nondegenerate band, we expect just Figure 1. Absorption spectra of trans-azobenzene in vacuum (black lines) and water. The case with (without) cavity field effects is represented with red (blue) lines. For the first two panels, the impulsive electric field is parallel to the plane of the molecule (see Figure 2). The bottom panel shows the absorption spectrum averaged over the three Cartesian directions of the field (eqs 33 and 34).

Journal of Chemical Theory and Computation
Article one eigenvalue diff erent from zero, and since 21,33 the normalized eigenvector associated with the nonzero eigenvalue would set the direction for the TDM, d 0B . If in turn the band is almost degenerate, we can still find the TDMs with the largest contributions to the absorption by diagonalizing the cross-section matrix and taking the eigenvectors associated with the highest eigenvalues. In our case, we find at least two possible directions for the B band TDMs that we will call B 1 and B 2 transitions. Results for A, B 1 , and B 2 TDMs are reported in Table 1. Figure 2 shows a schematics of trans-azobenzene molecule along with the TDMs corresponding to A, B 1 , and B 2 excited states.
Returning to Figure 1, first, we observe a red shift in the absorption peaks of the solvated molecule with respect to its gas-phase counterparts. The latter is an expected reaction field effect. Cavity−field effects might induce shifts in the spectrum when the solvent dielectric function dispersion in the absorption frequency region is large. In this case, the red and blue ends of an absorption band are affected differently by the cavity field effect, and the band would be deformed. Such a strong dispersion is however not the case for common solvent, and we do not expect shifts associated with cavity field effects.
Second, we check that the cavity field effects change not only the absolute but also the relative strength of absorption peaks, therefore impacting in a nontrivial way on the absorption spectrum. To assess cavity field effects for trans-azobenzene in solution in a quantitative way, we compare our results for the cavity field factor (CFF) with the prediction by Onsager model, which considers the molecule as hosted by a spherical cavity. 1 We select two representative optically active transitions (called A and B in Figure 1) and we compute the CFF directly from the spectra for transitions A and B (we refer to it as "PCM" CFF or just CFF), using (41) and through the Onsager analytic formula, that is, The results are reported in Table 2. Notice that not only there is a substantial quantitative departure from Onsager prediction for both A and B transitions, but also there is a strong dependence of the CFF on the specific transition that is overlooked by Onsager model.
Since the Debye dielectric function for water is almost constant in the ultraviolet and visible (UV−vis) spectrum, neither the PCM (eq 41) nor Onsager CFF (eq 42) are able to bear any frequency dependence through the dielectric constant. The reason for the CFF difference for transitions A and B is instead explored in the next section.
Anistropic Cavity Field Effects. Keeping the dielectric function as a constant, the ultimate cause for the disagreement between PCM and Onsager model comes from the fact that the solvent−molecule interface cannot be adequately modeled by a spherical surface for the molecule in question (see Figure  2). In the Onsager (spherical) model, the electric field acting on the molecule (cavity field) is increased by the same amount independently on the polarization direction and the frequency. Therefore, cavity field effects treated in such fashion, provide equal enhancement of the strength of every peak in the average absorption spectrum (cf. lower panel in Figure 1). If we consider more realistic shapes for the molecular cavity, the absorption strength corresponding to certain excitations would be significantly more enhanced than others depending on the orientation of their TDMs. Even in the case of transitions that are associated with TDMs that are practically colinear this effect may be substantial.
To illustrate the latter, let us consider a still simple but more physically informed shape for the molecular cavity. We remark that trans-azobenzene is more than 2.5 larger in the direction connecting the two benzene moieties than in the orthogonal direction. We notice as well that the transitions of interest are characterized by in-plane dipole moments (see Figure 2). To describe the cavity field influence in these two transitions, we are merely interested in addressing the possible effect of the cavity anisotropy in the plane. Hence, we need a cavity featuring different characteristic length in the "long" and "short" axes of the planar structure, disregarding the chosen (perhaps arbitrary) characteristic length in the third direction orthogonal to the molecular plane. We take advantage of the known analytic expression for the CFF in the case a prolate ellipsoidal cavity. 14,34, 35 We choose the prolate ellipsoid with the major axis along the direction of the TDM corresponding

Journal of Chemical Theory and Computation
Article to A excited state, that is, d 0A , and having a circumference section with a diameter 0.38 times as long as the major axis of the in-plane ellipse. Then, we calculate the CFF as the squared ratio between TDMs with and without cavity field effects. 14 The computation of TDM with cavity field effects within the prolate ellipsoidal model amplifies more the components in the shorter axis. 14,35 This setup is sufficient to explain the transition-dependence of the CFF, yielding a CFF = 1.12 for A, 1.20 and 1.46 for B 1 and B 2 , respectively. From the last numbers, we recover the correct trend of cavity field effects, that is, the largest CFF is obtained for the excited states with largest component of the TDM along the shorter axis of the molecule, namely, B 2 transition in our case. Within the ellipsoidal model, we have an overall CFF = 1.33 for the B band (assuming B 1 and B 2 TDMs to be exactly orthogonal) which match qualitatively the PCM data reported in Table 2.
We do not expect to find a quantitative agreement through the former analysis since the molecular cavity is in any case more complex than an ellipsoid and better described within PCM. Nonequilibrium Cavity Field Effects. Finally, we comment on the nonequilibrium effects as treated using EOM-TDPCM. In section 2.2, we obtained the expression for the polarization charges propagation in the case of infinite relaxation time, that is, eq 13. Using this limit in both the reaction-field and cavityfield time-dependent polarization charges, we obtained the same absorption spectrum as for the EOM-TDPCM plotted in Figure 1 (not shown). The reason is that the Debye relaxation of water is much longer (τ D = 3.37 ps) than the characteristic time for electronic excitations (tenth of fs). The slow degrees of freedom of the solvent (driving the inertial polarization) cannot follow the rapid change of either the electronic density or the Maxwell field in the frequency range of electronic excitations (the UV−vis spectrum). Therefore, the dynamics of the solvent polarization relaxation after the application of the impulsive field is dominated only by its fast degrees of freedom, which are characterized by the high-frequency dielectric constant of the solvent, ϵ d (see eq 13). As a consequence, the only transition-dependence appearing in the CFF is coming from the anisotropic cavity, and not from the dielectric function frequency dependence, which is the ultimate responsible for nonequilibrium solvent polarization effects. Nevertheless, this situation might be drastically different when the relaxation time of the solvent is small enough to be comparable with the characteristic time of electronic excitations. For these cases, the strong frequency dependence of the dielectric function in the electronic excitation range reflects on the CFF. Such a CFF frequency dependence is a unique feature of nonequilibrium cavity field effects in the absorption spectrum that is unrelated to the anisotropy of the cavity.
To expose nonequilibrium cavity field effects, we compute the CFF for the two selected transitions (namely, A and B) for a set relaxation times and ascertain that (i) the CFF (CFF B and CFF A ) and (ii) the CFF difference (CFF B − CFF A ) change with the relaxation time. This dependence shows that there is an underlying frequency dependence in the CFF that cannot be accounted for by considering anisotropic cavity field effects.
Therefore, we performed further EOM-TDPCM/RT-TDDFT calculation on the solvated molecule for hypothetical solvents with shorter Debye relaxation times and with the same static and dynamic dielectric constant of water. For the sake of simplicity, we choose only one direction for the application of the impulsive field, namely, the x-axis (see Figure 2). The results for the optical absorption spectra of solvents with τ D = 3370 (water), 100, 10, and 1 fs are plotted in Figure 3 for comparison.
In Figure 3, we observe a great variation in the spectra featuring no cavity field effects for different relaxation times. In particular, we notice a systematic redshift of the first absorption peak (transition A) for diminishing relaxation times. This strong effect is due to reaction field and its discussion is out of the scope of this Article. We rather focus on the variation of CFF with the solvent relaxation time in the case of transitions A and B. A summary of these results is reported in Table 3.
In Table 3, we observe a clear CFF relaxation-time dependence for both transitions, our first evidence that nonequilibrium cavity field effects are taken into account. In  . The ellipsoidal cavity model (vide supra) does not change the qualitative picture drawn from Onsager's model for CFF versus τ D ; it simply tunes the maximum and minimum CFF at zero or infinite relaxation times and has excitation-dependent minimum and maximum values. The PCM, featuring a more complex molecular-shape cavity, further adjust quantitatively these maximum and minimum CFF values (as seen in Table  3). In each model, the maximum and minimum CFF values for zero or infinite relaxation times are associated with the static and dynamic dielectric constants of the solvent, respectively. For the spherical model, the minimum and maximum CFF are independent from the frequency, whereas in the ellipsoidal model they depend on the orientation of the underlying transition dipole moment (anisotropic cavity effects). In the last row of Table 3, we show the difference CFF B − CFF A . As expected, the difference in CFF is not constant, which is another evidence of CFF dependence on the frequency unaccounted by anisotropic cavity effects. Therefore, nonequilibrium cavity field effects have an impact in the absorption spectral shape.
In Figure 4, we plot the CFF versus τ D for the spherical (Onsager), the prolate ellipsoidal and the molecular-shape (PCM) cavity models. For the ellipsoidal model, we plot the overall CFF corresponding to the B band (before decomposed in B 1 and B 2 ), to facilitate its comparison with PCM results. Apart from the quantitative departure of the molecular-shape model from the rest, there is an important qualitative difference: the transient between maximum to minimum CFF values is narrower, occurring in a relaxation-time window of tenth of femtosecond for the molecular-shape cavity, as opposed to a few picosecond for spherical and ellipsoidal cavities (see Figure 4 inset). The spherical and ellipsoidal cavity models do not predict relevant nonequilibrium cavity field effects for τ D ≤ 0.5 ps or τ D ≥ 3 ps, where the CFF takes approximately its maximum and minimum values, respectively. We recall that the latter might be transition-dependent for the ellipsoidal model because of the cavity anisotropy. It is in the relaxation time window 0.5−3 ps, where we expect to find nontrivial nonequilibrium cavity field effects in the form of strongly frequency-dependent CFF. However, in the case of a molecular-shape cavity, we find that nonequilibrium cavity field effects can only be relevant in the relaxation time scale of 0− 100 fs. The latter disagreement highlights the fact that an accurate description of the molecular cavity is also essential to account for nonequilibrium cavity field effects, making impossible to decide when to apply our full EOM-TDPCM treatment (with cavity field effects) based on estimations extracted from simple models (such as Onsager's).

CONCLUDING REMARKS
In summary, we have extended the time-dependent polarizable continuum model (TDPCM) framework, 2,5 in its equation-ofmotion (EOM-TDPCM) version, 13 to account for nonequilibrium cavity field effects within quantum mechanical calculations of molecules in solution and subject to external electrostatic fields and/or electromagnetic radiation (light). Such a scheme (EOM-TDPCM with cavity field effects) provides a more realistic picture for the description of solvated molecule, shortening the gap between simulation/theoretical and experimental results.
Our theoretical contribution has been incorporated in the Octopus code (to be released as version 9.0). 32 This implementation enables us to perform real-time time-dependent density functional theory (RT-TDDFT) simulations coupled with EOM-TDPCM and optical absorption spectrum calculations, including nonequilibrium reaction and cavity field effects.
To show an application of our methodology, we compute the optical absorption spectrum of trans-azobenzene in water employing EOM-TDPCM/RT-TDDFT simulations. These calculations are relevant to highlight the nontrivial role of anisotropic and nonequilibrium cavity field effects in the optical absorption spectrum of solvated molecules, however, they are not intended to provide benchmarking results for trans-azobenzene in water. We underline that the cavity field factor, that is, the ratio between the absorption spectra with and without cavity field effects, changes throughout the UV−vis. spectrum frequencies depending strongly on the orientation of the TDMs of the excited states associated with each absorption peak.
Our cavity field effects description within PCM goes beyond the simplified Onsager's model, where the molecule is hosted by a spherical cavity. 3,4 At difference with Onsager's model, PCM give rise to a modification of the optical absorption intensities that is transition-dependent. This effect was rationalized in terms of another simplified model for an anisotropic cavity with ellipsoidal shape, which is able to reproduce qualitatively the PCM results.
Finally, we show that nonequilibrium solvent polarization affects the overall shape of the optical absorption spectrum. In particular, we find evidence of the nonequilibrium effects in the change of absorption peak height due to the cavity field for different relaxation times. We remark that an accurate description of the cavity shape is so important to our treatment of nonequilibrium cavity field effects that we cannot even rely on the typical Onsager's (spherical cavity) model to conclude whether a nonequilibrium treatment is required or not.

A.1. Alternative Formulation of Static Polarization
The partition in eq 1 is arbitrary. We may as well pose it in a different way, akin to the standard PCM formulation for the reaction-field response, namely We take v C (r) ≡ v(r) for r ∈ Ω i . Inside the cavity, f(r) is equal to the potential generated by the fictitious external charges (source of the Maxwell field) in an homogenous vacuum.
Elsewhere it matches the potential associated with the Maxwell field (applied in a dielectric media without the vacuum cavity).
In the most general case, f(r) can be represented in terms of the Green functions for the Poisson problems in and outside the cavity, respectively. For a solvent, this expression reduces to As a consequence of this partition, the potential f(r) is discontinuous at r ∈ Γ, whereas the normal component of the electric displacement vectors corresponding to f(r) is instead continuous across the interface Γ. The term v cf ′ (r) is again a polarization contribution that solves the Laplace problem in and outside the cavity, as its counterpart v cf (r) in the partition eq 1 (see section 2.1), but this time obeying a different set of continuity conditions able to recover those from the original generalized Poisson problem. In this case, eq 4 holds with a different PCM response matrix, namely  Hence, within partition eq 43, the cavity-field PCM response matrix (eq 7) in the latter case distinguishes from its reactionfield counterpart only by an extra factor, ϵ. The extra factor indicates that the effect of the Maxwell potential should be taken inside the vacuum cavity since the polarization potential of eq 3 is the one felt by a distribution of charges placed therein.

A.2. Alternative Formulation to the Optical Spectrum
Let us find an expression for the absorption cross-section employing the partition (eq 43) instead of eq 1 in eq 24. In the case of a solvent dielectric medium, we can write explicitly v C (r,ω) = ϵ(ω)v M (r,ω) + v cf ′ (r,ω), where v M (r,ω) and v cf (r,ω) are the Maxwell-field and polarization potentials, respectively. Using as well the quasi-static approximation for the Maxwell potential in eq 24, we get The first term in eq 66, gives rise to an "impulsive" polarization potential, that is, having a Dirac delta time-dependence. To deal with this term, we may use the same strategy used for the impulsive Maxwell potential. 21 The second term in eq 66 is the solution of the EOM with the initial condition The solution of this EOM is Let us analyze some limiting cases. Notice that when the external medium has an infinite relaxation time, that is, τ D → ∞, also τ ii → ∞. In such a case,  t ( ) cf,D , ̃c f,0/d , and   → and, hence, Δq cf (t) = 0. Therefore, as expected, only the dynamic PCM response matrix is involved in the evolution of the polarization charges, that is, . Instead if the external medium has a null relaxation time, that is, τ D → 0, also τ ii → 0. In this case, Thus, also as expected, the entire static PCM response matrix is involved in the evolution of the polarization charges, that is,

A.5. PCM Implementation in Octopus
Octopus is a code specialized in DFT and RT-TDDFT calculations that uses pseudopotentials to describe atomic core electrons and a real-space grid instead of basis functions. 32 The previous PCM implementation in Octopus included only static and dynamic reaction-field polarization effects of the solvent in equilibrium with the molecular density. 37 Cavity field effects and nonequilibrium solvent polarization, either coming from the reaction or cavity field, were incorporated recently in Octopus (version 8.0) by the authors of this contribution. The propagation of the polarization charges due to solute electrons follows an EOM akin to eq 11 (see ref 13), whereas polarization charges due to solute nuclei follow a PCM equation similar to that in eq 4 (see, e.g., ref 37). Static and dynamic cavity field effects are accounted for by using eqs 4 and 11, respectively.
The EOM are integrated numerically using first-order Euler algorithm. In particular, the propagation of cavity-field polarization charges from time t to t + Δt following eq 11 is obtained from To calculate the optical absorption spectrum with cavity field effects, our implementation in Octopus (to be released in version 9.0) relies on eq 52. d̅ (ω) in eq 52 are calculated from eq 36a using a fast Fourier transform algorithm. d̅ (t) is computed during the real-time simulation from eq 53, the realspace approximation of eq 38b and the BEM approximation of eq 57.
Within the PCM implementation in Octopus, 37 the molecular cavity tessellation is computed using GEPOL algorithm from the union of spheres centered at each atom position except for Hydrogen. 2 The default radii of these spheres are the van der Waals radii of the corresponding atoms scaled by 1.2 (e.g., for carbon and nitrogen are 2.4 and 1.9 Å, respectively). 38 Tesserae closer than 0.1 Å are merged into a single one. To avoid singularities in the Coulomb potential resulting when grid points are close to the representative point of the cavity tessellation, we use a continuous and smooth representation of the polarization charges in each tessera (see discussion in ref 37).