Tutorial T11: Active Matter & Nonequilibrium Phase Separation
Scripts: tutorials/T11_active_matter_twot/run.jl · analyze.jl · plot.py
Equilibrium phase separation requires attractive interparticle forces or unfavorable enthalpic cross-interactions that lower free energy. Out of equilibrium, however, persistent self-propulsion or differential thermal driving alone breaks microscopic detailed balance and drives spontaneous macroscopic phase separation, producing dense, hexatically ordered domains coexisting with dilute active or hot fluids even in purely repulsive, chemically identical systems.
This tutorial examines two canonical nonequilibrium phase-separation systems in 2D reduced units (ParticleDynamics v1.2.0 active-matter, multi-bath thermodynamics, and checkpoint-restart APIs:
Part A: Active Ornstein–Uhlenbeck Particles (AOUPs), MIPS & Entropy Production:
Overdamped active matter via
ActiveOrnsteinUhlenbeck+EulerHeun()in a 2DPeriodicBox, multi-modeOUSpectrum(taus, scales), thermalBrownian+ AOUP superposition,MSDObservablefree-particle analytical calibration,SoftRepulsive2D neighbor-list dynamics across (plus atime-step convergence check at the smallest ), and GSDWritertrajectory archival.Demonstrates persistence-driven Motility-Induced Phase Separation (MIPS) (Tailleur & Cates 2008; Fily & Marchetti 2012; Cates & Tailleur 2015; Martin et al. 2021) from a unimodal fluid to bimodal dense-cluster + dilute-gas coexistence, and evaluates the Fodor et al. (2016) (Phys. Rev. Lett. 117, 038103) path-action entropy production rate
and active kinetic temperature ratio across the crossover from near-equilibrium ( ) into deep MIPS.
Part B: Two-Temperature Binary Purely Repulsive WCA Mixtures & Weber, Weber & Frey (2016):
Multi-group
Group(:cold, TypeSelection(:C))+Group(:hot, TypeSelection(:H))interacting via purely repulsiveWCA( , zero attraction) and coupled to distinctLangevin(cold; gamma, kT=T_C)andLangevin(hot; gamma, kT=T_H)baths underBAOAB(track_thermo=true), with per-groupThermodynamicObservable(:cold,:hot,:all),BathExchangeObservable(:heat,:entropy_production_rate),CollisionObservable(:pair_rates), andGSDWriterParticleSystem.from_gsdcheckpoint-restart continuation.Reproduces Weber, Weber & Frey (2016) (Phys. Rev. Lett. 116, 058301; with complementary two-temperature thermodynamics from Grosberg & Joanny 2015, Phys. Rev. E 92, 032118): starting from a verified well-mixed isotropic fluid at
, increasingdrives purely repulsive hot particles to compress cold particles into denser, hexatically ordered cold domains (both and rising above the equilibrium fluid baseline) coexisting with a lower-density disordered hot fluid, sustained by a steady inter-species heat flux and positive entropy production rate .
Trajectory Visualization
tutorials/render_movies.py --targets T11).
1. Physical Models & Nonequilibrium Statistical Mechanics
Part A: Overdamped AOUPs, Discrete-Time Calibration, MIPS & Fodor et al. (2016)
In the overdamped Active Ornstein–Uhlenbeck Particle (AOUP) model (Fodor et al. 2016; Martin et al. 2021),
The 2D RMS self-propulsion speed is
and for a multi-mode OUSpectrum
In ParticleDynamics, EulerHeun() updates positions with OUSpectrum mode evolves via the discrete OU recurrence
Using the Onsager–Machlup path action, Fodor et al. (2016) (Eq. 8) derived the steady-state trajectory entropy production rate per particle for pair-interacting AOUPs in terms of third derivatives of the pair potential:
For SoftRepulsive harmonic disks,
Dimensionless entropy produced per persistence time
(reported alongside the physical rate itself, which is non-monotonic in because particle arrest inside MIPS clusters suppresses relative velocities at large ), andActive kinetic temperature ratio
(using the steady-state identity ), which approaches linearly as (with a finite dense-fluid slope proportional to ) and decreases toward as particles jam inside MIPS clusters (Tailleur & Cates 2008; Fily & Marchetti 2012; Cates & Tailleur 2015; Martin et al. 2021).
Part B: Two-Temperature Binary Purely Repulsive WCA Mixtures & Weber, Weber & Frey (2016)
Following Weber, Weber & Frey (2016) (Phys. Rev. Lett. 116, 058301), we simulate a 50:50 binary 2D mixture of chemically identical, purely repulsive Weeks–Chandler–Andersen (WCA) disks (
The mixture is placed at nominal disk area fraction C coupled to a cold Langevin bath at H to a hot Langevin bath at
Because WCA has no attractive well and the effective Barker–Henderson disk diameter at
Complementary two-temperature statistical mechanics (Grosberg & Joanny 2015, Phys. Rev. E 92, 032118; Ilker & Joanny 2020, Phys. Rev. Research 2, 023200) predicts the steady-state thermodynamic signatures tracked on the GPU by ThermodynamicObservable and BathExchangeObservable:
Effective kinetic temperature shift: inter-species collisions heat the cold species above its bath (
) and cool the hot species below its bath ( ).Steady-state first law (heat conservation): heat absorbed per unit time from the hot bath (
) transfers across domain interfaces viaC–Hcollisions and dissipates into the cold bath ( ), with in steady state.Steady-state second law (medium entropy production rate):
computed by
BathExchangeObservablefrom the per-particleBAOABbath heat accumulatorsst.dq.
2. ParticleDynamics v1.2.0 API Walkthrough
Part A: ActiveOrnsteinUhlenbeck, OUSpectrum & EulerHeun()
Single-mode AOUPs, multi-mode OUSpectrum processes, and thermal AOUPs (superposing Brownian white noise with correlated ActiveOrnsteinUhlenbeck forcing on the same group) use the same declarative Workflow API:
allp = Group(:all, AllSelection())
# Multi-mode OUSpectrum (two correlation times on the same active group)
ou_two_mode = ActiveOrnsteinUhlenbeck(
allp;
gamma = 1.0,
spectrum = OUSpectrum([0.2, 1.5], [S1, S2]),
)
# Interacting 2D AOUP MIPS simulation with SoftRepulsive + EulerHeun + GSDWriter
sys = ParticleSystem(cfg; types=[:A], typeids=fill(Int32(1), N), masses=Dict(:A => 0.0))
sim = Simulation(
sys;
groups = Groups(allp),
integrator = Integrator(
dt = 1.5e-3,
scheme = EulerHeun(),
forces = [SoftRepulsive(epsilon=100.0, sigma=1.0, cutoff=1.0, pairs=:neighborlist,
neighborlist=CellList(buffer=0.4, capacity=64, rebuild_interval=10))],
methods = [ActiveOrnsteinUhlenbeck(allp; gamma=1.0, tau=200.0, noise_scale=S)],
),
writers = [GSDWriter("out/aoup_mips.gsd"; every=800, group=allp, write_start=false, mode=:replace, diameter=1.0)],
precision = Float64,
)
prepare!(sim)Part B: Multi-Group Two-Temperature WCA + Langevin, BathExchangeObservable, CollisionObservable & ParticleSystem.from_gsd
Assigning distinct Langevin baths to :cold and :hot groups under BAOAB(track_thermo=true) with purely repulsive WCA tracks per-particle bath heat exchange (st.dq) and total entropy production (BathExchangeObservable) alongside per-species kinetic temperatures and pair collision rates:
cold = Group(:cold, TypeSelection(:C))
hot = Group(:hot, TypeSelection(:H))
allp = Group(:all, AllSelection())
t_all = ThermodynamicObservable(allp; name=:all)
t_cold = ThermodynamicObservable(cold; name=:cold)
t_hot = ThermodynamicObservable(hot; name=:hot)
bath = BathExchangeObservable(name=:bath)
coll = CollisionObservable(name=:collisions)
sim1 = Simulation(
sys;
groups = Groups(cold, hot, allp),
integrator = Integrator(
dt = 0.002,
scheme = BAOAB(track_thermo=true),
forces = [WCA(epsilon=1.0, sigma=1.0, pairs=:neighborlist,
neighborlist=CellList(buffer=0.45, capacity=48, rebuild_interval=10))],
methods = [
Langevin(cold; gamma=20.0, kT=0.05),
Langevin(hot; gamma=20.0, kT=4.00),
],
),
observables = [t_all, t_cold, t_hot, bath, coll],
writers = [GSDWriter("out/twot_stage1.gsd"; every=block_steps, group=allp,
write_start=false, mode=:replace, diameter=1.0)],
precision = Float64,
)
prepare!(sim1)
# Equilibrate -> run Stage 1 production blocks -> reload checkpoint via ParticleSystem.from_gsd:
sys_restart = ParticleSystem.from_gsd("out/twot_stage1.gsd")
# Build a fresh Simulation(sys_restart; ...) and continue into Stage 2.HOOMD GSD Float32 coordinate schema
GSDWriter stores particles/position, particles/velocity, and configuration/box in standard HOOMD IEEE-754 Float32 precision, while preserving typeid, types, masses, and configuration/step without loss. Across the Stage 1 ParticleSystem.from_gsd handoff at 0 type-ID mismatches, and matching step counters (160,000).
3. Results & Visual Verification
Part A: Active Ornstein–Uhlenbeck Particles: Calibration, MIPS & Fodor et al. (2016)

Free-particle AOUP &
OUSpectrumcalibration (Panel a): Across 17 lag times spanning the ballistic ( ) to diffusive ( ) crossover at , GPUEulerHeun()reproduces the analytical closed-form MSD curves with RMS relative errors of1.85%(single_mode),2.22%(two_mode_spectrumviaOUSpectrum), and1.48%(thermal_aoupcombiningBrownian+ActiveOrnsteinUhlenbeck).Persistence-driven Motility-Induced Phase Separation (Panels b & c): At fixed
and ( ), the local packing-fraction distribution ( , accumulated across 16 GSD production frames) evolves from a unimodal distribution at ( , , Sarle bimodality ) through broad fluctuations near onset at ( , ) into bimodal dense–dilute coexistence for ( ), reaching ( ), , and a coexistence gap at ( ), consistent with AOUP MIPS phenomenology (Cates & Tailleur 2015; Martin et al. 2021). Panel (c) visualizes the emergent hexagonally packed MIPS cluster ( ) coexisting with a dilute active gas ( ).Fodor et al. (2016) irreversibility, non-monotonic EPR rate & kinetic arrest (Panel d):
Near-equilibrium approach (
): At , the Stratonovich midpoint entropy production rate drops to (8.4%of its intermediate peak at ) and the active kinetic ratio reaches . Note that lies ( ) below unity: the effective-equilibrium limit is approached linearly via , which retains a physical dense-fluid offset at ( , ) rather than reaching identically.Non-monotonic EPR rate vs.
: The physical entropy production rate is non-monotonic (Panel d, inset): it rises from at to a maximum of at , then decreases by to (16.7%of the peak) at as particles jam inside the MIPS cluster ( , kinetic arrest), changing by only between the two sweep endpoints. Multiplying by gives the dimensionless entropy produced per persistence time , which spans from to (a factor of driven predominantly by the span of itself times the endpoint rate ratio).Time-step discretization caveat &
convergence check: Because is varied alongside across the sweep (reaching at ), small- measurements can mix physical persistence effects with finite-step discretization error. Repeating at ( ) with identical physical equilibration and sampling windows confirms discretization convergence: vs. ( , ) and vs. ( , ).
Part B: Two-Temperature Binary 2D WCA Mixture: Weber, Weber & Frey (2016)

Equilibrium fluid baseline & Weber, Weber & Frey (2016) repulsive demixing (Panels a & b): At
(equilibrium control, purely repulsive WCA at , , , ), speciesCandHform a mobile, well-mixed isotropic fluid: the like-neighbor fraction is statistically consistent with combinatorial finite- exchangeability ( , ), global six-fold order is negligible ( ), and species local densities and local hexatic order are symmetric ( vs. ; vs. ). Raising across drives spontaneous repulsion-only demixing: at , rises to (cold-domain purity , composition std ). Hot-particle kinetic pressure compresses the cold species above the equilibrium fluid baseline to (cold compression [ ]; hot–cold contrast [ ] against ), while cold local six-fold order rises to (ordering gain above fluid baseline [ ]; contrast against hot fluid of [ , ]).Steady heat flux,
BathExchangeObservableEPR, kinetic temperature shift & collisions (Panel c): Across , inter-species collisions sustain a steady heat current from the hot bath into the cold bath: at , vs. (steady-state energy imbalance ), heating the cold species to ( ) and cooling the hot species to ( ), with total entropy production rate . At equilibrium ( ), the small residual (0.024%of the rate, across particles) reflects finite- BAOAB splitting shadow-energy drift at .CollisionObservableconfirms combinatorial 1:2:1 symmetry at equilibrium ( , cross-species fraction vs. , ) and cross-species collision suppression upon demixing at (cross-species fraction drops to , [ ], with ). Separately, as a software buffer-wiring check,BathExchangeObservable(:entropy_production_rate) matches the manual species sum accumulated from the samest.dqbuffer within .GSDWriterParticleSystem.from_gsdcheckpoint restart (Panel d): Splitting the production trajectory at into Stage 1twot_stage1.gsdParticleSystem.from_gsd Stage 2 yields statistically consistent steady-state observables across the checkpoint boundary ( : vs. , [ ]; : vs. , [ ]; : vs. , [ ]; : vs. , [ ]; : vs. , [ ]).
4. Quantitative Production Summary
Measured on an NVIDIA GeForce RTX 3090 (Float64, run.jl total wall time 484.1 s: Part A 84.7 s, Part B 335.5 s), with 8-block standard errors of the mean.
Part A: 2D AOUP Persistence Sweep (N = 2,000, φ = 0.58, D_a = 8.0, γ = 1.0, ε_SR = 100, EulerHeun)
| Regime | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 0.001 | 0.13 | Near-equilibrium | |||||||
| 0.003 | 0.22 | Near-equilibrium | |||||||
| 0.010 | 0.40 | Active fluid | |||||||
| 0.050 | 0.89 | EPR rate peak | |||||||
| 0.250 | 2.00 | Active fluid | |||||||
| 1.500 | 4.90 | Active fluid | |||||||
| 10.0 | 12.6 | MIPS onset | |||||||
| 40.0 | 25.3 | Bimodal MIPS | |||||||
| 120.0 | 43.8 | Bimodal MIPS | |||||||
| 200.0 | 56.6 | Deep MIPS |
Small-
Part B: Two-Temperature Binary 2D WCA Mixture (N = 2,000, φ = 0.52, T_C = 0.05, γ = 20.0, r_c = 2^{1/6} σ, BAOAB) {#Part-B:-Two-Temperature-Binary-2D-WCA-Mixture-N-2,000,-φ-0.52,-TC-0.05,-γ-20.0,-rc-2{1/6}-σ,-BAOAB}
BathExchange) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 1.0 | 611 / 1,209 / 608 | ||||||||
| 5.0 | 990 / 1,570 / 906 | ||||||||
| 20.0 | 1,302 / 1,957 / 1,482 | ||||||||
| 50.0 | 1,324 / 2,329 / 2,060 | ||||||||
| 80.0 | 1,253 / 2,639 / 2,414 |
Physics Validation Summary (37 / 37 PASS)
Physics validation metrics are tallied separately from software/API regression checks (verify_check) and non-gated diagnostics (report_diagnostic).
| Physics Validation Metric | Measured (ParticleDynamics v1.2.0) | Reference / Target | Status |
|---|---|---|---|
Free-particle AOUP MSD RMS rel. err. (1-mode / 2-mode OUSpectrum / thermal) | 1.85% / 2.22% / 1.48% | PASS | |
| Fodor et al. (2016) small- | 8.4% | PASS | |
| AOUP small- | PASS | ||
| AOUP non-monotonic EPR rate ( | 16.7% ( | PASS | |
| AOUP MIPS bimodality ( | PASS | ||
| Weber, Weber & Frey (2016) WCA equilibrium fluid control ( | PASS | ||
| Weber, Weber & Frey (2016) WCA demixing ( | PASS | ||
| Weber, Weber & Frey (2016) cold compression & hexatic ordering above fluid baseline: | PASS | ||
| Two-temperature thermodynamics: | 0.163%, | PASS | |
CollisionObservable equilibrium symmetry ( | PASS | ||
| Stage 2 vs. Stage 1 steady-state continuity across GSD restart ( | PASS |
Software & API Regression Checks (6 / 6 CHECK_OK)
The following verify_check entries test internal API wiring and serialization fidelity rather than independent physical laws:
| API Regression Check | Measured | Criterion | Status |
|---|---|---|---|
BathExchangeObservable st.dq buffer wiring (Sdot_obs vs. manual Qc/TC + Qh/TH from same st.dq buffer) | CHECK_OK | ||
GSDWriter ParticleSystem.from_gsd handoff (box, tid, step) | 0 / 0 (160,000) | Float32 GSD), 0 mismatches | CHECK_OK |
5. Running the Tutorial
# Quick GPU smoke verification (N=400 AOUP + N=400 Two-T WCA, < 60 s warm compute on RTX 3090)
TUTORIAL_FAST=1 julia --project tutorials/T11_active_matter_twot/run.jl
TUTORIAL_FAST=1 julia --project tutorials/T11_active_matter_twot/analyze.jl
# Full production validation (N=2000 AOUP 10-point tau sweep + dt/2 check + N=2000 Two-T WCA + GSD restart)
julia --project tutorials/T11_active_matter_twot/run.jl
julia --project tutorials/T11_active_matter_twot/analyze.jl
# Regenerate 300-DPI documentation figures
python3 tutorials/T11_active_matter_twot/plot.pyReferences
É. Fodor, C. Nardini, M. E. Cates, J. Tailleur, P. Visco & F. van Wijland, "How Far from Equilibrium Is Active Matter?," Phys. Rev. Lett. 117, 038103 (2016).
J. Tailleur & M. E. Cates, "Statistical Mechanics of Interacting Run-and-Tumble Bacteria," Phys. Rev. Lett. 100, 218103 (2008).
Y. Fily & M. C. Marchetti, "Athermal Phase Separation of Self-Propelled Particles with No Alignment," Phys. Rev. Lett. 108, 235702 (2012).
M. E. Cates & J. Tailleur, "Motility-Induced Phase Separation," Annu. Rev. Condens. Matter Phys. 6, 219–244 (2015).
D. Martin, J. O'Byrne, M. E. Cates, É. Fodor, C. Nardini, J. Tailleur & F. van Wijland, "Statistical mechanics of active Ornstein-Uhlenbeck particles," Phys. Rev. E 103, 032607 (2021).
S. N. Weber, C. A. Weber & E. Frey, "Binary Mixtures of Particles with Different Diffusivities Demix," Phys. Rev. Lett. 116, 058301 (2016).
A. Y. Grosberg & J.-F. Joanny, "Nonequilibrium statistical mechanics of mixtures of particles in contact with different thermostats," Phys. Rev. E 92, 032118 (2015).
E. Ilker & J.-F. Joanny, "Phase separation and nucleation in mixtures of particles with different temperatures," Phys. Rev. Research 2, 023200 (2020).