<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 General Tutorial
This is an introductory tutorial for the python package currently called kappa.  We will build molecules, draw them, and look at their attributes.
First we must import the package.
Step1:  As it stands users must define a forcefield before building molecules.  We will establish an Amber forcefield.  We can turn interactions in the forcefield on and off, but we won't concern ourselves with that here.
Step2:  To build molecules, users call the build function.  To see the kinds of molecules available for generation, print kappa.lattices.
Step3:  We'll build our bread and butter molecule first, an armchair carbon nanotube.  Every molecule generated through kappa.build requires a forcefield argument then a lattice string found from kappa.lattices.
Step4:  We can plot our molecules too.  This plot routine will show the bonds.
Step5:  Attributes of the molecules include, but are not limited to
Step6:  Molecule.atomtypes comes from its forcefield.
Now let's generate the lines of a .pdb text file. The .pdb format holds topology information critical for runnning Molecular Dynamics (MD) simulations. GROMACS specifically uses this file type, but others like openMM are compatible as well.
To view a PDB structure, you need a tool such as VMD (recommended) or PyMOL, both free.
First though we should add hydrogens to the ends of the CNT so no C's have just a single bond.
Step7:  pdb_txt holds a list with each element a line string for the file. Let's write this to the current directory.
Step8:  Let's give that graphene a shot too.
Step9:  We can also export .gro files, which contain topology + box size info (recommended).
<ASSISTANT_TASK:>
Python Code:
#put matplotlib plots in the notebook, then import the package
%matplotlib inline 
import kappa
Explanation: General Tutorial
This is an introductory tutorial for the python package currently called kappa.  We will build molecules, draw them, and look at their attributes.
First we must import the package.
End of explanation
amber = kappa.Amber()
Explanation: As it stands users must define a forcefield before building molecules.  We will establish an Amber forcefield.  We can turn interactions in the forcefield on and off, but we won't concern ourselves with that here.
End of explanation
print(kappa.lattices)
Explanation: To build molecules, users call the build function.  To see the kinds of molecules available for generation, print kappa.lattices.
End of explanation
cnt = kappa.build(amber, "cnt")
Explanation: We'll build our bread and butter molecule first, an armchair carbon nanotube.  Every molecule generated through kappa.build requires a forcefield argument then a lattice string found from kappa.lattices.
End of explanation
kappa.plot.bonds(cnt)
Explanation: We can plot our molecules too.  This plot routine will show the bonds.
End of explanation
graphene = kappa.build(amber, "graphene", radius=2)
kappa.plot.bonds(graphene, indices=True)
# print(graphene.posList)
print(graphene.bondList)
print(graphene.angleList)
print(graphene.atomtypes)
Explanation: Attributes of the molecules include, but are not limited to: posList, bondList, angleList, atomtypes.  We'll show this off in a smaller molecule.
End of explanation
cnt.hydrogenate()
pdb_txt = kappa.md.generate.pdb(cnt)
Explanation: Molecule.atomtypes comes from its forcefield.
Now let's generate the lines of a .pdb text file. The .pdb format holds topology information critical for runnning Molecular Dynamics (MD) simulations. GROMACS specifically uses this file type, but others like openMM are compatible as well.
To view a PDB structure, you need a tool such as VMD (recommended) or PyMOL, both free.
First though we should add hydrogens to the ends of the CNT so no C's have just a single bond.
End of explanation
kappa.md.save_file(pdb_txt,'.','cnt.pdb')
Explanation: pdb_txt holds a list with each element a line string for the file. Let's write this to the current directory.
End of explanation
pdb_txt = kappa.md.generate.pdb(graphene)
kappa.md.save_file(pdb_txt,'.','graphene.pdb')
Explanation: Let's give that graphene a shot too.
End of explanation
gro_txt = kappa.md.generate.gro(cnt)
kappa.md.save_file(gro_txt,'.','cnt.gro')
Explanation: We can also export .gro files, which contain topology + box size info (recommended).
End of explanation
<END_TASK>