Creating cyclic Polymers

Constructing a polymer with cyclic topology can be carried out in PySoftK by employing the pysoftk.topologies.ring function. First, we need to import the initial molecule and read it using RDKit, as shown in the following snippet:

from rdkit import Chem
from rdkit.Chem import AllChem

mol=Chem.MolFromSmiles("c1cc(ccc1Br)Br")
AllChem.EmbedMolecule(mol)

Then, we can create a cyclic topology, by using the following commands:

from pysoftk.topologies.ring import *

cyc=Rn(mol,'Br').pol_ring(8,FF="UFF",iters=1000)

The new molecular unit (stored in the variable cyc) can be used to replicate and form a polymer with a given desired number of units (in this case 8).

It is important to notice that we have used a different Force Field (Universal Force Field) and increased the number of iterations in the geometry optiomization process (iters=1000). This ensures a correct initial configuration highligthing the importance of always testing the correct parameters to generate correct structures.

To print the structure in XYZ format, one needs to add the following lines of conde as can be seen in this snipet:

from pysoftk.format_printers.format_mol import *

Fmt(cyc).xyz_print("ring.xyz")

By using a common visualization program (such as VMD), the built structure ring.xyz can be displayed and the result as presented above

../_images/ring_2.png

Figure Cyclic polymer with 8 repetition units.