{ "cells": [ { "cell_type": "markdown", "id": "2887ae18", "metadata": {}, "source": [ "# ADLD - HFLD\n", "\n", "This tutorial demonstrates how to use ORCA together with the ORCA python interface (OPI) to perform the **[Atomic Decomposition of London Dispersion energy (ADLD)](https://doi.org/10.1021/acscentsci.5c00356)** analysis to decompose the London dispersion energy of the **[Hartree-Fock plus London Dispersion (HFLD)](https://doi.org/10.1021/acs.jctc.9b00425)** interaction energy within a dimer into atomic contributions. Decomposing the HFLD energy allows a non-empirical estimate of atomic London dispersion contributions. For the quicker but more empirical ADLD(D4) decomposition, see the corresponding notebook. In comparison to ADLD(D4) only one calculation of the whole system is required, since the subsystems consisiting of only one fragment have no contribution.\n", "\n", "In this notebook we will:\n", "1. Import the required python dependencies.\n", "2. Define a working directory.\n", "3. Set up the input structure.\n", "4. Run a HFLD calculation for the supersystem.\n", "7. Process the ADLD results.\n", "8. Visualize the results.\n", "9. Generating the Cube File." ] }, { "cell_type": "markdown", "id": "0e7b75a9", "metadata": {}, "source": [ "## Step 1: Import Dependencies\n", "\n", "We start by importing the modules needed for:\n", "- Interfacing with ORCA input/output\n", "- Numerical calculations and data handling\n", "- Plotting results\n", "\n", "> **Note:** We additionally import modules for visualization/plotting like `py3Dmol`. For this, it might be necessary to install `py3Dmol` into your OPI `venv` (e.g., by activating the `.venv` and using `uv pip install py3Dmol`)." ] }, { "cell_type": "code", "execution_count": 1, "id": "78657414", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "import shutil\n", "\n", "# > pandas and numpy for data handling\n", "import numpy as np\n", "\n", "# > OPI imports for performing ORCA calculations and reading output\n", "from opi.core import Calculator\n", "from opi.output.core import Output\n", "from opi.input.simple_keywords import BasisSet, Dlpno, \\\n", " Scf, AuxBasisSet, Approximation\n", "from opi.input.structures.structure import Structure\n", "from opi.input.blocks import BlockFrag\n", "\n", "# > For visualization of molecules\n", "import py3Dmol" ] }, { "cell_type": "markdown", "id": "28791864", "metadata": {}, "source": [ "## Step 2: Working Directory and Conversion Factor\n", "\n", "We define a subfolder `RUN` in which the actual ORCA calculations will take place. Also, we define a conversion factor, since we want the resulting interaction energies in kcal/mol for better interpretability." ] }, { "cell_type": "code", "execution_count": null, "id": "3e349fdf", "metadata": {}, "outputs": [], "source": [ "# > Calculation is performed in `RUN`\n", "working_dir = Path(\"RUN\")\n", "# > The `working_dir`is automatically (re-)created\n", "shutil.rmtree(working_dir, ignore_errors=True)\n", "working_dir.mkdir()\n", "# > Conversion factor for atomic units to kcal/mol\n", "unit_conversion = 627.509 " ] }, { "cell_type": "markdown", "id": "5f638574", "metadata": {}, "source": [ "## Step 3: Setup the Input Structure\n", "\n", "As an example we will decompose the LD interaction in an cubane dimer. The 3D structure in Cartesian coordinates is defined and visualized:\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "61fac6de", "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.