{
"cells": [
{
"cell_type": "markdown",
"id": "b91ef7ef-93c4-4c23-a3e3-5bcaa3279476",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# Linear Response"
]
},
{
"cell_type": "markdown",
"id": "db9d3811-04e8-4570-a0a0-55935750fb6a",
"metadata": {},
"source": [
"## Electric-dipole polarizability\n",
"\n",
"The frequency-dependent electric-dipole polarizability is, next to the dipole moment, the most important effect characterizing the response of a molecule to electromagnetic radiation. It is a second-order symmetric tensor determined by the linear response function\n",
"\n",
"\\begin{equation*}\n",
"\\alpha_{\\alpha\\beta}(-\\omega; \\omega) = -\n",
" \\langle\\langle \\hat{\\mu}_{\\alpha};\\hat{\\mu}_{\\beta}\n",
"\\rangle\\rangle_{\\omega}\n",
"\\end{equation*}\n",
"\n",
"In the limit of static fields, $\\alpha(0;0)$ can also be determined from the second-order derivative of the energy with respect to electric field strengths."
]
},
{
"cell_type": "markdown",
"id": "7d50555d-d5be-4783-b620-42c86284298b",
"metadata": {},
"source": [
"### Significance\n",
"\n",
"Several molecular properties which describe nonlinear effects,\n",
"such as the Kerr effect or magnetic circular dichroism \n",
"arising in the presence of radiation and additional electric or \n",
"magnetic fields, are interpreted as derivatives of the dipole \n",
"polarizability. They can be calculated as \n",
"higher-order response functions. Similarly, relativistic \n",
"corrections to the polarizabilities for heavy atoms can be \n",
"estimated from higher-order response functions \n",
"including the mass-velocity and Darwin operators,\n",
"{cite}`skjohjajjcp103`."
]
},
{
"cell_type": "markdown",
"id": "d95ef9e0-afde-40cc-a1bd-a2c8f23f6186",
"metadata": {},
"source": [
"### Isotropic and anisotropic components\n",
"\n",
"In isotropic fluids, the experimentally measured quantity is \n",
"usually the scalar component of the $\\alpha$ tensor given by the\n",
"isotropic average, defined as\n",
"\n",
"\\begin{equation*}\n",
"\\alpha_{\\rm iso} = \\frac{1}{3}\n",
"\\alpha_{\\eta\\eta}\n",
"\\end{equation*}\n",
"\n",
"The polarizability anisotropy may be defined as\n",
"\n",
"\\begin{eqnarray*}\n",
"(\\alpha_{\\rm anis})^2 &=&\n",
"(3 \\alpha_{\\mu\\nu}\\alpha_{\\mu\\nu} -\n",
"\\alpha_{\\mu\\mu}\\alpha_{\\nu\\nu})/2,\n",
"\\end{eqnarray*}\n",
"\n",
"which, using the components of the diagonalized tensor, leads to \n",
" \n",
"\\begin{eqnarray*}\n",
"\\alpha_{\\rm anis} &=& 2^{-1/2} [ (\\alpha_{xx} - \\alpha_{yy})^2 +\n",
" (\\alpha_{yy} - \\alpha_{zz})^2 +\n",
" (\\alpha_{zz} - \\alpha_{xx})^2 ]^{1/2}.\n",
"\\end{eqnarray*}\n",
"\n",
"For linear molecules, $\\alpha_{\\rm anis}$ reduces to the difference \n",
"between the parallel and perpendicular components,\n",
"\n",
"\\begin{eqnarray*}\n",
"\\alpha_{\\rm anis} = \\alpha_{\\parallel} - \\alpha_{\\perp}.\n",
"\\end{eqnarray*}"
]
},
{
"cell_type": "markdown",
"id": "2894e6aa-423d-4569-9f6a-7906095f1b4e",
"metadata": {},
"source": [
"### Measurements\n",
"\n",
"The macroscopic property related to the molecular polarizability \n",
"$\\alpha$ is the dielectric constant\n",
"$\\epsilon$, defined by the ratio of the permittivity of the \n",
"medium to the electric constant, ${\\epsilon_0}$. It is also \n",
"related to the refractive index $n$ ($n=\\sqrt{\\epsilon}$, \n",
"assuming the vacuum magnetic permeability to \n",
"be equal to 1). The quantity measured in a dielectric constant \n",
"experiment is\n",
"\n",
"\\begin{equation*}\n",
"\\tilde{\\alpha} =\n",
"\\left( \\tilde{\\mu}_{Z}^{F}/{F} \\right)_{F \\rightarrow 0} = \n",
"\\langle \\alpha_{II} \\rangle_\\Omega + \\mu_z^2/3kT\n",
"\\end{equation*}\n",
"\n",
"where we use the notation $ <...>_\\Omega $ for the average over \n",
"all the orientations, $k$ is the Boltzmann constant and $T$ is the temperature.\n",
"The temperature-dependent term is proportional to the square of the dipole\n",
"moment, the temperature-independent term is the isotropic average \n",
"of the polarizability (using the equation for the isotropic average given just above we can \n",
"obtain a corresponding expression in terms of properties \n",
"calculated in the molecular frame of reference).\n",
"\n",
"The anisotropy of the electric dipole polarizability can be\n",
"determined in Rayleigh scattering experiments, where the observed \n",
"depolarization of the incident light is a function of \n",
"$(\\alpha_{\\rm anis})^2$."
]
},
{
"cell_type": "markdown",
"id": "6a82725c-67e1-445c-b535-f6c14d6975e7",
"metadata": {},
"source": [
"### High-accuracy results\n",
"\n",
"The static electric dipole polarizability of the He atom has\n",
"been studied in more detail than any other response property of any other\n",
"atomic or molecular system. Not only the non-relativistic value is\n",
"known accurately, and the relativistic corrections have been\n",
"computed, but also the quantum-electrodynamic \n",
"corrections have been analyzed and\n",
"numerous effects related to the nuclear mass have been taken into\n",
"account {cite}`glbjksprl92`."
]
},
{
"cell_type": "markdown",
"id": "b9433c9a-975f-4f9f-9f5b-b81cb6e8cab1",
"metadata": {},
"source": [
"### Basis set requirements\n",
"\n",
"Standard energy-optimized basis sets\n",
"are not suitable for accurate \n",
"calculations of electric polarizabilities. The simplest\n",
"solution (adding the necessary\n",
"polarization and diffuse functions) makes the basis sets too large\n",
"to enable efficient calculations for large molecules.\n",
"Significantly smaller basis sets, designed considering the \n",
"electric-field dependence \n",
"of the orbitals, provide \n",
"results of similar or better quality at lower computational cost.\n",
"\n",
"A practical problem that may be encountered in calculations using \n",
"very extended basis sets is the appearance of linear dependencies in \n",
"the basis set. This may make the response equations (as well as the \n",
"equations determining the molecular energy/density) \n",
"ill-conditioned and the calculations slowly convergent; in \n",
"exceptional cases it may even be impossible to converge the equations. \n",
"The problem is normally resolved by removing the linear \n",
"dependencies in the basis set, or by removing manually the \n",
"most diffuse basis functions from the basis set."
]
},
{
"cell_type": "markdown",
"id": "89398a23-49c4-487a-b95d-832b5ac0d918",
"metadata": {},
"source": [
"### Electron correlation\n",
"\n",
"Electron correlation effects on the isotropic\n",
"polarizability are \n",
"in general moderate, being at the most 5-10\\%\\ of the uncorrelated\n",
"value and for nondipolar systems always leading to an increased \n",
"polarizability.\n",
"Correlation effects are usually larger on the individual tensor\n",
"components than on the isotropic polarizability, and can therefore \n",
"be expected to be more important for the polarizability \n",
"anisotropies. In general, Hartree-Fock polarizability\n",
"anisotropies cannot be considered accurate enough to allow for a\n",
"quantitative comparison with experimental observations,\n",
"or for the interpretation of the ellipticity arising in some \n",
"birefringences, where the polarizability anisotropies often constitute an \n",
"important (and dominant) orientational\n",
"contribution.\n",
"\n",
"DFT in general reproduces quite well correlation effects in the \n",
"polarizability of small molecular systems. In particular,\n",
"polarizability anisotropies calculated using DFT will usually be in better agreement with experiment. \n",
"However, due to the local nature of the exchange-correlation\n",
"functionals and the lack of general implementations of current\n",
"density functionals, DFT does not perform so well for extended \n",
"conjugated systems."
]
},
{
"cell_type": "markdown",
"id": "7e05177c-6d1e-4394-b06a-54cc1e0837a8",
"metadata": {
"editable": true,
"jp-MarkdownHeadingCollapsed": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"### Cauchy moment expansion\n",
"\n",
"Response functions for a system in its electronic ground\n",
"state\\index{ground state} are \n",
"analytic functions of the frequency arguments, except at the poles \n",
"that occur when a frequency or a sum of frequencies is equal to an \n",
"excitation energy. Thus, for frequencies below the first pole, the \n",
"linear, quadratic or cubic response functions can be expanded in \n",
"power series.\n",
"\n",
"Let us consider in more detail the simplest case when only \n",
"electric dipole operators are involved and the frequency \n",
"dependence of the (hyper)polarizabilities is of interest. The \n",
"Cauchy series - that is, the power series expansion of the \n",
"frequency-dependent\n",
"polarizability - is usually written\n",
"as\n",
"\n",
"$$\n",
" \\alpha(-\\omega ; \\omega) = \\sum_{k=0}^{\\infty} \\omega^{2k} S(-2k-2)\n",
" = S(-2) + \\omega^2 S(-4) + \\omega^4 S(-6) + \\cdots,\n",
"$$\n",
"\n",
"where $S(-2) = \\alpha(0;0)$. This expansion is valid also for \n",
"purely imaginary frequency arguments. "
]
},
{
"cell_type": "markdown",
"id": "0a395e40-b636-4634-b0bd-f9ed0ccf37fc",
"metadata": {},
"source": [
"## In VeloxChem"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "0216ae9a-5b3d-4579-b369-cf37b320d080",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-output"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Warning * Environment variable OMP_NUM_THREADS not set.\n",
"* Warning * Setting OMP_NUM_THREADS to 4.\n"
]
}
],
"source": [
"import veloxchem as vlx"
]
},
{
"cell_type": "markdown",
"id": "367ab5ce-84bd-42a1-ad74-36276a8925cc",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"First, we determine the reference state of the system."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "49ec9eb9-46be-4498-931a-4146790522ea",
"metadata": {
"editable": true,
"scrolled": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove_output"
]
},
"outputs": [],
"source": [
"mol_str = \"\"\"3\n",
"\n",
"O 0.000000000000 0.000000000000 0.000000000000\n",
"H 0.000000000000 0.740848095288 0.582094932012\n",
"H 0.000000000000 -0.740848095288 0.582094932012\n",
"\"\"\"\n",
"\n",
"molecule = vlx.Molecule.read_xyz_string(mol_str)\n",
"basis = vlx.MolecularBasis.read(molecule, \"def2-svpd\", ostream=None)\n",
"\n",
"scf_drv = vlx.ScfRestrictedDriver()\n",
"scf_drv.ostream.mute()\n",
"\n",
"scf_drv.xcfun = \"b3lyp\"\n",
"scf_results = scf_drv.compute(molecule, basis)"
]
},
{
"cell_type": "markdown",
"id": "bd9951f5-53ac-43aa-b6c1-f90dbce3cd34",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"### Real response function\n",
"\n",
"We calculate the needed linear response functions with use of the `LinearResponseSolver` class."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "1bbfa593-00a2-4c1d-b5df-6638377c0264",
"metadata": {
"editable": true,
"scrolled": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"hide-output",
"output_scroll"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" \n",
" Linear Response Solver Setup \n",
" ============================== \n",
" \n",
" Number of Frequencies : 2 \n",
" Max. Number of Iterations : 150 \n",
" Convergence Threshold : 1.0e-04 \n",
" ERI Screening Scheme : Cauchy Schwarz + Density \n",
" ERI Screening Threshold : 1.0e-12 \n",
" Exchange-Correlation Functional : B3LYP \n",
" Molecular Grid Level : 4 \n",
" \n",
"* Info * Molecular grid with 40720 points generated in 0.02 sec. \n",
" \n",
"* Info * Processing Fock builds... (batch size: 9) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 3 gerade trial vectors in reduced space \n",
"* Info * 6 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 47.94 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.75 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 1 * Residuals (Max,Min): 8.45e-01 and 1.89e-01 \n",
" \n",
" <>_0.0000 : -9.01161246 Residual Norm: 0.19770107 \n",
" <>_0.0656 : -9.20248108 Residual Norm: 0.18863810 \n",
" <>_0.0000 : -9.53971511 Residual Norm: 0.31867382 \n",
" <>_0.0656 : -9.64430453 Residual Norm: 0.31469367 \n",
" <>_0.0000 : -8.46320379 Residual Norm: 0.84501162 \n",
" <>_0.0656 : -8.57203409 Residual Norm: 0.83255985 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 9) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 6 gerade trial vectors in reduced space \n",
"* Info * 12 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 72.42 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.75 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 2 * Residuals (Max,Min): 1.12e-01 and 2.01e-02 \n",
" \n",
" <>_0.0000 : -9.09615293 Residual Norm: 0.02138969 \n",
" <>_0.0656 : -9.29211162 Residual Norm: 0.02009095 \n",
" <>_0.0000 : -9.73585054 Residual Norm: 0.04219749 \n",
" <>_0.0656 : -9.84454457 Residual Norm: 0.04171911 \n",
" <>_0.0000 : -9.31931552 Residual Norm: 0.11162972 \n",
" <>_0.0656 : -9.45876238 Residual Norm: 0.11004217 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 8) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 9 gerade trial vectors in reduced space \n",
"* Info * 17 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 94.18 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.75 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 3 * Residuals (Max,Min): 1.37e-02 and 7.82e-04 \n",
" \n",
" <>_0.0000 : -9.09692448 Residual Norm: 0.00083876 \n",
" <>_0.0656 : -9.29287459 Residual Norm: 0.00078245 \n",
" <>_0.0000 : -9.73799055 Residual Norm: 0.00264362 \n",
" <>_0.0656 : -9.84673034 Residual Norm: 0.00268306 \n",
" <>_0.0000 : -9.34755032 Residual Norm: 0.01367302 \n",
" <>_0.0656 : -9.48835616 Residual Norm: 0.01341692 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 8) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 12 gerade trial vectors in reduced space \n",
"* Info * 22 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 115.97 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.75 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 4 * Residuals (Max,Min): 6.56e-04 and 5.14e-05 \n",
" \n",
" <>_0.0000 : -9.09692566 Residual Norm: 0.00005136 \n",
" <>_0.0656 : -9.29287577 Residual Norm: 0.00005883 \n",
" <>_0.0000 : -9.73800472 Residual Norm: 0.00017941 \n",
" <>_0.0656 : -9.84674589 Residual Norm: 0.00018212 \n",
" <>_0.0000 : -9.34779283 Residual Norm: 0.00065565 \n",
" <>_0.0656 : -9.48860561 Residual Norm: 0.00064486 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 4) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 14 gerade trial vectors in reduced space \n",
"* Info * 24 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 126.82 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.75 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 5 * Residuals (Max,Min): 5.88e-05 and 5.64e-06 \n",
" \n",
" <>_0.0000 : -9.73800476 Residual Norm: 0.00000564 \n",
" <>_0.0656 : -9.84674594 Residual Norm: 0.00000865 \n",
" <>_0.0000 : -9.34779352 Residual Norm: 0.00003494 \n",
" <>_0.0656 : -9.48860634 Residual Norm: 0.00003797 \n",
" \n",
" *** Linear response converged in 5 iterations. Time: 1.69 sec \n",
" \n",
" \n",
" Polarizability (w=0.0000) \n",
" ------------------------- \n",
" X Y Z \n",
" X 9.09692566 0.00000000 0.00000000 \n",
" Y 0.00000000 9.73800476 0.00000000 \n",
" Z 0.00000000 0.00000000 9.34779352 \n",
" \n",
" Polarizability (w=0.0656) \n",
" ------------------------- \n",
" X Y Z \n",
" X 9.29287577 0.00000000 0.00000000 \n",
" Y 0.00000000 9.84674594 0.00000000 \n",
" Z 0.00000000 0.00000000 9.48860634 \n",
" \n"
]
}
],
"source": [
"lrf = vlx.LinearResponseSolver()\n",
"\n",
"lrf.a_operator = \"electric dipole\"\n",
"lrf.b_operator = \"electric dipole\"\n",
"\n",
"# other available operators\n",
"#lrf.b_operator = \"electric dipole\"\n",
"#lrf.b_operator = \"linear momentum\"\n",
"#lrf.b_operator = \"angular momentum\"\n",
"#lrf.b_operator = \"magnetic dipole\"\n",
"\n",
"lrf.a_components = [\"x\", \"y\", \"z\"]\n",
"lrf.b_components = [\"x\", \"y\", \"z\"]\n",
"\n",
"lrf.frequencies = [0.0, 0.0656]\n",
"\n",
"lrf_results = lrf.compute(molecule, basis, scf_results)"
]
},
{
"cell_type": "markdown",
"id": "00dc8a28-08dd-4e7b-8353-3e94133351c0",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"Print the requested molecular properties."
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "4b2833bc-461d-43f7-9b59-03653e5fd85f",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"output_scroll"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Comp Freq alpha\n",
"---------------------\n",
" xx 0.0000 9.096926\n",
" yx 0.0000 0.000000\n",
" zx 0.0000 0.000000\n",
" xx 0.0656 9.292876\n",
" yx 0.0656 0.000000\n",
" zx 0.0656 0.000000\n",
" xy 0.0000 0.000000\n",
" yy 0.0000 9.738005\n",
" zy 0.0000 0.000000\n",
" xy 0.0656 0.000000\n",
" yy 0.0656 9.846746\n",
" zy 0.0656 0.000000\n",
" xz 0.0000 0.000000\n",
" yz 0.0000 0.000000\n",
" zz 0.0000 9.347794\n",
" xz 0.0656 0.000000\n",
" yz 0.0656 0.000000\n",
" zz 0.0656 9.488606\n"
]
}
],
"source": [
"print(\"Comp Freq alpha\")\n",
"print(\"-\"*21)\n",
"for key in lrf_results[\"response_functions\"].keys():\n",
" print(f\" {key[0]}{key[1]}{key[2]:8.4f}{-lrf_results['response_functions'][key]:10.6f}\")"
]
},
{
"cell_type": "markdown",
"id": "d9c03753-5c8a-425b-b8ed-579fc322d0e4",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"### Complex response function\n",
"\n",
"We calculate the needed linear response functions with use of the `ComplexResponse` class."
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "52eeb279-ba26-44f9-9e53-2004be9d33a6",
"metadata": {
"editable": true,
"scrolled": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"hide-output",
"output_scroll"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" \n",
" Complex Response Solver Setup \n",
" =============================== \n",
" \n",
" Number of Frequencies : 2 \n",
" Max. Number of Iterations : 150 \n",
" Convergence Threshold : 1.0e-04 \n",
" ERI Screening Scheme : Cauchy Schwarz + Density \n",
" ERI Screening Threshold : 1.0e-12 \n",
" Exchange-Correlation Functional : B3LYP \n",
" Molecular Grid Level : 4 \n",
" \n",
"* Info * Molecular grid with 40720 points generated in 0.02 sec. \n",
" \n",
"* Info * Processing Fock builds... (batch size: 3) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 1 gerade trial vectors in reduced space \n",
"* Info * 2 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 30.95 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.69 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 1 * Residuals (Max,Min): 8.45e-01 and 8.33e-01 \n",
" \n",
" Operator: electric dipole (['z']) \n",
" \n",
" <>_0.0000 : -8.46269350 0.00000000j Residual Norm: 0.84498224 \n",
" <>_0.0656 : -8.57145838 -0.01536178j Residual Norm: 0.83253311 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 4) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 3 gerade trial vectors in reduced space \n",
"* Info * 4 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 41.83 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.69 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 2 * Residuals (Max,Min): 1.12e-01 and 1.09e-01 \n",
" \n",
" Operator: electric dipole (['z']) \n",
" \n",
" <>_0.0000 : -9.31865693 0.00000000j Residual Norm: 0.11164275 \n",
" <>_0.0656 : -9.45878685 -0.01990331j Residual Norm: 0.10876894 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 3) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 4 gerade trial vectors in reduced space \n",
"* Info * 6 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 49.99 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.69 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 3 * Residuals (Max,Min): 1.37e-02 and 1.34e-02 \n",
" \n",
" Operator: electric dipole (['z']) \n",
" \n",
" <>_0.0000 : -9.34689234 0.00000000j Residual Norm: 0.01367735 \n",
" <>_0.0656 : -9.48759482 -0.01998091j Residual Norm: 0.01336083 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 4) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 6 gerade trial vectors in reduced space \n",
"* Info * 8 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 60.87 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.69 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 4 * Residuals (Max,Min): 5.48e-04 and 5.37e-04 \n",
" \n",
" Operator: electric dipole (['z']) \n",
" \n",
" <>_0.0000 : -9.34713524 0.00000000j Residual Norm: 0.00054764 \n",
" <>_0.0656 : -9.48784349 -0.01998114j Residual Norm: 0.00053700 \n",
" \n",
"* Info * Processing Fock builds... (batch size: 2) \n",
"* Info * batch 1/1 \n",
" \n",
"* Info * 7 gerade trial vectors in reduced space \n",
"* Info * 9 ungerade trial vectors in reduced space \n",
" \n",
"* Info * 66.31 kB of memory used for subspace procedure on the master node \n",
"* Info * 2.69 GB of memory available for the solver on the master node \n",
" \n",
" *** Iteration: 5 * Residuals (Max,Min): 3.52e-05 and 2.71e-05 \n",
" \n",
" Operator: electric dipole (['z']) \n",
" \n",
" <>_0.0000 : -9.34713579 0.00000000j Residual Norm: 0.00002708 \n",
" <>_0.0656 : -9.48784407 -0.01998114j Residual Norm: 0.00003524 \n",
" \n",
" *** Complex response converged in 5 iterations. Time: 1.22 sec \n",
" \n",
" \n"
]
}
],
"source": [
"lrf = vlx.ComplexResponse() \n",
"\n",
"lrf.a_operator = \"electric dipole\"\n",
"lrf.b_operator = \"electric dipole\"\n",
"\n",
"# other available operators\n",
"#lrf.b_operator = \"electric dipole\"\n",
"#lrf.b_operator = \"linear momentum\"\n",
"#lrf.b_operator = \"angular momentum\"\n",
"#lrf.b_operator = \"magnetic dipole\"\n",
"\n",
"lrf.a_components = [\"z\"]\n",
"lrf.b_components = [\"z\"]\n",
"\n",
"lrf.damping = 0.00454\n",
"\n",
"lrf.frequencies = [0.0, 0.0656]\n",
"\n",
"lrf_results = lrf.compute(molecule, basis, scf_results)"
]
},
{
"cell_type": "markdown",
"id": "2fab7204-0c91-42ed-97f8-4571d96b69f7",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"Print the requested molecular properties."
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "9c747f6d-ac5a-4344-9345-b7378d66e670",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Comp Freq alpha\n",
"-------------------------------\n",
" zz 0.0000 9.347136-0.000000j\n",
" zz 0.0656 9.487844+0.019981j\n"
]
}
],
"source": [
"print(\"Comp Freq alpha\")\n",
"print(\"-\"*31)\n",
"for key in lrf_results[\"response_functions\"].keys():\n",
" print(f\" {key[0]}{key[1]}{key[2]:8.4f}{-lrf_results['response_functions'][key]:20.6f}\")"
]
},
{
"cell_type": "markdown",
"id": "99016cce-a660-45da-8264-ae715e90aba4",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"```{note}\n",
"Taking into account the perturbation operator of the form $\\hat{V}^\\omega = - \\hat{\\mu}_\\alpha F_\\alpha^\\omega$, we need to change the sign of the response function values to get values for the polarizability.\n",
"```"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}