Skip to content

User Guide

Welcome to the MolPy User Guide! Here you will find practical workflows to help you accomplish your research tasks.

πŸ§ͺ Parsing Chemistry

Goal: Define molecules using strict syntax instead of manual construction. - Use BigSMILES for monomers with reactive ports. - Use CGSmiles for coarse-grained topology. - Use GBigSMILES for systems with distributions.

from molpy.parser.smiles import parse_bigsmiles
# Parse a stochastic object directly from string
molecule_ir = parse_bigsmiles("{[<]CC[>]}[$]CO[$]")

πŸ—οΈ Building Polymers

Goal: Assemble complex polymer architectures from monomer libraries. - Build linear, block, or star polymers. - Automatically connect reactive ports using graph rules.

# Simple linear polymer construction
builder = PolymerBuilder(library=my_monomers, connector=my_connector)
result = builder.build("{[#EO2][#PS]}")
polymer = result.polymer

πŸ”— Polymer SMILES

Goal: Program chemical reactivity and mechanisms. - Define custom reactions with Selectors. - Execute reactions on specific ports or atoms.

# Run a specific reaction on two fragments
cc_coupling = Reacter(
    name="C-C",
    bond_former=form_single_bond,
    # ... selectors ...
)
result = cc_coupling.run(fragments[0], fragments[1], port_atom_L=p1, port_atom_R=p2)

πŸ•ΈοΈ Polymer Crosslinking

Goal: Create 3D cross-linked networks and simulation templates. - Generate LAMMPS fix bond/react templates. - Build explicitly cross-linked networks in memory.

πŸ“Š Polydisperse Systems

Goal: Model realistic material distributions and ensembles. - Generate chains following Poisson or Schulz-Zimm distributions. - Plan systems with target total mass and compositions.


Need API Basics?

If you are looking for detailed explanations of core classes (like Atomistic, Frame, Topology), check out the Tutorials section.