{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Building Systems with Roto-Translations\n", "For building systems programatically, PyBigDFT offers some helper routines based on the concept of rototranslations. Using these features, we can easily align molecules in space." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rotations and Translations\n", "Let's begin by showing the basics of rotating and translating molecules." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from BigDFT.IO import XYZReader\n", "from BigDFT.Systems import System\n", "from BigDFT.Fragments import Fragment\n", "\n", "sys = System()\n", "sys[\"WAT:0\"] = Fragment()\n", "with XYZReader(\"H2O\") as ifile:\n", " for at in ifile:\n", " sys[\"WAT:0\"] += Fragment([at])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Translation. Note that the units are atomic units." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from copy import deepcopy\n", "sys[\"WAT:1\"] = deepcopy(sys[\"WAT:0\"])\n", "sys[\"WAT:1\"].translate([-10, 0, 0])" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol