Quickstart¶
This page walks through the complete AutoPoly workflow on the simplest possible system: a box of polyethylene (PE) chains with the OPLS-AA force field.
The 3-step pattern¶
Every AutoPoly script follows the same shape:
- System — decides where output goes
- Polymer / Molecule — defines what to build
- generate — generates the files with a chosen force field
Step by step¶
1. Create the system¶
out names the output directory that will hold everything AutoPoly generates.
2. Define the polymer¶
from AutoPoly import Polymer
polymer = Polymer(
chain_num=10, # 10 chains in the box
sequence=["CC[*]"] + ["[*]CC[*]"] * 48 + ["[*]CC"], # PE, DOP = 50
topology="linear", # or "ring"
tacticity="atactic" # or "isotactic" / "syndiotactic"
)
The sequence is a list of complement SMILES — one entry per monomer, in chain order. Wildcard atoms ([*]) mark the connection points:
"CC[*]"— first monomer (1 wildcard, right side)"[*]CC[*]"— middle monomers (2 wildcards)"[*]CC"— last monomer (1 wildcard, left side)
The degree of polymerization is implicit: DOP = len(sequence) (here 1 + 48 + 1 = 50). See the Complement SMILES guide for the full format.
3. Generate the LAMMPS files¶
AutoPoly now generates monomer .lt templates, performs atom typing for OPLS-AA, grows chains with the Monte Carlo self-avoiding-walk placer, runs moltemplate, and writes the LAMMPS inputs.
What you get¶
my_polymer/polyethylene/
├── moltemplate/ # Intermediate files (.lt inputs, moltemplate output)
├── system.data # LAMMPS data file (topology & coordinates)
├── system.in.init # Units, atom/bond/angle styles
├── system.in.settings # Force field parameters
└── system.in.charges # Atomic charges
Run it with LAMMPS by including the pieces from your own input script:
See Output Files for a description of each file.
Next steps¶
- Build a block copolymer by mixing monomers in the sequence — tutorial
- Add a solvent with the
Moleculeclass — Polymers vs Molecules - Try a different force field — selection guide
- Control chain placement — MC Placement & Chain Growth