Previous Article in Journal
Molecular-Level Imaging and Detection of Vibration of Fac-tris(2-phenylpyridine)iridium(III) Solids Through Transmission Electron Microscopy and Electron Energy Loss Spectroscopy
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A General Formalism for Electromagnetic Response Based on Quasi-Energy Derivatives Within a Single-Determinant Framework

Key Laboratory of Theoretical Chemistry of Environment, Ministry of Education, School of Environment, South China Normal University, Guangzhou 510006, China
*
Authors to whom correspondence should be addressed.
Chemistry 2025, 7(6), 181; https://doi.org/10.3390/chemistry7060181
Submission received: 23 October 2025 / Revised: 10 November 2025 / Accepted: 12 November 2025 / Published: 14 November 2025
(This article belongs to the Section Theoretical and Computational Chemistry)

Abstract

A unified electromagnetic response theory has been formulated in terms of quasi-energy derivatives within the nonrelativistic single-determinant framework. The formalism is applicable to any type of optical response, without restriction to monochromatic fields. Electromagnetic properties are expressed through quasi-energy derivatives, providing a consistent and general description under arbitrary static or dynamic perturbations. Magnetic properties obtained from this framework are inherently gauge-invariant, since a gauge transformation of the electromagnetic potentials corresponds to a unitary phase transformation acting on both the Hamiltonian and molecular orbitals. The present theory thus offers a comprehensive foundation for evaluating (hyper)polarizabilities, (hyper)magnetizabilities, and other related response properties.

Graphical Abstract

1. Introduction

Since the early development of quantum chemistry, one of its central goals has been the accurate prediction of molecular properties from first principles. Among these properties, those associated with the response of molecules to external electromagnetic fields—such as (hyper)polarizabilities and (hyper)magnetizabilities—play a critical role in understanding spectroscopic behavior, intermolecular interactions, and optical phenomena [1,2,3,4,5,6,7,8,9,10,11,12,13].
A straightforward way to evaluate such response properties is the finite-field approach [14,15], which computes changes in self-consistent field (SCF) energy under small variations of the applied field. In each field direction, this approach requires a few single-point calculations at slightly different field strengths to approximate a derivative of a given order. However, its accuracy is highly sensitive to the choice of field step size, and the accumulated numerical error becomes more pronounced for higher-order derivatives. This finite-field approach, moreover, is inherently limited to static field perturbations and cannot capture frequency-dependent response properties induced by time-dependent electromagnetic fields.
Another commonly used approach is the sum-over-states method [16,17,18,19], which expresses response properties as explicit sums over electronic excited states. This formulation is derived by taking derivatives of the expectation value of the dipole operator μ ^ . It originates from the Rayleigh–Schrödinger perturbation theory, where the system’s response is expanded in terms of eigenstates of the unperturbed Hamiltonian. In principle, the expansion involves a complete set of many-electron excited states, rendering the method formally exact. In practice, however, the summation must be truncated to a manageable number of states in an infinite-dimensional Hilbert space, which introduces numerical approximations. While conceptually straightforward and potentially accurate when a sufficiently large and well-described excitation manifold is available, the sum-over-states method is computationally demanding and strongly dependent on the quality and completeness of the excited states. These limitations significantly hinder its routine applicability, especially for large systems and higher-order response properties.
A more widely applicable and systematically accurate alternative is the analytical derivative method [20,21,22,23,24,25], in which molecular response properties are obtained by expanding relevant physical quantities in a Taylor series with respect to external perturbation parameters. Within this formalism, the response of molecular orbitals to the applied field must be explicitly taken into account. If the ground-state orbitals are well-suited, it is often assumed that orbital responses of all orders can be represented as linear transformations of the unperturbed orbitals. Under this approximation, the resulting set of equations reduces to a linear system for the transformation matrix, which is often referred to as the coupled-perturbed (CP) Hartree–Fock (HF) equations. These equations, derived from the stationarity conditions of the underlying variational energy functionals, provide a rigorous route to compute response properties of arbitrary order. Because higher-order response properties are very sensitive to electron correlation effects [20,26], attempts to improve predictive accuracy have motivated the extension of analytical derivative theory beyond the HF level. Although post HF methods can offer systematic improvements, they are computationally demanding and impractical for large systems. The use of nonorthogonal localized molecular orbitals can reduce the cost in large-scale calculations [13,27,28]. In contrast, Kohn–Sham (KS) density functional theory (DFT) provides a more computationally affordable means of incorporating electron correlation, prompting several researchers [26,29,30,31,32,33] to extend the analytical derivative formalism to the KS framework. Compared with its HF counterpart, the KS-based formulation introduces additional complexity at higher orders—for instance, third-order response properties require explicit evaluation of the third derivative of the exchange-correlation (xc) functional with respect to the external perturbation.
In the historical development of the analytical derivative theory, there have emerged three different formulations, where the response properties are defined as the derivatives of (i) the expectation value of the dipole operator μ ^ , (ii) the energy E = H ^ , or (iii) the so-called quasi-energy W = H ^ i t .
Sekino and Bartlett [20] first introduced a systematic formulation at the HF level for evaluating static and frequency-dependent polarizabilities, based on derivatives of the expectation value of the dipole operator μ ^ . They thought that, whether the perturbation was static or dynamic, response properties derived from the dipole expectation value were equivalent to those obtained from energy derivatives. Building on this foundation, Rice et al. [21] and, independently, Karna and Dupuis [22] later proposed simplified formulations by leveraging the ( 2 n + 1 ) rule, which streamlines the computation of higher-order responses. Their framework was subsequently adopted in numerous studies, including various extensions to KS-DFT [26,29,30,31], and has been widely implemented in modern electronic structure codes. In principle, response properties obtained from this framework are equivalent to those derived from the full, untruncated sum-over-states method. However, despite its popularity, the dipole-derivative-based framework suffers from conceptual and formal inconsistencies. First, the Hamiltonian does not commute with the dipole operator and hence cannot share its eigenstates, making the dipole expectation value, strictly speaking, not a well-defined observable. Moreover, the dipole operator is incompatible with periodic boundary conditions in crystalline systems—a well-known inconsistency that has motivated alternative formulations such as the KGB method, which introduces the vector potential to circumvent this issue [34]. As a consequence, response of μ ^ to perturbations lacks rigorous physical meaning. Second, frequency-dependent response quantities, such as the first hyperpolarizability tensor β a b c ( ω B ω C ; ω B , ω C ) , can violate the symmetry of mixed partial derivatives, and the frequency dependence associated with the first dimension is not treated in a reasonable way. Furthermore, the simplification of the second-order response density matrix necessitates the use of unphysical constructs involving the CP-HF/KS equations that do not exist under such electromagnetic perturbations. More fundamentally, for a time-dependent perturbation, the traditional Hellmann–Feynman theorem is no longer valid. There is no physical justification for the assumption that the electron density remains unaffected by the external field. In other words, the dipole moment, i.e., the first derivative of the energy E with respect to the external field, cannot be equated to μ ^ . The analytical forms of energy and dipole derivatives are no longer equivalent in the presence of dynamic fields.
Although, to the best of our knowledge, there have been no published formulations that rigorously express frequency-dependent response properties as energy derivatives under time-varying fields, our work shows that, in the presence of time-varying fields, higher-order energy derivatives naturally contain additional terms with explicit frequency dependence, whose contributions become increasingly significant at high frequencies. Nevertheless, defining response properties via energy derivatives under time-dependent perturbations is not without its own theoretical challenges. For such systems, one must resort to the time-dependent Schrödinger equation, where energy ceases to be a well-defined quantity. The Hamiltonian expectation value only carries a time-averaged meaning and is not an observable in the conventional sense. In addition, for magnetic response properties, issues such as gauge-origin dependence become particularly pronounced. Our deeper analysis, however, reveals that the commonly perceived gauge problem stems from an incomplete treatment: while most existing methods account for the gauge transformation of the vector potential in the operators, they neglect the simultaneous transformation of both the basis functions and the scalar potential. In reality, electromagnetic fields exhibit gauge invariance, and the HF and KS equations should remain gauge covariant. Gauge transformations amount to translations of energy-momentum space and leave the physical system unchanged. Under such a transformation, the wavefunction merely acquires a phase factor e i g , with g being the gauge function associated with a chosen gauge origin. While this resolves the gauge-dependence of energy response in static systems, it also underscores the fact that energy is not a gauge-invariant quantity under time-dependent magnetic fields. As such, energy-derivative-based magnetic response properties remain inherently ill-defined in this context. This motivates a shift to quasi-energy-based formulations as a more consistent foundation for electromagnetic response theory.
The quasi-energy W is a well-defined, gauge-invariant observable in general, owing to the gauge covariance of the HF and KS equations. Notably, Rice and Handy [23], as well as Sasagane, Aiga, and Itoh [25], first suggested the idea of defining response properties as quasi-energy derivatives, though they did not provide a complete derivation. Later, Banerjee and Harbola [32], together with Aiga and coworkers [33], advocated using the Floquet-state [24] energy as a means to characterize response properties. However, the time-averaged Floquet energy is itself time-independent and therefore does not yield general and meaningful field derivatives. In the 2000s, a related density-matrix-based quasi-energy formulation was developed by Thorvaldsen et al. [35,36], who employed a variational principle based on a time-averaged quasi-energy Lagrangian. Although their approach has been further extended in various directions [37,38,39,40,41,42,43], the resulting response properties are also not obtained in a direct manner from the quasi-energy itself, and the inherent gauge invariance of the quasi-energy was not explicitly recognized. For these reasons, we adopt the quasi-energy derivative framework proposed by Sasagane et al., which offers a physically consistent foundation for treating time-dependent perturbations and recovers conventional response theories in the static limit ( ω 0 ).
In this work, we present a systematic derivation of analytical quasi-energy derivatives (up to third order) at the SCF level where the electronic wavefunction is described by a single Slater determinant. These analytical derivatives are based on a straightforward Taylor expansion in the external fields and can be applied to a wide range of electromagnetic response properties, including electric-field-induced polarizabilities and magnetic-field-induced magnetizabilities. The resulting formulation not only offers enhanced physical clarity for arbitrary-order derivatives but is also amenable to implementation. Moreover, we generalize the framework to arbitrary time-dependent electromagnetic perturbations, going beyond the conventional setting of static and monochromatic fields, and thereby extend the applicability of quasi-energy response theory to a broader class of physical phenomena such as second-harmonic generation (SHG). In addition, we address a commonly neglected yet essential aspect of analytical derivative theory: the explicit perturbation dependence of basis functions. In some cases, a basis set may be adapted to or parameterized by external fields, which introduces an additional layer of complexity. Under time-dependent perturbations, the operator i t also acts on such a basis. To account for this, we develop a generalized derivative theory that includes the explicit response of basis functions to external fields, ensuring that all sources of perturbation dependence are consistently treated.

2. General Formalism

2.1. Time-Harmonic Electromagnetic Fields

An electromagnetic field may be either static or dynamic, with the latter exhibiting time dependence. In most cases, a time-dependent field can be modeled as a time-harmonic oscillation. According to Maxwell’s equations, the time-dependent part of such a harmonic field typically consists of two linearly independent complex-conjugate solutions, e i ω t and e i ω t . Any linear combination of these components can be used to represent the time-harmonic field, i.e.,
F ( r , t ) = F + ( r ) e i ω t + F ( r ) e i ω t .
Sometimes, multiple fields may be present simultaneously, possibly including a static component. The overall effect is then described by the vector sum of the individual fields,
F ( r , t ) = A ( ω A 0 ) F A + ( r ) e i ω A t + F A ( r ) e i ω A t = A F A ( r ) e i ω A t .
In particular, the case of ω A = 0 corresponds to a static field. Equation (2) represents the general form of an electromagnetic field. Even in the case of an anharmonic time-varying field, expansion in a Fourier series allows it to be expressed as a linear combination of harmonic components, each with a specific frequency ω A .
We now turn to the question of how the quasi-energy of a system responds to these fields. For notational simplicity, the partial derivative of a physical quantity with respect to the a-th Cartesian component of an independent field F A ( r , t ; ω A ) , evaluated at zero field, is denoted by placing a superscript a and appending its characteristic frequency ω A in parentheses, e.g.,
E A a E a ( ω A ) = E [ F A a ( r ) e i ω A t ] 0 .
It follows directly that
E * a ( ω A ) = E * [ F A a ( r ) e i ω A t ] 0 = E [ F A a ( r ) e i ω A t ] 0 * = E a * ( ω A ) ,
where the asterisk (*) denotes complex conjugation and the spatial field distribution F A a ( r ) is assumed to be real.

2.2. Quasi-Energy Response

Under general time-dependent perturbations, the many-electron wavefunction is no longer an eigenstate of the Hamiltonian. Instead, its evolution is governed by the time-dependent Schrödinger equation (in atomic units)
H ^ ( { r } , t ) i t Ψ ( { r } , t ) = 0 ,
where { r } represents the set of all electron coordinates. Following the treatment of Sasagane et al. [25], the wavefunction can be written as
Ψ ( { r } , t ) = Φ ( { r } , t ) exp i t 0 t d t W ( t ) ,
where Φ ( { r } , t ) is represented as a single Slater determinant and W is the quasi-energy. Substitution of this ansatz into Equation (5) transforms it into an eigenvalue equation
H ^ ( { r } , t ) i t Φ ( { r } , t ) = W ( t ) Φ ( { r } , t ) .
If the Hamiltonian carries no explicit time dependence, Equation (7) reduces to the conventional time-independent Schrödinger equation. Assuming that Φ ( { r } , t ) remains normalized at all times, we can evaluate the quasi-energy W ( t ) as
W ( t ) = Φ | H ^ | Φ E ( t ) Φ | i t | Φ T ( t ) .
The first term in Equation (8) corresponds to the instantaneous energy of the system, which can be written in terms of the density matrix D ν μ as
E = D ν μ H μ ν + 1 2 D ν μ D λ κ ( μ ν | κ λ ) + E xc ,
where H μ ν denotes the core Hamiltonian matrix and E xc is the xc energy. The Einstein summation convention is adopted throughout.
The second term in Equation (8) represents the dynamic phase arising from the time-dependence of the wavefunction, and evaluates to
T = D ν μ T μ ν + i n i C μ i * S μ ν t C ν i ,
where n i is the occupation number of the i-th orbital, C μ i denotes the matrix of orbital coefficients, S μ ν is the overlap matrix in the basis function representation, and T μ ν is defined as
T μ ν = ( μ | i t | ν ) .
Theoretically, the responses of T μ ν to a static field should vanish at all orders, i.e.,
T μ ν 0 = 0 ,
T μ ν a ( 0 ) = 0 ,
T μ ν a b ( 0 , 0 ) = 0 ,
In particular, if the basis functions are independent of the external perturbation, T μ ν vanishes identically.
The energy response can be obtained directly by taking successive derivatives of Equation (9). The zeroth-order energy reads
E 0 = D ν μ 0 H μ ν 0 + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) 0 + E xc 0 ,
which characterizes the unperturbed system. The first-order energy response is given by
E A a = D ν μ A a F μ ν 0 + D ν μ 0 H μ ν A a + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) A a + D ν μ 0 ( μ ν A a | v xc ) ,
where v xc denotes the xc potential, and F μ ν 0 is the zeroth-order Fock matrix, defined as
F μ ν 0 = H μ ν 0 + D λ κ 0 ( μ ν | κ λ ) 0 + ( μ ν 0 | v xc ) .
Note that the derivative appearing in an xc integral acts on the basis function pair, e.g., ( μ ν A a | v xc ) ( ( μ ν ) A a | v xc ) . The second-order energy response takes the form
E A a B b = D ν μ A a B b F μ ν 0 + D ν μ A a F μ ν B b + D ν μ B b H μ ν A a + D ν μ 0 H μ ν A a B b + D ν μ B b D λ κ 0 ( μ ν | κ λ ) A a + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) A a B b + D ν μ B b ( μ ν A a | v xc ) + D ν μ 0 ( μ ν A a B b | v xc ) + D ν μ 0 ( μ ν A a | f xc | ρ B b ) ,
where f xc is the xc kernel, i.e., the second functional derivative of E xc , and ρ is not restricted to the electron density but depends on the variables entering the functional. The third-order energy response
E A a B b C c = D ν μ A a B b C c F μ ν 0 + D ν μ A a B b F μ ν C c + D ν μ A a C c F μ ν B b + D ν μ A a F μ ν B b C c + D ν μ B b C c H μ ν A a + D ν μ B b H μ ν A a C c + D ν μ C c H μ ν A a B b + D ν μ 0 H μ ν A a B b C c + D ν μ B b C c D λ κ 0 ( μ ν | κ λ ) A a + D ν μ B b D λ κ C c ( μ ν | κ λ ) A a + D ν μ B b D λ κ 0 ( μ ν | κ λ ) A a C c + D ν μ C c D λ κ 0 ( μ ν | κ λ ) A a B b + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) A a B b C c + D ν μ B b C c ( μ ν A a | v xc ) + D ν μ B b ( μ ν A a C c | v xc ) + D ν μ B b ( μ ν A a | f xc | ρ C c ) + D ν μ C c ( μ ν A a B b | v xc ) + D ν μ 0 ( μ ν A a B b C c | v xc ) + D ν μ 0 ( μ ν A a B b | f xc | ρ C c ) + D ν μ C c ( μ ν A a | f xc | ρ B b ) + D ν μ 0 ( μ ν A a C c | f xc | ρ B b ) + D ν μ 0 ( μ ν A a | f xc | ρ B b C c ) + D ν μ 0 ( μ ν A a | k xc | ρ B b | ρ C c )
involves k xc , the third functional derivative of E xc . All terms that involve v xc , f xc , and k xc correspond to xc contributions of increasing order. Particularly, k xc vanishes in the case of a pure HF exchange.
The response of T cannot be directly obtained by taking derivatives of Equation (10), as the orbital coefficients C μ i implicitly depend on the external perturbation. To resolve this, we expand both sides of Equation (10) as Taylor series in powers of the external fields { F } , which results in
p = 0 T ( p ) p ! { F } p = p = 0 q = 0 D ν μ ( p ) T μ ν ( q ) p ! q ! { F } p { F } q + i n i p = 0 q = 0 r = 0 C μ i * ( p ) S μ ν ( q ) C ν i ( r ) p ! q ! r ! { F } p { F } q t { F } r .
Since each field in { F } is independent, we can collect terms of equal perturbation order on both sides. The expansion up to third order yields the following equations:
T 0 = 0 ,
T A a = D ν μ 0 T μ ν A a ω A n i C μ i * 0 S μ ν 0 C ν i A a ,
T A a B b = D ν μ A a T μ ν B b + D ν μ B b T μ ν A a + D ν μ 0 T μ ν A a B b ω B n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b ω A n i C μ i * B b S μ ν 0 + C μ i * 0 S μ ν B b C ν i A a ω A + ω B n i C μ i * 0 S μ ν 0 C ν i A a B b ,
T A a B b C c = D ν μ A a B b T μ ν C c + D ν μ A a C c T μ ν B b + D ν μ B b C c T μ ν A a + D ν μ A a T μ ν B b C c + D ν μ B b T μ ν A a C c + D ν μ C c T μ ν A a B b + D ν μ 0 T μ ν A a B b C c ω C n i C μ i * A a B b S μ ν 0 + C μ i * A a S μ ν B b + C μ i * B b S μ ν A a + C μ i * 0 S μ ν A a B b C ν i C c ω B n i C μ i * A a C c S μ ν 0 + C μ i * A a S μ ν C c + C μ i * C c S μ ν A a + C μ i * 0 S μ ν A a C c C ν i B b ω A n i C μ i * B b C c S μ ν 0 + C μ i * B b S μ ν C c + C μ i * C c S μ ν B b + C μ i * 0 S μ ν B b C c C ν i A a ω B + ω C n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b C c ω A + ω C n i C μ i * B b S μ ν 0 + C μ i * 0 S μ ν B b C ν i A a C c ω A + ω B n i C μ i * C c S μ ν 0 + C μ i * 0 S μ ν C c C ν i A a B b ω A + ω B + ω C n i C μ i * 0 S μ ν 0 C ν i A a B b C c .
A detailed derivation of them is provided in Appendix A.
The quasi-energy responses up to third order are thus given by
W 0 = E 0 ,
W A a = E A a T A a ,
W A a B b = E A a B b T A a B b ,
W A a B b C c = E A a B b C c T A a B b C c .

