CAPSChain Assembly and Packing Suite

Theory · 6 methods

Protocols

What CAPS computes, as it computes it: the equation, its symbols with CAPS's defaults, when to use the method, the source file, the tests that check it, and any departure from the cited method.

21-step compression and decompression

Alternating NVT heating, NVT cooling and NPT compression up to a maximum pressure, then decompression stages, then a final NPT stage at the target conditions. It relaxes the density of glassy polymer cells far faster than plain NPT at room temperature.

$$\begin{gathered}\text{21 stages: heat to } T_\mathrm{max}, \text{ cool to } T_\mathrm{final}, \text{ compress at } 0.02, 0.6, 1.0\,P_\mathrm{max} \dots \\ \text{decompress at } 0.5, 0.1, 0.01\,P_\mathrm{max}, \text{ final NPT at } P_\mathrm{final}\end{gathered}$$

Larsen et al. 2011, Table 1

SymbolMeaningIn CAPS
T_maxheating temperature600 K (choose Tg + 200–300 K)
P_maxlargest pressure5 × 10⁴ bar (49 346 atm)
time scalemultiplies every duration1 (shortened runs are labelled)

When to use it

Glassy polymer cells before property calculations. Rubbers far above Tg equilibrate with plain NPT. For long runs on a cluster, Export writes any CAPS protocol for LAMMPS (protocol Equilibration protocol): each stage its own fix and run in the same ensembles, temperatures and pressures (Nosé–Hoover), every length scaled by -var scale for a quick check, then NPT production with density.dat; the push-off stages limit each step to 0.1 Å instead of capping the Lennard-Jones force.

Source
core/src/equilibrate.cpp
Tested by
Protocol.Larsen21MatchesThePublishedSchedule · Equilibrate.RunsStagesContinuously; tests/test_relax.cpp LammpsData.ProtocolStages (the stages, their lengths in steps, the push-off substitute, production); the 21-step, annealing and push-off protocols written for the PS melt run through LAMMPS (shortened by -var scale)
Departure from the reference
none

References

  1. Larsen, G. S., Lin, P., Hart, K. E., Colina, C. M., "Molecular simulations of PIM-1-like polymers of intrinsic microporosity", Macromolecules 44, 6944–6951 (2011). doi:10.1021/ma200345v

Bond exchange moves during MD

Bonds that break and form while CAPS's own dynamics runs, for every exchange chemistry. Every few steps, Monte Carlo moves change the topology, and the force field follows from its own terms by type. Swap: two bonds trade partners, as LAMMPS fix bond/swap does (associative exchange; transesterification, disulfide metathesis, bead-spring vitrimers). Shift: a pivot hands a bond from one residue to another within reach, with a valence per residue (multivalent linkers, polysulfide sulfur). Bind: two sites bond or a bond breaks, weighed by a binding constant (dissociative exchange; Diels–Alder, stickers). Each move is Metropolis–Hastings with its proposal counts, so the topologies are sampled with their Boltzmann weights. A barrier slows every move alike without biasing them. The energy change is computed exactly from the atoms within three bonds of the change, which is all a change can affect. The energy the moves add is kept out of the conserved quantity.

$$p_\mathrm{acc} = e^{-E_a/k_\mathrm{B}T}\,\min\!\left[1,\ \frac{q_\mathrm{rev}}{q_\mathrm{fwd}}\,K^{\pm 1}\,e^{-\Delta U/k_\mathrm{B}T}\right],\qquad \Delta U = U_\mathrm{cluster}^\mathrm{after} - U_\mathrm{cluster}^\mathrm{before}$$

q: the probability of proposing the move and its reverse (swap: the four ways of picking the same swap; shift: attackers before and after; bind: either site picked first); K = exp(ε/k_B T) for bind, + on binding and − on breaking

SymbolMeaningIn CAPS
E_abarrier of the exchange chemistrykcal/mol, 0 by default
εbinding free energy (bind)kcal/mol
capturelargest distance of a new bondÅ, 1.5 by default
clusteratoms within three bonds of the change, before and after—

When to use it

Vitrimer and dynamic-network runs in CAPS (caps exchange run, or DynamicsOptions::topology with exchange_callback), and the LAMMPS deck for bead-spring systems (caps exchange bond-swap). Then stress relaxation, bond lifetimes and healing with caps exchange modulus, memory, bridges and heal.

