# Time-dependence of observables#

In time-dependent Hartree–Fock, we are determining the time-dependence of the orbital rotation parameters (or electron transfer parameters). In spectroscopic applications, this time-dependence arises due to the system being subjected to an external time-dependent electromagnetic field as described by the Hamiltonian

where, in response theory, the coupling term, \(\hat{V}(t)\), is treated as a perturbation and expanded in the frequency domain according to

The sum over \(\omega\) includes both positive and negative Fourier components of the field and we have

There is also an implied Einstein summation over the Cartesian molecular axes \(\alpha=\{x,y,z\}\).

Representing a monochromatic electric field

In the electric-dipole approximation, the coupling between the system and a monochromatic sinusoidal electric field is given by

In this case, the summation over \(\omega\) includes two terms namely \(\omega = \{\pm\omega_0\}\), and we have

## Perturbation expansions#

The time-dependent electron transfer amplitudes are expanded in orders of the perturbation

where it has been used that the zeroth-order solution to the phase-isolated wave function is equal to the reference state, or, in other words, \(\kappa_{ai}^{(0)}(t) = 0\).

With use of Fourier expansions, we have

*et cetera* for higher orders. The arguments are here used to separate the time-dependent functions from their Fourier amplitudes.

The terms in the generator of orbital rotations that are linear in the perturbation can be written

where, in the second term, we have made use of the fact that we are free to change sign of the frequency summation variable in the Fourier expansion.

Spin-adapted electron transfer operators

With use of spin-adapted electron transfer operators, we get

where summations run over molecular orbitals.

## Expectation values of observables#

In time-dependent Hartree–Fock, the expectation value of an observable becomes

where we have made use of the fact that the expectation value can equally well be determined with respect to the phase isolated wave function.

The contributions to the expectation value that are linear in the perturbation can be written

The MO-representation of the \(\hat{\kappa}^{(1)}\)-operator can be determined from linear response theory [NRS18] and calculated with use of the VeloxChem program, and it is thereafter a trivial task to calculate the expectation value of its commutator with the observable \(\hat{\Omega}\).

The factor “\(i\)” multiplying the expectation value is typically suppressed in intermediate steps of the calculations as to return at a point of convenience.

## Response functions#

Response functions are defined from the order expansions of observables. The linear response functions are identified from the expression

As an example, the tensor components of the electric-dipole polarizability can be determined as follows

## Illustration#

```
import numpy as np
import veloxchem as vlx
```

```
ethylene_xyz = """
6
C 0.67759997 0.00000000 0.00000000
C -0.67759997 0.00000000 0.00000000
H 1.21655197 0.92414474 0.00000000
H 1.21655197 -0.92414474 0.00000000
H -1.21655197 -0.92414474 0.00000000
H -1.21655197 0.92414474 0.00000000
"""
```

```
molecule = vlx.Molecule.read_xyz_string(ethylene_xyz)
basis = vlx.MolecularBasis.read(molecule, "def2-svp", ostream=None)
nocc = molecule.number_of_alpha_electrons()
norb = basis.get_dimension_of_basis(molecule)
nvirt = norb - nocc
print("Number of occupied orbitals :", nocc)
print("Number of virtual orbitals :", nvirt)
print("Number of molecular orbitals:", norb)
```

```
Number of occupied orbitals : 8
Number of virtual orbitals : 40
Number of molecular orbitals: 48
```

```
molecule.show()
```

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:

`jupyter labextension install jupyterlab_3dmol`

This system is subjected to an electric field along the \(x\)-direction with a angular frequency of \(\omega = 0.0656\) a.u. and an amplitude \(F^\omega_x\).

Within the electric-dipole approximation the perturbation operator is in this case given by

and we will be concerned with the determination of the induced dipole moment along the C–C bond axis associated with the expectation value of the operator

First, we determine the Hartree–Fock reference state.

```
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.ostream.mute()
scf_results = scf_drv.compute(molecule, basis)
```

