{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Partial bond orders and benzene\n", "\n", "This notebook applies a SMIRNOFF FFXML involving partial bond orders (reducing the number of parameters) to assign bond parameters for benzene. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Import stuff we need\n", "from openff.toolkit.typing.engines.smirnoff import *\n", "import openeye.oechem as oechem\n", "import openeye.oeiupac as oeiupac\n", "import openeye.oeomega as oeomega" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# NBVAL_SKIP\n", "# Load our force field from this directory. Use of partial bond orders here means there is only one [#6X3]~[#6X3] \n", "# bond parameter line rather than three which otherwise would be required\n", "ffxml = 'Frosst_AlkEthOH_extracarbons.offxml'\n", "ff = ForceField(ffxml)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Initialize benzene as a test molecule\n", "mol = oechem.OEMol()\n", "oeiupac.OEParseIUPACName(mol, 'benzene')\n", "omega = oeomega.OEOmega()\n", "omega(mol)\n", "oechem.OETriposAtomNames(mol)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Applying oechem.oequacpac.OEAssignPartialCharges with specified charge method \"OECharges_AM1BCCSym\".\n", "\n", "HarmonicBondGenerator:\n", "\n", " [#6X4:1]-[#6X4:2] : 0 matches\n", " [#6X4:1]-[#1:2] : 0 matches\n", " [#8:1]~[#1:2] : 0 matches\n", " [#6X4:1]-[O&X2&H1:2] : 0 matches\n", " [#6X4:1]-[O&X2&H0:2] : 0 matches\n", " [#8X2:1]-[#1:2] : 0 matches\n", " [#6X3:1]!#[#6X3:2] : 12 matches\n", " [#6X3:1]-[#1:2] : 6 matches\n", "\n", "12 bonds added (0 skipped due to constraints)\n", "\n", "HarmonicAngleGenerator:\n", "\n", " [a,A:1]-[#6X4:2]-[a,A:3] : 0 matches\n", " [#1:1]-[#6X4:2]-[#1:3] : 0 matches\n", " [#6X4:1]-[#6X4:2]-[#6X4:3] : 0 matches\n", " [#8X2:1]-[#6X4:2]-[#8X2:3] : 0 matches\n", " [#6X4:1]-[#8X2:2]-[#1:3] : 0 matches\n", " [#6X4:1]-[#8X2:2]-[#6X4:3] : 0 matches\n", " [*:1]~[#6X3:2]~[*:3] : 36 matches\n", " [#1:1]-[#6X3:2]~[*:3] : 12 matches\n", " [#1:1]-[#6X3:2]-[#1:3] : 0 matches\n", "\n", "18 angles added (0 skipped due to constraints)\n", "\n", "PeriodicTorsionGenerator Propers:\n", "\n", " [a,A:1]-[#6X4:2]-[#6X4:3]-[a,A:4] : 0 matches\n", " [a,A:1]-[#6X4:2]-[#8X2:3]-[#1:4] : 0 matches\n", " [a,A:1]-[#6X4:2]-[#8X2:3]-[!#1:4] : 0 matches\n", " [#1:1]-[#6X4:2]-[#6X4:3]-[#1:4] : 0 matches\n", " [#1:1]-[#6X4:2]-[#6X4:3]-[#6X4:4] : 0 matches\n", " [#6X4:1]-[#6X4:2]-[#8X2:3]-[#1:4] : 0 matches\n", " [#6X4:1]-[#6X4:2]-[#6X4:3]-[#6X4:4] : 0 matches\n", " [#6X4:1]-[#6X4:2]-[#8X2:3]-[#6X4:4] : 0 matches\n", " [#6X4:1]-[#8X2:2]-[#6X4:3]-[O&X2&H0:4] : 0 matches\n", " [#8X2:1]-[#6X4:2]-[#6X4:3]-[#8X2:4] : 0 matches\n", " [#8X2:1]-[#6X4:2]-[#6X4:3]-[#1:4] : 0 matches\n", " [#1:1]-[#6X4:2]-[#6X4:3]-[OX2:4] : 0 matches\n", " [*:1]~[#6X3:2]-[#6X4:3]~[*:4] : 0 matches\n", " [#1:1]-[#6X4:2]-[#6X3:3]=[#6X3:4] : 0 matches\n", " [*:1]~[#6X3:2]-[#6X3:3]~[*:4] : 0 matches\n", " [*:1]~[#6X3:2]:[#6X3:3]~[*:4] : 48 matches\n", " [*:1]-[#6X3:2]=[#6X3:3]-[*:4] : 0 matches\n", "\n", "PeriodicTorsionGenerator Impropers:\n", "\n", " [a,A:1]~[#6X3:2]([a,A:3])~[OX1:4] : 0 matches\n", "\n", "24 torsions added\n", "0 impropers added, each applied in a six-fold manner\n", "\n", "NonbondedForceGenerator:\n", "\n", " [#1:1] : 6 matches\n", " [$([#1]-C):1] : 0 matches\n", " [$([#1]-C-[#7,#8,F,#16,Cl,Br]):1] : 0 matches\n", " [$([#1]-C(-[#7,#8,F,#16,Cl,Br])-[#7,#8,F,#16,Cl,Br]):1] : 0 matches\n", "[$([#1]-C(-[#7,#8,F,#16,Cl,Br])(-[#7,#8,F,#16,Cl,Br])-[#7,#8,F,#16,Cl,Br]):1] : 0 matches\n", " [#1$(*-[#8]):1] : 0 matches\n", " [#6:1] : 6 matches\n", " [#6X4:1] : 0 matches\n", " [#8:1] : 0 matches\n", " [#8X2:1] : 0 matches\n", " [#8X2+0$(*-[#1]):1] : 0 matches\n", "\n" ] } ], "source": [ "# NBVAL_SKIP\n", "topology = generateTopologyFromOEMol(mol)\n", "system = ff.createSystem(topology, [mol], chargeMethod = 'OECharges_AM1BCCSym', verbose = True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.8" } }, "nbformat": 4, "nbformat_minor": 1 }