2.3. Density-Matrix Response

The density matrix D ν μ is defined as
D ν μ = n i C ν i C μ i * .
Since the quasi-energy responses involve the density matrix at each order, it is necessary to evaluate how the density matrix (29) varies with respect to external perturbations.
In the absence of any perturbation, one recovers the zeroth-order density matrix,
D ν μ 0 = n i C ν i 0 C μ i 0 * ,
which corresponds to the ground-state density. Upon introducing perturbations, the first-, second-, and third-order responses of the density matrix can be obtained by differentiation:
D ν μ A a D ν μ a ( ω A ) = n i C ν i a ( ω A ) C μ i 0 * + C ν i 0 C μ i a * ( ω A ) ,
D ν μ A a B b D ν μ a b ( ω A , ω B ) = n i C ν i a b ( ω A , ω B ) C μ i 0 * + C ν i a ( ω A ) C μ i b * ( ω B ) + C ν i b ( ω B ) C μ i a * ( ω A ) + C ν i 0 C μ i a b * ( ω A , ω B ) ,
D ν μ A a B b C c D ν μ a b c ( ω A , ω B , ω C ) = n i C ν i a b c ( ω A , ω B , ω C ) C μ i 0 * + C ν i a b ( ω A , ω B ) C μ i c * ( ω C ) + C ν i a c ( ω A , ω C ) C μ i b * ( ω B ) + C ν i a ( ω A ) C μ i b c * ( ω B , ω C ) + C ν i b c ( ω B , ω C ) C μ i a * ( ω A ) + C ν i b ( ω B ) C μ i a c * ( ω A , ω C ) + C ν i c ( ω C ) C μ i a b * ( ω A , ω B ) + C ν i 0 C μ i a b c * ( ω A , ω B , ω C ) .
For convenience in the subsequent derivations, we assume that the orbital coefficients at each order are related to the ground-state coefficients through a linear transformation. These transformation matrices U are defined by
C μ i a ( ω A ) = C μ j 0 U j i a ( ω A ) ,
C μ i a b ( ω A , ω B ) = C μ j 0 U j i a b ( ω A , ω B ) ,
C μ i a b c ( ω A , ω B , ω C ) = C μ j 0 U j i a b c ( ω A , ω B , ω C ) ,
Then, Equations (31)–(33) become
D ν μ a ( ω A ) = n i C ν j 0 U j i a ( ω A ) C μ i 0 * + C ν i 0 C μ j 0 * U j i a * ( ω A ) ,
D ν μ a b ( ω A , ω B ) = n i C ν j 0 U j i a b ( ω A , ω B ) C μ i 0 * + C ν j 0 U j i a ( ω A ) C μ k 0 * U k i b * ( ω B ) + C ν j 0 U j i b ( ω B ) C μ k 0 * U k i a * ( ω A ) + C ν i 0 C μ j 0 * U j i a b * ( ω A , ω B ) ,
D ν μ a b c ( ω A , ω B , ω C ) = n i C ν j 0 U j i a b c ( ω A , ω B , ω C ) C μ i 0 * + C ν j 0 U j i a b ( ω A , ω B ) C μ k 0 * U k i c * ( ω C ) + C ν j 0 U j i a c ( ω A , ω C ) C μ k 0 * U k i b * ( ω B ) + C ν j 0 U j i a ( ω A ) C μ k 0 * U k i b c * ( ω B , ω C ) + C ν j 0 U j i b c ( ω B , ω C ) C μ k 0 * U k i a * ( ω A ) + C ν j 0 U j i b ( ω B ) C μ k 0 * U k i a c * ( ω A , ω C ) + C ν j 0 U j i c ( ω C ) C μ k 0 * U k i a b * ( ω A , ω B ) + C ν i 0 C μ j 0 * U j i a b c * ( ω A , ω B , ω C ) .
It follows that the density matrices exhibit the following symmetric relations:
D ν μ a ( ω A ) = D μ ν a * ( ω A ) ,
D ν μ a b ( ω A , ω B ) = D μ ν a b * ( ω A , ω B ) ,
D ν μ a b c ( ω A , ω B , ω C ) = D μ ν a b c * ( ω A , ω B , ω C ) ,

2.4. Orthonormality

We assume that the molecular orbitals remain orthonormal at all times, i.e.,
S i j = C μ i * S μ ν C ν j = δ i j .
Note that matrices with subscripts i, j, k, etc. are represented in the molecular orbital basis.
Since the ground-state orbitals are already required to be orthonormal,
S i j 0 = C μ i 0 * S μ ν 0 C ν j 0 = δ i j ,
the higher-order orbital overlaps must vanish.
For instance, the first-order condition reads
S i j A a = C μ i a * ( ω A ) S μ ν 0 C ν j 0 + C μ i 0 * S μ ν a ( ω A ) C ν j 0 + C μ i 0 * S μ ν 0 C ν j a ( ω A ) = U k i a * ( ω A ) S k j 0 + S i j a ( ω A ) + S i k 0 U k j a ( ω A ) = U k i a * ( ω A ) δ k j + S i j a ( ω A ) + δ i k U k j a ( ω A ) = U j i a * ( ω A ) + S i j a ( ω A ) + U i j a ( ω A ) = 0 ,
where S i j a ( ω A ) = C μ i 0 * S μ ν a ( ω A ) C ν j 0 .
In our notation, when perturbation indices appear in the superscript of a molecular orbital integral, such as S i j A a S i j a ( ω A ) , they denote a derivative acting solely on the matrix elements in the atomic orbital basis, not on the orbital coefficients. To indicate a total derivative, the perturbation indices are placed as a superscript on the entire matrix element, as in S i j A a . It is worth noting that the derivatives of S μ ν with respect to different fields should be identical, such that S μ ν A a S μ ν a ( ω A ) = S μ ν a . Accordingly, we omit the frequency argument in parentheses for the derivatives of S μ ν throughout this work.
Following a similar procedure as in the first-order case, one can derive the second- and third-order orthonormality conditions as
S i j A a B b = U j i a b * ( ω A , ω B ) + U k i a * ( ω A ) S k j b + U k i a * ( ω A ) U k j b ( ω B ) + U k i b * ( ω B ) S k j a + S i j a b + S i k a U k j b ( ω B ) + U k i b * ( ω B ) U k j a ( ω A ) + S i k b U k j a ( ω A ) + U i j a b ( ω A , ω B ) = 0 ,
S i j A a B b C c = U j i a b c * ( ω A , ω B , ω C ) + U k i a b * ( ω A , ω B ) S k j c + U k i a b * ( ω A , ω B ) U k j c ( ω C ) + U k i a c * ( ω A , ω C ) S k j b + U k i a * ( ω A ) S k j b c + U k i a * ( ω A ) S k l b U l j c ( ω C ) + U k i a c * ( ω A , ω C ) U k j b ( ω B ) + U k i a * ( ω A ) S k l c U l j b ( ω B ) + U k i a * ( ω A ) U k j b c ( ω B , ω C ) + U k i b c * ( ω B , ω C ) S k j a + U k i b * ( ω B ) S k j a c + U k i b * ( ω B ) S k l a U l j c ( ω C ) + U k i c * ( ω C ) S k j a b + S i j a b c + S i k a b U k j c ( ω C ) + U k i c * ( ω C ) S k l a U l j b ( ω B ) + S i k a c U k j b ( ω B ) + S i k a U k j b c ( ω B , ω C ) + U k i b c * ( ω B , ω C ) U k j a ( ω A ) + U k i b * ( ω B ) S k l c U l j a ( ω A ) + U k i b * ( ω B ) U k j a c ( ω A , ω C ) + U k i c * ( ω C ) S k l b U l j a ( ω A ) + S i k b c U k j a ( ω A ) + S i k b U k j a c ( ω A , ω C ) + U k i c * ( ω C ) U k j a b ( ω A , ω B ) + S i k c U k j a b ( ω A , ω B ) + U i j a b c ( ω A , ω B , ω C ) = 0 .
These expressions impose constraints on the orbital transformation matrices U .

2.5. Determination of U: The CP-HF/KS Equations

To determine the transformation matrices U , we minimize the quasi-energy Equation (8) with respect to orbital variations, subject to the constraint of orbital orthonormality. This leads to a Roothaan-like equation
F μ ν T μ ν C ν i i S μ ν t C ν i = S μ ν C ν j ε j i
in the atomic orbital basis. To facilitate the treatment of the time derivative t acting on the orbital coefficients, we expand each quantity in the above expression as a Taylor series in the external fields:
p = 0 q = 0 F μ ν T μ ν ( p ) C ν i ( q ) p ! q ! { F } p { F } q i p = 0 q = 0 S μ ν ( p ) C ν i ( q ) p ! q ! { F } p t { F } q = p = 0 q = 0 r = 0 S μ ν ( p ) C ν j ( q ) ε j i ( r ) p ! q ! r ! { F } p { F } q { F } r .
In analogy with the derivation of the responses of T, we obtain the original CP-HF/KS equations (up to second order)
F μ ν 0 C ν i 0 = S μ ν 0 C ν j 0 ε j i 0 ,
F μ ν a ( ω A ) C ν i 0 + F μ ν 0 C ν i a ( ω A ) T μ ν a ( ω A ) C ν i 0 + ω A S μ ν 0 C ν i a ( ω A ) = S μ ν a C ν j 0 ε j i 0 + S μ ν 0 C ν j a ( ω A ) ε j i 0 + S μ ν 0 C ν j 0 ε j i a ( ω A ) ,
F μ ν a b ( ω A , ω B ) C ν i 0 + F μ ν a ( ω A ) C ν i b ( ω B ) + F μ ν b ( ω B ) C ν i a ( ω A ) + F μ ν 0 C ν i a b ( ω A , ω B ) T μ ν a b ( ω A , ω B ) C ν i 0 T μ ν a ( ω A ) C ν i b ( ω B ) T μ ν b ( ω B ) C ν i a ( ω A ) + ω B S μ ν a C ν i b ( ω B ) + ω A S μ ν b C ν i a ( ω A ) + ω A + ω B S μ ν 0 C ν i a b ( ω A , ω B ) = S μ ν a b C ν j 0 ε j i 0 + S μ ν a C ν j b ( ω B ) ε j i 0 + S μ ν a C ν j 0 ε j i b ( ω B ) + S μ ν b C ν j a ( ω A ) ε j i 0 + S μ ν 0 C ν j a b ( ω A , ω B ) ε j i 0 + S μ ν 0 C ν j a ( ω A ) ε j i b ( ω B ) + S μ ν b C ν j 0 ε j i a ( ω A ) + S μ ν 0 C ν j b ( ω B ) ε j i a ( ω A ) + S μ ν 0 C ν j 0 ε j i a b ( ω A , ω B ) ,
where ε j i is the Lagrange multiplier matrix, and the first- and second-order Fock matrices are, respectively,
F μ ν a ( ω A ) = H μ ν a + D λ κ a ( ω A ) ( μ ν | κ λ ) 0 + D λ κ 0 ( μ ν | κ λ ) a + ( μ ν a | v xc ) + ( μ ν 0 | f xc | ρ a ( ω A ) ) ,
and
F μ ν a b ( ω A , ω B ) = H μ ν a b + D λ κ a b ( ω A , ω B ) ( μ ν | κ λ ) 0 + D λ κ a ( ω A ) ( μ ν | κ λ ) b + D λ κ b ( ω B ) ( μ ν | κ λ ) a + D λ κ 0 ( μ ν | κ λ ) a b + ( μ ν a b | v xc ) + ( μ ν a | f xc | ρ b ( ω B ) ) + ( μ ν b | f xc | ρ a ( ω A ) ) + ( μ ν 0 | f xc | ρ a b ( ω A , ω B ) ) + ( μ ν 0 | k xc | ρ a ( ω A ) | ρ b ( ω B ) ) .
The derivatives of H μ ν are typically independent of field frequencies, but may exhibit frequency dependence when the system is subject to a gauge transformation. This case is not considered here, but will be discussed in Section 3.2.

2.5.1. The First-Order CP-HF/KS Equation

By substituting the definition (34) into Equation (51) and contracting with C μ k 0 * over μ and ν , Equation (51) can be transformed into the molecular orbital representation:
F k i a ( ω A ) + ε k j 0 U j i a ( ω A ) T k i a ( ω A ) + ω A S k j 0 U j i a ( ω A ) = S k j a ε j i 0 + S k l 0 U l j a ( ω A ) ε j i 0 + S k j 0 ε j i a ( ω A ) .
Since ε i j 0 and S i j 0 are diagonal, we can express the above equation as
F j i a ( ω A ) + ε j 0 U j i a ( ω A ) T j i a ( ω A ) + ω A U j i a ( ω A ) = S j i a ε i 0 + U j i a ( ω A ) ε i 0 + ε j i a ( ω A ) ,
with no summation implied over the indices of the ground-state orbital energies ε i 0 .
If we further assume that ε j i a is block-diagonal, i.e.,
ε j i a ( ω A ) = 0
whenever j vir and i occ , or j occ and i vir , then we have
U j i a ( ω A ) = F j i a ( ω A ) T j i a ( ω A ) S j i a ε i 0 ε i 0 ε j 0 ω A .
As for the occ-occ and vir-vir blocks of U j i a ( ω A ) , they can be obtained from the orthonormality condition given in Equation (45):
U k i a * ( ω A ) + U i k a ( ω A ) = S i k a ,
for i , k occ or i , k vir . The above equation also holds in the static limit of ω A = 0 , which implies that S i k a must be Hermitian. For convenience, we further assume that
U k i a * ( ω A ) = U i k a ( ω A ) ,
so that the diagonal blocks of U i k a ( ω A ) can be directly obtained as
U i k a ( ω A ) = 1 2 S i k a .
It is important to note that the orthonormality condition (45) may no longer hold for the vir-occ and occ-vir blocks if the basis set depends on the perturbation. This can potentially violate the overall orthonormality of the orbitals, and care must be taken when constructing perturbation-dependent basis sets.
Equation (58) allows for an iterative determination of the off-diagonal blocks of U j i a ( ω A ) . Alternatively, a more direct approach is to substitute Equation (53) into Equation (58), and rearrange the terms such that those involving U j i a ( ω A ) appear on one side and all constant terms on the other. This yields
A j i k l + ω A δ i k δ j l U l k a ( ω A ) + B j i l k U l k a * ( ω A ) = H j i a n k ( j i | k k ) a ( j i a | v xc ) n k ( j i 0 | f xc | k k a ) + T j i a ( ω A ) + S j i a ε i 0 ,
where
A j i k l = n k ( j i | | k l ) 0 + ( ε j 0 ε i 0 ) δ i k δ j l ,
B j i l k = n k ( j i | | l k ) 0 .
The two-electron integral ( i j | | k l ) 0 is defined as
( i j | | k l ) 0 = ( i j 0 | r 12 1 + f xc | k l 0 ) .
In Equation (62), we may take i , k occ and j vir , while the index l typically runs over the full orbital space. When the basis functions are independent of perturbations, the occ-occ block of U l k a ( ω A ) vanishes (see Equation (61)), and thus only l vir contributes. However, if the basis set is perturbation-dependent, contributions from all orbitals may be nonzero. In this case, since U l k a ( ω A ) for l occ is already known from Equation (61), we may split the summation over l into contributions from virtual and occupied orbitals, and move the known terms with l occ to the right-hand side as constants. This leads to
A j i k l + ω A δ i k δ j l U l k a ( ω A ) + B j i l k U l k a * ( ω A ) = R j i a ( ω A ) ,
where i , k occ , j , l vir , and the right-hand-side constants R j i a ( ω A ) are defined as
R j i a ( ω A ) = H j i a n k ( j i | k k ) a ( j i a | v xc ) n k ( j i 0 | f xc | k k a ) + T j i a ( ω A ) + S j i a ε i 0 + n k 2 ( j i | | k m ) 0 S m k a + ( j i | | m k ) 0 S m k a * .
The index m in the last term runs over the occupied orbitals. When the basis functions are field-independent, only H j i a survives on the right-hand side. By taking the complex conjugate of Equation (66) and replacing ω A with ω A , we obtain another independent equation
A j i k l * ω A δ i k δ j l U l k a * ( ω A ) + B j i l k * U l k a ( ω A ) = R j i a * ( ω A ) .
Equations (66) and (68) form a standard linear system:
A j i k l + ω A δ i k δ j l B j i l k B j i l k * A j i k l * ω A δ i k δ j l U l k a ( ω A ) U l k a * ( ω A ) = R j i a ( ω A ) R j i a * ( ω A ) ,
whose solution directly determines the first-order response density. The above equation bears resemblance to the Casida equation [44], but with a key distinction: while Equation (69) is solved for the response density, the Casida equation seeks the poles of this expression, i.e., the eigenvalues for which the operator matrix becomes singular, yielding the excitation energies.

