Polymer Builder: Infinite Periodic Chains#
Build infinite polymer chains that are periodic in one dimension, such as polyethylene, syndiotactic polystyrene and copolymers. The builder finds the dihedral angles that make the repeat unit periodic and optionally optimizes the geometry and lattice vector.
Expected duration: This notebook takes about a minute to run.
Overview#
This example builds infinite polymer chains, periodic in one dimension, for example as input for periodic DFTB or band structure calculations. The repeat unit is a short sequence of monomers. The builder optimizes the dihedral angles such that the monomer that would follow the last one is a translation of the first: that translation is the lattice vector, and the last monomer bonds to the periodic image of the first one.
If no such dihedrals exist, the repeat unit is made longer. The lattice vector is along x, as AMS requires for one-dimensional systems.
import numpy as np
from scm.plams import view
from scm.structures.builder.polymer import *
Polyethylene#
The repeat unit of polyethylene is one ethylene monomer. The optimization finds the planar zigzag chain.
ethylene = Monomer.from_smiles("[*]CC[*]")
polyethylene = build_periodic_polymer({"E": ethylene}, "E", seed=0)
print(polyethylene.formula(), "lattice vector", np.round(polyethylene.lattice.vectors[0], 3))
view(polyethylene, direction="tilt_x", width=400, height=300)
C2H4 lattice vector [2.535 0. 0. ]
Syndiotactic polystyrene#
In syndiotactic polystyrene the configuration alternates, so the repeat unit is a styrene monomer followed by its mirror image.
monomers = with_mirror_images({"S": Monomer.from_smiles("[*]CC([*])c1ccccc1")})
syndiotactic = build_periodic_polymer(monomers, ["S", "S*"], seed=0)
print(syndiotactic.formula(), "lattice vector", np.round(syndiotactic.lattice.vectors[0], 3))
view(syndiotactic, direction="tilt_x", width=400, height=300)
C16H16 lattice vector [5.075 0. 0. ]
Copolymers and side groups#
Any linear sequence can be the repeat unit, for example an alternating copolymer. Link points that are not used by the chain are capped, here with chlorine.
monomers = {
"E": ethylene,
"G": Monomer.from_smiles("[*]CC([*])c1ccc([*])cc1", head="A", tail="B"),
}
copolymer = build_periodic_polymer(monomers, ["E", "G"], cap="Cl", seed=0)
print(copolymer.formula(), "lattice vector", np.round(copolymer.lattice.vectors[0], 3))
view(copolymer, direction="tilt_x", width=400, height=300)
C10H11Cl lattice vector [5.072 0. 0. ]
Optimization#
The chain is close to a minimum, but its geometry comes from rigid monomers. Optionally the builder optimizes the geometry and the lattice vector with AMS, here with UFF.
optimized = build_periodic_polymer({"E": ethylene}, "E", optimize="uff", seed=0)
print("lattice vector after optimization", np.round(optimized.lattice.vectors[0], 3))
See also#
Python Script#
#!/usr/bin/env python
# coding: utf-8
# ## Overview
#
# This example builds infinite polymer chains, periodic in one dimension, for example as input for periodic DFTB or
# band structure calculations. The repeat unit is a short sequence of monomers. The builder optimizes the dihedral
# angles such that the monomer that would follow the last one is a translation of the first: that translation is the
# lattice vector, and the last monomer bonds to the periodic image of the first one.
#
# If no such dihedrals exist, the repeat unit is made longer. The lattice vector is along x, as AMS requires for
# one-dimensional systems.
import numpy as np
from scm.plams import view
from scm.structures.builder.polymer import *
# ## Polyethylene
#
# The repeat unit of polyethylene is one ethylene monomer. The optimization finds the planar zigzag chain.
ethylene = Monomer.from_smiles("[*]CC[*]")
polyethylene = build_periodic_polymer({"E": ethylene}, "E", seed=0)
print(polyethylene.formula(), "lattice vector", np.round(polyethylene.lattice.vectors[0], 3))
view(polyethylene, direction="tilt_x", width=400, height=300, picture_path="picture1.png")
# ## Syndiotactic polystyrene
#
# In syndiotactic polystyrene the configuration alternates, so the repeat unit is a styrene monomer followed by its
# mirror image.
monomers = with_mirror_images({"S": Monomer.from_smiles("[*]CC([*])c1ccccc1")})
syndiotactic = build_periodic_polymer(monomers, ["S", "S*"], seed=0)
print(syndiotactic.formula(), "lattice vector", np.round(syndiotactic.lattice.vectors[0], 3))
view(syndiotactic, direction="tilt_x", width=400, height=300, picture_path="picture2.png")
# ## Copolymers and side groups
#
# Any linear sequence can be the repeat unit, for example an alternating copolymer. Link points that are not used by
# the chain are capped, here with chlorine.
monomers = {
"E": ethylene,
"G": Monomer.from_smiles("[*]CC([*])c1ccc([*])cc1", head="A", tail="B"),
}
copolymer = build_periodic_polymer(monomers, ["E", "G"], cap="Cl", seed=0)
print(copolymer.formula(), "lattice vector", np.round(copolymer.lattice.vectors[0], 3))
view(copolymer, direction="tilt_x", width=400, height=300, picture_path="picture3.png")
# ## Optimization
#
# The chain is close to a minimum, but its geometry comes from rigid monomers. Optionally the builder optimizes the
# geometry and the lattice vector with AMS, here with UFF.
optimized = build_periodic_polymer({"E": ethylene}, "E", optimize="uff", seed=0)
print("lattice vector after optimization", np.round(optimized.lattice.vectors[0], 3))