Source
core/src/exchange_moves.cpp (ExchangeEngine), core/src/topology_edit.cpp (TopologyEditor), core/src/kremer_grest.cpp (write_kg_bond_swap)
Tested by
ExchangeMoves.SwapSamplesBoltzmannWeights and ShiftRespectsValencesAndSamplesBoltzmannWeights (frozen atoms: every topology with its Boltzmann weight to 0.015), BindSamplesThePartitionFunction (Z = 1 + 4K + 2K² of Wilcoxson et al.), LocalEnergyEqualsTheWholeSystems (DSF and PME, to 10⁻⁷), ChainLabelsKeepChainLengths, Topology.SwapsDuringNveKeepTheConservedQuantity
Departure from the reference
LAMMPS bond/swap accepts on the Metropolis factor alone and tries one swap per processor and call; CAPS adds the proposal ratio (exact detailed balance) and tries as many moves as asked. Swap labels: like LAMMPS, a1/b1 and a2/b2 must share them.

References

  1. Sides, S. W., Grest, G. S., Stevens, M. J., Plimpton, S. J., "Effect of end-tethered polymers on surface adhesion of glassy polymers", J. Polym. Sci. B Polym. Phys. 42, 199–208 (2004). doi:10.1002/polb.10672
  2. Rao, P., Xia, X., Ni, R., "A bond swap algorithm for simulating dynamically crosslinked polymers", J. Chem. Phys. 160, 061102 (2024). doi:10.1063/5.0186553
  3. Wilcoxson, T. A., Li, T., Holoman, T. R., Mitra, G., Truskett, T. M., Hocky, G. M., "Simulation and network assembly pipelines for dynamically bonded soft materials", (2026). doi:10.48550/arXiv.2609.21204
  4. Branham-Ferrari, M. R., Cheng, S., Sokolov, A. P., Simmons, D. S., "Reaction–diffusion competition drives anomalous relaxation of vitrimers", Nat. Phys. , (2026). doi:10.1038/s41567-026-03468-0

All-atom exchange in rubber networks