Second, we get the MO representation of the operator \(\hat{\Omega}\).

```
dipole_drv = vlx.ElectricDipoleIntegralsDriver()
dipole_mats = dipole_drv.compute(molecule, basis)
mu_x_ao = -1.0 * dipole_mats.x_to_numpy()
C = scf_results["C_alpha"]
mu_x = np.einsum("ap, ab, bq -> pq", C, mu_x_ao, C)
```

Third, we determine the linear response parameters.

```
lrf_drv = vlx.LinearResponseSolver()
lrf_drv.ostream.mute()
lrf_drv.a_operator = "electric dipole"
lrf_drv.b_operator = "electric dipole"
lrf_drv.a_components = ["x"]
lrf_drv.b_components = ["x"]
lrf_drv.frequencies = [0.0656]
lrf_results = lrf_drv.compute(molecule, basis, scf_results)
```

In VeloxChem, the resulting linear response parameters are structured into 1D-arrays known as *response vectors*

The response vectors depend on the angular frequency, \(\omega\), and they associated with separate Cartesian axes, \(\alpha\). The elements of the response vector relate to the wave function parameters

where “\(ai\)” and “\(ia\)” are thought of as MO-matrix indices for the \(\kappa\)-parameters but compound vector indices in the 1D-arrays. Here appears a factor of “\(i\)” that combined with the aforementioned one give an overall factor of -1 in the final result.

Spin-adapted electron transfer operators in VeloxChem

In VeloxChem, normalzed spin-adapted electron transfer operators are adopted

Among other things, with this choice the diagonal elements in the electronic Hessian will be close to orbital energy differences and not two times these values. Whatever the choice, final results will be identical as long as it is implemented in a consistent manner.

Response vectors are obtained from VeloxChem with use of the `get_full_vector(index)`

method, where indices of “\(0\)” and “\(1\)” will instruct the method to return vectors \((\mathbf{Z} + \mathbf{Y})\) and \((\mathbf{Z} - \mathbf{Y})\), respectively.

```
Z = -0.5 * (
lrf_results["solutions"][("x", 0.0656)].get_full_vector(0)
+ lrf_results["solutions"][("x", 0.0656)].get_full_vector(1)
) * np.sqrt(2)
Y = -0.5 * (
lrf_results["solutions"][("x", 0.0656)].get_full_vector(0)
- lrf_results["solutions"][("x", 0.0656)].get_full_vector(1)
) * np.sqrt(2)
```

A factor of -1 has here been introduced in recognition of the fact that the perturbation operator is equal to *minus* the electric dipole operator and the factor of \(\sqrt{2}\) is associated with the aforementioned normalization of electron transfer operators.

We scatter the response parameters into an MO-matrix.

```
def vector_to_matrix(Z, Y):
zymat = np.zeros((norb, norb), dtype=float)
idx = 0
for i in range(nocc):
for a in range(nocc, norb):
zymat[a, i] = Z[idx]
zymat[i, a] = Y[idx]
idx += 1
return zymat
```

```
zymat = vector_to_matrix(Z, Y)
```

Fourth, we determine the expectation value of the commutator between \(\hat{\kappa}^{(1)}(\omega)\) and \(\hat{\Omega}\) to determine the electric-dipole polarizability

```
def commutator(A, B):
return np.matmul(A, B) - np.matmul(B, A)
```

```
def expectation_value(A): # closed shell state
return 2 * np.einsum("ii ->", A[:nocc, :nocc])
```

```
alpha_xx = - expectation_value(commutator(zymat, mu_x))
```

We note that the factor of -1 comes from the left out factor of \(i^2\).

```
print(f"Polarizability: {alpha_xx:12.8f}")
```

```
Polarizability: 34.84380178
```

We compare our result with the reference value from VeloxChem.

```
print(f"Reference: {-lrf_results['response_functions'][('x', 'x', 0.0656)]:12.8f}")
```

```
Reference: 34.84380178
```

We note that the two results are in perfect agreement.