{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Input and Output in PyBigDFT\n", "There are a number of standard file types that PyBigDFT can work with using its IO module. Here we will demonstrate some of that capability. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## XYZ Files\n", "The XYZReader class has access to some built in molecules, so let's begin there. You can access any of the molecules in the database just by opening an XYZReader with that name. Or you can specify a filename path to get something you've already made yourself." ] }, { "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[\"SI4:0\"] = Fragment()\n", "with XYZReader(\"CH4\") as ifile:\n", " for atom in ifile:\n", " sys[\"SI4:0\"].append(atom)\n", " \n", "sys[\"CH2F:1\"] = Fragment()\n", "with XYZReader(\"CH2F\") as ifile:\n", " for atom in ifile:\n", " sys[\"CH2F:1\"].append(atom)\n", " \n", "sys[\"CH2F:1\"].translate([-5, 0, 0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's look at what we built." ] }, { "cell_type": "code", "execution_count": 2, "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