Exchange moves on an all-atom network: the ester links of an acid-cured ENR, its esters on a cellulose surface, PBS grafted through maleic acid, and the polysulfide bridges of a sulfur cure. A template move (transesterification_exchange, polysulfide_exchange) makes its new bond at the capture distance, 1 to 3 Å longer than a bond, so the energy is taken after a local relaxation: the atoms within three bonds of the change relax by steepest descent with the rest of the cell held, before the change and after it alike, and ΔU compares the two minima. A hydrogen the template moves (the alcohol's H in transesterification) goes onto its new partner at a covalent bond length first. The atoms near the change take the types the run's own force-field assignment gives the product (a secondary carbon that becomes an ester's stays a CH), a type no atom had before joins the force field, and the terms of combinations of types the structure never had are learned from the same assignment. Where the force field itself lacks a term, the assignment with an overlay or with CAPS ML completion fills it: the missing torsion is fitted to CAPS's machine-learned potential once and used for the rest of the run. Charges follow the roles the atoms play, so the total charge stays.

$$\Delta U = \min U_\mathrm{after}(\mathbf{x}_\mathrm{shell}) - \min U_\mathrm{before}(\mathbf{x}_\mathrm{shell}),\qquad p_\mathrm{acc} = e^{-E_a/k_\mathrm{B}T}\,\min\!\left[1,\ \frac{n_\mathrm{fwd}}{n_\mathrm{back}}\,e^{-\Delta U/k_\mathrm{B}T}\right]$$

x_shell: the atoms within relax_depth bonds of the change (3 by default) and their hydrogens; every bonded term within three bonds of them and every atom within the cut-off enter U; n_fwd, n_back: the template's matches before and after the change

SymbolMeaningIn CAPS
ΔUenergy change between the relaxed stateskcal/mol
E_abarrier of the exchange chemistrykcal/mol
relax_depthbonds from the change within which atoms relax3

When to use it

caps exchange run DATA --kind template --chemistry transesterification (ENR + diacid, ENR on cellulose, ENR/PBS through maleic acid) or --chemistry polysulfide_rubber (sulfur-cured NR and SBR), with --ff FF.json for the run's assignment and --complete ml where the force field lacks terms; --relax and --relax-depth set the relaxation.

Source
core/src/exchange_moves.cpp (ExchangeEngine::apply_relaxed, edit), core/src/topology_edit.cpp (TopologyEditor::learn, change with retyping), core/src/react.cpp (transesterification_exchange, polysulfide_exchange)
Tested by
ExchangeMoves.RelaxedTemplateMovesAreAccepted, TemplateMovesAHydrogen (the types after the moves are a fresh typing's), RubberVitrimers.EnrDiacid, SulfurCuredNr (the first C–S–S–C torsion learned), EnrOnCellulose (acyl groups moved onto glucose hydroxyls), EnrPbsMaleate
Departure from the reference
positions change, so the acceptance is a relaxed-energy criterion as in the atomistic vitrimer studies, not exact detailed balance; steepest descent leaves a few kcal/mol of strain in a crosslinked network (ENR + disulfide diacid, OPLS-AA 2024: ΔU about 7 kcal/mol at depth 3 and 1000 steps against 50 at depth 1 and 200)

References

  1. Yang, H., Yu, K., Mu, X., Wei, Y., Guo, Y., Qi, H. J., "Molecular dynamics studying on welding behavior in thermosetting polymers due to bond exchange reactions", RSC Adv. 6, 22476–22487 (2016). doi:10.1039/c5ra26128g
  2. Wick, C. D., Peters, A. J., Li, G., "A molecular dynamics modeling framework for shape memory vitrimers", J. Polym. Sci. 63, 9–19 (2025). doi:10.1002/pol.20240616

Healing-test builders and exchange protocols

The structures a healing test starts from and the runs that measure bond exchange, all with the moves of the exchange page. Builders: a cut removes every bond crossing a plane (by the minimum image); a gap cuts and then moves the upper side away, lengthening the cell, for a weld; a crack removes the atoms within a sphere with their bonds; fragments are cuts at the mid-planes of chosen axes, the pieces a recycling run joins again. Protocols: a step strain stretches the cell along one axis at constant volume and follows the normal stress difference as exchange relaxes it, with a KWW fit; a Tv scan runs NPT at each temperature with exchange and fits a hinge to the specific volume, and an Arrhenius law to the time between accepted moves; a heal run counts the bonds bridging the two sides across the cut plane (not through the periodic cell face), and those crossing its plane, after each chunk of MD (at constant pressure to close a gap). Creep takes the same moves through the creep run's topology hook. Each run hands the force field the moves left to the next, so protocols chain.

$$\sigma(t) = \sigma_\mathrm{ax} - \tfrac12\left(\sigma_{\mathrm{t}1} + \sigma_{\mathrm{t}2}\right) \approx \sigma_0\, e^{-(t/\tau)^{\beta}},\qquad \langle\tau\rangle = \frac{\tau}{\beta}\,\Gamma\!\left(\frac{1}{\beta}\right),\qquad v(T) = v_0 + b_\mathrm{low}\min(T - T_v, 0) + b_\mathrm{high}\max(T - T_v, 0)$$

stress from the pressure tensor (atm × 0.101325 = MPa); the strain keeps the volume: the axis × (1 + ε), the other two × 1/√(1 + ε); the hinge is Tg in a network without exchange

SymbolMeaningIn CAPS
εstep strain—
τ, βKWW time and stretching exponentps, —
T_vhinge of the specific volumeK
bridgesbonds joining atoms that started on opposite sides of the cut, across its plane (not through the periodic cell face)bonds
σ_ax, σ_t1, σ_t2normal stress along the strained axis and across itMPa

When to use it

Self-healing, welding and recycling of vitrimer and rubber networks in CAPS: caps exchange cut, gap, crack or fragment builds the start; caps exchange heal-run, step-strain and tv run it with exchange (the options of caps exchange run, or --no-exchange for the permanent network); then caps exchange heal compares healed and intact pulls.

Source
core/src/exchange_protocols.cpp (cut_bonds_across, open_gap, remove_sphere, fragment, step_strain, tv_scan, heal_run), core/src/mechanics.cpp (run_creep with CreepOptions::topology)
Tested by
ExchangeProtocols.Builders (bond counts across a plane, gap, void, fragments), HealRunRebondsACut (bind moves rebond a cut bead-spring network), StepStrainAndTvScan (volume kept, tensile stress after the strain, one specific volume per temperature)
Departure from the reference
MD strain rates and exchange rates are far above experiment; a short heal run counts bonds, not recovered strength, which needs the pulls of caps exchange heal; a Tv hinge needs five temperatures or more

References

  1. Stukalin, E. B., Cai, L.-H., Kumar, N. A., Leibler, L., Rubinstein, M., "Self-healing of unentangled polymer networks with reversible bonds", Macromolecules 46, 7525–7541 (2013). doi:10.1021/ma401111n
  2. Ciarella, S., Ellenbroek, W. G., "Swap-driven self-adhesion and healing of vitrimers", Coatings 9, 114 (2019). doi:10.3390/coatings9020114
  3. Yang, H., Yu, K., Mu, X., Wei, Y., Guo, Y., Qi, H. J., "Molecular dynamics studying on welding behavior in thermosetting polymers due to bond exchange reactions", RSC Adv. 6, 22476–22487 (2016). doi:10.1039/c5ra26128g
  4. Perego, A., Khabaz, F., "Volumetric and rheological properties of vitrimers: a hybrid molecular dynamics and Monte Carlo simulation study", Macromolecules 53, 8406–8416 (2020). doi:10.1021/acs.macromol.0c01423
  5. Wick, C. D., Peters, A. J., Li, G., "A molecular dynamics modeling framework for shape memory vitrimers", J. Polym. Sci. 63, 9–19 (2025). doi:10.1002/pol.20240616
  6. Chen, Q., Huang, W., Zhang, L., Xi, L., Liu, J., "Fully atomistic molecular dynamics simulation of chemically modified natural rubber with hydrogen-bonding network", Polymer 284, 126284 (2023). doi:10.1016/j.polymer.2023.126284

Melting point by the Z method

Each run starts from the perfect crystal at rest, gives the atoms Maxwell–Boltzmann velocities at a starting temperature T0 and integrates at constant energy and volume (no thermostat, no barostat). In a harmonic crystal the energy then shares itself equally between kinetic and potential, so the run settles near T0/2; its total energy E is fixed by T0. Plotted against E, the mean temperature of the second half of each run rises along the crystal branch until the crystal can no longer hold: the first energy at which it melts puts the run onto the liquid branch at a lower temperature, because the latent heat comes out of the kinetic energy. The highest crystal point is the critical superheating limit (E_LS, T_LS); the temperature of the lowest-energy melted run is the melting temperature T_m at that volume. Melting is detected from the crystal's own Bragg order: ρ(G) = |Σ_j exp(iG·r_j)|/N over the star of reciprocal vectors (d ≥ 2 Å) where the perfect cell's order is largest, as a fraction of its starting value; it stays near the Debye–Waller factor in a crystal and falls to about N^(−1/2) in a liquid. A run whose order over its last fifth is below 0.3 has melted. Bisection runs between the last crystal start and the first melted start narrow the energy step around the bottom of the Z. The cell must be at least twice the cut-off wide.

$$T_m = \lim_{E \to E_{LS}^{+}} T(E), \qquad \rho(\mathbf{G}) = \frac{1}{N} \left| \sum_{j=1}^{N} e^{\,i \mathbf{G}\cdot\mathbf{r}_j} \right|, \qquad \langle T \rangle \xrightarrow{\text{harmonic}} \frac{T_0}{2}$$

Belonoshko, Skorodumova, Rosengren & Johansson 2006

SymbolMeaningIn CAPS
Etotal energy per atom of a run (fixed)kcal/mol
T0starting temperature of the velocitiesK
E_LS, T_LScritical superheating limit: the hottest crystal runkcal/mol, K
T_mmelting temperature at the crystal's volumeK
Greciprocal vectors of the cell's strongest low-order reflection1/Å
ρ(G)Bragg order parameter—

When to use it

A first melting point of an inorganic filler, a salt or a small-molecule crystal (an antioxidant, a curative) with a given force field, without building a solid–liquid interface. Polymer crystals melt over a range and superheat strongly; a heating scan or a two-phase run is more reliable for them.

Source
core/src/zmethod.cpp (z_method)
Tested by
ZMethod.HarmonicLimitHalvesTheTemperature (256 Lennard-Jones argon atoms from rest at T0 = 10 K settle at 5.04 K, the order on the four {111} vectors stays 0.99, drift 5e-6 kcal/mol per atom); ZMethod.LennardJonesCrystalTracesAZ (ρ* = 0.95, eleven runs of 4000 steps with four bisections: the crystal branch rises to T_LS 170 K, the first melted run sits at 156 K with order 0.14)
Departure from the reference
constant volume only (the melting point belongs to the crystal's density, not to zero pressure); short runs overestimate T_LS because melting near the limit needs a long waiting time; a melted run with order between 0.3 and the crystal's may be one caught while melting

References

  1. Belonoshko, A. B., Skorodumova, N. V., Rosengren, A., Johansson, B., "Melting and critical superheating", Phys. Rev. B 73, 012201 (2006). doi:10.1103/PhysRevB.73.012201

Restraints in minimisation, dynamics and the engine exports

A restraint adds ½ k (q − q_lo)² below a lower bound and ½ k (q − q_hi)² above an upper bound to the potential, and nothing in between; equal bounds give the plain harmonic ½ k (q − q0)². The restrained quantity q is a distance between two atoms (minimum image), an angle i-j-k, a torsion i-j-k-l with the IUPAC sign (its deviation taken around the circle from the centre of the bounds) or an atom's displacement from an anchor over chosen axes, whose flat bottom is a sphere of the given radius. Forces are the analytic derivatives (the torsion's by Blondel & Karplus); the internal restraints add to the virial, so a barostat feels them. A force constant can ramp linearly to a final value over a run, which releases a crosslink, a crystal or a filler in stages; while it ramps the conserved quantity is not conserved. The same restraints are written into the engine inputs: LAMMPS fix restrain, whose bond and angle K is k/2 and whose dihedral is K[1 − cos(φ − φ0)] with φ0 shifted by 180° for LAMMPS's own reckoning (equal to ½ k Δφ² near the minimum), lbound for a distance's lower bound alone, and fix spring/self (½ K r²) for position restraints anchored where the atoms are written, with Kstart → Kstop for ramps; GROMACS [ intermolecular_interactions ] with bonds of function 10, harmonic angles and [ dihedral_restraints ], and [ position_restraints ] (function 1, or 2 for the flat-bottomed sphere) inside each molecule type, with the anchors in a reference file for grompp -r. What an engine cannot express is left out of its file and said in the notes.

$$E = \tfrac12 k \left[\max(q_{\mathrm{lo}} - q,\, 0) + \max(q - q_{\mathrm{hi}},\, 0)\right]^2 \qquad k(t) = k + (k_{\mathrm{end}} - k)\,\frac{t}{t_{\mathrm{run}}}$$

LAMMPS fix restrain and fix spring/self; GROMACS restraint potentials (bonds function 10, dihedral and position restraints); Blondel & Karplus 1996

SymbolMeaningIn CAPS
qdistance (Å), angle or torsion (rad), or displacement from the anchor (Å)Å, rad
q_lo, q_hibounds of the flat bottom (equal: harmonic)Å, °
kforce constantkcal/mol/Ų, kcal/mol/rad²
k_endforce constant at the end of a run (ramp)as k

When to use it

Hold a crosslink, a hydrogen bond or an interphase geometry while the rest equilibrates; release a crystal or filler in stages by ramping k to zero; tether a substrate's atoms softly instead of freezing them; take the same restraints to LAMMPS or GROMACS for long runs elsewhere, the base for umbrella sampling of pull-out and debonding.

Source
core/src/restraints.cpp (add_restraint_forces, parse_restraints, lammps_restraint_lines, gromacs_intermolecular_restraints, gromacs_position_restraints); dynamics.cpp, relax.cpp
Tested by
Restraints.EnergiesEqualGromacs (a distance, an angle, a torsion, a position and a flat-bottomed position restraint equal gmx 2026.3's 0.449999, 4.56926, 685.059, 0.0999998 and 0.315001 kJ/mol); Restraints.ForcesAreGradients (every kind, harmonic and flat, across the cell boundary and the ±180° seam; the virial is Σ r·f); Restraints.GromacsExportRunsTheSameRestraints and Restraints.LammpsExportRunsTheSameRestraints (the written files run by gmx and lmp give CAPS's energies); Restraints.DynamicsConservesAndMinimisationHolds (NVE conserves the total with the restraint energy in it; a minimisation ends at the restrained distance)
Departure from the reference
LAMMPS has no upper or two-sided flat bottoms (other than a distance's lower bound), no flat-bottomed positions and no ramp for spring/self; its torsion restraint is a cosine; GROMACS has no ramp and no flat-bottomed angle; position restraints are not rescaled with a changing cell