2.5.2. The Second-Order CP-HF/KS Equation

In a similar manner, multiplication of both sides of Equation (52) by C μ k 0 * followed by summation over μ and ν yields
F k i a b ( ω A , ω B ) + F k j a ( ω A ) U j i b ( ω B ) + F k j b ( ω B ) U j i a ( ω A ) + ε k j 0 U j i a b ( ω A , ω B ) T k i a b ( ω A , ω B ) T k j a ( ω A ) U j i b ( ω B ) T k j b ( ω B ) U j i a ( ω A ) + ω B S k j a U j i b ( ω B ) + ω A S k j b U j i a ( ω A ) + ω A + ω B S k j 0 U j i a b ( ω A , ω B ) = S k j a b ε j i 0 + S k l a U l j b ( ω B ) ε j i 0 + S k j a ε j i b ( ω B ) + S k l b U l j a ( ω A ) ε j i 0 + S k l 0 U l j a b ( ω A , ω B ) ε j i 0 + S k l 0 U l j a ( ω A ) ε j i b ( ω B ) + S k j b ε j i a ( ω A ) + S k l 0 U l j b ( ω B ) ε j i a ( ω A ) + S k j 0 ε j i a b ( ω A , ω B ) .
This is equivalent to the following expression, given that both ε i j 0 and S i j 0 are diagonal matrices:
F j i a b ( ω A , ω B ) + F j l a ( ω A ) U l i b ( ω B ) + F j l b ( ω B ) U l i a ( ω A ) + ε j 0 U j i a b ( ω A , ω B ) T j i a b ( ω A , ω B ) T j l a ( ω A ) U l i b ( ω B ) T j l b ( ω B ) U l i a ( ω A ) + ω B S j l a U l i b ( ω B ) + ω A S j l b U l i a ( ω A ) + ω A + ω B U j i a b ( ω A , ω B ) = S j i a b ε i 0 + S k l a U l i b ( ω B ) ε i 0 + S j l a ε l i b ( ω B ) + S k l b U l i a ( ω A ) ε i 0 + U j i a b ( ω A , ω B ) ε i 0 + U j k a ( ω A ) ε k i b ( ω B ) + S j l b ε l i a ( ω A ) + U j k b ( ω B ) ε k i a ( ω A ) + ε j i a b ( ω A , ω B ) .
We make a similar assumption as in the first-order case, namely that
ε j i a b ( ω A , ω B ) = 0
for the vir-occ and occ-vir blocks. Under this assumption, we obtain
U j i a b ( ω A , ω B ) = F j i a b ( ω A , ω B ) + G j i a b ( ω A , ω B ) W j i a b ( ω A , ω B ) ε i 0 ε j 0 ω A ω B ,
where G j i a b and W j i a b are defined as
G j i a b ( ω A , ω B ) = F j l a ( ω A ) U l i b ( ω B ) + F j l b ( ω B ) U l i a ( ω A ) U j k a ( ω A ) ε k i b ( ω B ) U j k b ( ω B ) ε k i a ( ω A ) ,
W j i a b ( ω A , ω B ) = S j i a b ε i 0 + S j l a U l i b ( ω B ) ε i 0 + S j k a ε k i b ( ω B ) + S j l b U l i a ( ω A ) ε i 0 + S j k b ε k i a ( ω A ) ω B S j l a U l i b ( ω B ) ω A S j l b U l i a ( ω A ) + T j i a b ( ω A , ω B ) + T j l a ( ω A ) U l i b ( ω B ) + T j l b ( ω B ) U l i a ( ω A ) .
The diagonal blocks of U j i a b ( ω A , ω B ) can also be determined by exploiting the orthonormality condition (46):
U k i a b * ( ω A , ω B ) + U i k a b ( ω A , ω B ) = U j i a * ( ω A ) U j k b ( ω B ) U j i b * ( ω B ) U j k a ( ω A ) S i k a b U j i a * ( ω A ) S j k b U j i b * ( ω B ) S j k a S j i a * U j k b ( ω B ) S j i b * U j k a ( ω A ) .
Choosing
U k i a b * ( ω A , ω B ) = U i k a b ( ω A , ω B )
leads to the following working expression:
U i k a b ( ω A , ω B ) = 1 2 U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + S i k a b + U j i a * ( ω A ) S j k b + U j i b * ( ω B ) S j k a + S j i a * U j k b ( ω B ) + S j i b * U j k a ( ω A ) .
To facilitate a more direct solution of the off-diagonal blocks of U j i a b ( ω A , ω B ) , we insert Equation (54) into Equation (73), isolating the terms involving unknowns on one side to give
A j i k l + ω A δ i k δ j l U l k a b ( ω A , ω B ) + B j i l k U l k a b * ( ω A , ω B ) = H j i a b D λ κ a ( ω A ) ( j i | κ λ ) b D λ κ b ( ω B ) ( j i | κ λ ) a n k ( j i | k k ) a b n k ( j i | | n l ) 0 U l k a ( ω A ) U n k b * ( ω B ) + U l k b ( ω B ) U n k a * ( ω A ) ( j i a b | v xc ) ( j i a | f xc | ρ b ( ω B ) ) ( j i b | f xc | ρ a ( ω A ) ) D λ κ a ( ω A ) ( j i 0 | f xc | κ λ b ) D λ κ b ( ω B ) ( j i 0 | f xc | κ λ a ) n k ( j i 0 | f xc | k k a b ) ( j i 0 | k xc | ρ a ( ω A ) | ρ b ( ω B ) ) G j i a b ( ω A , ω B ) + W j i a b ( ω A , ω B ) .
The index l on the left-hand side is summed over all orbitals, as nonzero contributions arise regardless of whether the basis functions are perturbation-dependent. Following the same procedure, we partition the index l into virtual and occupied orbitals and move all constant terms to the right-hand side to obtain
A j i k l + ω A + ω B δ i k δ j l U l k a b ( ω A , ω B ) + B j i l k U l k a b * ( ω A , ω B ) = R j i a b ( ω A , ω B ) ,
where
R j i a b ( ω A , ω B ) = H j i a b D λ κ a ( ω A ) ( j i | κ λ ) b D λ κ b ( ω B ) ( j i | κ λ ) a n k ( j i | k k ) a b n k ( j i | | n l ) 0 U l k a ( ω A ) U n k b * ( ω B ) + U l k b ( ω B ) U n k a * ( ω A ) ( j i a b | v xc ) ( j i a | f xc | ρ b ( ω B ) ) ( j i b | f xc | ρ a ( ω A ) ) D λ κ a ( ω A ) ( j i 0 | f xc | κ λ b ) D λ κ b ( ω B ) ( j i 0 | f xc | κ λ a ) n k ( j i 0 | f xc | k k a b ) ( j i 0 | k xc | ρ a ( ω A ) | ρ b ( ω B ) ) G j i a b ( ω A , ω B ) + W j i a b ( ω A , ω B ) n k ( j i | | k m ) 0 U m k a b ( ω A , ω B ) + ( j i | | m k ) 0 U m k a b * ( ω A , ω B ) .
In the two equations above, we take i , k , m occ and j , l vir . The index n may be restricted to virtual orbitals if the basis functions are field-independent; otherwise, it must run over all orbitals. Taking the complex conjugate of Equation (80) and replacing ( ω A , ω B ) with ( ω A , ω B ) yields
A j i k l * ω A + ω B δ i k δ j l U l k a b * ( ω A , ω B ) + B j i l k * U l k a b ( ω A , ω B ) = R j i a b * ( ω A , ω B ) .
Equations (80) and (82) together form a system of linear equations:
A j i k l + ω A + ω B δ i k δ j l B j i l k B j i l k * A j i k l * ω A + ω B δ i k δ j l U l k a b ( ω A , ω B ) U l k a b * ( ω A , ω B ) = R j i a b ( ω A , ω B ) R j i a b * ( ω A , ω B ) ,
which constitutes the working second-order CP-HF/KS equation. It depends on the solutions of the first-order Equation (69), and together, the first- and second-order solutions determine the second-order response density.

2.6. Quasi-Energy Response: Working Form

Using the expressions derived in Section 2.3, Section 2.4 and Section 2.5, the quasi-energy derivatives from Section 2.2 can be simplified to yield the following explicit working formulas that are suitable for practical evaluation (see Appendix B for details).
  • The First Order:
W a ( ω A ) = n i S i i a ε i 0 + ω A 2 + D ν μ 0 H μ ν a T μ ν a ( ω A ) + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a + D ν μ 0 ( μ ν a | v xc ) .
The Second Order:
W a b ( ω A , ω B ) = n i 2 U j i a ( ω A ) S j i b * ε i 0 ω A + ω B n i 2 U j i b ( ω B ) S j i a * ε i 0 + ω A ω B n i 2 U j i a * ( ω A ) S j i b + U j i b * ( ω B ) S j i a ε i 0 + ω A + ω B n i 2 S i i a b 2 ε i 0 + ω A + ω B + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 + n i 8 ω A + 3 ω B S k i a S k i b * + ω B + 3 ω A S k i b S k i a * n i 4 S k i a F k i b * ( ω B ) T k i b * ( ω B ) + S k i a * F k i b ( ω B ) T k i b ( ω B ) + S k i b F k i a b * ( ω A ) T k i a * ( ω A ) + S k i b * F k i a b ( ω A ) T k i a ( ω A ) + 1 2 D ν μ a ( ω A ) H μ ν b T μ ν b ( ω B ) + D ν μ b ( ω B ) H μ ν a T μ ν a ( ω A ) + D ν μ a ( ω A ) D λ κ 0 ( μ ν | κ λ ) b + D ν μ b ( ω B ) D λ κ 0 ( μ ν | κ λ ) a + D ν μ a ( ω A ) ( μ ν b | v xc ) + D ν μ b ( ω B ) ( μ ν a | v xc ) + D ν μ 0 ( μ ν b | f xc | ρ a ( ω A ) ) + D ν μ 0 ( μ ν a | f xc | ρ b ( ω B ) ) + D ν μ 0 H μ ν a b T μ ν a b ( ω A , ω B ) + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a b + D ν μ 0 ( μ ν a b | v xc ) ,
where i , k occ and j vir .
The Third Order:
W a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) ω A + ω B + ω C + n i F j l a ( ω A ) T j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) + n i F j l b ( ω B ) T j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) + n i F j l c ( ω C ) T j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) n i F k i a b ( ω A ) T k i a ( ω A ) U j i b * ( ω B ) S j k c + U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) S j k b + S i k b c + S j i b * U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + S j i c * U j k b ( ω B ) n i F k i b ( ω B ) T k i b ( ω B ) U j i a * ( ω A ) S j k c + U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) S j k a + S i k a c + S j i a * U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + S j i c * U j k a ( ω A ) n i F k i c b ( ω C ) T k i c ( ω C ) U j i a * ( ω A ) S j k b + U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) S j k a + S i k a b + S j i a * U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + S j i b * U j k a ( ω A ) + S a b c ( ω A , ω B , ω C ) + V a b c ( ω A , ω B , ω C ) ,
where i , k occ , and j vir in the first bracketed term. The quantities S a b c ( ω A , ω B , ω C ) and V a b c ( ω A , ω B , ω C ) are defined as (with i , k restricted to occupied orbitals)
S a b c ( ω A , ω B , ω C ) = n i 2 U k i a b ( ω A , ω B ) S k i c * ε k 0 + ε i 0 + ω A + ω B + U k i a b * ( ω A , ω B ) S k i c ε k 0 + ε i 0 + ω C + U k i a c ( ω A , ω C ) S k i b * ε k 0 + ε i 0 + ω A + ω C + U k i a c * ( ω A , ω C ) S k i b ε k 0 + ε i 0 + ω B + U k i b c ( ω B , ω C ) S k i a * ε k 0 + ε i 0 + ω B + ω C + U k i b c * ( ω B , ω C ) S k i a ε k 0 + ε i 0 + ω A + n i 4 ω A + ω B + ω C U k i a b ( ω A , ω B ) S k i c * + U k i a c ( ω A , ω C ) S k i b * + U k i b c ( ω B , ω C ) S k i a * + U k i a b * ( ω A , ω B ) S k i c + U k i a c * ( ω A , ω C ) S k i b + U k i b c * ( ω B , ω C ) S k i a n i 2 U j i b * ( ω B ) S j l c + U j i c * ( ω C ) S j l b + S l i b c * U l i a ( ω A ) 2 ε i 0 ω A + ω B + ω C + U j i a * ( ω A ) S j l c + U j i c * ( ω C ) S j l a + S l i a c * U l i b ( ω B ) 2 ε i 0 + ω A ω B + ω C + U j i a * ( ω A ) S j l b + U j i b * ( ω B ) S j l a + S l i a b * U l i c ( ω C ) 2 ε i 0 + ω A + ω B ω C n i 2 ω C ω A ω B U j i a b ( ω A , ω B ) S j i c * + ω B ω A ω C U j i a c ( ω A , ω C ) S j i b * + ω A ω B ω C U j i b c ( ω B , ω C ) S j i a * n i 2 U j i a b * ( ω A , ω B ) S j i c + U j i a c * ( ω A , ω C ) S j i b + U j i b c * ( ω B , ω C ) S j i a ω A + ω B + ω C n i 2 U j i a * ( ω A ) S j i b c + U j i b * ( ω B ) S j i a c + U j i c * ( ω C ) S j i a b + S i i a b c 2 ε i 0 + ω A + ω B + ω C ,
and
V a b c ( ω A , ω B , ω C ) = D ν μ a ( ω A ) H μ ν b c T μ ν b c ( ω B , ω C ) + ( μ ν b c | v xc ) + ( μ ν b | f xc | ρ c ( ω C ) ) + ( μ ν c | f xc | ρ b ( ω B ) ) + D ν μ b ( ω B ) H μ ν a c T μ ν a c ( ω A , ω C ) + ( μ ν a c | v xc ) + ( μ ν a | f xc | ρ c ( ω C ) ) + ( μ ν c | f xc | ρ a ( ω A ) ) + D ν μ c ( ω C ) H μ ν a b T μ ν a b ( ω A , ω B ) + ( μ ν b c | v xc ) + ( μ ν a | f xc | ρ b ( ω B ) ) + ( μ ν b | f xc | ρ a ( ω A ) ) + D ν μ 0 H μ ν a b c T μ ν a b c ( ω A , ω B , ω C ) + 1 2 D λ κ 0 ( μ ν | κ λ ) a b c + ( μ ν a b c | v xc ) + D λ κ a ( ω A ) ( μ ν | κ λ ) b c + D λ κ b ( ω B ) ( μ ν | κ λ ) a c + D λ κ c ( ω C ) ( μ ν | κ λ ) a b + ( μ ν b c | f xc | ρ a ( ω A ) ) + ( μ ν a c | f xc | ρ b ( ω B ) ) + ( μ ν a b | f xc | ρ c ( ω C ) ) + D ν μ a ( ω A ) D λ κ b ( ω B ) ( μ ν | κ λ ) c + D ν μ a ( ω A ) D λ κ c ( ω C ) ( μ ν | κ λ ) b + D ν μ b ( ω B ) D λ κ c ( ω C ) ( μ ν | κ λ ) a + ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) ,
respectively. The third-order derivative of the xc functional ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) is computed numerically but in different forms for various types of functionals, as detailed in Appendix C.
If a perturbation-independent basis set is used, Equations (84)–(86) simplify to
W a = D ν μ 0 H μ ν a ,
W a b ( ω A , ω B ) = 1 2 D ν μ a ( ω A ) H μ ν b + D ν μ b ( ω B ) H μ ν a + D ν μ 0 H μ ν a b ,
W a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) ω A + ω B + ω C + n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) + n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) + n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) n i F k i a b ( ω A ) U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) n i F k i b ( ω B ) U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) n i F k i c b ( ω C ) U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + D ν μ a ( ω A ) H μ ν b c + D ν μ b ( ω B ) H μ ν a c + D ν μ c ( ω C ) H μ ν a b + D ν μ 0 H μ ν a b c + ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) .

