Working with AaronTools in Jupyter Notebooks¶
You can download the Jupyter Notebook version of this page here (click “Download raw file”).
Jupyter Notebooks provide a useful way of working with AaronTools (particularly when first learning) because it allows for the display of interactive 3D models of AaronTools Geometries.
For example, below we build a Geometry object for toluene and then display the resulting structure by calling geom.display().
Note that if you hover over an atom it will display the element and atom number.
from AaronTools.geometry import Geometry
import numpy as np
geom = Geometry.from_string('toluene', form='iupac')
geom.display()
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
We can then use other AaronTools commands to build more complex structures.
For example, we can replace H12 with a CN group and then build and display a dimer.
# copy geom to a new Geometry object
geom2 = geom.copy()
# replace atom 12 with CN
geom.substitute("CN", '12')
# shift second geometry to (1, 1, 3.5) and rotate 30 degrees around z-axis
geom2.coord_shift([1, 1, 3.5])
geom2.rotate([0, 0, 1], angle=np.radians(30))
# combine monomers to make dimer and display
dimer = geom + geom2
dimer.display()
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
If we are satisfied with this structure we could then write it to an input file for our favorite quantum chemistry package or run calculations directly in Psi4 from this Jupyter Notebook (see Future Tutorial on running Psi4).