|
19 | 19 | "9. Generating the Cube File." |
20 | 20 | ] |
21 | 21 | }, |
| 22 | + { |
| 23 | + "cell_type": "markdown", |
| 24 | + "id": "858e9ec2-0a90-47e0-adba-e026372ce209", |
| 25 | + "metadata": {}, |
| 26 | + "source": [ |
| 27 | + "## Step 1: Installing 3rd-party Dependencies" |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "cell_type": "code", |
| 32 | + "execution_count": null, |
| 33 | + "id": "723ed3ff-335c-4516-b967-b8b1019ccbc0", |
| 34 | + "metadata": {}, |
| 35 | + "outputs": [], |
| 36 | + "source": [ |
| 37 | + "import sys\n", |
| 38 | + "!{sys.executable} -m pip install --upgrade numpy py3Dmol" |
| 39 | + ] |
| 40 | + }, |
22 | 41 | { |
23 | 42 | "cell_type": "markdown", |
24 | 43 | "id": "0e7b75a9", |
25 | 44 | "metadata": {}, |
26 | 45 | "source": [ |
27 | | - "## Step 1: Import Dependencies\n", |
| 46 | + "## Step 2: Import Dependencies\n", |
28 | 47 | "\n", |
29 | 48 | "We start by importing the modules needed for:\n", |
30 | 49 | "- Interfacing with ORCA input/output\n", |
31 | 50 | "- Numerical calculations and data handling\n", |
32 | | - "- Plotting results\n", |
33 | | - "\n", |
34 | | - "> **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`)." |
| 51 | + "- Plotting results" |
35 | 52 | ] |
36 | 53 | }, |
37 | 54 | { |
|
46 | 63 | "\n", |
47 | 64 | "# > pandas and numpy for data handling\n", |
48 | 65 | "import numpy as np\n", |
| 66 | + "# > For visualization of molecules\n", |
| 67 | + "import py3Dmol\n", |
49 | 68 | "\n", |
50 | 69 | "# > OPI imports for performing ORCA calculations and reading output\n", |
51 | 70 | "from opi.core import Calculator\n", |
|
54 | 73 | " Scf, AuxBasisSet, Approximation\n", |
55 | 74 | "from opi.input.structures.structure import Structure\n", |
56 | 75 | "from opi.input.blocks import BlockFrag\n", |
57 | | - "from opi.utils.units import AU_TO_KCAL\n", |
58 | | - "\n", |
59 | | - "# > For visualization of molecules\n", |
60 | | - "import py3Dmol" |
| 76 | + "from opi.utils.units import AU_TO_KCAL" |
61 | 77 | ] |
62 | 78 | }, |
63 | 79 | { |
64 | 80 | "cell_type": "markdown", |
65 | 81 | "id": "28791864", |
66 | 82 | "metadata": {}, |
67 | 83 | "source": [ |
68 | | - "## Step 2: Working Directory and Conversion Factor\n", |
| 84 | + "## Step 3: Working Directory and Conversion Factor\n", |
69 | 85 | "\n", |
70 | 86 | "We define a subfolder `adld_hfld` 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." |
71 | 87 | ] |
|
89 | 105 | "id": "5f638574", |
90 | 106 | "metadata": {}, |
91 | 107 | "source": [ |
92 | | - "## Step 3: Setup the Input Structure\n", |
| 108 | + "## Step 4: Setup the Input Structure\n", |
93 | 109 | "\n", |
94 | 110 | "As an example we will decompose the LD interaction in an cubane dimer. The 3D structure in Cartesian coordinates is defined and visualized:\n" |
95 | 111 | ] |
|
217 | 233 | "id": "951edfa2", |
218 | 234 | "metadata": {}, |
219 | 235 | "source": [ |
220 | | - "## Step 4: Run HFLD for the Supramolecular System\n", |
| 236 | + "## Step 5: Run HFLD for the Supramolecular System\n", |
221 | 237 | "\n", |
222 | 238 | "We run a HFLD/def2-TZVP calculation for the complete system. We choose the moderate def2-TZVP basis set, because the HFLD London dispersion energy is dependent on the basis and this is a good compromise for computational costs vs. accuracy. The fragments in the calculation will automatically be defined by ORCA (in this example two fragments, one for each monomer). We define and run three helper functions: `setup_calc`, `run_calc`, and `check_and_parse_output`. \n", |
223 | 239 | "\n", |
|
348 | 364 | "id": "71352834", |
349 | 365 | "metadata": {}, |
350 | 366 | "source": [ |
351 | | - "## Step 5: Processing of ADLD Energies\n", |
| 367 | + "## Step 6: Processing of ADLD Energies\n", |
352 | 368 | "\n", |
353 | 369 | "Now we perform the post-processing for the ADLD. First, we gather atomic contributions of the LD. " |
354 | 370 | ] |
|
420 | 436 | "id": "feed6238", |
421 | 437 | "metadata": {}, |
422 | 438 | "source": [ |
423 | | - "## Step 6: Crude Visualization of ADLD Contributions\n", |
| 439 | + "## Step 7: Crude Visualization of ADLD Contributions\n", |
424 | 440 | "\n", |
425 | 441 | "In the original ADLD publication, the `rho_disp` function was evaluated on a grid and the results was written to a `.cube` file for visualization. For the sake of a simple visualization within this notebook, we will first evaluate this function only on the atomic positions and color the atoms by the values at their centers. These plots offer a qualitative analysis of the data and may differ in detail from those published. Further below, we also generate the cube file for the full visualization. We refer the interested reader to the [LDDsuite](https://github.com/bistonigroup/LDDsuite) on GitHub.\n", |
426 | 442 | "\n", |
|
627 | 643 | "id": "68b8fc69", |
628 | 644 | "metadata": {}, |
629 | 645 | "source": [ |
630 | | - "## Step 7: Generating the Cube File\n", |
| 646 | + "## Step 8: Generating the Cube File\n", |
631 | 647 | "\n", |
632 | 648 | "For the correct visualization, also the cube file can be generated that might be plotted separately:" |
633 | 649 | ] |
|
731 | 747 | "notebook_metadata_filter": "-all" |
732 | 748 | }, |
733 | 749 | "kernelspec": { |
734 | | - "display_name": "orca-pi", |
| 750 | + "display_name": "Python 3 (ipykernel)", |
735 | 751 | "language": "python", |
736 | 752 | "name": "python3" |
737 | 753 | }, |
|
745 | 761 | "name": "python", |
746 | 762 | "nbconvert_exporter": "python", |
747 | 763 | "pygments_lexer": "ipython3", |
748 | | - "version": "3.11.11" |
| 764 | + "version": "3.14.3" |
749 | 765 | } |
750 | 766 | }, |
751 | 767 | "nbformat": 4, |
|
0 commit comments