3. Applications

The general formalism developed in the previous section can be directly applied to two commonly encountered types of perturbations: electric and magnetic fields. Electric fields give rise to (hyper)polarizabilities, while magnetic fields induce (hyper)magnetizabilities. In this section, we examine the explicit forms of these perturbations, which is essential for practical calculations and program implementation.

3.1. Polarizabilities

For a system with zero net charge, if the external electric field can be approximated as homogeneous, its interaction with the system may be described by the dipole approximation:
H = μ ^ e · E ,
where E is the external electric field and μ ^ e is the electric dipole operator:
μ ^ e = I Z I r I i r i ,
which includes contributions from both the nuclei and electrons. If the nuclear positions are considered fixed and unaffected by the external field, the nuclear contribution becomes a constant. As such, only the electronic part of the dipole operator needs to be taken into account in the SCF procedure.
To characterize the system’s response to such a perturbation, we define the electric dipole moment, polarizability, and first hyperpolarizability as follows:
μ e a ( ω A ) = W a ( ω A ) = D ν μ 0 H μ ν a ,
α a b ( ω A , ω B ) = W a b ( ω A , ω B ) = 1 2 D ν μ a ( ω A ) H μ ν b + D ν μ b ( ω B ) H μ ν a ,
β a b c ( ω A , ω B , ω C ) = W a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) × ω A + ω B + ω C ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) + n i F k i a b ( ω A ) U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + n i F k i b ( ω B ) U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + n i F k i c b ( ω C ) U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) ,
where i , k occ and j , l vir . In practice, computation of such electric response properties can be performed with standard (field-independent) basis sets, for which the derivatives of the basis functions with respect to external fields vanish. The core Hamiltonian has nonzero field derivatives only at first order:
H μ ν a = ( μ | r a | ν ) .
Derived from the quasi-energy formalism with a field-independent basis set, the first-order response (94) coincides exactly with that obtained from the expectation value of the dipole operator, and the second-order form (95) is also largely consistent. The only difference at second order lies in the quasi-energy formalism’s explicit incorporation of the symmetry with respect to the permutation of differentiation orders. However, discrepancies begin to appear at third order: the quasi-energy response (96) includes additional terms involving the second-order response density and exhibits an explicit dependence on field frequencies. This indicates a breakdown of the so-called ( 2 n + 1 ) rule for time-dependent perturbations. Nevertheless, it is worth noting that when the applied frequencies satisfy the equation ω A + ω B + ω C = 0 , the additional terms in Equation (96) cancel out. In other words, nonlinear optical phenomena such as SHG can still be correctly described. Equations (94)–(96) can thus reduce to the special cases presented in the works of Rice et al. [21] and of Karna and Dupuis [22]. However, their derivations are not sufficiently direct—for instance, interpreting SHG by invoking an artificial external field oscillating at 2 ω . In contrast, our formulation is grounded in a more general framework that allows for arbitrary combinations of time-harmonic perturbations, leading to a clearer physical interpretation of the resulting response properties.

3.2. Magnetizabilities

When a magnetic field is applied, the system can also respond to it. If the source of the field is sufficiently distant, the magnetic field B can be approximated as uniform. Under this assumption, the nonrelativistic magnetic interaction takes the form
H ^ = i i A ( r i ) · i + 1 2 A 2 ( r i ) + 1 2 σ i · B = i i 2 B × r i · i + 1 8 B × r i 2 + 1 2 σ i · B = μ ^ m · B + 1 8 i B 2 r i 2 B · r i 2 ,
where A is the vector potential, defined by × A = B , and σ i σ is the Pauli vector. The first term in Equation (98) corresponds to the paramagnetic contribution of the electrons, which is precisely the classical magnetic dipole interaction, and the electronic magnetic moment operator μ ^ m arises from both orbital and spin angular momenta:
μ ^ m = 1 2 i l ^ i + g s s ^ i 1 2 i i r i × i + σ i ,
where the leading minus sign results from the negative charge of the electron, the factor of 1 2 corresponds to the Bohr magneton, and g s 2 is the Landé g-factor for the electron spin, introduced to correct the gyromagnetic ratio. The second term in Equation (98) represents the diamagnetic contribution of the electrons, which reflects the system’s tendency to oppose the applied magnetic field.
Strictly speaking, the magnetic interaction operator should also include paramagnetic and diamagnetic contributions from the nuclei. Even under the Born–Oppenheimer approximation, atomic nuclei possess spin magnetic moments and exhibit diamagnetic responses to an external magnetic field. However, these terms involve mass in the denominator, and since the nuclear mass is at least three orders of magnitude greater than the electronic mass, the nuclear contributions to the magnetic interaction are negligibly small compared to those of the electrons and are therefore commonly neglected.
We now define the (permanent) magnetic moment, magnetizability, and first hypermagnetizability of the system as
μ m a ( ω A ) = W a ( ω A ) = D ν μ 0 H μ ν a ,
ξ a b ( ω A , ω B ) = W a b ( ω A , ω B ) = 1 2 D ν μ a ( ω A ) H μ ν b + D ν μ b ( ω B ) H μ ν a D ν μ 0 H μ ν a b ,
ζ a b c ( ω A , ω B , ω C ) = W a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) × ω A + ω B + ω C ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) + n i F k i a b ( ω A ) U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + n i F k i b ( ω B ) U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + n i F k i c b ( ω C ) U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) D ν μ a ( ω A ) H μ ν b c D ν μ b ( ω B ) H μ ν a c D ν μ c ( ω C ) H μ ν a b ,
where i , k occ , j , l vir , and a field-independent basis set is used. Due to the presence of nonlinear (quadratic) terms in the magnetic interaction operator, the one-electron core Hamiltonian has nonvanishing derivatives up to second order:
H μ ν a = 1 2 ( μ | i ϵ a j k a r j k + σ a | ν ) ,
H μ ν a b = 1 4 ( μ | δ a b r 2 r a r b | ν ) ,
where ϵ a j k a is the Levi-Civita tensor.
Equations (101) and (102) can be decomposed into paramagnetic and diamagnetic contributions, owing to the differing orders of the paramagnetic and diamagnetic interaction operators in the external magnetic field. Specifically, for magnetizability, we have
ξ p a b ( ω A , ω B ) = 1 2 D ν μ a ( ω A ) H μ ν b + D ν μ b ( ω B ) H μ ν a ,
ξ d a b = D ν μ 0 H μ ν a b .
For the first hypermagnetizability, the paramagnetic and diamagnetic parts are given by
ζ p a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) × ω A + ω B + ω C ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) + n i F k i a b ( ω A ) U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + n i F k i b ( ω B ) U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + n i F k i c b ( ω C ) U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) ,
ζ d a b c ( ω A , ω B , ω C ) = D ν μ a ( ω A ) H μ ν b c D ν μ b ( ω B ) H μ ν a c D ν μ c ( ω C ) H μ ν a b .
Magnetic response properties bring in considerations related to gauge transformations, as the vector potential enters explicitly in the interaction Hamiltonian. According to Maxwell’s equations, a gauge transformation of the scalar and vector potentials,
φ φ = φ t g ,
A A = A + g ,
with g being the gauge function, leaves the physical electromagnetic fields unchanged. Similarly, the HF and KS equations must obey gauge covariance—i.e., they must retain their validity under such transformations. It would be unphysical for the HF/KS equations to break down simply because the gauge has changed. Under a gauge transformation, the one-electron wavefunction acquires a position- and time-dependent phase factor:
ψ i ψ i = ψ i e i g ( r , t ) .
As rigorously shown in Appendix D, The function g appearing in the exponent of the phase factor is exactly the gauge function.
When a gauge transformation is considered, both the transformed operators and wavefunctions (more specifically, the basis functions) must be taken into account. Due to the introduction of a phase factor, the basis functions become dependent on the external magnetic field (see Equation (A71)). In this case, more general expressions for the quasi-energy derivatives are required to properly evaluate magnetic response properties. Fortunately, the added phase factor does not affect the overlap between basis functions, as it cancels out:
S μ ν = ( μ | ν ) = ( μ | ν ) = S μ ν .
It follows that all field derivatives of S μ ν vanish at any order. As a result, the magnetic response properties up to third order take the forms
μ m a ( ω A ) = D ν μ 0 T μ ν a ( ω A ) H μ ν a ( ω A ) ,
ξ a b ( ω A , ω B ) = 1 2 D ν μ a ( ω A ) T μ ν b ( ω B ) H μ ν b ( ω B ) + 1 2 D ν μ b ( ω B ) T μ ν a ( ω A ) H μ ν a ( ω A ) + D ν μ 0 T μ ν a b ( ω A , ω B ) H μ ν a b ( ω A , ω B ) ,
ζ a b c ( ω A , ω B , ω C ) = n i 2 U j i a b ( ω A , ω B ) U j i c * ( ω C ) U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) U j i b c * ( ω B , ω C ) U j i a ( ω A ) × ω A + ω B + ω C ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) n i F j l a ( ω A ) T j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) n i F j l b ( ω B ) T j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) n i F j l c ( ω C ) T j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) + n i F k i a b ( ω A ) T k i a ( ω A ) U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + n i F k i b ( ω B ) T k i b ( ω B ) U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + n i F k i c b ( ω C ) T k i c ( ω C ) U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + D ν μ a ( ω A ) T μ ν b c ( ω B , ω C ) H μ ν b c ( ω B , ω C ) + D ν μ b ( ω B ) T μ ν a c ( ω A , ω C ) H μ ν a c ( ω A , ω C ) + D ν μ c ( ω C ) T μ ν a b ( ω A , ω B ) H μ ν a b ( ω A , ω B ) + D ν μ 0 T μ ν a b c ( ω A , ω B , ω C ) H μ ν a b c ( ω A , ω B , ω C ) .
Note that the gauge transformation of the scalar potential causes the core Hamiltonian matrix H μ ν to become explicitly dependent on the magnetic fields (or field frequencies), which must be properly accounted for in practical calculations.
T μ ν can now be explicitly expressed as
T μ ν = ( μ | i t | ν ) = ( μ | ( t g ) | ν ) = i 2 A ω A B A e i ω A t · R × ( μ | r | ν ) ,
which is, perhaps unexpectedly, identical to the result of the gauge-transformation operator for the scalar potential. Moreover, it involves only the first-order field derivative:
T μ ν a ( ω A ) = i ω A 2 ϵ a j k a R j ( μ | r k | ν ) .
Equations (113)–(115) are exactly equivalent to Equations (100)–(102), thereby confirming that the response properties derived from quasi-energy derivatives are completely independent of the choice of gauge origin, as all gauge-dependent contributions cancel out. This is a direct consequence of the gauge covariance of the HF/KS equations.

Comparison with the GIAO Method

The magnetic response properties derived above are gauge-invariant, as the quasi-energy itself is a gauge-invariant quantity. In contrast, the energy and the dipole expectation are not conserved under gauge transformations. Consequently, frameworks based on their field derivatives inevitably lead to gauge-dependent magnetic properties. To address this so-called gauge-origin dependence, several gauge localization schemes [45,46,47,48,49,50] have been developed. Among them, the most widely adopted is the gauge-including/independent atomic orbitals (GIAOs) [48,49,50], originally referred to as London atomic orbitals [51]. In this method, the gauge in a gauge-transformed basis function ϕ ν is modified as
g ν = 1 2 B · R R ν × r ,
where the gauge origin R is fixed at the center R ν of the ν -th atomic orbital, i.e.,
ϕ ν = ϕ ν e i g ν = ϕ ν e i 2 B · R ν R × r .
However, the gauge function appearing in the field-dependent operators remains unchanged. This artificial treatment compromises the covariance of the HF/KS equations under gauge transformations.
In this case, the gauge-transformed overlap matrix S μ ν no longer vanishes:
S μ ν = ( μ | e B · U μ ν | ν ) ,
where we define
U μ ν = i 2 R μ ν × r = i 2 R ν R μ × r .
The matrix T μ ν becomes
T μ ν = i 2 A ω A B A e i ω A t · R ν R × ( μ | r e B · U μ ν | ν ) .
Both Equations (120) and (122) contribute nonzero higher-order field derivatives, which necessitates the use of the full formulation with field-dependent basis sets in magnetic response theory.
Moreover, one can show that gauge-origin dependent terms in Equations (113)–(115) such as
H μ ν a ( ω A ) T μ ν a ( ω A ) = μ U μ ν a 1 2 2 I Z I r r I i 2 ϵ a j k a r ν j k + 1 2 σ a i 2 ω A ϵ a j k a R ν j r k ν
and
H μ ν a b ( ω A , ω B ) T μ ν a b ( ω A , ω B ) = ( μ | U μ ν a U μ ν b 1 2 2 I Z I r r I i 2 U μ ν a ϵ b j k b + U μ ν b ϵ a j k a r ν j k + 1 2 U μ ν a σ b + U μ ν b σ a i 2 ω B U μ ν a ϵ b j k b + ω A U μ ν b ϵ a j k a R ν j r k + 1 4 δ a b r ν 2 r ν a r ν b | ν )
(with r ν defined as r R ν ) merely redistribute the gauge dependence over the atoms. While the resulting expressions may appear free of explicit dependence on the gauge origin R , the computed magnetic properties remain strongly basis-set-dependent.
In this regard, the GIAO method does not fundamentally resolve the gauge problem but instead introduces additional complexity. If all the atomic centers R μ , R ν , in the GIAO expressions are set to zero, one immediately recovers the expressions under the conventional gauge transformation. The core issue is that GIAOs fail to recognize the inherent gauge covariance of the HF/KS equations. Since the quasi-energy is an observable, it should by construction be gauge-invariant—without resorting to artificial gauge localization schemes.

4. Results and Discussion

4.1. Numerical Tests

We have implemented the newly developed electromagnetic response theory based on the HF/KS quasi-energy framework within the PySCF platform [52,53,54,55] for computing general response properties. The core computational step is solving the CP-HF/KS Equations (69) and (83), which are linear and can, in principle, be handled by standard linear solvers. However, such direct approaches are often inefficient for large-scale and sparse systems. To improve performance, our implementation includes interfaces to not only an exact solver but more efficient iterative techniques, including Krylov subspace methods [56,57] and Newton–Krylov (N-K) algorithms [58,59]. These methods enable faster convergence to a target accuracy in many cases. We benchmarked all implementations against the conventional solver as a reference, evaluating both their numerical accuracy and computational efficiency.
First-order response properties require no additional elaborate computation; once the unperturbed density is known, they can be directly evaluated. Therefore, these properties are not included in the following numerical tests. When the sum of the frequencies of the external fields acting on different components of the response tensor is zero, the second- and third-order electromagnetic response properties obtained from our formalism coincide with those given by existing frameworks. Accordingly, we computed the second- and third-order electromagnetic responses corresponding to several conventional optical properties of the H2O molecule (O-H bond length: 0.957 Å, H-O-H bond angle: 104.5°) at both the spin-restricted HF and KS-DFT levels, using the STO-3G basis set from the Basis Set Exchange (BSE) database [60]. The results obtained by different numerical solvers were compared.
For KS-DFT, which includes electron correlation effects to some extent, the numerical complexity of the k xc term in Equation (88) depends on the form of the xc functional (see Appendix C). For example, the local-density-approximation (LDA) functional depends only on the electron density ρ ; the generalized-gradient-approximation (GGA) functional further includes its gradient ρ ; and the meta-GGA (mGGA) functional introduces 2 ρ and the kinetic-energy density τ as additional variables. Non-collinear functionals may also depend on the spin magnetization vector m and the kinetic spin-density vector u . Although our implementation is capable of numerically evaluating all these cases, the present tests were limited to collinear functionals, among which SVWN5, PBE, and TPSS were chosen as representatives of the LDA, GGA, and mGGA functionals, respectively. The radial and angular grids were set to 99 and 590 points for the numerical integration.
Table 1 and Table 2 summarize the computed results for the electric and magnetic response properties, respectively. The monochromatic field was assigned a frequency of 0.1 a.u. To make the data more compact, scalar quantities were used in place of the full response tensors, such as the spherically averaged polarizability:
α ¯ = 1 3 α i i ,
and the magnitude of the first hyperpolarizability:
β ¯ = β ˜ i β ˜ i , where β ˜ i = 1 3 β i j j + β j i j + β j j i .
Similar scalar definitions were applied to other second- and third-order response tensors.
For the electric response properties, reference data from Gaussian 16 Rev. B.01 [61] are provided for comparison, while for the magnetic responses, results from Dalton 2020.1 [62] are included. There are only a few quantum chemistry packages that support the calculation of magnetizabilities. Even the Dalton program still lacks a complete library of mGGA functionals and is limited to the evaluation of static magnetizabilities for closed-shell systems. Since odd-order magnetic response properties of closed-shell systems are purely imaginary for one-component nonrelativistic theory, only the second-order results are presented here.
In Table 2, the diamagnetic contribution depends solely on the unperturbed density and does not require solving the CP equations, whereas the paramagnetic term, analogous to the electric polarizability, involves the first-order CP equations. Accurate solutions of the CP-HF/KS equations rely on well-converged unperturbed molecular orbitals; therefore, the ground-state SCF energy was converged to 10 11 a.u. in all calculations. The Krylov solver used for the CP-HF/KS equations employed a convergence threshold of 10 9 a.u. within the subspace iterations.
As shown in Table 1 and Table 2, the results obtained from our implementation are largely reliable. In Table 1, the deviations from the Gaussian 16 results become slightly more pronounced with the increasing complexity of the xc functional, which is likely attributable to the different numerical integration grid pruning schemes employed in the two programs (NWChem-type grids in PySCF vs. SG-1 grids in Gaussian 16). In addition, the results produced by the various solvers implemented in our code are virtually identical. Considering the superior efficiency of the Krylov solver for large linear systems, it is therefore adopted as the default solver for the CP equations in subsequent calculations.

4.2. Inelastic Response Properties

The electromagnetic response formalism developed in this work encompasses all conventional optical properties, which correspond to processes where the sum of the perturbation frequencies equals zero—i.e., the frequencies of the emitted fields match those of the incident ones. In practice, however, inelastic scattering processes can occur, where the frequency balance is broken due to energy exchange between the external field and the electronic system. Such situations give rise to inelastic response properties, including frequency-mixed or frequency-converted responses that are typically inaccessible in standard optical response theories. The present formalism enables direct prediction of these inelastic responses, as they naturally arise from their mathematical definitions. To illustrate this capability, we computed several frequency-dependent inelastic properties of the H2O molecule at ω = 0.05 , 0.10 , 0.15 , 0.20 a.u., and the results are summarized in Table 3.
To obtain nonzero third-order magnetic responses, the generalized HF/KS framework was employed. This approach allows each molecular orbital to mix α - and β -spin components, thereby accounting for spin-magnetic coupling and non-collinear operator contributions that are essential for accurately describing magnetic correlation effects.
For inelastic properties, as indicated by Equations (96) and (102), the ( 2 n + 1 ) rule breaks down, and the third-order responses show explicit frequency dependence. Consequently, they vary more strongly with the field frequency than the second-order responses under dynamic fields, as illustrated in Table 3.

4.3. Gauge-Invariant Magnetic Properties

Gauge transformations of the electromagnetic potentials introduce a gauge-dependent phase factor e i g into the orbitals and simultaneously impose a unitary transformation on the Hamiltonian. Since a unitary transformation leaves all physical observables of the system unchanged, the quasi-energy and its derivatives are inherently gauge-invariant without any additional corrections.
In contrast, the magnetic properties derived from the GIAO method are based on energy derivatives. Under a dynamic electromagnetic field, the energy is not a gauge-conserved quantity, and the correction introduced by GIAO effectively adds a degree of arbitrariness by distributing the gauge origin among individual atomic centers. This leads to a stronger basis-set dependence of the computed properties. Nevertheless, as the basis set approaches completeness, the difference between GIAO and non-GIAO results diminishes, as can be seen from Table 4. Despite its widespread use, the GIAO approach is conceptually and computationally more involved, and offers limited physical insight.

5. Conclusions

Conventional electromagnetic response theories often suffer from internal inconsistencies and limited generality, particularly under time-dependent perturbations, where the expectation value of the Hamiltonian is no longer an observable. In such cases, frameworks based on energy derivatives become invalid, whereas the quasi-energy provides a more general and physically well-defined quantity.
In this work, we have developed a general electromagnetic response theory based on quasi-energy derivatives and implemented it for nonrelativistic spin-restricted, unrestricted, and generalized references, enabling the calculation of a wide range of electromagnetic response properties. First, the present theoretical framework provides a more general, consistent, and rigorous derivation, particularly for systems under time-dependent perturbations. It can further be extended to mixed response properties involving derivatives with respect to distinct perturbations. Second, the formalism places no restriction on the type or combination of external fields, allowing the treatment of arbitrary dynamic or static perturbations. As a result, it not only encompasses all conventional optical properties but also extends naturally to the prediction of inelastic responses. Additionally, the gauge dependence of magnetic properties is fully resolved within this framework, since the quasi-energy and its derivatives are themselves gauge-invariant quantities.

Author Contributions

Conceptualization, X.L. and D.P.; methodology, X.L. and D.P.; software, X.L.; writing—original draft preparation, X.L.; writing—review and editing, D.P. and F.L.G. All authors have read and agreed to the published version of the manuscript.

Funding

X.L., D.P., and F.L.G. are grateful for financial support from the National Key R&D Program of China (Grant No. 2017YFB0203403), and the National Natural Science Foundation of China (Grant Nos. 21273081, 21673085, 22373037).

Data Availability Statement

No new data were created or analyzed in this study. Data sharing is not applicable to this article.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Derivation of T-Response

Isolating the first three orders of the expansion in Equation (20), we directly obtain
T 0 = 0 ,
T A a F A a = D ν μ 0 T μ ν A a F A a + i n i C μ i * 0 S μ ν 0 C ν i A a t F A a ,
1 2 T A a B b F A a F B b = D ν μ A a T μ ν B b + 1 2 D ν μ 0 T μ ν A a B b F A a F B b + i n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b F A a t F B b + i 2 n i C μ i * 0 S μ ν 0 C ν i A a B b t F A a F B b ,
1 6 T A a B b C c F A a F B b F C c = 1 2 D ν μ A a B b T μ ν C c + 1 2 D ν μ A a T μ ν B b C c + 1 6 D ν μ 0 T μ ν A a B b C c F A a F B b F C c + i n i 1 2 C μ i * A a B b S μ ν 0 + C μ i * A a S μ ν B b + 1 2 C μ i * 0 S μ ν A a B b C ν i C c F A a F B b t F C c + i 2 n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b C c F A a t F B b F C c + i 6 n i C μ i * 0 S μ ν 0 C ν i A a B b C c t F A a F B b F C c .
The summation indices in Equations (A3) and (A4) are dummy variables, and exchanging them does not affect the value of the expressions., e.g., D ν μ A a T μ ν B b F A a F B b = D ν μ B b T μ ν A a F A a F B b . Therefore, the expressions can be symmetrized by averaging over all permutations of the field indices, which gives
T A a B b F A a F B b = D ν μ A a T μ ν B b + D ν μ B b T μ ν A a + D ν μ 0 T μ ν A a B b F A a F B b + i n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b F A a t F B b + i n i C μ i * B b S μ ν 0 + C μ i * 0 S μ ν B b C ν i A a F B b t F A a + i n i C μ i * 0 S μ ν 0 C ν i A a B b t F A a F B b ,
T A a B b C c F A a F B b F C c = D ν μ A a B b T μ ν C c + D ν μ A a C c T μ ν B b + D ν μ B b C c T μ ν A a + D ν μ A a T μ ν B b C c + D ν μ B b T μ ν A a C c + D ν μ C c T μ ν A a B b + D ν μ 0 T μ ν A a B b C c F A a F B b F C c + i n i C μ i * A a B b S μ ν 0 + C μ i * A a S μ ν B b + C μ i * B b S μ ν A a + C μ i * 0 S μ ν A a B b C ν i C c F A a F B b t F C c + i n i C μ i * A a C c S μ ν 0 + C μ i * A a S μ ν C c + C μ i * C c S μ ν A a + C μ i * 0 S μ ν A a C c C ν i B b F A a F C c t F B b + i n i C μ i * B b C c S μ ν 0 + C μ i * B b S μ ν C c + C μ i * C c S μ ν B b + C μ i * 0 S μ ν B b C c C ν i A a F B b F C c t F A a + i n i C μ i * A a S μ ν 0 + C μ i * 0 S μ ν A a C ν i B b C c F A a t F B b F C c + i n i C μ i * B b S μ ν 0 + C μ i * 0 S μ ν B b C ν i A a C c F B b t F A a F C c + i n i C μ i * C c S μ ν 0 + C μ i * 0 S μ ν C c C ν i A a B b F C c t F A a F B b + i n i C μ i * 0 S μ ν 0 C ν i A a B b C c t F A a F B b F C c .
By inserting each independent field as F A a ( r , t ) = F A a ( r ) e i ω A t into Equations (A2), (A5), and (A6) and canceling out the shared factors, we arrive at Equations (21)–(24).

Appendix B. Derivation of W-Response

Appendix B.1. The First-Order W-Response

Let us first evaluate the first term in the first-order energy response (16),
D ν μ a ( ω A ) F μ ν 0 = n i C ν j 0 U j i a ( ω A ) C μ i 0 * + C ν i 0 C μ j 0 * U j i a * ( ω A ) F μ ν 0 = n i U j i a ( ω A ) F i j 0 + U j i a * ( ω A ) F j i 0 .
Since the ground-state Fock matrix is diagonal in the molecular orbital basis, i.e., F i j 0 = δ i j ε j 0 , the summation over j yields
U j i a ( ω A ) F i j 0 + U j i a * ( ω A ) F j i 0 = U i i a ( ω A ) + U i i a * ( ω A ) ε i 0 .
By virtue of the orthonormality condition (45), we have
D ν μ a ( ω A ) F μ ν 0 = n i S i i a ε i 0 .
Thus, the first-order response of the electronic energy becomes
E a = n i S i i a ε i 0 + D ν μ 0 H μ ν a + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a + D ν μ 0 ( μ ν a | v xc ) .
Now we turn to the first-order response of T, as given in Equation (22). The second term therein can be rewritten as
ω A n i C μ i 0 * S μ ν 0 C ν i a ( ω A ) = ω A n i C μ i 0 * S μ ν 0 C ν j 0 U j i a ( ω A ) = ω A n i δ i j U j i a ( ω A ) = ω A n i U i i a ( ω A ) = 1 2 ω A n i S i i a .
Then, Equation (22) is equivalent to
T a ( ω A ) = D ν μ 0 T μ ν a ( ω A ) + 1 2 ω A n i S i i a .
The total first-order quasi-energy response is therefore Equation (84).

Appendix B.2. The Second-Order W-Response

Similarly, we begin by evaluating the first term in Equation (18), using the definition of the second-order density matrix (38):
D ν μ a b ( ω A , ω B ) F μ ν 0 = n i U j i a b ( ω A , ω B ) F i j 0 + U j i a ( ω A ) U k i b * ( ω B ) F k j 0 + U j i b ( ω B ) U k i a * ( ω A ) F k j 0 + U j i a b * ( ω A , ω B ) F j i 0 .
Owing to the diagonal structure of the zeroth-order Fock matrix in the molecular orbital basis, the summation over j can be carried out to produce
U j i a b ( ω A , ω B ) F i j 0 + U j i a ( ω A ) U k i b * ( ω B ) F k j 0 + U j i b ( ω B ) U k i a * ( ω A ) F k j 0 + U j i a b * ( ω A , ω B ) F j i 0 = U j i a ( ω A ) U j i b * ( ω B ) + U j i b ( ω B ) U j i a * ( ω A ) ε j 0 + U i i a b ( ω A , ω B ) + U i i a b * ( ω A , ω B ) ε i 0 ,
where the expression inside the second brackets can be reduced by virtue of the orthonormality condition (46), resulting in
U i i a b ( ω A , ω B ) + U i i a b * ( ω A , ω B ) = U j i a * ( ω A ) S j i b U j i a * ( ω A ) U j i b ( ω B ) U j i b * ( ω B ) S j i a S i i a b S j i a * U j i b ( ω B ) U j i b * ( ω B ) U j i a ( ω A ) S j i b * U j i a ( ω A ) .
Accordingly, we obtain
D ν μ a b ( ω A , ω B ) F μ ν 0 = n i U j i a ( ω A ) U j i b * ( ω B ) + U j i b ( ω B ) U j i a * ( ω A ) ε j 0 ε i 0 n i U j i a * ( ω A ) S j i b + U j i b * ( ω B ) S j i a + S i i a b + S j i a * U j i b ( ω B ) + S j i b * U j i a ( ω A ) ε i 0 .
For further simplification, we separate the summation over j in the above expression into contributions from virtual and occupied orbitals (the latter can be transformed using Equation (61)), and write
D ν μ a b ( ω A , ω B ) F μ ν 0 = n i U j i a ( ω A ) U j i b * ( ω B ) + U j i b ( ω B ) U j i a * ( ω A ) ε j 0 ε i 0 n i U j i a * ( ω A ) S j i b + U j i b * ( ω B ) S j i a + S i i a b + S j i a * U j i b ( ω B ) + S j i b * U j i a ( ω A ) ε i 0 + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 ,
where i , k occ and j vir .
The second term in Equation (18) can be recast into
D ν μ a ( ω A ) F μ ν b ( ω B ) = n i U j i a ( ω A ) F j i b * ( ω B ) + U j i a * ( ω A ) F j i b ( ω B ) .
Similarly, by separating the summation over j into contributions from virtual and occupied orbitals, we obtain
D ν μ a ( ω A ) F μ ν b ( ω B ) = n i U j i a ( ω A ) F j i b * ( ω B ) + U j i a * ( ω A ) F j i b ( ω B ) n i 2 S k i a F k i b * ( ω B ) + S k i a * F k i b ( ω B ) = n i U j i a ( ω A ) U j i b * ( ω B ) ε i 0 ε j 0 + ω B + T j i b * ( ω B ) + S j i b * ε i 0 + n i U j i a * ( ω A ) U j i b ( ω B ) ε i 0 ε j 0 ω B + T j i b ( ω B ) + S j i b ε i 0 n i 2 S k i a F k i b * ( ω B ) + S k i a * F k i b ( ω B ) ,
where i , k occ and j vir , and Equation (58) has been fully utilized.
It can be seen that the combination of Equations (A17) and (A19) leads to partial cancelation of terms:
D ν μ a b ( ω A , ω B ) F μ ν 0 + D ν μ a ( ω A ) F μ ν b ( ω B ) = n i U j i a ( ω A ) T j i b * ( ω B ) + ω B U j i b * ( ω B ) + n i U j i a * ( ω A ) T j i b ( ω B ) ω B U j i b ( ω B ) n i U j i b * ( ω B ) S j i a + S i i a b + S j i a * U j i b ( ω B ) ε i 0 + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 n i 2 S k i a F k i b * ( ω B ) + S k i a * F k i b ( ω B ) .
Consequently, the second-order energy response takes the form
E a b ( ω A , ω B ) = n i U j i a ( ω A ) T j i b * ( ω B ) + ω B U j i b * ( ω B ) + n i U j i a * ( ω A ) T j i b ( ω B ) ω B U j i b ( ω B ) n i U j i b * ( ω B ) S j i a + S i i a b + S j i a * U j i b ( ω B ) ε i 0 + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 n i 2 S k i a F k i b * ( ω B ) + S k i a * F k i b ( ω B ) + D ν μ b ( ω B ) H μ ν a + D ν μ 0 H μ ν a b + D ν μ b ( ω B ) D λ κ 0 ( μ ν | κ λ ) a + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a b + D ν μ b ( ω B ) ( μ ν a | v xc ) + D ν μ 0 ( μ ν a b | v xc ) + D ν μ 0 ( μ ν a | f xc | ρ b ( ω B ) ) .
However, upon closer inspection, one can show that the first-order terms in Equation (18) can be reorganized as
D ν μ a ( ω A ) F μ ν b ( ω B ) + D ν μ b ( ω B ) H μ ν a + D ν μ b ( ω B ) D λ κ 0 ( μ ν | κ λ ) a + D ν μ b ( ω B ) ( μ ν a | v xc ) + D ν μ 0 ( μ ν a | f xc | ρ b ( ω B ) ) = D ν μ b ( ω B ) F μ ν a ( ω A ) + D ν μ a ( ω A ) H μ ν b + D ν μ a ( ω A ) D λ κ 0 ( μ ν | κ λ ) b + D ν μ a ( ω A ) ( μ ν b | v xc ) + D ν μ 0 ( μ ν b | f xc | ρ a ( ω A ) )
according to Equation (53). Proceeding in the same manner, we obtain an alternative expression for the second-order energy response:
E a b ( ω A , ω B ) = n i U j i b ( ω B ) T j i a * ( ω A ) + ω A U j i a * ( ω A ) + n i U j i b * ( ω B ) T j i a ( ω A ) ω A U j i a ( ω A ) n i U j i a * ( ω A ) S j i b + S i i a b + S j i b * U j i a ( ω A ) ε i 0 + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 n i 2 S k i b F k i a * ( ω A ) + S k i b * F k i a ( ω A ) + D ν μ a ( ω A ) H μ ν b + D ν μ 0 H μ ν a b + D ν μ a ( ω A ) D λ κ 0 ( μ ν | κ λ ) b + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a b + D ν μ a ( ω A ) ( μ ν b | v xc ) + D ν μ 0 ( μ ν a b | v xc ) + D ν μ 0 ( μ ν b | f xc | ρ a ( ω A ) ) .
This expression is mathematically equivalent to Equation (A21), but to make the symmetry under the interchange of differentiation order explicit, we take the average of the two forms in the final result:
E a b ( ω A , ω B ) = n i 2 U j i a ( ω A ) T j i b * ( ω B ) S j i b * ε i 0 + n i 2 U j i a * ( ω A ) T j i b ( ω B ) S j i b ε i 0 + n i 2 U j i b ( ω B ) T j i a * ( ω A ) S j i a * ε i 0 + n i 2 U j i b * ( ω B ) T j i a ( ω A ) S j i a ε i 0 + n i 2 ω B ω A U j i a ( ω A ) U j i b * ( ω B ) U j i b ( ω B ) U j i a * ( ω A ) n i S i i a b ε i 0 + n i 4 S k i a S k i b * + S k i b S k i a * ε k 0 + 3 ε i 0 n i 4 S k i a F k i b * ( ω B ) + S k i a * F k i b ( ω B ) + S k i b F k i a * ( ω A ) + S k i b * F k i a ( ω A ) + 1 2 D ν μ a ( ω A ) H μ ν b + D ν μ b ( ω B ) H μ ν a + D ν μ a ( ω A ) D λ κ 0 ( μ ν | κ λ ) b + D ν μ b ( ω B ) D λ κ 0 ( μ ν | κ λ ) a + D ν μ a ( ω A ) ( μ ν b | v xc ) + D ν μ b ( ω B ) ( μ ν a | v xc ) + D ν μ 0 ( μ ν b | f xc | ρ a ( ω A ) ) + D ν μ 0 ( μ ν a | f xc | ρ b ( ω B ) ) + D ν μ 0 H μ ν a b + 1 2 D ν μ 0 D λ κ 0 ( μ ν | κ λ ) a b + D ν μ 0 ( μ ν a b | v xc ) ,
where we choose i , k occ and j vir .
The second derivative of T is also simplifiable. From Equation (23), we find that
C μ i a * ( ω A ) S μ ν 0 + C μ i 0 * S μ ν a C ν i b ( ω B ) = C μ k 0 * U k i a * ( ω A ) S μ ν 0 + C μ i 0 * S μ ν a C ν j 0 U j i b ( ω B ) = δ k j U k i a * ( ω A ) + S i j a U j i b ( ω B ) = U j i a * ( ω A ) + S j i a * U j i b ( ω B ) .
Similarly,
C μ i b * ( ω B ) S μ ν 0 + C μ i 0 * S μ ν b C ν i a ( ω A ) = U j i b * ( ω B ) + S j i b * U j i a ( ω A ) .
For the last term in Equation (23), we have
C μ i 0 * S μ ν 0 C ν i a b ( ω A , ω B ) = S i j 0 U j i a b ( ω A , ω B ) = δ i j U j i a b ( ω A , ω B ) = U i i a b ( ω A , ω B ) = 1 2 U j i a * ( ω A ) S j i b + U j i a * ( ω A ) U j i b ( ω B ) + U j i b * ( ω B ) S j i a + S i i a b + S j i a * U j i b ( ω B ) + U j i b * ( ω B ) U j i a ( ω A ) + S j i b * U j i a ( ω A ) .
Hence, T a b ( ω A , ω B ) can be cast into
T a b ( ω A , ω B ) = n i 2 U j i a ( ω A ) T j i b * ( ω B ) + U j i a * ( ω A ) T j i b ( ω B ) + U j i b ( ω B ) T j i a * ( ω A ) + U j i b * ( ω B ) T j i a ( ω A ) + 1 2 D ν μ a ( ω A ) T μ ν b ( ω B ) + D ν μ b ( ω B ) T μ ν a ( ω A ) + D ν μ 0 T μ ν a b ( ω A , ω B ) + n i 2 ω A ω B U j i a * ( ω A ) + S j i a * U j i b ( ω B ) U j i b * ( ω B ) + S j i b * U j i a ( ω A ) + n i 2 ω A + ω B U j i a * ( ω A ) S j i b + S i i a b + U j i b * ( ω B ) S j i a .
Splitting the summation over j into virtual and occupied orbitals gives
T a b ( ω A , ω B ) = n i 2 U j i a ( ω A ) T j i b * ( ω B ) + U j i a * ( ω A ) T j i b ( ω B ) + U j i b ( ω B ) T j i a * ( ω A ) + U j i b * ( ω B ) T j i a ( ω A ) n i 4 S k i a T k i b * ( ω B ) + S k i a * T k i b ( ω B ) + S k i b T k i a * ( ω A ) + S k i b T k i a ( ω A ) + 1 2 D ν μ a ( ω A ) T μ ν b ( ω B ) + D ν μ b ( ω B ) T μ ν a ( ω A ) + D ν μ 0 T μ ν a b ( ω A , ω B ) + n i 2 ω A ω B U j i a * ( ω A ) + S j i a * U j i b ( ω B ) U j i b * ( ω B ) + S j i b * U j i a ( ω A ) + n i 2 ω A + ω B U j i a * ( ω A ) S j i b + S i i a b + U j i b * ( ω B ) S j i a n i 8 3 ω A + ω B S k i a * S k i b + 3 ω B + ω A S k i b * S k i a ,
where i , k occ and j vir .
Consequently, the second-order quasi-energy response can be written as Equation (85).

Appendix B.3. The Third-Order W-Response

By analogy with previous derivations, we make use of the canonical form of the ground-state molecular orbitals and the orthonormality condition (47), which allows us to simplify the first term in the third-order energy response (19) as
D ν μ a b c ( ω A , ω B , ω C ) F μ ν 0 = n i U j i a b ( ω A , ω B ) U j i c * ( ω C ) + U j i c ( ω C ) U j i a b * ( ω A , ω B ) + U j i a c ( ω A , ω C ) U j i b * ( ω B ) + U j i b ( ω B ) U j i a c * ( ω A , ω C ) + U j i b c ( ω B , ω C ) U j i a * ( ω A ) + U j i a ( ω A ) U j i b c * ( ω B , ω C ) ε j 0 ε i 0 n i U j i a b * ( ω A , ω B ) S j i c + U j i a c * ( ω A , ω C ) S j i b + U j i a * ( ω A ) S j i b c + U j i a * ( ω A ) S j k b U k i c ( ω C ) + U j i a * ( ω A ) S j k c U k i b ( ω B ) + U j i b c * ( ω B , ω C ) S j i a + U j i b * ( ω B ) S j i a c + U j i b * ( ω B ) S j k a U k i c ( ω C ) + U j i c * ( ω C ) S j i a b + S i i a b c + S j i a b * U j i c ( ω C ) + U j i c * ( ω C ) S j k a U k i b ( ω B ) + S j i a c * U j i b ( ω B ) + S j i a * U j i b c ( ω B , ω C ) + U j i b * ( ω B ) S j k c U k i a ( ω A ) + U j i c * ( ω C ) S j k b U k i a ( ω A ) + S j i b c * U j i a ( ω A ) + S j i b * U j i a c ( ω A , ω C ) + S j i c * U j i a b ( ω A , ω B ) ε i 0 .
According to the definition of the second-order Fock matrix (54), we find in Equation (19) that
D ν μ a ( ω A ) F μ ν b c ( ω B , ω C ) + D ν μ b c ( ω B , ω C ) H μ ν a + D λ κ 0 ( μ ν | κ λ ) a + ( μ ν a | v xc ) + D ν μ 0 ( μ ν a | f xc | ρ b c ( ω B , ω C ) ) + ( μ ν a | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) = D ν μ b c ( ω B , ω C ) F μ ν a ( ω A ) + D ν μ a ( ω A ) H μ ν b c + D λ κ b ( ω B ) ( μ ν | κ λ ) c + D λ κ c ( ω C ) ( μ ν | κ λ ) b + D λ κ 0 ( μ ν | κ λ ) b c + ( μ ν b c | v xc ) + ( μ ν b | f xc | ρ c ( ω C ) ) + ( μ ν c | f xc | ρ b ( ω B ) ) + D ν μ b ( ω B ) ( μ ν c | f xc | ρ a ( ω A ) ) + D ν μ c ( ω C ) ( μ ν b | f xc | ρ a ( ω A ) ) + D ν μ 0 ( μ ν b c | f xc | ρ a ( ω A ) ) + ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) ,
where
D ν μ b c ( ω B , ω C ) F μ ν a ( ω A ) = n i U j i b c ( ω B , ω C ) F j i a * ( ω A ) + U j i b c * ( ω B , ω C ) F j i a ( ω A ) + n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) .
The summation over j in the first brackets above can be partitioned into contributions from the occupied and virtual subspaces. For the occupied part, using the orthonormality condition (46), we have
n i U k i b c ( ω B , ω C ) F k i a * ( ω A ) + U k i b c * ( ω B , ω C ) F k i a ( ω A ) = n i F k i a ( ω A ) U i k b c ( ω B , ω C ) + U k i b c * ( ω B , ω C ) = n i F k i a ( ω A ) U j i b * ( ω B ) S j k c + U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) S j k b + S i k b c + S j i b * U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + S j i c * U j k b ( ω B ) ,
where i , k occ , and j runs over the full orbital space. For the virtual part, by virtue of the first-order CP-HF/KS equation (58), we obtain
n i U j i b c ( ω B , ω C ) F j i a * ( ω A ) + U j i b c * ( ω B , ω C ) F j i a ( ω A ) = n i U j i b c ( ω B , ω C ) U j i a * ( ω A ) ε i 0 ε j 0 + ω A + T j i a * ( ω A ) + S j i a * ε i 0 + n i U j i b c * ( ω B , ω C ) U j i a ( ω A ) ε i 0 ε j 0 ω A + T j i a ( ω A ) + S j i a ε i 0 ,
where i , k occ and j vir . Consequently, Equation (A32) becomes
D ν μ b c ( ω B , ω C ) F μ ν a ( ω A ) = n i U j i b c ( ω B , ω C ) U j i a * ( ω A ) ε i 0 ε j 0 + ω A + T j i a * ( ω A ) + S j i a * ε i 0 + n i U j i b c * ( ω B , ω C ) U j i a ( ω A ) ε i 0 ε j 0 ω A + T j i a ( ω A ) + S j i a ε i 0 n i F k i a ( ω A ) U j i b * ( ω B ) S j k c + U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) S j k b + S i k b c + S j i b * U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + S j i c * U j k b ( ω B ) + n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) ,
where i , k occ , and the indice j is restricted to the virtual orbitals in the first two terms, but otherwise runs over all orbitals. Similarly, we have
D ν μ a c ( ω A , ω C ) F μ ν b ( ω B ) = n i U j i a c ( ω A , ω C ) U j i b * ( ω B ) ε i 0 ε j 0 + ω B + T j i b * ( ω B ) + S j i b * ε i 0 + n i U j i a c * ( ω A , ω C ) U j i b ( ω B ) ε i 0 ε j 0 ω B + T j i b ( ω B ) + S j i b ε i 0 n i F k i b ( ω B ) U j i a * ( ω A ) S j k c + U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) S j k a + S i k a c + S j i a * U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + S j i c * U j k a ( ω A ) + n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) ,
and
D ν μ a b ( ω A , ω B ) F μ ν c ( ω C ) = n i U j i a b ( ω A , ω B ) U j i c * ( ω C ) ε i 0 ε j 0 + ω C + T j i c * ( ω C ) + S j i c * ε i 0 + n i U j i a b * ( ω A , ω B ) U j i c ( ω C ) ε i 0 ε j 0 ω C + T j i c ( ω C ) + S j i c ε i 0 n i F k i c ( ω C ) U j i a * ( ω A ) S j k b + U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) S j k a + S i k a b + S j i a * U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + S j i b * U j k a ( ω A ) + n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) .
By separating the summation over j in the second-order U -dependent terms of Equation (A30) into contributions from virtual and occupied orbitals, we find that Equations (A30) and (A35)–(A37) can be combined in such a way that certain terms cancel out:
D ν μ a b c ( ω A , ω B , ω C ) F μ ν 0 + D ν μ a b ( ω A , ω B ) F μ ν c ( ω C ) + D ν μ a c ( ω A , ω C ) F μ ν b ( ω B ) + D ν μ b c ( ω B , ω C ) F μ ν a ( ω A ) = n i U j i a b ( ω A , ω B ) T j i c * ( ω C ) + ω C U j i c * ( ω C ) + U j i a b * ( ω A , ω B ) T j i c ( ω C ) ω C U j i c ( ω C ) + U j i a c ( ω A , ω C ) T j i b * ( ω B ) + ω B U j i b * ( ω B ) + U j i a c * ( ω A , ω C ) T j i b ( ω B ) ω B U j i b ( ω B ) + U j i b c ( ω B , ω C ) T j i a * ( ω A ) + ω A U j i a * ( ω A ) + U j i b c * ( ω B , ω C ) T j i a ( ω A ) ω A U j i a ( ω A ) + n i F j l a ( ω A ) U l i b ( ω B ) U j i c * ( ω C ) + U l i c ( ω C ) U j i b * ( ω B ) + n i F j l b ( ω B ) U l i a ( ω A ) U j i c * ( ω C ) + U l i c ( ω C ) U j i a * ( ω A ) + n i F j l c ( ω C ) U l i a ( ω A ) U j i b * ( ω B ) + U l i b ( ω B ) U j i a * ( ω A ) n i F k i a ( ω A ) U j i b * ( ω B ) S j k c + U j i b * ( ω B ) U j k c ( ω C ) + U j i c * ( ω C ) S j k b + S i k b c + S j i b * U j k c ( ω C ) + U j i c * ( ω C ) U j k b ( ω B ) + S j i c * U j k b ( ω B ) n i F k i b ( ω B ) U j i a * ( ω A ) S j k c + U j i a * ( ω A ) U j k c ( ω C ) + U j i c * ( ω C ) S j k a + S i k a c + S j i a * U j k c ( ω C ) + U j i c * ( ω C ) U j k a ( ω A ) + S j i c * U j k a ( ω A ) n i F k i c ( ω C ) U j i a * ( ω A ) S j k b + U j i a * ( ω A ) U j k b ( ω B ) + U j i b * ( ω B ) S j k a + S i k a b + S j i a * U j k b ( ω B ) + U j i b * ( ω B ) U j k a ( ω A ) + S j i b * U j k a ( ω A ) n i 2 U k i a b ( ω A , ω B ) S k i c * + U k i a b * ( ω A , ω B ) S k i c + U k i a c ( ω A , ω C ) S k i b * + U k i a c * ( ω A , ω C ) S k i b + U k i b c ( ω B , ω C ) S k i a * + U k i b c * ( ω B , ω C ) S k i a ε k 0 + ε i 0 n i U j i a * ( ω A ) S j i b c + U j i a * ( ω A ) S j l b U l i c ( ω C ) + U j i a * ( ω A ) S j l c U l i b ( ω B ) + U j i b * ( ω B ) S j i a c + U j i b * ( ω B ) S j l a U l i c ( ω C ) + U j i c * ( ω C ) S j i a b + S i i a b c + S j i a b * U j i c ( ω C ) + U j i c * ( ω C ) S j l a U l i b ( ω B ) + S j i a c * U j i b ( ω B ) + U j i b * ( ω B ) S j l c U l i a ( ω A ) + U j i c * ( ω C ) S j l b U l i a ( ω A ) + S j i b c * U j i a ( ω A ) ε i 0 ,
with i , k restricted to occupied orbitals, and j , l running over all orbitals except in the first term in braces, where the index j refers only to virtual orbitals. Therefore, the third-order energy response reads
E a b c ( ω A , ω B , ω C ) = D ν μ a b c ( ω A , ω B , ω C ) F μ ν 0 + D ν μ a b ( ω A , ω B ) F μ ν c ( ω C ) + D ν μ a c ( ω A , ω C ) F μ ν b ( ω B ) + D ν μ b c ( ω B , ω C ) F μ ν a ( ω A ) + D ν μ a ( ω A ) D λ κ b ( ω B ) ( μ ν | κ λ ) c + D ν μ a ( ω A ) D λ κ c ( ω C ) ( μ ν | κ λ ) b + D ν μ b ( ω B ) D λ κ c ( ω C ) ( μ ν | κ λ ) a + D ν μ a ( ω A ) H μ ν b c + ( μ ν b c | v xc ) + ( μ ν b | f xc | ρ c ( ω C ) ) + ( μ ν c | f xc | ρ b ( ω B ) ) + D ν μ b ( ω B ) H μ ν a c + ( μ ν a c | v xc ) + ( μ ν a | f xc | ρ c ( ω C ) ) + ( μ ν c | f xc | ρ a ( ω A ) ) + D ν μ c ( ω C ) H μ ν a b + ( μ ν b c | v xc ) + ( μ ν a | f xc | ρ b ( ω B ) ) + ( μ ν b | f xc | ρ a ( ω A ) ) + D λ κ 0 D ν μ a ( ω A ) ( μ ν | κ λ ) b c + D ν μ b ( ω B ) ( μ ν | κ λ ) a c + D ν μ c ( ω C ) ( μ ν | κ λ ) a b + D ν μ 0 ( μ ν b c | f xc | ρ a ( ω A ) ) + ( μ ν a c | f xc | ρ b ( ω B ) ) + ( μ ν a b | f xc | ρ c ( ω C ) ) + D ν μ 0 H μ ν a b c + 1 2 D λ κ 0 ( μ ν | κ λ ) a b c + ( μ ν a b c | v xc ) + ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) .
For T a b c ( ω A , ω B , ω C ) as given in Equation (24), one can observe that
C μ i b c * ( ω B , ω C ) S μ ν 0 + C μ i b * ( ω B ) S μ ν c + C μ i c * ( ω C ) S μ ν b + C μ i 0 * S μ ν b c C ν i a ( ω A ) = U k i b c * ( ω B , ω C ) + U j i b * ( ω B ) S j k c + U j i c * ( ω C ) S j k b + S k i b c * U k i a ( ω A ) ,
C μ i a c * ( ω A , ω C ) S μ ν 0 + C μ i a * ( ω A ) S μ ν c + C μ i c * ( ω C ) S μ ν a + C μ i 0 * S μ ν a c C ν i b ( ω B ) = U k i a c * ( ω A , ω C ) + U j i a * ( ω A ) S j k c + U j i c * ( ω C ) S j k a + S k i a c * U k i b ( ω B ) ,
C μ i a b * ( ω A , ω B ) S μ ν 0 + C μ i a * ( ω A ) S μ ν b + C μ i b * ( ω B ) S μ ν a + C μ i 0 * S μ ν a b C ν i c ( ω C ) = U k i a b * ( ω A , ω B ) + U j i a * ( ω A ) S j k b + U j i b * ( ω B ) S j k a + S k i a b * U k i c ( ω C ) .
Similarly, we can obtain
C μ i c * ( ω C ) S μ ν 0 + C μ i 0 * S μ ν c C ν i a b ( ω A , ω B ) = U j i c * ( ω C ) + S j i c * U j i a b ( ω A , ω B ) ,
C μ i b * ( ω B ) S μ ν 0 + C μ i 0 * S μ ν b C ν i a c ( ω A , ω C ) = U j i b * ( ω B ) + S j i b * U j i a c ( ω A , ω C ) ,
C μ i a * ( ω A ) S μ ν 0 + C μ i 0 * S μ ν a C ν i b c ( ω B , ω C ) = U j i a * ( ω A ) + S j i a * U j i b c ( ω B , ω C ) .
The third-order coefficients C ν i a b c ( ω A , ω B , ω C ) appearing in C μ i 0 * S μ ν 0 C ν i a b c ( ω A , ω B , ω C ) deserve particular attention, as this term can be recast as
C μ i 0 * S μ ν 0 C ν i a b c ( ω A , ω B , ω C ) = S i j 0 U j i a b c ( ω A , ω B , ω C ) = δ i j U j i a b c ( ω A , ω B , ω C ) = U i i a b c ( ω A , ω B , ω C ) ,
to which we need to apply a further assumption. Imposing the relation U k i a b c ( ω A , ω B , ω C ) = U i k a b c ( ω A , ω B , ω C ) for the occ-occ block gives
U i i a b c ( ω A , ω B , ω C ) = 1 2 U j i a b * ( ω A , ω B ) S j i c + U j i a b * ( ω A , ω B ) U j i c ( ω C ) + U j i a c * ( ω A , ω C ) S j i b + U j i a * ( ω A ) S j i b c + U j i a * ( ω A ) S j k b U k i c ( ω C ) + U j i a c * ( ω A , ω C ) U j i b ( ω B ) + U j i a * ( ω A ) S j k c U k i b ( ω B ) + U j i a * ( ω A ) U j i b c ( ω B , ω C ) + U j i b c * ( ω B , ω C ) S j i a + U j i b * ( ω B ) S j i a c + U j i b * ( ω B ) S j k a U k i c ( ω C ) + U j i c * ( ω C ) S j i a b + S i i a b c + S j i a b * U j i c ( ω C ) + U j i c * ( ω C ) S j k a U k i b ( ω B ) + S j i a c * U j i b ( ω B ) + S j i a * U j i b c ( ω B , ω C ) + U j i b c * ( ω B , ω C ) U j i a ( ω A ) + U j i b * ( ω B ) S j k c U k i a ( ω A ) + U j i b * ( ω B ) U j i a c ( ω A , ω C ) + U j i c * ( ω C ) S j k b U k i a ( ω A ) + S j i b c * U j i a ( ω A ) + S j i b * U j i a c ( ω A , ω C ) + U j i c * ( ω C ) U j i a b ( ω A , ω B ) + S j i c * U j i a b ( ω A , ω B ) .
Therefore, T a b c ( ω A , ω B , ω C ) finally takes the form
T a b c ( ω A , ω B , ω C ) = D ν μ a b ( ω A , ω B ) T μ ν c ( ω C ) + D ν μ a c ( ω A , ω C ) T μ ν b ( ω B ) + D ν μ b c ( ω B , ω C ) T μ ν a ( ω A ) + D ν μ a ( ω A ) T μ ν b c ( ω B , ω C ) + D ν μ b ( ω B ) T μ ν a c ( ω A , ω C ) + D ν μ c ( ω C ) T μ ν a b ( ω A , ω B ) + D ν μ 0 T μ ν a b c ( ω A , ω B , ω C ) ω A n i U k i b c * ( ω B , ω C ) + U j i b * ( ω B ) S j k c + U j i c * ( ω C ) S j k b + S k i b c * U k i a ( ω A ) ω B n i U k i a c * ( ω A , ω C ) + U j i a * ( ω A ) S j k c + U j i c * ( ω C ) S j k a + S k i a c * U k i b ( ω B ) ω C n i U k i a b * ( ω A , ω B ) + U j i a * ( ω A ) S j k b + U j i b * ( ω B ) S j k a + S k i a b * U k i c ( ω C ) ω A + ω B n i U j i c * ( ω C ) + S j i c * U j i a b ( ω A , ω B ) ω A + ω C n i U j i b * ( ω B ) + S j i b * U j i a c ( ω A , ω C ) ω B + ω C n i U j i a * ( ω A ) + S j i a * U j i b c ( ω B , ω C ) ω A + ω B + ω C n i U i i a b c ( ω A , ω B , ω C ) .
Subtracting Equation (A48) from Equation (A39), one arrives at Equation (86).

