Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kthpanor committed Dec 13, 2023
1 parent ccdaa71 commit 768da74
Show file tree
Hide file tree
Showing 168 changed files with 9,391 additions and 8,309 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
230 changes: 230 additions & 0 deletions _sources/docs/spec_prop/dipole_equiv.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "bf51bfd1-549a-46a0-81a5-f6e7e426c8bd",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# Dipole equivalence relations"
]
},
{
"cell_type": "markdown",
"id": "8208fce5-8f6c-4d5a-a291-3deb97542ccd",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"A molecular system subjected to an external field is described by the Hamiltonian\n",
"\n",
"$$\n",
"\\hat{H} = \\hat{H}_0 + \\hat{V}(t)\n",
"$$\n",
"\n",
"where field coupling is contained in the latter term\n",
"\n",
"$$\n",
"\\hat{V}(t) = \\sum_\\omega \\hat{V}^\\omega_\\alpha F^\\omega_\\alpha e^{-i\\omega t}\n",
"$$\n",
"\n",
"With use of a variational approach to study an observable described by the operator $\\hat{\\Omega}$, the following relation can be found for the associated linear responses {cite}(Norman2018)\n",
"\n",
"$$\n",
"-i\\omega \\langle \\langle \\hat{\\Omega}; \\hat{V}^\\omega_\\alpha \\rangle \\rangle =\n",
"\\frac{1}{i\\hbar}\n",
"\\left(\n",
"\\langle \\langle \\left[ \\hat{\\Omega}, \\hat{H}_0 \\right]; \\hat{V}^\\omega_\\alpha \\rangle \\rangle_\\omega\n",
"+\n",
"\\langle \\left[ \\hat{\\Omega}, \\hat{V}^\\omega_\\alpha \\right] \\rangle\n",
"\\right)\n",
"$$\n",
"\n",
"In the complete basis set limit, the following commutator relation holds true\n",
"\n",
"$$\n",
"\\left[\n",
"\\hat{r}_\\alpha, \\hat{H}_0\n",
"\\right] =\n",
"\\frac{i\\hbar}{m_\\mathrm{e}} \\hat{p}_\\alpha\n",
"$$\n",
"\n",
"where $m_\\mathrm{e}$ is the electron mass.\n",
"\n",
"Combining the two equation for the case when $\\hat{\\Omega}$ and $\\hat{V}^\\omega_\\alpha$ are both equal to position operators, we are led to conclude\n",
"\n",
"$$\n",
"\\omega \\langle \\langle \\hat{r}_\\alpha; \\hat{r}_\\beta \\rangle \\rangle_\\omega =\n",
"\\frac{i}{m_\\mathrm{e}} \\langle \\langle \\hat{p}_\\alpha; \\hat{r}_\\beta \\rangle \\rangle_\\omega\n",
"$$\n",
"\n",
"A residue analysis results in a similar relation for individual transition moments\n",
"\n",
"$$\n",
"\\omega_f \\langle \\Psi_0 | \\hat{r}_\\alpha | \\Psi_f \\rangle =\n",
"\\frac{i}{m_\\mathrm{e}} \\langle \\Psi_0 | \\hat{p}_\\alpha | \\Psi_f \\rangle \n",
"$$\n",
"\n",
"Relations of this form are known as dipole length–dipole velocity equivalences, and they serve the computational chemist with a choice of adopting the length or velocity gauge in calculations of spectra and properties.\n",
"\n",
"As an example, let us calculate the polarizability of the neon atom in the length and velocity representations and see how results get to be in closer agreement with increasing quality of the employed basis set."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4d87ca18-bac9-4878-8ebb-875d75e62626",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-output"
]
},
"outputs": [],
"source": [
"import numpy as np\n",
"import veloxchem as vlx"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d6ba77f9-39f6-45da-afd6-962ef0ee0448",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"molecule = vlx.Molecule.read_str(\"Ne 0.000 0.000 0.000\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "038f9b63-4cbc-4c81-9cf6-a683279f6a2a",
"metadata": {
"editable": true,
"scrolled": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"scf_drv = vlx.ScfRestrictedDriver()\n",
"scf_drv.ostream.mute()\n",
"\n",
"lrf_drv = vlx.LinearResponseSolver()\n",
"lrf_drv.ostream.mute()\n",
"\n",
"lrf_drv.b_operator = \"electric dipole\"\n",
"\n",
"lrf_drv.a_components = [\"z\"]\n",
"lrf_drv.b_components = [\"z\"]\n",
"\n",
"w = 0.0656\n",
"lrf_drv.frequencies = [w]"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "d455a439-e1cb-4d23-9569-7d3d92536829",
"metadata": {
"editable": true,
"scrolled": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--------------------------------------------\n",
"Basis set -<<z;z>> -i/w*<<p_z;z>>\n",
"--------------------------------------------\n",
" aug-cc-pVDZ 1.837316 1.720512\n",
"daug-cc-pVDZ 2.362190 2.377629\n",
"--------------------------------------------\n"
]
}
],
"source": [
"result_string = \"\"\n",
"\n",
"for basis_set in [\"aug-cc-pVDZ\", \"daug-cc-pVDZ\"]:\n",
" basis = vlx.MolecularBasis.read(molecule, basis_set, ostream=None)\n",
"\n",
" scf_results = scf_drv.compute(molecule, basis)\n",
"\n",
" lrf_drv.a_operator = \"electric dipole\"\n",
" lrf_results = lrf_drv.compute(molecule, basis, scf_results)\n",
" lrf_length = lrf_results[\"response_functions\"][(\"z\", \"z\", w)]\n",
"\n",
" lrf_drv.a_operator = \"linear momentum\"\n",
" lrf_results = lrf_drv.compute(molecule, basis, scf_results)\n",
" lrf_velocity = lrf_results[\"response_functions\"][(\"z\", \"z\", w)]\n",
"\n",
" result_string += f\"{basis_set :>12s}{-lrf_length :16.6f}{lrf_velocity / w :16.6f}\\n\"\n",
"\n",
"print(\"-\" * 44 + f\"\\n{'Basis set':12s}{'-<<z;z>>':>16s}{'-i/w*<<p_z;z>>':>16s}\\n\" + \"-\" * 44)\n",
"print(result_string + \"-\" * 44)"
]
},
{
"cell_type": "markdown",
"id": "7628e750-30ae-4a79-b66e-f0a744b9c758",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"For a property such as the polarizability the addition of diffuse functions in the basis set is critical, and it is seen that with a double augmentation, results obtained in the length and velocity representations are in good mutual agreement."
]
}
],
"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
}
49 changes: 25 additions & 24 deletions docs/basics_notebook.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/cite.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
<li class="toctree-l3"><a class="reference internal" href="spec_prop/rovib.html">Rovibronic states</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="spec_prop/dipole_equiv.html">Dipole equivalence relations</a></li>
<li class="toctree-l2"><a class="reference internal" href="spec_prop/finite_field.html">Finite field method</a></li>
<li class="toctree-l2"><a class="reference internal" href="spec_prop/nto.html">Natural transition orbitals</a></li>
<li class="toctree-l2"><a class="reference internal" href="spec_prop/selection_rules.html">Selection rules</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/elec_struct/available_xcfun.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
<li class="toctree-l3"><a class="reference internal" href="../spec_prop/rovib.html">Rovibronic states</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../spec_prop/dipole_equiv.html">Dipole equivalence relations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../spec_prop/finite_field.html">Finite field method</a></li>
<li class="toctree-l2"><a class="reference internal" href="../spec_prop/nto.html">Natural transition orbitals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../spec_prop/selection_rules.html">Selection rules</a></li>
Expand Down
Loading

0 comments on commit 768da74

Please sign in to comment.