Skip to content

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 ( ,  ,  ) while exercising the ParticleDynamics v1.2.0 active-matter, multi-bath thermodynamics, and checkpoint-restart APIs:

  1. Part A: Active Ornstein–Uhlenbeck Particles (AOUPs), MIPS & Entropy Production:

    • Overdamped active matter via ActiveOrnsteinUhlenbeck + EulerHeun() in a 2D PeriodicBox, multi-mode OUSpectrum(taus, scales), thermal Brownian + AOUP superposition, MSDObservable free-particle analytical calibration, SoftRepulsive 2D neighbor-list dynamics across   (plus a time-step convergence check at the smallest ), and GSDWriter trajectory 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.

  2. 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 repulsive WCA ( , zero attraction) and coupled to distinct Langevin(cold; gamma, kT=T_C) and Langevin(hot; gamma, kT=T_H) baths under BAOAB(track_thermo=true), with per-group ThermodynamicObservable (:cold, :hot, :all), BathExchangeObservable (:heat, :entropy_production_rate), CollisionObservable (:pair_rates), and GSDWriter ParticleSystem.from_gsd checkpoint-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  , increasing drives 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 ​

Live Fresnel Studio Dashboard (T11): Split view of overdamped AOUP Motility-Induced Phase Separation (Cates & Tailleur 2015; Martin et al. 2021, left) and two-temperature hot–cold demixing (Weber, Weber & Frey 2016, right) with live like-neighbor demixing fraction f_like(t) and local-density contrast φ_C vs. φ_H (tutorials/render_movies.py --targets T11).

Studio Fresnel snapshot of AOUP MIPS clustering and Weber et al. two-temperature demixing


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), disks in a 2D periodic box evolve under friction ( ), repulsive pair potential  , and exponentially correlated Gaussian self-propulsion with persistence time and active diffusivity :

The 2D RMS self-propulsion speed is  , the persistence length is   , the Péclet number is   , and the free-particle active temperature is  . For non-interacting particles, the closed-form 2D mean-squared displacement crosses over from ballistic () to diffusive ():

and for a multi-mode OUSpectrum plus optional thermal white noise  , the MSD is additive:     .

In ParticleDynamics, EulerHeun() updates positions with    where each OUSpectrum mode evolves via the discrete OU recurrence     ( ). Matching the discrete-time long-time diffusivity   yields:

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,    ( ),   while radial curvature remains anharmonic, yielding   . Evaluating and at the Stratonovich midpoint across a single step (  ,   ) preserves time-reversal antisymmetry (    ) and avoids Itô discretization bias. Two complementary quantities accompany :

  • 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 ), and

  • Active 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 ( ,  ,  , shifted to zero at with zero attractive tail,  ):

The mixture is placed at nominal disk area fraction    (number density  , WCA-cutoff area fraction   ), with species C coupled to a cold Langevin bath at   and species H to a hot Langevin bath at    with strong damping   approaching the overdamped regime of Weber, Weber & Frey (2016):

Because WCA has no attractive well and the effective Barker–Henderson disk diameter at   is    (giving effective packing fraction  , well below 2D hard-disk freezing  ), the   control is a uniform, mobile, well-mixed isotropic fluid with negligible global bond-orientational order ( ) and exchangeable species statistics    . Raising across drives purely nonequilibrium, repulsion-only demixing: the higher effective pressure of the hot species compresses the cold species into denser, hexatically ordered cold domains (so both and   increase above the equilibrium fluid baseline) coexisting with a lower-density, disordered hot fluid.

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 via C–H collisions and dissipates into the cold bath ( ), with    in steady state.

  • Steady-state second law (medium entropy production rate):

    computed by BathExchangeObservable from the per-particle BAOAB bath heat accumulators st.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:

julia
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:

julia
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  , the measured round-trip differences are    ,   , box difference   , 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) ​

AOUP free-particle MSD calibration, persistence-driven MIPS local density distributions, 2D real-space snapshots, and Fodor et al. (2016) entropy production and kinetic arrest

  • Free-particle AOUP & OUSpectrum calibration (Panel a): Across 17 lag times   spanning the ballistic () to diffusive () crossover at  , GPU EulerHeun() reproduces the analytical closed-form MSD curves with RMS relative errors of 1.85% (single_mode), 2.22% (two_mode_spectrum via OUSpectrum), and 1.48% (thermal_aoup combining Brownian + 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) ​

Weber, Weber & Frey (2016) two-temperature 2D binary WCA demixing snapshots, cold-domain compression and hexatic ordering, steady-state heat flux and BathExchangeObservable entropy production, and GSD checkpoint restart continuity

  • Equilibrium fluid baseline & Weber, Weber & Frey (2016) repulsive demixing (Panels a & b): At   (equilibrium control, purely repulsive WCA at  ,  ,  ,  ), species C and H form 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, BathExchangeObservable EPR, 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  . CollisionObservable confirms 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 same st.dq buffer within .

  • GSDWriter ParticleSystem.from_gsd checkpoint restart (Panel d): Splitting the   production trajectory at    into Stage 1 twot_stage1.gsd ParticleSystem.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.0010.13      Near-equilibrium
0.0030.22      Near-equilibrium
0.0100.40      Active fluid
0.0500.89      EPR rate peak
0.2502.00      Active fluid
1.5004.90      Active fluid
10.012.6      MIPS onset
40.025.3      Bimodal MIPS
120.043.8      Bimodal MIPS
200.056.6      Deep MIPS

Small- discretization check ( ):    ( ) gives   ,   ;    ( ) gives    (   , ),    (   , ).

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 MetricMeasured (ParticleDynamics v1.2.0)Reference / TargetStatus
Free-particle AOUP MSD RMS rel. err. (1-mode / 2-mode OUSpectrum / thermal)1.85% / 2.22% / 1.48% (analytical)PASS
Fodor et al. (2016) small- approach ( ): ,  , 8.4%, PASS
AOUP small- time-step convergence ( vs. at  )    (),     () ,  PASS
AOUP non-monotonic EPR rate ( at  , drop ) , 16.7% (  drop), PASS
AOUP MIPS bimodality (  vs.  ): , ,  ,   vs. ,  , gap ,   ,  , gap , PASS
Weber, Weber & Frey (2016) WCA equilibrium fluid control ( ): exchangeability, ,   (  , ),   , / ( ),  ,  PASS
Weber, Weber & Frey (2016) WCA demixing ( ): ,  ,  , PASS
Weber, Weber & Frey (2016) cold compression & hexatic ordering above fluid baseline: ,  , ,    (),   (),   (),   (), , , PASS
Two-temperature thermodynamics:  ,  , heat balance  ,   ,  , 0.163%,  , , , PASS
CollisionObservable equilibrium symmetry () & demixing C–H suppression  ( vs. )   ( ) at eq, at  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 CheckMeasuredCriterionStatus
BathExchangeObservable st.dq buffer wiring (Sdot_obs vs. manual Qc/TC + Qh/TH from same st.dq buffer)  (all 5 ratios)CHECK_OK
GSDWriter ParticleSystem.from_gsd handoff (, , box, tid, step) ,  ,  , 0 / 0 (160,000) (Float32 GSD), 0 mismatchesCHECK_OK

5. Running the Tutorial ​

bash
# 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.py

References ​

  1. É. 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).

  2. J. Tailleur & M. E. Cates, "Statistical Mechanics of Interacting Run-and-Tumble Bacteria," Phys. Rev. Lett. 100, 218103 (2008).

  3. Y. Fily & M. C. Marchetti, "Athermal Phase Separation of Self-Propelled Particles with No Alignment," Phys. Rev. Lett. 108, 235702 (2012).

  4. M. E. Cates & J. Tailleur, "Motility-Induced Phase Separation," Annu. Rev. Condens. Matter Phys. 6, 219–244 (2015).

  5. 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).

  6. S. N. Weber, C. A. Weber & E. Frey, "Binary Mixtures of Particles with Different Diffusivities Demix," Phys. Rev. Lett. 116, 058301 (2016).

  7. A. Y. Grosberg & J.-F. Joanny, "Nonequilibrium statistical mechanics of mixtures of particles in contact with different thermostats," Phys. Rev. E 92, 032118 (2015).

  8. E. Ilker & J.-F. Joanny, "Phase separation and nucleation in mixtures of particles with different temperatures," Phys. Rev. Research 2, 023200 (2020).

ParticleDynamics v1.2.0 · GPU-native molecular dynamics in pure Julia · MIT License