Multi-Particle Collision Framework for Active Polar Fluids Oleksandr Baziei, Benjamín Loewe, Tyler N. Shendruk Abstract Sufficiently dense intrinsically out-of-equilibrium suspensions, such as those observed in biological systems, can be modelled as active fluids characterised by their orientational symmetry. While mesoscale numerical approaches to active nematic fluids have been developed, polar fluids are simulated as either ensembles of microscopic self-propelled particles or continuous hydrodynamic-scale equations of motion. To better simulate active polar fluids in complex geometries or as a solvent for suspensions, mesoscale numerical approaches are needed. In this work, the coarse-graining Multi-Particle Collision Dynamics (MPCD) framework is applied to three active particle models to produce mesoscale simulations of polar active fluids. The first active-polar MPCD (AP-MPCD) is a variant of the Vicsek model, while the second and third variants allow the speed of the particles to relax towards a self-propulsion speed subject to Andersen and Langevin thermostats, respectively. Each of these AP-MPCD variants exhibit a flocking transition at a critical activity and banding in the vicinity of the transition point. We leverage the mesoscale nature of AP-MPCD to explore flocking in the presence of external fields, which destroys banding, and anisotropic obstacles, which act as a ratchet that biases the flocking direction. These results demonstrate the capacity of AP-MPCD to capture the known phenomenology of polar active suspensions, and its versatility to study active polar fluids in complex scenarios. I Introduction Active fluids spontaneously flow because they are composed of a continuum of microscopic motors that everywhere convert internal fuel into mechanical work [ 1 , 2 ] and serve the biophysics community as idealised generic models of collective motion. Biological examples of systems modelled as active fluids include suspensions of swimming bacteria [ 3 ] , mitotic spindles [ 4 ] , epithelial tissues [ 5 ] , ensembles of neural progenitor cells [ 6 ] , ectodermal cells [ 7 ] and more [ 8 , 9 ] . Modelling such systems has primarily relied on two numerical approaches: particle-based approaches [ 10 ] and continuum theories [ 11 ] . These two limiting approaches are connected through the coarse-graining of self-propelled particle models into continuum theories, which is well established for standard models [ 12 ] . Indeed, Vicsek’s original model of self-propelled particles with minimal interactions leading to collective flocking [ 13 ] was immediately followed by the Toner-Tu model [ 14 ] , which applied symmetry arguments rather than direct coarse-graining to arrive at a continuum theory, the renormalisation of which can predict the critical behaviour [ 15 ] . Both the particle-based Vicsek model (and its variants [ 16 , 17 ] ) and the Toner-Tu model [ 18 , 19 , 20 , 21 ] (often supplemented by a Swift-Honenberg-type ansatz [ 22 , 23 ] ) have been remarkably fruitful models of active matter. However, particle-based and continuum models represent the limiting approaches to simulating soft condensed matter systems [ 24 ] . They are supplemented by a third, middling approach: mesoscale simulations. Mesoscale lies midway between the microscopic scale of a material and the macroscopic scale of the system. Mesoscale simulations, such as coarse-grained molecular dynamics [ 25 , 26 ] , dissipative particle dynamics [ 27 , 28 , 29 ] and multi-particle collision dynamics [ 30 , 8 ] , have proven valuable for simulating soft condensed matter systems. In particular, systems involving mesoscale solutes, such as anisotropic colloids [ 31 , 32 , 33 , 34 ] , polymers [ 35 ] , or complex fluids [ 36 , 37 , 38 , 39 , 40 , 41 ] are amenable to mesoscale methods. Likewise, particle-based coarse-grained approaches can more easily simulate complex geometries, such as wavy channels [ 42 ] , funnels [ 43 ] or confined swimmers [ 44 ] , because they can avoid complex meshing methods that are often crucial to solving continuum differential equations in the vicinity of boundaries [ 45 ] . However, few mesoscale techniques have been developed for active fluids, despite the importance of understanding the dynamics of passive inclusions embedded in active surroundings [ 46 , 47 ] and active dynamics in complex geometries [ 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 ] for designing material applications for active matter. To better simulate active polar fluids as a background active medium for dynamic mesoscale objects in complex geometries, coarse-grained numerical approaches are needed. This work introduces three mesoscale approaches to simulating active polar fluids. These mesoscale algorithms utilise the Multi-Particle Collision Dynamics (MPCD) framework, which we introduce in § II.1 . We then review the Vicsek model (§ II.2 ), before using it as the basis for the first active polar MPCD (AP-MPCD) in § III , which replaces interactions with multi-particle collisions that preserve the speed of each fluid particle. This “Vicsek-MPCD” model exhibits a flocking transition at sufficiently high activity and density (§ III.1 ). We demonstrate that the system transitions to flocking at an activity consistent with the predicted low-density scaling [ 57 ] . Furthermore, we go beyond the low-density limit and characterise the scaling behaviour at high densities. We then relax the constraint that fluid particles have a fixed self-propulsion speed through two thermostatted approaches. The first of these is an Andersen-thermostatted AP-MPCD (§ IV ), while the second is Langevin-thermostatted AP-MPCD (§ V ). After demonstrating that all three algorithms exhibit a flocking transition, we consider how the MPCD framework simulates collective motion in complex geometries focusing on one of the three algorithms. Concentrating on Langevin AP-MPCD, we demonstrate the coexistence of a disorderly dilute phase and a dense flocking phase in system near the flocking transition, which is expressed via stable bands (§ V.3 ). In addition, the influence of gravity on a system of self-propelled particles demonstrates that external forces suppress the phase transition (§ V.4 ). Finally in § V.5 , we embed the polar fluid in geometries constructed of asymmetric obstacles. The active fluid inherits the broken symmetry of the obstacles, which not only sets the direction of flocking but impacts the flocking transition. Through these results, we demonstrate that the AP-MPCD is a versatile numerical tool for simulating active polar fluids. The framework offers numerous tunable parameters, including the collision operator for particles and versatile boundary conditions. This flexibility allows for modelling of a variety of different scenarios, while reproducing known phenomena, such as order-disorder phase transition in the Vicsek model or banding in the vicinity of critical activity. In the future, its flexibility will allow it to be extended beyond self-propelled particles to simulate more complex biologically relevant active systems such as active suspensions [ 58 ] . II Methods To introduce novel active polar algorithms we have to discuss the pre-existing passive hydrodynamic solver, Multi-Particle Collision Dynamics (MPCD; § II.1 ). This computational technique can employ intrinsic thermostats (§ II.1.1 and § II.1.2 ). After summarising MPCD, we review the Vicsek model (§ II.2 ), before proposing hybrid and novel mesoscale algorithms for active polar fluids. II.1 Multi-particle Collision Dynamics Multi-Particle Collision Dynamics (MPCD) is a particle-based mesoscale simulation technique that intrinsically incorporates thermal fluctuations to model hydrodynamic flows [ 30 , 59 , 60 , 61 ] . The MPCD algorithm is a two-step method composed of a streaming step in which particles translate and a collision step in which particles stochastically exchange properties with their neighbours while respecting appropriate conservation laws. In MPCD, the fluid is discretised into N point particles of mass m . During the streaming step, the position of the i th particle is updated as \boldsymbol{r}_{i}(t+\delta t)=\boldsymbol{r}_{i}\left(t\right)+\boldsymbol{v}_{i}\left(t\right)\delta t, (1) in which \boldsymbol{r}_{i}\left(t\right) is the instantaneous position, \boldsymbol{v}_{i}\left(t\right) the instantaneous velocity and \delta t is the time step. (a) (b) Figure 1: Schematic of the MPCD framework. (a) Space is divided into cells with linear size a . Velocities \boldsymbol{v}_{i}\left(t\right) (blue arrows) of each particle sum up to cell c ’s centre of mass velocity \boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right) (red arrow). (b) A stochastic Andersen collision operation (Eq. 3 ) that conserves momentum assigns random velocities (green arrows) to each particle in cell c . The system is of size L and is divided into cells of size a , within which the collision steps occur (Fig. 1 a). Each cell is indexed c . This division into cells significantly reduces the computational load by restricting interactions to particles within the same cell. A random grid shift ensures Galilean invariance [ 62 ] . Only particles in the same cell interact and the interactions involve all particles in the same cell. Within each cell c , the collision operator \boldsymbol{R}_{ic} stochastically produces new velocities \vec{v}_{i}(t+\delta t)=\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right), (2) for each of the i particles in terms of their original velocity \vec{v}_{i}\left(t\right) and the centre of mass velocity of the local cell \boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)=\left\langle\vec{v}_{j}\right\rangle_{c}=N_{C}^{-1}\Sigma_{i=1}^{N_{C}}\boldsymbol{v}_{i} , in which \left\langle\cdot\right\rangle_{c} denotes the average over cell c assuming all particles have the same mass m and N_{C} is the number of particle in cell c . As the simulation progresses, particle velocities are updated based on the collision operator, introducing randomness and mimicking particle interactions. Although there are several choices for collision operator [ 63 ] , this study focuses on two thermostatted approaches: Andersen MPCD and Langevin MPCD [ 64 ] . II.1.1 Andersen MPCD Thermostatted MPCD collision operators maintain constant temperature conditions [ 64 ] . Though momentum is conserved, the energy is not; it is constantly fluctuating about a constant thermal energy k_{\textmd{B}}T . Thermostatted collision operators include thermostatting inside each cell, such that no global velocity rescaling is required, even if external fields are applied. Andersen-thermostatted MPCD implements an Andersen thermostat within the collision operation while locally conserving momentum. During the collision steps (Fig. 1 b), each particle is reassigned its velocity with a random value drawn from a Maxwell–Boltzmann distribution with energy k_{\textmd{B}}T in an isotropically random direction while preserving momentum by subtracting the average of all random velocities. The collision operator is \boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right)=\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+\boldsymbol{\xi}_{i}-\left\langle\boldsymbol{\xi}\right\rangle_{c}, (3) in which \boldsymbol{\xi}_{i} are random velocities components drawn from a Gaussian distribution with zero thermodynamic mean and uncorrelated variance. The instantaneous cell-average of random velocities is \left\langle\boldsymbol{\xi}\right\rangle_{c} . Andersen MPCD has found widespread success in simulating situations in which energy is injected into the system from an external force [ 65 , 64 , 37 ] . In this work, particle mass m=1 , energy k_{\textmd{B}}T=1 and cell size a=1 set the simulation units. The unit time is \Delta t_{\text{MPCD}}=a\sqrt{m/k_{\textmd{B}}T}=1 and the time step is \delta t=0.1\Delta t_{\text{MPCD}} . The average number of particles per cell \left\langle N_{c}\right\rangle is equivalent to the particle mass density in the simulations. All results are reported in simulation units and all the simulations are in D=2 dimensions. The random variables are drawn from Gaussian distribution with \left\langle\boldsymbol{\xi}_{i}\left(t\right)\right\rangle=0 and \left\langle\boldsymbol{\xi}_{i}\left(t\right)\boldsymbol{\xi}_{j}(t^{\prime})\right\rangle=\delta_{ij}\delta(t-t^{\prime})\underline{\underline{I}} for Kronecker delta \delta_{ij} , Dirac delta \delta(t-t^{\prime}) and identity matrix \underline{\underline{I}} . The total number of particles is N=\left\langle N_{c}\right\rangle L^{2} . Unless stated otherwise, the system is square and has a size L=100 with periodic boundary conditions in all Cartesian directions. A warmup time of \mathfrak{T}_{W}=1.5\times 10^{4}\delta t is found to be sufficiently long for all systems to reach steady state. After the warmup, data collection occurs for \mathfrak{T}=5\times 10^{5}\delta t . II.1.2 Langevin MPCD The Langevin collision operator is another approach to thermostatting MPCD [ 64 ] . In Langevin MPCD, the collision operator is \displaystyle\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right) \displaystyle=\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+b\left[\boldsymbol{v}_{i}\left(t\right)-\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)\right] \displaystyle\qquad+\ell\left(\boldsymbol{\xi}_{i}-\Sigma_{j}^{N_{C}}\frac{\boldsymbol{\xi}_{i}}{N_{C}}\right), (4) in which \displaystyle b \displaystyle=\frac{2m-\gamma\delta t}{2m+\gamma\delta t}, (5) \displaystyle\ell \displaystyle=\frac{2\sqrt{\gamma\delta t}}{2m+\gamma\delta t} (6) with \gamma a drag coefficient. The collision operator exerts two effects on the fluid particles: a viscous force that opposes the relative motion of fluid particles within each cell, and random kicks resulting from the thermal bath, described by the white noise \boldsymbol{\xi}_{i} with all the same properties as in § II.1.1 . The drag factor (Eq. 5 ) and the noise strength (Eq. 6 ) are related through the fluctuation-dissipation theorem. The units are the same as in Andersen MPCD (§ II.1.1 ) but include the additional parameter \gamma . Setting \gamma=2m/\delta t and m=1/2 causes b=0 and l=1 , which reduces Langevin MPCD (Eq. 4 ) to Andersen MPCD (Eq. 3 ). Here, however, the drag is set to \gamma=1 , which is much less than 2m/\delta t=20 and gives b=0.905 and \ell=0.301 . Although Langevin MPCD is a simple model for including dissipation, it is employed less frequently in the literature than Andersen MPCD. In this work, we propose an additional active polar term in \boldsymbol{R}_{ic} for both Andersen and Langevin MPCD algorithms. The active term is proposed after implementing the Vicsek model in the MPCD framework to produce a hybrid Vicsek-MPCD algorithm. Before proposing a hybrid Vicsek-MPCD approach, we review the traditional Vicsek model. Figure 2: Schematic of the Vicsek model. Each particle i has an instantaneous velocity (blue arrow). The average direction \left\langle\theta\right\rangle_{a} within the interaction distance a around particle i is given by the red arrow. Green arrows represent instantaneous velocities of the particles within the interaction range, while magenta arrows represent those outside the interaction range. II.2 Vicsek Model The Vicsek model operates on a simple rule: At each time step, each self-propelled particle attempts to align its direction of motion with the average direction of its neighbours while subjected to stochastic perturbations. This models polar interactions between self-propelled particles [ 13 ] . It is a “dry” active model [ 11 ] that conserves energy since the particles travel at a constant speed. The alignment interaction, however, is active, injecting momentum through the reorientation of velocities. It offers a simplified-yet-insightful framework that captures rich collective dynamics in a number of different contexts [ 66 , 67 ] . In particular, it exhibits a collective transition to a cohesive flocking state, in which individual particles collectively converge upon a spontaneously chosen direction [ 68 ] . This manifests as a kinetic transition through spontaneous rotational symmetry breaking [ 69 , 70 , 71 ] . In the original Vicsek model, the position of the i th particle is updated as \boldsymbol{r}_{i}(t+\delta t)=\boldsymbol{r}_{i}\left(t\right)+\boldsymbol{v}_{i}\left(t\right)\delta t, (7) in which \boldsymbol{v}_{i}\left(t\right)=v_{0}\boldsymbol{e}_{i}\left(t\right) is the velocity of the i th particle, which maintains a constant speed v_{0} , but has an instantaneous orientation \boldsymbol{e}_{i}\left(t\right)=\left(\cos\theta_{i}\left(t\right),\sin\theta_{i}\left(t\right)\right) determined by the angle \theta_{i}\left(t\right) in 2D — though Vicsek model can also be implemented in 3D [ 70 ] . Figure 3: Schematic of the hybrid Vicsek-MPCD algorithm. The collision operator in the Vicsek-MPCD model (Eq. 12 ) rotates velocity of the particle while speed remains unchanged. The red arrow is the centre of mass velocity \boldsymbol{v}^{\textmd{cm}}_{c} in a cell of size a . Blue arrows are the instantaneous velocity of each particle. Cones represent the distribution of random velocities, characterized by the strength of the noise \eta . Between time steps, each particle instantaneously updates its heading \boldsymbol{e}_{i} based on the instantaneous state of its neighbours (Fig. 2 ). The direction of motion of all the particles are updated simultaneously at each time step according to \theta_{i}(t+\delta t)=\left\langle\theta(t)\right\rangle_{r_{ij}\leq a}+\zeta_{i}. (8) The first term, \left\langle\theta(t)\right\rangle_{r_{ij}\leq a}=\arctan[\left\langle\sin\theta(t)\right\rangle_{r_{ij}\leq a}/\left\langle\cos\theta(t)\right\rangle_{r_{ij}\leq a}] , represents the local direction averaged over all particles within the interaction range of radius a (Fig. 2 ). The average is centred on particle i and includes particle i , as well as all particles j for which r_{ij}=\sqrt{\left(\boldsymbol{r}_{i}-\boldsymbol{r}_{j}\right)^{2}}\leq a . The second term is a noise \zeta_{i} , which is a random angle drawn uniformly from the interval [-\pi\eta,\pi\eta] . The factor \eta represents the width of the angular distribution and thus sets the strength of the noise. We will often use the activity parameter \alpha=1-\eta. (9) There are six parameters in the Vicsek model: a , \delta t , v_{0} , \eta , L , and N . The first two set the units of length ( a ) and time ( \delta t ). Consequently, the three adjustable parameters are v_{0} , \eta and the particle density \rho=N/L^{2} . To quantify the degree of flocking, the normalised ensemble averaged speed \phi=\frac{\left|\left\langle\boldsymbol{v}\right\rangle\right|}{v_{0}}=\frac{1}{Nv_{0}}\left|\Sigma_{i=1}^{N}\boldsymbol{v}_{i}\right| (10) is used as the order parameter. When there is no order in the system, the particles move in independent directions and there is no net transport, such that this flocking order parameter goes to zero ( \phi\to 0 ). However, as the system self-organises into a flock, particles collectively move in a spontaneously chosen direction and \phi\to 1 . The continuum description of the Vicsek model is given by the Toner-Tu equation [ 14 ] (\partial_{t}+\lambda\boldsymbol{v}\cdot\boldsymbol{\nabla})\boldsymbol{v}+\boldsymbol{\nabla}p=\alpha^{\prime}\boldsymbol{v}+\nu\nabla^{2}\boldsymbol{v}-\beta\boldsymbol{v}\left|\boldsymbol{v}\right|^{2}, (11) in which \alpha^{\prime} and \beta are fixed parameters and \boldsymbol{v}(\boldsymbol{r},t) satisfies the incompressibility condition \boldsymbol{\nabla}\cdot\boldsymbol{v}=0 . Equation 11 is a continuum hydrodynamic model that describes the dynamics of self-propelled particle systems exhibiting ordered collective motion. In conjunction with the Swift-Hohenberg ansatz [ 22 , 23 ] , Eq. 11 is commonly used as continuous model of bacterial turbulence [ 72 ] . While the Vicsek model is microscopic and the Toner-Tu equation is a macroscopic hydrodynamic-scale model, mesoscale simulations are lacking. We now propose a hybrid MPCD technique for mesoscale simulations of active polar fluids to fill this gap. III Vicsek-MPCD Hybrid Algorithm Both the Vicsek model and the MPCD algorithm are composed of two steps: streaming and collision. The streaming step is identical in the two models (Eq. 1 and Eq. 7 ). In the Vicsek model, the alignment of particle i with the particles within the interaction radius acts as a “collision” event, while an MPCD collision is a stochastic local exchange within each lattice-based cell. In the following section, we implement Vicsek alignment within MPCD cells to create a hybrid Vicsek-MPCD algorithm. Figure 4: Flocking transition in Vicsek-MPCD for various densities \rho as a function of activity \alpha=1-\eta . The time-averaged flocking order parameter \left\langle\phi\right\rangle is the magnitude of the average velocity normalised by v_{0}=\sqrt{2} (Eq. 10 ). Each point represents the average of an entire simulation. III.1 Vicsek-MPCD Collision Operator The proposed Vicsek model builds on the MPCD framework while preserving the original Vicsek concept of aligning particles with constant speed. This amounts to an operation that rotates the original velocity \vec{v}_{i}\left(t\right) to align with the local average \boldsymbol{v}^{\textmd{cm}}_{c} plus some noise (Fig. 3 ). The collision operator that updates the velocities \vec{v}_{i}(t+\delta t)=\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right) (Eq. 2 ) for the Vicsek-MPCD algorithm is \displaystyle\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right) \displaystyle=\mathcal{R}\cdot\vec{v}_{i}\left(t\right), (12) \displaystyle\mathcal{R} \displaystyle=\begin{bmatrix}\cos\left(\delta\theta_{i}\right)&-\sin\left(\delta\theta_{i}\right)\\ \sin\left(\delta\theta_{i}\right)&\cos\left(\delta\theta_{i}\right)\end{bmatrix}, (13) in which each particle's velocity is rotated at each time step over the angle \displaystyle\delta\theta_{i}\left(t\right) \displaystyle=\left\langle\theta\right\rangle_{c}-\theta_{i}\left(t\right)+\zeta_{i}. (14) This is identical to the Vicsek model (Eq. 8 ), except that the average orientation is taken over the MPCD cells, rather than over the interaction range a . The noise \zeta_{i} is drawn from the same uniform distribution of width [-\pi\eta,\pi\eta] and activity is \alpha=1-\eta . The Vicsek order parameter \phi=\left|\left\langle\boldsymbol{v}\right\rangle\right|/v_{0} (Eq. 10 ) applies to the Vicsek-MPCD algorithm. The particle velocity components are initialised randomly from a uniform distribution p\left(v_{i,j}\right)=\sqrt{k_{B}T/m}(2v_{i,j}\varrho-1), (15) in which j\in\{x,y\} is the spatial component and \varrho is randomly drawn uniformly from the interval [0,1) . This distribution is characterised by the average speed v_{0}=\sqrt{\frac{2k_{B}T}{m}}. (16) Since k_{B}T=1 and m=1 , the characteristic speed is v_{0}=\sqrt{2} . The flocking order parameter fluctuates in time and so is averaged \left\langle\phi\right\rangle=\mathfrak{T}^{-1}\sum_{t=0}^{\mathfrak{T}}\phi\left(t\right) . The main difference between the traditional Vicsek model and the proposed Vicsek-MPCD is that the interactions do not happen within an interaction range around each individual particle but rather happen in multi-particle collision events. We will show that this algorithm reproduces the main properties of the traditional Vicsek model. III.2 Vicsek-MPCD Results We simulate a series of different particle densities \rho=N/L^{2}\in\left[0.001,25\right] and activities in the interval \alpha\in[0,1] . The initial condition has N particles uniformly distributed within the system with their velocities drawn from Eq. 15 . Figure 5: Binder cumulant U (Eq. 17 ) for density \rho=1 at different activities \alpha . The rapid change in U between 0.6<\alpha<0.9 indicates a transition. The critical activity \alpha_{k}=0.82 (vertical black line) is identified as the point between fluctuations immediately after the global minimum (red line) and the monotonic rise (green line). The hybrid Vicsek-MPCD algorithm exhibits a flocking transition (Fig. 4 ). For sufficiently small activities \alpha=1-\eta , the temporally averaged flocking order parameter \left\langle\phi\right\rangle is zero (Movie VII ); however, after some critical activity \alpha_{k} which depends on the particle density, the average speed starts to increase. At higher activities, the order parameter plateaus to \left\langle\phi\right\rangle\to 1 (Movie VII ). The denser the system, the lower the activity at which the ensemble becomes ordered. In a minority of numerical realisations, the system may remain in the disordered state for the duration of the simulation, without finding the expected steady-state flocking ( e.g. Fig. 4 ; \rho=5 and \alpha=0.75 ). To measure the critical activity \alpha_{k} , we employ a Binder cumulant [ 73 ] U=1-\frac{\left\langle\phi^{4}\right\rangle}{3\left\langle\phi^{2}\right\rangle^{2}}, (17) which is the fourth-order cumulant of the order parameter. The Binder cumulant quantifies how much a distribution differs from a normal one [ 74 ] . In the vicinity of the critical point, order parameters generally exhibit broader than normal distributions due to their scale invariance at the critical point [ 75 ] , causing rapid changes in U in the vicinity of the critical activity (Fig. 5 ). This property can be employed to identify the critical activity \alpha_{k} at which ordered flocking emerges more precisely than directly from Fig. 4 . The negative dip suggests coexistence and a first order phase transition [ 76 ] . The critical activity \alpha_{k} is identified as the value of \alpha after the global minimum no-longer stochastically fluctuates but rather steadily rises monotonically, until U plateaus. Figure 6: Critical activity \alpha_{k} decays as density \rho increases for each of the AP-MPCD collision operators. The solid black lines correspond to the low density systems ( \rho\leq 1 ) with scaling \alpha_{k}-1\sim\rho^{-1/2} . The dashed black line corresponds to the high density systems ( \rho>1 ) with scaling \alpha_{k}-1\sim\rho^{-1/3} . The inset shows logarithmic axes of critical noise \eta_{k} (Eq. 9 ) for Vicsek-MPCD. Figure 7: Comparison of algorithms’ scaling with number of particles N . The Vicsek algorithm without a neighbour list scales quadratically with particle number as \sim N^{2} (red). Utilising a neighbour lists can improve the scaling to \sim N\ln(N) (green). The hybrid Vicsek-MPCD scales as \sim N for sufficiently large numbers of particles (blue). The black dashed line shows a scaling of \sim N^{2} and the black dotted line shows \sim N for comparison. For small densities ( \rho\lesssim 2.5 ), the critical order parameter decays rapidly but slows as the density increases (Fig. 6 ; circular markers). In both the dilute and dense regimes, the critical activity follows a power law \alpha_{k}-1=h\rho^{n} . For \rho<1 , h=0.261\pm 0.005 and the exponent is n=0.473\pm 0.003 , where the uncertainties are the standard deviation between fits for three separate realisations of each parameter. This is consistent with the predicted exponent n=1/D in D=2 dimensions for low densities ( \rho\leq 1 ) [ 57 ] . When the average number of particles per cell exceeds 1 , there is a change in the scaling (Fig. 6 ). This is because particles are continually interacting with neighbours, rather than experiencing discrete pair collisions. For larger densities ( \rho>1 ), h=0.238\pm 0.008 and n=0.296\pm 0.026 . We are not aware of an analytical prediction for the scaling of the critical activity for flocking in the large density limit. These suggest the critical activity scales with the density as \alpha_{k}\sim\rho^{-1/2} in the dilute limit and as \alpha_{k}\sim\rho^{-1/3} in the dense limit. Since the Vicsek model (§ II.2 ) must calculate the distances between all pairs of particles, the simulation time scales as \sim N^{2} , which can be improved to \sim N\ln(N) using neighbour lists (Fig. 7 ). On the other hand, the hybrid Vicsek-MPCD need only sort particles into cells within which multi-particle collision operations occur and so scales as \sim N for sufficiently large numbers of particles (Fig. 7 ). In conclusion, the Vicsek-MPCD algorithm exhibits collective dynamics that are consistent with the traditional Vicsek model. In the following sections, we will use what we have learned from hybridising MPCD and the Vicsek model to design two novel MPCD algorithms for simulating active polar fluids. IV Andersen Active Polar MPCD Algorithm This section introduces an Andersen active polar MPCD (AAP-MPCD) algorithm that builds on the passive Andersen-thermostatted MPCD algorithm (§ II.1.1 ) and demonstrates that it exhibits a flocking transition similar to the Vicsek model from § III . IV.1 Andersen Active Polar MPCD Collision Operator To simulate an active polar fluid with thermostatted particle velocities, the speeds must fluctuate and so the velocities cannot simply be rotated. Noise enters the AAP-MPCD algorithm as a thermostat that changes both the heading and magnitude of velocity. The active term in Eq. 18 causes fluctuations in the speed to relax towards a value of \alpha but, unlike in the Vicsek model, the speed can vary, which is essential for non-dry systems. AAP-MPCD sets a target speed \alpha for all the particles and dictates that their velocities approach \alpha in the cell-averaged direction \hat{\boldsymbol{v}}^{\textmd{cm}}_{c}=\boldsymbol{v}^{\textmd{cm}}_{c}/v^{\textmd{cm}}_{c} where v^{\textmd{cm}}_{c}=\left|\boldsymbol{v}^{\textmd{cm}}_{c}\right| . The rate at which speeds approach \alpha is controlled by a relaxation parameter \tau . In addition, the velocities are subject to random kicks \boldsymbol{\xi}_{i} from a thermal bath. A collision operator that actively biases the particles towards the desired speed is \displaystyle\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right) \displaystyle=\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+\tau\left[\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}\left(t\right)-\boldsymbol{v}_{i}\left(t\right)\right] \displaystyle\qquad+\boldsymbol{\xi}_{i}-\left\langle\boldsymbol{\xi}\right\rangle_{c}. (18) This collision operator is identical to Andersen MPCD collision (Eq. 3 ), except that the additional active term \tau\left[\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}\left(t\right)-\boldsymbol{v}_{i}\left(t\right)\right] drives each velocity towards the target speed \alpha in the average direction of motion \hat{\boldsymbol{v}}^{\textmd{cm}}_{c} (Fig. 8 ). Figure 8: Activity in AAP-MPCD (Eq. 18 ) and LAP-MPCD (Eq. 21 ) drives the velocities of each particle (blue arrows) towards a speed \alpha . Green arrow represent the active impulse on each particle and on the centre of mass velocity (red arrow). While passive Andersen MPCD conserves momentum, AAP-MPCD breaks momentum conservation, just as the Vicsek model does. Assuming all the particles have the same mass, the local centre of mass velocity after the collision operation is obtained by using Eq. 18 in Eq. 2 and averaging over the cell c . The centre of mass velocity is updated to \displaystyle\boldsymbol{v}^{\textmd{cm}}_{c}(t+\delta t) \displaystyle=\left\langle\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+\tau\left[\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}\left(t\right)-\boldsymbol{v}_{i}\left(t\right)\right]+\boldsymbol{\xi}_{i}-\left\langle\boldsymbol{\xi}\right\rangle_{c}\right\rangle_{c} \displaystyle=\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+\tau\left[\alpha-v^{\textmd{cm}}_{c}\left(t\right)\right]\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}\left(t\right). (19) This shows that \boldsymbol{v}^{\textmd{cm}}_{c}(t+\delta t)\neq\boldsymbol{v}^{\textmd{cm}}_{c}(t) and momentum is not conserved since the centre of mass velocity changes by \tau(\alpha-v^{\textmd{cm}}_{c})\hat{\boldsymbol{v}}^{\textmd{cm}}_{c} . Only when a cell has a centre of mass speed v^{\textmd{cm}}_{c}=\alpha or \tau=0 is the speed unchanged. AAP-MPCD reduces to the passive momentum-conserving version of Andersen MPCD (§ II.1.1 ) when \tau=0 . So AAP-MPCD seems “wetter” for smaller values of \tau>0 . Additionally, the relaxation has a maximum value of \tau=1 , which can be seen by rewriting Eq. 19 as \boldsymbol{v}^{\textmd{cm}}_{c}(t+\delta t)=(1-\tau)\boldsymbol{v}^{\textmd{cm}}_{c}+\tau\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c} . This form shows the limiting values are \tau=0 and \tau=1 . In the limit of \tau=0 , AAP-MPCD is passive and fully conserves momentum ( i.e. is “wet”), whereas when \tau=1 the speed of the MPCD cell immediately becomes \alpha and the system is entirely “dry”. When 0<\tau<1 , the fluid is intermediate between wet and dry with \tau controlling the rate of momentum injection. On the other hand, setting the target speed to zero ( \alpha=0 ) does not remove impulses but rather creates a frictional damping towards a non-flowing state. IV.2 AAP-MPCD Results Since the AAP-MPCD collision operator has a target speed \alpha rather than the set Vicsek speed v_{0} , the average order parameter (Eq. 10 ) is redefined as \phi=\frac{\left|\left\langle\boldsymbol{v}\right\rangle\right|}{\alpha}=\frac{1}{N\alpha}\left|\Sigma_{i=1}^{N}\boldsymbol{v}_{i}\right|. (20) We run simulations with densities \rho\in[0.001,25] and target speeds in the interval \alpha\in[0,2] . The relaxation rate is set to \tau=0.5 . The initial velocities of the particles are drawn from a uniform isotropic distribution function (Eq. 15 ). Figure 9: The flocking transition in AAP-MPCD. The time-averaged flocking order parameter \left\langle\phi\right\rangle is the magnitude of the average velocity normalised by activity \alpha (Eq. 20 ). The colouring represents the density \rho and is the same as in Fig. 4 . The AAP-MPCD system is found to exhibit a flocking transition (Fig. 9 ), similar to the Vicsek-MPCD (Fig. 4 ). Though AAP-MPCD matches the qualitative behaviour of the Vicsek model, there are quantitative differences. For instance, the rise of net transport velocity is steeper than observed in the Vicsek-MPCD model (Fig. 4 ). After an initial rise, the time-averaged flocking order parameter \left\langle\phi\right\rangle reaches a plateau. Small densities are not able to reach their maximum flocking speed of \alpha since \alpha and \tau are not large enough. On the other hand, dense systems reach their flocking state even for small \alpha and maintain their order against thermal fluctuations. A number of differences exist between the hybrid Vicsek-MPCD and AAP-MPCD algorithms. Most importantly, \alpha represents the competition between active ordering and noise in two very different ways: In the Vicsek-MPCD algorithm \alpha=1-\eta represents the degree of orientational aligning against angular noise, while in AAP-MPCD \alpha is a target speed that should be compared to the thermal speeds \sqrt{2k_{\textmd{B}}T/m} imposed by the thermostat (Eq. 16 ). Unlike the Vicsek model in AAP-MPCD noise enters as a thermostat that changes both the heading and magnitude of velocity, but both algorithms need a source of noise to compete with active alignment this source is a temperature of the system. Because of the different activity behaviour in AAP-MPCD, the critical activity also behaves differently. Critical activities of AAP-MPCD are larger than the critical values of Vicsek-MPCD for \tau=0.5 and \rho\lesssim 10 but have similar values for \rho\gtrsim 10 (Fig. 6 ). In summary, particles in AAP-MPCD approach a target speed subject to thermal fluctuations rather than having a fixed speed. Yet, AAP-MPCD is seen to exhibit a flocking transition, qualitatively agreeing with the Vicsek model. It does so without being perfectly dry. V Langevin Active Polar MPCD Algorithm Building on the Andersen active polar MPCD (§ IV ), this section introduces an active polar MPCD based on the Langevin MPCD algorithm. The desired properties of the collision operator are the same as in § IV : to have a preferred speed and random thermal forces, but now directly including dissipative terms. The results indicate that dissipation does not only preserve the flocking-like behaviour, but shifts the critical activity to lower values. Figure 10: The Langevin-AP MPCD flocking transition. The time-averaged flocking order parameter \left\langle\phi\right\rangle is the magnitude of the average velocity normalised by \alpha (Eq. 20 ). The colouring represents the density \rho and is the same as in Fig. 4 . V.1 Langevin Active Polar MPCD Collision Operator In the Langevin Active Polar MPCD (LAP-MPCD), the speeds of the particles fluctuate due to the thermal bath. The difference with the AAP-MPCD algorithm is that LAP-MPCD should include dissipative force coefficients based on the drag coefficient \gamma . With this, we propose the LAP-MPCD collision operator \displaystyle\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right) \displaystyle=\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)+\tau\left[\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}\left(t\right)-\boldsymbol{v}_{i}\left(t\right)\right] \displaystyle\qquad+b\left[\boldsymbol{v}_{i}\left(t\right)-\boldsymbol{v}^{\textmd{cm}}_{c}\left(t\right)\right] \displaystyle\qquad\qquad+\ell\left(\boldsymbol{\xi}_{i}-\left\langle\boldsymbol{\xi}\right\rangle_{c}\right), (21) in which the last two terms come from the passive Langevin algorithm (Eq. 4 ) with b and \ell given by Eq. 5 and Eq. 6 . The second term is the same active contribution as in AAP-MPCD (Eq. 18 ), with \alpha and \tau playing the same roles of target speed and relaxation parameter respectively. As in the Andersen case, the centre of mass velocity of cell c after the collision operation obeys Eq. 19 : the LAP-MPCD algorithm also does not preserve momentum. V.2 LAP-MPCD Results Simulations are run with densities \rho\in[0.001,25] and activity in the interval \alpha\in[0,1] . The initial velocities of the particles once again are drawn from a uniform isotropic distribution (Eq. 15 ). The relaxation parameter is set to \tau=0.5 and the friction coefficient to \gamma=1 . The model exhibits the same plateau as the other active polar models, with the average flocking order parameter \left\langle\phi\right\rangle rising even more steeply than or the hybrid Vicsek-MPCD or AAP-MPCD (Fig. 10 ). The LAP-MPCD with \gamma=1 transitions to flocking at activities \alpha_{k} that are approximately three times smaller than the AAP-MPCD model (Fig. 6 ). To understand why LAP-MPCD has a lower critical activity than AAP-MPCD, consider that the transition to an ordered flocking state occurs when the distribution of the velocities narrows. In AAP-MPCD (Eq. 18 ), it is the active term \tau\left[\alpha\hat{\boldsymbol{v}}^{\textmd{cm}}_{c}-\boldsymbol{v}_{i}\right] alone that narrows the distribution. However, in LAP-MPCD, the friction term b\left[\boldsymbol{v}_{i}-\boldsymbol{v}^{\textmd{cm}}_{c}\right] also acts to narrow the distribution about the centre of mass velocity. Thus, the friction term aids activity in aligning the velocities and results in a lower critical activity \alpha_{k} . All three active polar MPCD models show a flocking transition. The next sections consider perturbations to the flocking state through external fields or complex geometries. We choose to focus on LAP-MPCD since AAP-MPCD can be viewed as a specific case of LAP-MPCD (§ II.1.2 ). Figure 11: Snapshots of a travelling density band in a 1200\times 75 channel. The global density is \rho=10 , the activity is \alpha=0.22 and the colour bar shows the number of particle N_{c} in each MPCD cell. The time step is labelled on the left and the difference in time between snapshots is 3\times 10^{3} . White arrows represents the direction of motion of the band. V.3 Channel-Confined Flocking One of the unexpected aspects of the Vicsek model is the formation of bands in channels with periodic boundary conditions [ 77 ] . Although it was originally thought that the Vicsek model possesses a second-order phase transition to the flocking state [ 13 ] , more detailed studies demonstrated that it is a weak first-order transition with a tight range of coexistence [ 78 ] , which manifests as high density travelling bands moving through low density surroundings. We have already seen a suggestion of this in the negative dip of the Binder cumulants (Fig. 5 ), but we now explicitly study the traveling bands. To facilitate the formation of bands, the system is set to a periodic channel geometry. The system is rectangular with size L_{x}\times L_{y}=1200\times 75 . The boundary conditions are periodic in all directions and the global particle density is \rho=10 . There is no warmup time ( \mathfrak{T}_{W}=0 ) because we are interested in the process of bands evolution. In the vicinity of the phase transition point, LAP-MPCD exhibits coexistence via the formation of travelling density bands (Fig. 11 and Movie VII ). The bands consist of high density regions that travel coherently along the axis of the channel. Since the bands travel along the channel in the \pm\hat{\boldsymbol{x}} -direction, the density is averaged across the channel \left\langle\rho\right\rangle_{y}(x;t)=L_{y}^{-1}\sum_{y=0}^{L_{y}}N_{c}(x,y;t) and plotted as a kymograph or space-time diagram (Fig. 12 ). The kymographs show that bands form and travel through the system. At early times, bands are equally likely to move in the +\hat{\boldsymbol{x}} -direction as the -\hat{\boldsymbol{x}} -direction and many narrow bands exist, criss-crossing the system (Fig. 12 ; t\lesssim 15\times 10^{4} ). However, as time progresses many of the bands merge and eventually the one direction is spontaneously selected as the average direction of flocking (the +\hat{\boldsymbol{x}} -direction for the particular realisation shown in in Fig. 12 ). By the end of the simulation, all the bands are travelling in the same direction (Fig. 12 ). The slopes in the kymographs are linear, observed to be the same for each band and constant in time (Fig. 12 ). The group speed can be measured as the slope of the wave front of high density lines in the kymographs. Figure 12: Kymograph of the channel-averaged density \left\langle\rho\right\rangle_{y} of LAP-MPCD in a rectangular channel with periodic boundary conditions for global particles density \rho=10 and activity \alpha=0.22 . We find coexistence in the form of travelling bands in the activity range 0.16\leq\alpha\leq 0.25 in the case of global density \rho=10 . While individual particles speed up as activity \alpha increases, the group speed of the bands remains constant with activity in this regime (Fig. 13 ). For a small region of parameter space above the critical activity \alpha_{k} , the group speed is slightly faster than the individual speeds \left\langle\left|\boldsymbol{v}\right|\right\rangle . However, by \alpha=0.18 , the individual speed is greater than the group speed. Although the group speed is constant with activity immediately above the critical point, the system-averaged velocity \phi\propto\left|\left\langle\boldsymbol{v}\right\rangle\right| increases rapidly in this regime (Fig. 10 ). This implies that the near-transition increase in \phi occurs not due to acceleration of the bands but rather because the fraction of particles in the coherently moving dense bands increases with activity. The group speed is not found to be impacted by finite size effects since larger systems ( L_{y}>1200 ) exhibit comparable group speeds. In summary, LAP-MPCD reproduces coexistence of disorder and dense coherent travelling density bands for a narrow region of parameter space, which is consistent with the Vicsek model as it under goes a first order transition to the flocking state [ 79 ] . Figure 13: Comparison of group speed of high density bands to individual speeds just above the critical activity \alpha_{k}=0.16 (vertical black line). Purple markers show the average speed of individual particles \left\langle\left|\boldsymbol{v}\right|\right\rangle . Red markers show group speed of the band measured from the kymographs (Fig. 12 ). Error bars represent standard deviation between bands. The global density is \rho=10 , and the system size is 1200\times 75 . Measurements taken after \mathfrak{T}>15\times 10^{4} . V.4 Influence of Gravity While the previous section found that density bands exist for LAP-MPCD, this sections studies how stable these bands are if they are subjected to external perturbation. We consider the case of gravity \boldsymbol{g} changing the velocity of particles each time step according to \boldsymbol{v}_{i}\left(t+\delta t\right)=\boldsymbol{R}_{ic}\left(\boldsymbol{v}^{\textmd{cm}}_{c},\vec{v}_{i};t\right)+\boldsymbol{g}\delta t, (22) in which \boldsymbol{R}_{ic} is the LAP-MPCD collision operator (Eq. 21 ). The gravitational field is applied in the -\hat{\boldsymbol{y}} -direction, \boldsymbol{g}=-g\hat{\boldsymbol{y}} . For this section, we consider a rectangular system of size 75\times 8000 . This choice means gravity acts parallel to the long axis of the channel, which is the direction of motion of the density bands. The particle density is set to \rho=10 and activity \alpha=0.22 is chosen so that the system is in the vicinity of transition point (Fig. 13 ). Gravity magnitudes are in the range g\in\left[10^{-6},10^{-1}\right] . When the gravity is zero or weak, the bands remain stable (Fig. 14 ; black), as seen as localised peaks in the density that coherently travel through the system. Qualitatively, the peak width is seen to be many tens of MPCD cells wide, in agreement with the zero gravity limit (Fig. 12 ). However, as the strength of gravity increases, the bands disappear. At g=10^{-2} , the density \left\langle\rho\right\rangle_{x}\left(y\right) does not vary substantially about the mean and any deviations from \rho rapidly decay (Fig. 14 ; red). To quantify the variation about the mean, the spatial autocorrelation function \displaystyle C\left(\delta y\right) \displaystyle=\frac{\left\langle\left\langle\rho\right\rangle_{x}\left(y\right)\left\langle\rho\right\rangle_{x}\left(y+\delta y\right)\right\rangle-\left\langle\left\langle\rho\right\rangle_{x}\right\rangle^{2}}{\left\langle\left\langle\rho\right\rangle_{x}^{2}\right\rangle-\left\langle\left\langle\rho\right\rangle_{x}\right\rangle^{2}} (23) is measured, in which \left\langle\cdot\right\rangle_{x} denotes averaging over cells across the channel and \left\langle\cdot\right\rangle denotes averaging along the channel and over time. The autocorrelation function decreases and is fit to an exponential decay \displaystyle C\left(\delta y\right) \displaystyle=C_{0}e^{-\delta y/d} (24) over the range for which C>1/e (Fig. 15 ). The decorrelation length d is interpreted as the band width. Figure 14: Instantaneous number density of particles averaged across the channel \left\langle\rho\right\rangle_{x} and scaled by the global density \rho for gravities g=10^{-6} (black) and g=10^{-2} (red). Density is \rho=10 and activity is \alpha=0.22 . When gravity is weak, variations in the density are correlated over many MPCD cells (Fig. 15 ), which is consistent with Fig. 14 (black). For \rho=10 , the band width d decreases as the strength of gravity increases (Fig. 16 ). Once g increases above 10^{-2} , the width goes to zero (Fig. 16 ) since autocorrelation function is an immediate, delta-function drop to zero (Fig. 15 ). This indicates that the system can no longer sustain travelling density bands of finite width — gravity destroys the bands completely. As gravity increases, the band width d shrinks until g reaches a critical value, at which point d drops to zero signalling that gravity has destroyed the bands (Fig. 16 ). These results indicate that bands are a relatively fragile state that can be disrupted by a sufficiently strong external forcing. V.5 Asymmetric Obstacles in the MPCD Framework Figure 15: Spatial autocorrelation C of the number density \left\langle\rho\right\rangle_{x} (Eq. 23 ). Solid lines are fits to an exponential decay (Eq. 24 ). The system has global density \rho=10 , activity \alpha=0.22 and size 75\times 8000 . If an external field, such as gravity, can alter the nature of the flocking, can other biases change the dynamics? To explore this, we consider flocking in a system of asymmetric obstacles. Asymmetric obstacles have previously been demonstrated to act as ratchets, biasing the flocking direction, which can be exploited to direct the motion of self-propelled particles [ 52 ] . The MPCD framework facilitates the addition of a wide variety of boundaries as surfaces \mathcal{S}_{b}\left(\boldsymbol{r}^{*}\right)=0, (25) in which b is the index labelling the surface and \boldsymbol{r}^{*} is a point on the surface. An MPCD particle at position \boldsymbol{r}_{i} is outside boundary b so long as \mathcal{S}_{b}\left(\boldsymbol{r}_{i}\right)>0 but has impinged on the surface if \mathcal{S}_{b}(\boldsymbol{r}_{i})\leq 0 . This causes the impinging particle to be ray-traced back to the surface boundary at position \boldsymbol{r}^{*}_{i} at time t^{*}2 and even this is a superellipse with four-fold symmetry. Figure 16: Width d of the travelling density bands subject to gravity g for global density \rho=10 . The system has activity \alpha=0.22 and size 75\times 8000 . Error bars represent the uncertainty on the fit from Fig. 15 . To break the symmetry, we use an extension to Eq. 26 with a more generic form that allows for approximations of more complex shapes, such as triangles, hexagons and stars [ 80 ] . In 2D, the relative position defines an angle \varphi=\tan^{-1}\left(\delta x/\delta y\right) , which can be used to define the surface \mathcal{S}_{b}=\left(\frac{\delta x}{A\cos\left(M\varphi/4\right)}\right)^{p}+\left(\frac{\delta y}{B\sin\left(M\varphi/4\right)}\right)^{p}-\mathcal{R}^{p}. (27) Here, M\neq 4 breaks the four-fold symmetry, with M=3 producing approximate triangles. We simulate two different configurations of triangles as obstacles for the LAP-MPCD model. First, we consider an array of triangular obstacles with gaps forming a funnel (Fig. 17 ) and second, we study a channel with ratchet walls (Fig. 18 ). In both cases, the global density is \rho=25 , and all obstacles are triangles with M=3 , power p=12 and A=B=1 . Phantom particles are included in any cell that is intersected by a triangular obstacle boundary surface [ 81 ] . Because the MPCD viscosity depends on the particle number density [ 65 ] , cells with partial excluded volume have a systematically lower viscosity [ 81 ] . Phantom particles are used to ensure that the viscosity near the boundaries is not artificially lower than the bulk, which is necessary to ensure no-slip boundary conditions. The phantom particle velocities are drawn from zero-mean Gaussian distributions, which weigh each cell’s centre of mass velocity towards zero. Figure 17: Rectification of flocking by an array of triangular obstacles of size \mathcal{R}=8 with gaps of size of 5 . (a) Snapshot of a flock moving through funnels showing the velocity (arrows) and density (colour map) fields. The global density is \rho=10 and the activity is \alpha=0.5 Impermeable walls are located at the top/bottom of the system, while periodic boundaries are at the left/right. (b) The average \hat{\boldsymbol{x}} -component of the velocity, v_{x} . The funnels cause v_{x}>0 in all cases, indicating rectified motion from left to right. Firstly, we consider a barrier of five triangles in a square system of size L=100 (Fig. 17 (a) and Movie VII ). On the top and the bottom, impermeable perfect-slip walls form a wide channel with periodic boundary conditions at the ends, which ensures that flocking must occur in the \pm\hat{\boldsymbol{x}} directions. The five obstacles are fixed in place at \boldsymbol{q}_{b}=50\hat{\boldsymbol{x}}+b20\hat{\boldsymbol{y}} and have no-slip boundaries with phantom particles. Since the size of the triangles is \mathcal{R}=8 , this leaves a gap of 5 MPCD cells at the narrowest point between each triangle. On the right-hand side, the triangular bases act as a wall with small pores; whereas, on the left-hand side, pairs of triangles act as funnels. This rectifies the flocking direction (Fig. 17 (b)), biasing the flow to move from left to right, completely suppressing the reverse flow. By the end of every simulation, the active particles are all flocking in the +\hat{\boldsymbol{x}} -direction. While the funnels rectify the direction of flocking, they also disrupt the phase transition. While the flocking transition in bulk exhibited a sharp rise in the flocking order parameter (Fig. 10 ), the average \hat{x} -component of the velocity increases smoothly in the presence of the asymmetric obstacles (Fig. 17 (b)). Figure 18: Rectification of flocking by a ratchet channel composed of triangular obstacles. (a) Snapshot of a flock moving through the channel showing the velocity (arrows) and density (colour map) fields. The global density is \rho=10 and the activity is \alpha=0.5 (b) The average \hat{\boldsymbol{x}} -component of the velocity, v_{x} . While the majority of collective flocks move in the “easy direction” (left to right; v_{x}>0 ), a minority ( \approx 26\% ) move in the opposite direction ( v_{x}<0 ). Periodic boundaries are applied on the left/right ends. The second configuration we consider is a ratchet channel (Fig. 18 (a) and Movie VII ). The system is a long channel with size 120\times 60 . Again, impermeable perfect-slip walls on the top and bottom form a channel with periodic boundary conditions at the ends. Two rows of no-slip triangles with four on each row along the bottom \boldsymbol{q}_{b}^{\text{bot}}=(10+30b)\hat{\boldsymbol{x}} and along the top \boldsymbol{q}_{b}^{\text{top}}=\boldsymbol{q}_{b}^{\text{bot}}+60\hat{\boldsymbol{y}} line the channel and break the symmetry. The size of the triangles is \mathcal{R}=20 . The orientation of triangles, once again breaks left-right symmetry and encourages the MPCD particles to flock from left to right (the “easy” direction). Indeed the majority of realisations flock in this easy direction (Fig. 18 (b)). However, in a minority of simulations the flocking goes from right to left — against the ratchet in the “difficult” direction (Movie VII ). The probability of flocking in the difficult direction is approximately 26\% across all densities and activities (Fig. 18 (b)). As in the previous configuration, the transition to flocking is not as steep as in bulk, suggesting that the obstacles hinder flocking (Fig. 18 (b)). To better understand the nature of this minority, we run sixty two repeats for \rho=10 and \alpha=0.5 . We find that 24\% flock in the difficult leftward direction, which is consistent with Fig. 18 (b). This suggests that the ratio is relatively independent of the system-wide parameters and most likely set by the geometry of the ratchet channel. Furthermore, we observe that once the flock is established, it does not change direction regardless of whether it is flocking in the easy or difficult direction. These examples illustrate how the LAP-MPCD algorithm can be used to explore the collective motion of active polar fluids in complex geometries, including geometries with an engineered broken symmetry that gets passed on to the spontaneously broken symmetry of the collective flow. Future studies could employ LAP-MPCD to study active polar fluids in even more complex geometries [ 42 ] , randomised obstacle placement [ 56 ] or responsive boundaries [ 82 ] . VI Conclusion We have proposed three new algorithms to simulate active polar fluids based on the Multi-Particle Collision Dynamics (MPCD) framework. The first is a hybrid between the MPCD approach and the classic Vicsek model. The hybrid Vicsek-MPCD approach reproduces the expectations for the Vicsek model, including exhibiting a flocking transition. The critical activity for the flocking transition is found to scale with the density as \alpha_{k}\sim\rho^{-1/2} in the dilute limit and as \alpha_{k}\sim\rho^{-1/3} in the dense limit. The next two methods we proposed add an active term to the Andersen- and Langevin-thermostatted MPCD algorithms. Both of these thermostatted active polar MPCD algorithms exhibit a dynamic phase transition to the flocking state. The Langevin active polar MPCD (LAP-MPCD) is explicitly shown to be weakly first order due to the existence of travelling bands near the critical point. The group speed of the travelling bands can be measured from kymographs of the density. The bands are seen to be stable against perturbations from an external force, such as gravity, until a critical gravity. Arrays of asymmetric obstacles slow the transition but do not fully suppress the flocking transition. However, the obstacles rectify the flocking direction. These results demonstrate that LAP-MPCD captures all the most notable properties of the Vicsek model for dry polar active particles [ 83 ] with the results being consistent with previous studies [ 13 , 57 , 14 ] . Furthermore, the algorithm is highly versatile. The MPCD approach has proven to be valuable for simulating passive soft matter systems and is applicable to a wide range of problems, ranging from polymer suspensions [ 84 ] , swimmer dynamics [ 44 , 37 ] , eluting particles [ 85 ] , complex boundary conditions [ 56 , 42 ] , and much more [ 30 ] . Our goal in extending the MPCD approach to simulate active polar fluids is to continue to unlock this same potential for active fluids [ 86 , 87 ] . Continuum models of active polar fluids have been utilised as a model of bacterial suspensions [ 19 , 88 ] . Active polar MPCD opens a pathway for simulating complex suspensions of bacteria and mesoscale solutes. Mesoscale solutes in bacterial suspensions might include small diffusive chemicals like oxygen, large macromolecules such as extracellular DNA, colloids such as microplastics, or droplets formed from biological liquid-liquid phase separation. We hope that the methods proposed here will allow future studies to simulate the emergent rheological properties of complex bacteria/solute mixtures including fluctuations without directly solving the hydrodynamical differential equations. VII