Skip to content

Tutorials

Twelve runnable scripts live in the examples/ directory of the repository. Each one writes LAMMPS input files (system.data, system.in.init, system.in.settings, system.in.charges) into a new output directory.

Running them

# 1. Install AutoPoly (once, from the repo root)
pip install -e .

# 2. Run any example from the examples directory
cd examples
python example_pmma_linear.py

Output directories are git-ignored — just re-run a script to regenerate them.

The examples

Polymers (atomistic)

Tutorial System Force field Demonstrates
First Polymer: PMMA PMMA OPLS-AA Start here. Complete beginner workflow, complement SMILES step by step
Block Copolymer PE-PS-PE ABA triblock OPLS-AA Explicit per-position monomer sequences
Condensation Polymer (PLA) PLA GAFF Step-growth polymers, ester backbone
example_gasteiger_charges.py PMMA GAFF Automatic Gasteiger charge assignment
example_commodity_polymers_10.py 10 commodity polymers OPLS-AA Batch generation, CLI selection
Force Field Comparison PEO all 6 The six force fields side by side
MC Placement Methods PEO OPLS-AA grid vs MC random vs MC chain growth

Molecules and mixtures

Tutorial System Force field Demonstrates
Small Molecules & Mixtures water, ethanol, benzene GAFF The Molecule class, mixtures, polymer + solvent
Polymer Solution PEO + 200 water GAFF Explicit-solvent polymer solution
example_d4ppd.py D4PPD antioxidant GAFF2 Larger organic molecule, extended atom types

Coarse-grained

Tutorial Demonstrates
Bead-Spring Models Homopolymer, diblock (FENE), ring with angles, MC equilibration, SAW generation — direct LAMMPS data files, no moltemplate

Before you start

The examples assume you know the 3-step workflow and the basics of complement SMILES. If those are new, read them first — or just start with PMMA, which explains as it goes.