Appendix C. Evaluation of (ρ a (ω A)|k xc |ρ b (ω B)|ρ c (ω C))

When the third-order (quasi-)energy response is evaluated in the main text, the third-order derivative of the xc functional, E xc a b c ( ω A , ω B , ω C ) , is involved. In many cases, a standard basis set independent of perturbations is used, and for an LDA functional, E xc a b c ( ω A , ω B , ω C ) reduces to ( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) , with the explicit form given by
( ρ a ( ω A ) | k xc | ρ b ( ω B ) | ρ c ( ω C ) ) = d r ρ a ( r ; ω A ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) δ δ ρ ( r ) d r ρ c ( r ; ω C ) δ E xc δ ρ ( r ) = d r ρ a ( r ; ω A ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) δ δ ρ ( r ) d r ρ c ( r ; ω C ) e xc ρ ( r ) = d r ρ a ( r ; ω A ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) d r δ ρ ( r ) δ ρ ( r ) δ δ ρ ( r ) d r ρ c ( r ; ω C ) e xc ρ ( r ) = d r ρ a ( r ; ω A ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) d r δ ( r r ) ρ c ( r ; ω C ) 2 e xc ρ 2 ( r ) = d r ρ a ( r ; ω A ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) ρ c ( r ; ω C ) 2 e xc ρ 2 ( r ) = d r ρ a ( r ; ω A ) d r δ ρ ( r ) δ ρ ( r ) δ δ ρ ( r ) d r ρ b ( r ; ω B ) ρ c ( r ; ω C ) 2 e xc ρ 2 ( r ) = d r ρ a ( r ; ω A ) d r δ ( r r ) ρ b ( r ; ω B ) ρ c ( r ; ω C ) 3 e xc ρ 3 ( r ) = d r ρ a ( r ; ω A ) ρ b ( r ; ω B ) ρ c ( r ; ω C ) 3 e xc ρ 3 ( r ) ,
where e xc is the xc integrand:
E xc = d r e xc .
If the xc functional is a pure HF exchange, which depends on the second-order reduced density ρ ( r 1 , r 2 ) , we know that (for a closed-shell system) the non-local HF kernel has the form
f HFx = 1 2 δ ( r 1 r 1 ) δ ( r 2 r 2 ) r 12 ,
and thus k HFx vanishes. For GGA, mGGA, as well as non-collinear functionals, E xc may depend on additional independent variables. In this case, the chain rule for functional derivatives must be expanded in a complete function space. By applying integration by parts, we obtain a more general form for E xc a b c ( ω A , ω B , ω C ) :
E xc a b c ( ω A , ω B , ω C ) = d r x i a ( r ; ω A ) x j b ( r ; ω B ) x k c ( r ; ω C ) 3 e xc x i ( r ) x j ( r ) x k ( r ) .
Here, { x } represents the independent variables on which e xc depends. The specific set of variables differs for different types of functionals, as summarized in Table A1.
Table A1. The variables on which different types of xc functionals depend.
Table A1. The variables on which different types of xc functionals depend.
{ x } LDAGGAmGGA
spin-restricted ρ ρ , ρ ρ , ρ , 2 ρ , τ
collinear ρ ρ a ρ ρ , ρ ρ ρ ρ , ρ ρ , 2 ρ ρ , τ τ b
locally-collinear ρ + ρ c ρ + ρ , ρ + ρ ρ + ρ , ρ + ρ , 2 ρ + ρ , τ + τ d
non-collinear ρ m ρ m , ρ m ρ m , ρ m , 2 ρ m , τ u
a ρ ρ = 1 2 ρ + m z ρ m z ; b τ τ = 1 2 τ + u z τ u z ; c ρ + ρ = 1 2 ρ + m ρ m ; d τ + τ = 1 2 τ + u τ u .

Appendix D. Gauge Transformations

Maxwell’s equations permit arbitrary gauge transformations (109) of the scalar and vector potentials without altering the physical electromagnetic fields. To maintain gauge covariance of the HF and KS equations
f ^ i t ψ i = ε j i ψ j f ^ i t ψ i = ε j i ψ j
under such transformations, it is natural to assume that the single-electron wavefunctions transform by a local phase factor:
ψ i = ψ i e i f ( r , t ) ,
where f is a scalar function to be determined. We now examine the gauge-transformed HF/KS equations to verify whether they retain their form.
For the term f ^ ψ i , we have
f ^ ψ i = 1 2 2 i A + g · + 1 2 A + g 2 + 1 2 σ · B φ eff + ( t g ) ψ i e i f = 1 2 · e i f ψ i + ψ i e i f i A + g · e i f ψ i + ψ i e i f + 1 2 A + g 2 ψ i e i f + 1 2 σ · B ψ i e i f φ eff ψ i e i f + ψ i e i f t g = 1 2 e i f · ψ i 1 2 e i f 2 ψ i 1 2 ψ i · e i f 1 2 ψ i 2 e i f i A + g · e i f ψ i + ψ i e i f + 1 2 A 2 ψ i e i f + ψ i e i f A · g + 1 2 ψ i e i f g · g + 1 2 σ · B ψ i e i f φ eff ψ i e i f + ψ i e i f t g .
We can then apply the identity
e i f = i e i f f ,
2 e i f = e i f f · f i e i f 2 f
to obtain
e i f f ^ ψ i = i f · ψ i 1 2 2 ψ i + 1 2 ψ i f · f + i 2 ψ i 2 f i A + g · ψ i A + g · ψ i f + 1 2 A 2 ψ i + ψ i A · g + 1 2 ψ i g · g + 1 2 σ · B ψ i φ eff ψ i + ψ i t g .
For the time derivative term i t ψ i , we can write it as
i t ψ i = i t ψ i e i f = i e i f t ψ i + i ψ i t e i f .
By virtue of the chain rule
t e i f = i e i f t f ,
we get
e i f ( i t ) ψ i = i t ψ i + ψ i t f .
Therefore, substituting Equations (A55) and (A59) into the gauge-transformed equation in Equation (A53), and left-multiplying by e i f , gives
i t ψ i + ψ i t f + ε j i ψ j = i f · ψ i 1 2 2 ψ i + 1 2 ψ i f · f + i 2 ψ i 2 f i A + g · ψ i A + g · ψ i f + 1 2 A 2 ψ i + ψ i A · g + 1 2 ψ i g · g + 1 2 σ · B ψ i φ eff ψ i + ψ i t g .
Subtracting the original HF/KS equations
1 2 2 i A · + 1 2 A 2 + 1 2 σ · B φ eff i t ψ i = ε j i ψ j
from Equation (A62), we arrive at the condition that the scalar function f must satisfy:
ψ i t f = i f · ψ i + 1 2 ψ i f · f + i 2 ψ i 2 f i g · ψ i A + g · ψ i f + ψ i A · g + 1 2 ψ i g · g + ψ i t g .
It follows that this condition is fulfilled only if
f = g + a ,
where a is an arbitrary constant. Without loss of generality, we may set a = 0 . Therefore, the phase factor must be of the form e i g , and g is required to satisfy the Laplace equation 2 g = 0 .
This shows that the gauge transformation of the electromagnetic potentials does not alter the form of the HF/KS equations. The resulting wavefunction differs from the original one only by a unitary phase factor e i g , which indicates that the transformation corresponds to a global unitary transformation of the system.
If we express the external vector potential A in terms of the magnetic induction B , we can construct
A = 1 2 B × r g ,
where the gauge-shifted position vector is defined as r g = r R , with R being the gauge origin. The magnetic field B is assumed to be spatially uniform in the vicinity of the molecule, i.e., independent of the electronic coordinate r . This expression can be derived from the definition of the vector potential:
× A = B ϵ i j k j A k = B i .
Integrating both sides gives
ϵ i j k A k A 0 k = B i r j R j ,
where A 0 k and R j are integration constants. Setting A 0 k = k g , multiplying both sides by ϵ l i j followed by summation over indices i and j, and using the identity ϵ k i j ϵ l i j = 2 δ k l , we obtain
2 δ k l A k + k g = ϵ l i j B i r j R j ,
which is equivalent to
A l + l g = 1 2 ϵ l i j B i r j R j A = A + g = 1 2 B × r R .
By setting A = 0 at r = 0 , a one-to-one correspondence is established between the gauge function g and the gauge origin R :
g = 1 2 B × R g = 1 2 r · B × R + g 0 .
The integration constant g 0 can be set to zero, as it has no effect on observable quantities. It is also evident that this choice of g satisfies the condition 2 g = 0 , as required. By dropping the prime on A in Equation (A70), we recover the general expression for the vector potential under a uniform magnetic field, as given in Equation (A66). It can further be verified that this choice of A satisfies the Coulomb gauge condition:
i A i = 1 2 i ϵ i j k B j r k = 1 2 ϵ i j k i B j r k + 1 2 ϵ i j k B j i r k = 0 + 1 2 ϵ i j k B j δ i k = 0 .
Since our primary interest is in the response of the system to external magnetic fields, the magnetic fields generated by the motion of nuclei and electrons are neglected.

References

  1. Bursulaya, B.D.; Kim, H.J. Optical Kerr effect spectroscopy of liquid water: Role of fluctuating electronic polarizability. J. Phys. Chem. B 1997, 101, 10994–10999. [Google Scholar] [CrossRef]
  2. Ghanadzadeh, A.; Zeini, A.; Kashef, A.; Moghadam, M. Solvent polarizability and anisotropy effects on the photophysical behavior of oxazine 1: An appropriate polarizability indicator dye. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2009, 73, 324–329. [Google Scholar] [CrossRef] [PubMed]
  3. Egorochkin, A.N.; Kuznetsova, O.V.; Khamaletdinova, N.M.; Domratcheva-Lvova, L.G. Infrared spectroscopic studies of transition metal complexes and polarizability effect. J. Organomet. Chem. 2011, 696, 2199–2205. [Google Scholar] [CrossRef]
  4. Bender, J.S.; Coasne, B.; Fourkas, J.T. Assessing polarizability models for the simulation of low-frequency Raman spectra of benzene. J. Phys. Chem. B 2015, 119, 9345–9358. [Google Scholar] [CrossRef]
  5. Gasbarri, C.; Angelini, G. Polarizability over dipolarity for the spectroscopic behavior of azobenzenes in room-temperature ionic liquids and organic solvents. J. Mol. Liq. 2017, 229, 185–188. [Google Scholar] [CrossRef]
  6. Chattaraj, P.K.; Arun Murthy, T.V.S.; Giri, S.; Roy, D.R. A connection between softness and magnetizability. J. Mol. Struct. THEOCHEM 2007, 813, 63–65. [Google Scholar] [CrossRef]
  7. Foroutan-Nejad, C. Interatomic magnetizability: A QTAIM-based approach toward deciphering magnetic aromaticity. J. Phys. Chem. A 2011, 115, 12555–12560. [Google Scholar] [CrossRef]
  8. Yin, Y.; Wan, X.; Tu, X.; Wang, D. Large magneto-optical effects in the van der Waals ferrimagnet Mn3Si2Te6. Phys. Rev. B 2024, 110, 104410. [Google Scholar] [CrossRef]
  9. Delaire, J.A.; Nakatani, K. Linear and nonlinear optical properties of photochromic molecules and materials. Chem. Rev. 2000, 100, 1817–1846. [Google Scholar] [CrossRef]
  10. Marder, S.R. Organic nonlinear optical materials: Where we have been and where we are going. Chem. Commun. 2006, 131–134. [Google Scholar] [CrossRef]
  11. Boyd, R.W.; Prato, D. Nonlinear Optics; Academic Press: New York, NY, USA, 2008; pp. 1–4. [Google Scholar]
  12. Castet, F.; Rodriguez, V.; Pozzo, J.L.; Ducasse, L.; Plaquet, A.; Champagne, B. Design and characterization of molecular nonlinear optical switches. Accounts Chem. Res. 2013, 46, 2656–2665. [Google Scholar] [CrossRef] [PubMed]
  13. Gu, F.L.; Aoki, Y.; Springborg, M.; Kirtman, B. Calculations on Nonlinear Optical Properties for Large Systems: The Elongation Method; Springer: Berlin/Heidelberg, Germany, 2014; pp. 1–8. [Google Scholar]
  14. Gready, J.E.; Bacskay, G.B.; Hush, N.S. Finite-field method calculations of molecular polarisabilities. I. Theoretical basis and limitations of SCF and Galerkin treatments. Chem. Phys. 1977, 22, 141–150. [Google Scholar] [CrossRef]
  15. Locknar, S.A.; Peteanu, L.A.; Shuai, Z. Calculation of ground and excited state polarizabilities of unsubstituted and donor/acceptor polyenes: A comparison of the finite-field and sum-over-states methods. J. Phys. Chem. A 1999, 103, 2197–2201. [Google Scholar] [CrossRef]
  16. Bouř, P. Approximate ab initio calculations of polarizabilities via the excitation scheme. Chem. Phys. Lett. 1997, 265, 65–70. [Google Scholar] [CrossRef]
  17. Bouř, P. Computations of the Raman optical activity via the sum-over-states expansions. J. Comput. Chem. 2001, 22, 426–435. [Google Scholar] [CrossRef]
  18. Bishop, D.M.; Kirtman, B.; Champagne, B. Differences between the exact sum-over-states and the canonical approximation for the calculation of static and dynamic hyperpolarizabilities. J. Chem. Phys. 1997, 107, 5780–5787. [Google Scholar] [CrossRef]
  19. Champagne, B.; Kirtman, B. Evaluation of alternative sum-over-states expressions for the first hyperpolarizability of push-pull π-conjugated systems. J. Chem. Phys. 2006, 125, 024101. [Google Scholar] [CrossRef]
  20. Sekino, H.; Bartlett, R.J. Frequency dependent nonlinear optical properties of molecules. J. Chem. Phys. 1986, 85, 976–989. [Google Scholar] [CrossRef]
  21. Rice, J.E.; Amos, R.D.; Colwell, S.M.; Handy, N.C.; Sanz, J. Frequency dependent hyperpolarizabilities with application to formaldehyde and methyl fluoride. J. Chem. Phys. 1990, 93, 8828–8839. [Google Scholar] [CrossRef]
  22. Karna, S.P.; Dupuis, M. Frequency dependent nonlinear optical properties of molecules: Formulation and implementation in the HONDO program. J. Comput. Chem. 1991, 12, 487–504. [Google Scholar] [CrossRef]
  23. Rice, J.E.; Handy, N.C. The calculation of frequency-dependent polarizabilities as pseudo-energy derivatives. J. Chem. Phys. 1991, 94, 4959–4971. [Google Scholar] [CrossRef]
  24. Kutzelnigg, W. Stationary perturbation theory: I. Survey of basic concepts. Theor. Chim. Acta 1992, 83, 263–312. [Google Scholar] [CrossRef]
  25. Sasagane, K.; Aiga, F.; Itoh, R. Higher-order response theory based on the quasienergy derivatives: The derivation of the frequency-dependent polarizabilities and hyperpolarizabilities. J. Chem. Phys. 1993, 99, 3738–3778. [Google Scholar] [CrossRef]
  26. Colwell, S.M.; Murray, C.W.; Handy, N.C.; Amos, R.D. The determination of hyperpolarisabilities using density functional theory. Chem. Phys. Lett. 1993, 210, 261–268. [Google Scholar] [CrossRef]
  27. Li, S.; Hu, L.; Peng, L.; Yang, W.; Gu, F.L. Coupled-perturbed SCF approach for calculating static polarizabilities and hyperpolarizabilities with nonorthogonal localized molecular orbitals. J. Chem. Theory Comput. 2015, 11, 923–931. [Google Scholar] [CrossRef]
  28. Peng, D.; Li, S.; Peng, L.; Gu, F.L.; Yang, W. Time-Dependent Coupled Perturbed Hartree–Fock and Density-Functional-Theory Approach for Calculating Frequency-Dependent (Hyper) Polarizabilities with Nonorthogonal Localized Molecular Orbitals. J. Chem. Theory Comput. 2017, 13, 4101–4112. [Google Scholar] [CrossRef]
  29. Lee, A.M.; Colwell, S.M. The determination of hyperpolarizabilities using density functional theory with nonlocal functionals. J. Chem. Phys. 1994, 101, 9704–9709. [Google Scholar] [CrossRef]
  30. Van Gisbergen, S.J.A.; Snijders, J.G.; Baerends, E.J. Calculating frequency-dependent hyperpolarizabilities using time-dependent density functional theory. J. Chem. Phys. 1998, 109, 10644–10656. [Google Scholar] [CrossRef]
  31. Kamiya, M.; Sekino, H.; Tsuneda, T.; Hirao, K. Nonlinear optical property calculations by the long-range-corrected coupled-perturbed Kohn–Sham method. J. Chem. Phys. 2005, 122, 234111. [Google Scholar] [CrossRef]
  32. Banerjee, A.; Harbola, M.K. Variation-perturbation method in time-dependent density-functional theory. Phys. Lett. A 1997, 236, 525–532. [Google Scholar] [CrossRef]
  33. Aiga, F.; Tada, T.; Yoshimura, R. Frequency-dependent polarizabilities, hyperpolarizabilities, and excitation energies from time-dependent density-functional theory based on the quasienergy derivative method. J. Chem. Phys. 1999, 111, 2878–2888. [Google Scholar] [CrossRef]
  34. Kirtman, B.; Gu, F.L.; Bishop, D.M. Extension of the Genkin and Mednis treatment for dynamic polarizabilities and hyperpolarizabilities of infinite periodic systems. I. Coupled perturbed Hartree-Fock theory. J. Chem. Phys. 2000, 113, 1294–1309. [Google Scholar] [CrossRef]
  35. Thorvaldsen, A.J.; Ruud, K.; Kristensen, K.; Jørgensen, P.; Coriani, S. A density matrix-based quasienergy formulation of the Kohn–Sham density functional response theory using perturbation-and time-dependent basis sets. J. Chem. Phys. 2008, 129, 214108. [Google Scholar] [CrossRef] [PubMed]
  36. Helgaker, T.; Coriani, S.; Jørgensen, P.; Kristensen, K.; Olsen, J.; Ruud, K. Recent advances in wave function-based methods of molecular-property calculations. Chem. Rev. 2012, 112, 543–631. [Google Scholar] [CrossRef] [PubMed]
  37. Thorvaldsen, A.J.; Ruud, K.; Rizzo, A.; Coriani, S. Analytical calculations of frequency-dependent hypermagnetizabilities and Cotton–Mouton constants using London atomic orbitals. J. Chem. Phys. 2008, 129, 164110. [Google Scholar] [CrossRef]
  38. Bast, R.; Thorvaldsen, A.J.; Ringholm, M.; Ruud, K. Atomic orbital-based cubic response theory for one-, two-, and four-component relativistic self-consistent field models. Chem. Phys. 2009, 356, 177–186. [Google Scholar] [CrossRef]
  39. Ringholm, M.; Jonsson, D.; Bast, R.; Gao, B.; Thorvaldsen, A.J.; Ekström, U.; Helgaker, T.; Ruud, K. Analytic cubic and quartic force fields using density-functional theory. J. Chem. Phys. 2014, 140, 034103. [Google Scholar] [CrossRef]
  40. Friese, D.H.; Ringholm, M.; Gao, B.; Ruud, K. Open-ended recursive calculation of single residues of response functions for perturbation-dependent basis sets. J. Chem. Theory Comput. 2015, 11, 4814–4824. [Google Scholar] [CrossRef]
  41. Di Remigio, R.; Beerepoot, M.T.P.; Cornaton, Y.; Ringholm, M.; Steindal, A.H.; Ruud, K.; Frediani, L. Open-ended formulation of self-consistent field response theory with the polarizable continuum model for solvation. Phys. Chem. Chem. Phys. 2017, 19, 366–379. [Google Scholar] [CrossRef]
  42. Morgan, W.J.; Matthews, D.A.; Ringholm, M.; Agarwal, J.; Gong, J.Z.; Ruud, K.; Allen, W.D.; Stanton, J.F.; Schaefer, H.F., III. Geometric energy derivatives at the complete basis set limit: Application to the equilibrium structure and molecular force field of formaldehyde. J. Chem. Theory Comput. 2018, 14, 1333–1350. [Google Scholar] [CrossRef]
  43. Dundas, K.O.H.M.; Beerepoot, M.T.; Ringholm, M.; Reine, S.; Bast, R.; List, N.H.; Kongsted, J.; Ruud, K.; Olsen, J.M.H. Harmonic infrared and Raman spectra in molecular environments using the polarizable embedding model. J. Chem. Theory Comput. 2021, 17, 3599–3617. [Google Scholar] [CrossRef]
  44. Casida, M.E. Time-dependent density functional response theory for molecules. In Recent Advances in Density Functional Methods: (Part I); World Scientific: Singapore, 1995; pp. 155–192. [Google Scholar] [CrossRef]
  45. Kutzelnigg, W. Theory of magnetic susceptibilities and NMR chemical shifts in terms of localized quantities. Isr. J. Chem. 1980, 19, 193–200. [Google Scholar] [CrossRef]
  46. Hansen, A.E.; Bouman, T.D. Localized orbital/local origin method for calculation and analysis of NMR shieldings. Applications to 13C shielding tensors. J. Chem. Phys. 1985, 82, 5035–5047. [Google Scholar] [CrossRef]
  47. Keith, T.A.; Bader, R.F.W. Calculation of magnetic response properties using a continuous set of gauge transformations. Chem. Phys. Lett. 1993, 210, 223–231. [Google Scholar] [CrossRef]
  48. Ditchfield, R. Molecular orbital theory of magnetic shielding and magnetic susceptibility. J. Chem. Phys. 1972, 56, 5688–5691. [Google Scholar] [CrossRef]
  49. Helgaker, T.; Jo/rgensen, P. An electronic Hamiltonian for origin independent calculations of magnetic properties. J. Chem. Phys. 1991, 95, 2595–2601. [Google Scholar] [CrossRef]
  50. Ruud, K.; Helgaker, T.; Bak, K.L.; Jo/rgensen, P.; Jensen, H.J.A. Hartree–Fock limit magnetizabilities from London orbitals. J. Chem. Phys. 1993, 99, 3847–3859. [Google Scholar] [CrossRef]
  51. London, F. Théorie quantique des courants interatomiques dans les combinaisons aromatiques. J. Phys. Radium 1937, 8, 397–409. [Google Scholar] [CrossRef]
  52. Sun, Q.; Zhang, X.; Banerjee, S.; Bao, P.; Barbry, M.; Blunt, N.S.; Bogdanov, N.A.; Booth, G.H.; Chen, J.; Cui, Z.H.; et al. Recent developments in the PySCF program package. J. Chem. Phys. 2020, 153, 024109. [Google Scholar] [CrossRef]
  53. Sun, Q. Libcint: An efficient general integral library for Gaussian basis functions. J. Comput. Chem. 2015, 36, 1664–1671. [Google Scholar] [CrossRef]
  54. Ekström, U.; Visscher, L.; Bast, R.; Thorvaldsen, A.J.; Ruud, K. Arbitrary-order density functional response theory from automatic differentiation. J. Chem. Theory Comput. 2010, 6, 1971–1980. [Google Scholar] [CrossRef] [PubMed]
  55. Lehtola, S.; Steigemann, C.; Oliveira, M.J.T.; Marques, M.A.L. Recent developments in libxc—A comprehensive library of functionals for density functional theory. SoftwareX 2018, 7, 1–5. [Google Scholar] [CrossRef]
  56. Saad, Y. Iterative Methods for Sparse Linear Systems, 2nd ed.; SIAM: Philadelphia, PA, USA, 2003; pp. 157–257. [Google Scholar]
  57. Liesen, J.; Strakos, Z. Krylov Subspace Methods: Principles and Analysis; Numerical Mathematics and Scie; Oxford University Press: Oxford, UK, 2013; pp. 12–70. [Google Scholar]
  58. Knoll, D.A.; Keyes, D.E. Jacobian-free Newton–Krylov methods: A survey of approaches and applications. J. Comput. Phys. 2004, 193, 357–397. [Google Scholar] [CrossRef]
  59. Baker, A.H.; Jessup, E.R.; Manteuffel, T. A technique for accelerating the convergence of restarted GMRES. SIAM J. Matrix Anal. Appl. 2005, 26, 962–984. [Google Scholar] [CrossRef]
  60. Pritchard, B.P.; Altarawy, D.; Didier, B.; Gibson, T.D.; Windus, T.L. New basis set exchange: An open, up-to-date resource for the molecular sciences community. J. Chem. Inf. Model. 2019, 59, 4814–4820. [Google Scholar] [CrossRef]
  61. Frisch, M.J.; Trucks, G.W.; Schlegel, H.B.; Scuseria, G.E.; Robb, M.A.; Cheeseman, J.R.; Scalmani, G.; Barone, V.; Petersson, G.A.; Nakatsuji, H.; et al. Gaussian 16 Revision B.01; Gaussian Inc.: Wallingford, CT, USA, 2016. [Google Scholar]
  62. Aidas, K.; Angeli, C.; Bak, K.L.; Bakken, V.; Bast, R.; Boman, L.; Christiansen, O.; Cimiraglia, R.; Coriani, S.; Dahle, P.; et al. The Dalton quantum chemistry program system. Wiley Interdiscip. Rev. Comput. Mol. Sci. 2014, 4, 269–284. [Google Scholar] [CrossRef] [PubMed]
Table 1. Static and dynamic ( ω = 0.1 a.u.) polarizabilities and first hyperpolarizabilities of H2O calculated using various solvers at the spin-restricted HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
Table 1. Static and dynamic ( ω = 0.1 a.u.) polarizabilities and first hyperpolarizabilities of H2O calculated using various solvers at the spin-restricted HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
MethodSolver α ¯ ( 0 , 0 ) α ¯ ( ω , ω ) β ¯ ( 0 , 0 , 0 ) β ¯ ( 2 ω , ω , ω )
HFKrylov2.4561142.4938369.72443410.67309
N-K2.4561142.4938369.72443410.67309
exact2.4561142.4938369.72443410.67309
Gaussian2.4561142.4938369.72443410.67309
SVWN5Krylov2.3370722.3781019.60158210.94481
N-K2.3370722.3781019.60158210.94481
exact2.3370722.3781019.60158210.94481
Gaussian2.3370742.3781049.60161110.94484
PBEKrylov2.3890412.4308479.49039610.78105
N-K2.3890412.4308479.49039610.78105
exact2.3890412.4308479.49039610.78105
Gaussian2.3890242.4308299.49025510.78088
TPSSKrylov2.4472342.4885149.55597810.75230
N-K2.4472342.4885149.55597810.75230
exact2.4472342.4885149.55597810.75230
Gaussian2.4473812.4886679.56347810.76102
Table 2. Static and dynamic ( ω = 0.1 a.u.) magnetizabilities of H2O calculated using various solvers at the spin-restricted HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
Table 2. Static and dynamic ( ω = 0.1 a.u.) magnetizabilities of H2O calculated using various solvers at the spin-restricted HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
MethodSolver ξ ¯ d ξ ¯ p ( 0 , 0 ) ξ ¯ ( 0 , 0 ) ξ ¯ ( ω , ω )
HFKrylov−3.0042650.354248−2.650016−2.638684
N-K−3.0042650.354248−2.650016−2.638684
exact−3.0042650.354248−2.650016−2.638684
Dalton−3.0042630.354248−2.650015-
SVWN5Krylov−2.9970940.391350−2.605744−2.589627
N-K−2.9970940.391350−2.605744−2.589627
exact−2.9970940.391350−2.605744−2.589627
Dalton−2.9970930.391350−2.605744-
PBEKrylov−3.0105640.399143−2.611421−2.594833
N-K−3.0105640.399143−2.611421−2.594833
exact−3.0105640.399143−2.611421−2.594833
Dalton−3.0105650.399143−2.611422-
TPSSKrylov−3.0175070.380711−2.636796−2.622316
N-K−3.0175070.380711−2.636796−2.622316
exact−3.0175070.380711−2.636796−2.622316
Dalton----
Table 3. Dynamic ( ω = 0.05 , 0.10 , 0.15 , 0.20 a.u.) inelastic response properties of H2O calculated at the generalized HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
Table 3. Dynamic ( ω = 0.05 , 0.10 , 0.15 , 0.20 a.u.) inelastic response properties of H2O calculated at the generalized HF, SVWN5, PBE, and TPSS levels with the STO-3G basis set. All values are given in atomic units.
Method ω α ¯ ( ω , ω ) β ¯ ( ω , ω , ω ) ξ ¯ ( ω , ω ) ζ ¯ ( ω , ω , ω )
HF0.052.46542610.03915−0.0961251.060108
0.102.49383611.07370−0.0875541.104119
0.152.54284213.17900−0.0722231.167423
0.202.61519717.39514−0.0482161.254649
SVWN50.052.34716210.04824−0.0605471.184807
0.102.37810111.58515−0.0483251.236818
0.152.43203615.09977−0.0259421.318000
0.202.51311824.29370-0.0105781.437984
PBE0.052.3993269.921563−0.0586661.182924
0.102.43084711.39941−0.0460851.233733
0.152.48575514.74416−0.0230151.314061
0.202.56818623.14165-0.0147071.433669
TPSS0.052.4574009.962100−0.0799331.117914
0.102.48851411.33683−0.0689621.163513
0.152.54254514.35058−0.0490211.234274
0.202.62322521.48152−0.0169141.337470
Table 4. Static magnetizabilities of H2O calculated with and without GIAO at the spin-restricted HF, SVWN5, and PBE levels using the STO-3G, 6-31G, cc-pVDZ, and Sadlej-pVTZ basis sets. All values are given in atomic units.
Table 4. Static magnetizabilities of H2O calculated with and without GIAO at the spin-restricted HF, SVWN5, and PBE levels using the STO-3G, 6-31G, cc-pVDZ, and Sadlej-pVTZ basis sets. All values are given in atomic units.
MethodGauge BasisSTO-3G6-31Gcc-pVDZSadlej-pVTZ
HF-−2.650016−2.997862−2.820516−2.949613
GIAO−2.459860−2.798452−2.773012−2.931758
SVWN5-−2.605744−2.983692−2.820797−3.062157
GIAO−2.417908−2.784379−2.768266−3.059146
PBE-−2.611421−2.967591−2.796043−3.032509
GIAO−2.402182−2.754203−2.740750−3.027743
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Liu, X.; Peng, D.; Gu, F.L. A General Formalism for Electromagnetic Response Based on Quasi-Energy Derivatives Within a Single-Determinant Framework. Chemistry 2025, 7, 181. https://doi.org/10.3390/chemistry7060181

AMA Style

Liu X, Peng D, Gu FL. A General Formalism for Electromagnetic Response Based on Quasi-Energy Derivatives Within a Single-Determinant Framework. Chemistry. 2025; 7(6):181. https://doi.org/10.3390/chemistry7060181

Chicago/Turabian Style

Liu, Xinxin, Daoling Peng, and Feng Long Gu. 2025. "A General Formalism for Electromagnetic Response Based on Quasi-Energy Derivatives Within a Single-Determinant Framework" Chemistry 7, no. 6: 181. https://doi.org/10.3390/chemistry7060181

APA Style

Liu, X., Peng, D., & Gu, F. L. (2025). A General Formalism for Electromagnetic Response Based on Quasi-Energy Derivatives Within a Single-Determinant Framework. Chemistry, 7(6), 181. https://doi.org/10.3390/chemistry7060181

Article Metrics

Back to TopTop