Getting startedΒΆ

The streamm package includes modules to manipulate atomic structures, keep track of force field parameters and write input files for Quantum chemistry codes, such as NWChem and Gaussian molecular dynamics codes such as LAMMPS.

To get started we will first build ethane out of two methanes using the streamm.Buildingblock object. While this is a simple example, it is meant to illustrate the functionality of the streamm code to construct organic structures form building block units. In practice, this functionality allows for the combinatorial creation and analysis millions of variations of organic structures.

To create a streamm.Buildingblock object representing methane, we will create carbon and hydrogen particle objects and add them to the methane object with the correct positions.

import streamm
methane = streamm.Buildingblock('methane')
C = streamm.Particle(symbol='C')
H = streamm.Particle(symbol='H')
methane.add_partpos(C,[0.0,0.0,0.0])
methane.add_partpos(H,[0.69,0.69,0.69])
methane.add_partpos(H,[-0.69,-0.69,0.69])
methane.add_partpos(H,[-0.69,0.69,-0.69])
methane.add_partpos(H,[0.69,-0.69,-0.69])

You could also use a molecular viewer such as Avogadro to create an organic structure, see the Read .xyz How To for more information.

Next, we need to define the connectivity of structure by guessing a neighbor list based on the bonded_radius of each Particle using the guess_nblist() function.

methane.bonded_nblist = methane.guess_nblist(0,radii_buffer=1.25)

Then we can label some hydrogens as substitutable sites (rsite), and run the find_rsites() function to update the funcs list of the streamm.Buildingblock object.

methane.particles[1].rsite = 'RH'
methane.particles[2].rsite = 'RH'
methane.find_rsites()

We labeled these sites as RH, but it does not really matter, as long as you pass these labels to the attach() function.

import streamm.structures.buildingblock as bb
ethane = bb.attach(methane,methane,'RH',0,'RH',1,tag='ethane')

Then you can write an .xyz file to visualize your new streamm.Buildingblock using your favorite molecular viewing software.

ethane.write_xyz()