# Patchy energy landscapes promote stability of small groups of active particles

Gianni Jacucci, Davide Breoni, Sandrine Heijnen, José Palomo, Philip Jones, Hartmut Löwen, Giorgio Volpe, Sylvain Gigan

► To cite this version:

Gianni Jacucci, Davide Breoni, Sandrine Heijnen, José Palomo, Philip Jones, et al.. Patchy energy landscapes promote stability of small groups of active particles. Communications Physics, 2024, 7 (1), pp.245. 10.1038/s42005-024-01738-y. hal-04680898

HAL Id: hal-04680898

https://hal.sorbonne-universite.fr/hal-04680898v1

Submitted on 29 Aug 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

https://doi.org/10.1038/s42005-024-01738-y

# Patchy energy landscapes promote stability of small groups of active particles

<figure><img src="image_3.png" /></figure>

Check for updates

Gianni Jacucci<sup>1</sup>✉, Davide Breoni<sup>2</sup>, Sandrine Heijnen<sup>3</sup>, José Palomo<sup>4</sup>, Philip Jones<sup>5</sup>, Hartmut Löwen<sup>6,2</sup>, Giorgio Volpe<sup>6,3</sup> & Sylvain Gigan<sup>6,1</sup>

Group formation and coordination are fundamental characteristics of living matter, essential for performing tasks and ensuring survival. Interactions between individuals play a key role in group formation, and the impact of resource distributions is a vibrant area of research. As of now, an understanding of how patchy resource distributions determine group dynamics is not yet fully understood. Studying active particles in controlled optical landscapes as energy sources, we demonstrate a non-monotonic dependency of group size on landscape patchiness, with the smallest groups forming when the patches match the active particles’ size. A similar relationship is observed in terms of group stability, evidenced by a reduced rate of individual exchange in patchy environments compared to homogeneous conditions. Reduced group sizes can be beneficial to optimise resources in heterogeneous environments and to control information flow within populations. Our results provide insights into the role of patchy landscapes and uneven energy distributions in active matter and hold implications for refining swarm intelligence algorithms, enhancing crowd management techniques, and tailoring colloidal self-assembly.

Group living is widespread in the natural world<fnref n="1" /> and confers many advantages to individuals, such as increased survival from predators²⁻³, enhanced foraging efficiency⁴,⁵, or improved communication and decision making⁶,⁷. Yet, it also plays a key role in the transmission of diseases and genetic traits⁸,⁹. The formation, maintenance, and disbanding of groups depend not only on the interactions among individuals but also on the characteristics of the surrounding environment, such as its spatial or temporal heterogeneity¹⁰. For instance, while large group sizes are advantageous for foraging in homogeneous environments, the presence of a patchy landscape of resources compels individuals to adopt smaller group formations as an adaptive strategy to ensure sufficient resources for all members¹¹,¹².

Recently, active colloids have emerged as a useful tool for studying collective behaviour in living matter<sup>13,14</sup>. These artificial systems, unlike natural ones<sup>15-17</sup>, have the advantage of evolving on short timescales. Moreover, they are tuneable, and their small sizes make data acquisition more convenient. Previous studies have investigated the role of the interaction among individual active colloids in group formation, such as those due to attraction<sup>18-20</sup>, repulsion<sup>21</sup>, alignment<sup>22,23</sup>, reorientation<sup>24,25</sup>, or perception<sup>26,27</sup> and communication<sup>28,29</sup>. The role of physical features in the

environment on group formation has also been explored, such as the presence of obstacles<sup>30-35</sup> or of a disordered confining potential<sup>36</sup>. Although it is the key environmental factor shaping group dynamics in living matter<sup>10</sup>, the influence of a heterogeneous distribution of resources on collective phenomena is not yet fully understood. Indeed, while work exists that studied the effects of a linear gradient in the energy source of active colloids<sup>37-39</sup>, real-world landscapes of resources hardly follow linear gradients and the impact of complex energy distributions on group dynamics is largely unknown.

Here, we use phototactic active colloids moving in a spatially complex distribution of resources, generated optically, to investigate the role of patchy landscapes in the dynamics of group formation and cohesion. Our findings demonstrate a non-monotonic relationship between patch size and group dynamics; specifically, we observed that groups become smaller and more stable when the patchiness of the energy landscape is comparable to the size of the particles.

## Results

### Individual dynamics

As phototactic active particles, we used monodispersed silica colloids (diameter $d = 4.77 \pm 0.20$ µm) half-coated with a 90 nm carbon layer

<figure><img src="image_4.png" /></figure>

e-mail: giovanni.iacucci@lkb.ens.fr

<footnote n="1">¹laboratoire Kastler Brossel, Sorbonne Université, Ecole Normale Supérieure-Paris Sciences et Lettres (PSL) Research University, Centre National de la Recherche Scientifique (CNRS) UMR 8552, Collège de France, Paris, France. ²Institut für Theoretische Physik II-Weiche Materie, Heinrich-Heine-Universität Düsseldorf, Düsseldorf, Germany. ³Department of Chemistry, University College London, London, UK. ⁴Laboratoire de Physique de l'Ecole Normale Supérieure, ENS, Université PSL, CNRS, Sorbonne Université, Université Paris Cité, Paris, France. ⁵Department of Physics & Astronomy, University College London, London, UK.</footnote>
<figure><img src="image_5.png" /><figcaption>**Fig. 1** | **Active particles in complex energy landscapes.** a Trajectory of an active particle in a spatially complex distribution of energy, with high light intensities in green. The particle self-propels, avoiding the most intense illumination. The trajectory displays the particle's centre position over 50 minutes. b, c As the particles prefer to stay in the dark areas, the group size appears to be determined by the spatial</figcaption></figure>

characteristics of the environment--$\sigma_e$, i.e. the average size of the energy patches. Groups are smaller when the patchiness of the environment is comparable to the particles' dimensions than in homogeneous environments, as shown in **b** and **c**, respectively. Particles in groups (more than two individuals) are coloured pink, while isolated particles and pairs are grey.

(Methods). These particles self-propel in a water-2,6-lutidine critical mixture when exposed to light. The propulsion arises from the critical mixture's local demixing, induced by the carbon heating upon light absorption²¹,³⁷⁻⁴².

We created a complex two-dimensional energy source landscape with controllable spatial heterogeneity by shining a laser on an optical diffuser, generating a diffraction pattern of randomly distributed light patches. Known as speckle pattern, the intensity of these light patches follows a negative exponential probability distribution³⁴,⁴⁴. The energy density of the landscape and the typical size of its patches ($\sigma_e$) can be precisely controlled by optical means—Supplementary Fig. 1 and Methods for details. $\sigma_e$ is defined as the full width at half maximum of the landscape's autocorrelation. Figure 1a shows a typical example of a particle trajectory in a complex illumination. What can be qualitatively observed is that an active particle tends to navigate in the energy landscape by spending most of its time in the low-illumination areas—in other words, it performs negative phototaxis. This property of the individual trajectories has a direct consequence on group formation, with a group being defined as a collection of more than two particles in contact. As shown in Fig. 1b, in a heterogeneous energy landscape ($\sigma_e \approx d$), active particles tend to form smaller groups compared to the case of a homogeneous illumination ($\sigma_e \to \infty$). Under both illumination conditions, the average local power density ($I = 0.1 \ \mu\text{W}\mu\text{m}^{-2}$) was kept the same by matching the incoming power and envelope size Supplementary Fig. 2.

In order to explain the collective behaviours illustrated in Fig. 1, we first need to better understand the statistics of the dynamics of the individual particles on the underlying energy landscape. Figure 2a shows quantitatively that particles perform negative phototaxis. By comparing the light intensity at locations visited by the particles along their trajectories with the overall distribution of the energy landscape, we can observe that particles tend to avoid the most intense light regions. Delving deeper, Fig. 2b shows that as active particles navigate the darker, low-energy channels of the light landscape, they tend to align perpendicular to the light intensity gradient. This is due to their continuous interactions with the two-dimensional gradient, channelling their trajectories between high-energy patches and causing them to move perpendicular to the gradient-i.e. along low-intensity areas. This is evidenced by the emergence of a peak at an angle $\alpha = \pi/2$ in Fig. 2b. Here, $\alpha$ represents the angle between the particle's instantaneous velocity and the local intensity gradient, as illustrated in the inset of Fig. 2b. This result goes beyond previous observations in one-dimensional light gradients, which associated $\alpha = \pi$ ($\alpha = 0$) with negative (positive) phototaxis³⁹.

A complex energy landscape determines not only the preferential orientation of the active colloids but also their speed, with a decrease in

<figure><img src="image_6.png" /><figcaption>**Fig. 2** | **Statistics of single particle trajectories on a complex two-dimensional energy landscape.** A complex two-dimensional energy landscape ($\sigma_e = 5 \ \mu\text{m}$) affects the particles' spatial occupancy and motion dynamics. **a** Histogram comparing the distribution of the light intensity in the locations visited by the particles with the intensity distribution of the energy landscape. **b** Particles tend to move perpendicular to the gradient of the illumination ($\alpha = \pi/2$). $\alpha$, illustrated in the inset, is the angle between the velocity of the particle ($\mathbf{v}$) and the intensity gradient ($\nabla I$). Scalebar = $5 \ \mu\text{m}$. **c** A lower mean squared displacement ($\langle (\Delta\mathbf{r})^2 \rangle$) for $\sigma_e = 5 \ \mu\text{m}$ reflects avoidance of high-energy areas compared to a more homogeneous environment (Gaussian illumination, $\sigma_e \to \infty$). The inset shows the long-time diffusive behaviour. Shaded areas indicate standard deviations on the mean squared displacement. Data was obtained from averaging at least 20 trajectories, each lasting 45 min.</figcaption></figure>

average value from $0.095 \pm 0.012 \ \mu\text{ms}^{-1}$ in a homogeneous illumination to $0.068 \pm 0.005 \ \mu\text{ms}^{-1}$ in a landscape with $\sigma_e = 5 \ \mu\text{m}$ (Supplementary Fig. 3). Both in homogeneous energy landscapes³⁷,³⁸ and in one-dimensional light gradients³⁹ a linear increase of the velocity with the light intensity was observed after a given activation energy. This is also reproduced in two-dimensional gradients when the illumination has a Gaussian profile ($\sigma_e \to \infty$ in Supplementary Fig. 3a). In this case, the local value of the gradient is relatively low, making it comparable to the previously reported linear cases also in terms of particles' orientation with respect to the gradient ($\alpha = \pi$ in Supplementary Fig. 4a), and the observed migration towards the
<figure><img src="image_7.png" /><figcaption>**Fig. 3 |** Modelling the dynamics of active particles in complex energy landscapes.
A torque and spatial heterogeneities in the energy landscape determine the dynamics of the active particles. Simulated trajectories (in pink) of individual active particles with (a) different torque values (Ω) for a fixed σₑ = 5 µm, and (b) environment heterogeneity (σₑ) for a fixed Ω = 6. c In a complex environment (σₑ = 5 µm), increasing the torque causes the particles to avoid high-energy areas. d In the presence of a torque, particles move more perpendicular to the gradient (α = π/2). e The difference in the effective diffusion coefficients between complex and Gaussian</figcaption></figure>

<figure><img src="image_8.png" /></figure>

illuminations observed in the experiments is most accurately described by Ω = 0.6. **f** Role of the heterogeneity of the energy landscape (σₑ) on the effective diffusion coefficient (Dₑff(σₑ)) for a fixed value of the torque (Ω = 0.6). The effective diffusion coefficient, normalised to its value for a Gaussian illumination, is minimised when the spatial variation of the landscape is comparable to the size of the particles. In **e**, **f**, the standard deviation of the data matches the scatter point size. All simulations averaged 150 particles over 50 min each.

outer region of the illumination (σₑ → ∞ in Fig. 3b)³⁷⁻³⁹. However, when the heterogeneity of the landscape is comparable to the size of the particles (σₑ = 5 µm in Supplementary Fig. 3b) the velocity shows a less marked increase with the light intensity. This results from local values of the light gradient which are much stronger than in the previous cases (Supplementary Fig. 3b,d). Active particles do indeed experience an aligning torque proportional to the light gradient³⁷⁻³⁹, which, in turn, is proportional to the local light intensity. The aligning torque is a consequence of breaking the axial symmetry of the velocity field around the particle⁴⁵ and it forces the colloids to change direction and reduce speed near high-energy regions, as evidenced by the decrease of the speed in function of the gradient seen in Supplementary Fig. 3b, d. This torque-induced reorientation and avoidance of high-energy zones reduce the mean squared displacement of active particles in a complex landscape when compared to a Gaussian illumination, as seen in Fig. 2c. Specifically, the torque decreases the mean squared displacement at intermediate times as colloids are forced to stay in the low-energy regions and at long times as it limits the available space they can explore. The mean squared displacement, despite the decrease, exhibits a superdiffusive transition followed by a long-time return to diffusion in both scenarios, as for typical active colloids¹⁴. However, the long-time diffusion coefficient decreases from 2.45 ± 0.09 µm²s⁻¹ to 1.14 ± 0.04 µm²s⁻¹ when moving from a homogeneous to a complex energy landscape.

To disentangle the role of the torque (represented by the dimensionless parameter Ω, Fig. 3a) exerted by the field gradient and the heterogeneity of the energy landscape (σₑ, Fig. 3b) on the microscale dynamics, we employed a particle-based model that includes an aligning torque proportional to the gradient of the optical field (Methods)³⁷⁻³⁹. Figure 3c confirms how the presence of a torque prevents particles from accessing the high energy regions, with a cutoff in energy that decreases as the torque increases. The emergence of this behaviour coincides also with a preferential orientation of the particles' velocity perpendicular to the gradient of the illumination, whereas at Ω = 0 the orientation shows a relatively weak dependence on the gradient (Fig. 3d). Our model further validates that under a two-dimensional Gaussian illumination, the preferred orientation relative to

the gradient (α = π in Supplementary Fig. 4b) is governed by the effect of the torque. Additionally, as depicted in Fig. 3e, the discrepancy in the long-term behaviour of the mean squared displacement between σₑ = 5 µm and σₑ → ∞ in Fig. 2 can be attributed to the torque. In a complex illumination, an increase in torque restricts access to regions of higher energy, thereby reducing the mean squared displacement.

The mean squared displacement also depends on the spatial heterogeneity of the environment, as shown in Fig. 3f in terms of effective diffusion coefficient at a fixed value of torque (Ω = 0.6). In particular, Fig. 3f shows that when σₑ is on a similar length scale to the particle size, it significantly reduces the long-time diffusion coefficient. In contrast, in the asymptotic scenarios where energy variations occur on scales significantly smaller or larger than the particle size, the differences in long-term diffusivity become less pronounced. This effect is because when light patches are much larger than the particles, the energy landscape appears homogeneous to them. Similarly, when variations are much smaller, particles cannot resolve the spatial complexity of the environment and perceive an averaged field. This maximises the interaction with the environment when variations align with particle size.

## Group formation

To study the impact of the differences in individual trajectories on the collective behaviour of active systems we performed experiments with a higher concentration of particles (≈ 4%, compared to ≈ 0.1% in Fig. 2). When the concentration of active particles increases, they are more likely to collide with each other, slowing down and forming groups. A group lasts until the propulsion direction of one of the individuals points outside the cluster and its speed is such that it can escape the group by winning over the short-range attraction among particles²⁰,²¹.

A heterogeneous energy landscape plays a key role in the formation of groups. As illustrated in Fig. 4a, particles tend to aggregate, and eventually separate, in the dark regions of the optical landscape where their motility is lower. In complex energy landscapes, groups exhibit greater durability, with the average rate of aggregation and fragmentation events
a

<figure><img src="image_9.png" /></figure>

b

<figure><img src="image_10.png" /></figure>

c

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /></figure>

<figure><img src="image_13.png" /></figure>

**Fig. 4 | Group formation analysis.** Comparison of group formation in energy landscapes with different spatial characteristics, i.e. different sizes of the energy patches ($\sigma_e$). **a** Experimental trajectories showing an example of group aggregation and fragmentation in a complex landscape with $\sigma_e = 5$ µm, with the start marked by a filled circle and the end by a transparent one. When the patchiness of the landscape is comparable to the dimension of the particles, it reduces both the rate of individual exchange between them and the group size, **b**, **c**, respectively. In both panels of **c**, the insets show the distribution of sizes for different spatial heterogeneities. In **b**, the error bars represent the standard deviation of the data.

minimised when the spatial heterogeneity matches the individual particle scale (Fig. 4b). The torque does indeed play a dual role in group dynamics. Firstly, it makes encounters between individuals more difficult by causing particles to linger in low energy regions for longer periods of time, which reduces the rate of aggregation. Secondly, once groups have formed, the torque orients particles toward areas of low energy, causing them to face inward the cluster and reducing the likelihood of fragmentation. The role of the torque is further confirmed by Supplementary Fig. 5a, where decreasing it leads to (i) an overall increase of the rates and ii) a smaller difference in rates between homogeneous and complex energy landscapes.

The patchiness of the landscape also has a significant impact on group size, as demonstrated in Fig. 4c and Supplementary Video 1 and 2 for experiments and simulations, respectively. As individuals tend to avoid high energy regions, groups tend to grow until they fill the space confined between adjacent high-energy patches. The data presented in Fig. 4c support this qualitative relationship, revealing that complex energy landscapes with heterogeneity comparable to the particle size lead to a reduction in the group dimension. The interplay between the dimension of the energy patches and the group size is strongly influenced by the torque exerted by the gradient of resources. Decreasing the torque provides colloids with more freedom to move, enabling larger groups to form, as depicted in Supplementary Fig. 5a, b.

Notably, the differences in group dynamics depicted in Fig. 4 cannot be solely attributed to a lower average motility of active particles in complex landscapes—as depicted in Fig. 2 and Supplementary Fig. 3 in terms of the dynamics of individual colloids. Even when the mean squared displacement in a homogeneous energy landscape is reduced to match that in patchy ones (as shown in Supplementary Fig. 5c, d), disparities persist in both group dimension and stability. This further demonstrates that the spatial complexity of the energy landscape plays a critical role in shaping group dynamics.

Finally, the results presented in Fig. 4 are not restricted to disordered environments. In particular, they do not depend on the details of the spatial distribution of energy sources, but rather on its characteristic length. As shown in Supplementary Fig. 6, the collective behaviour of active colloids in periodically-distributed energy patches shows the same trends in function of $\sigma_e$ of Fig. 4, both in terms of size and stability of groups.

## Conclusion

In summary, we studied the effect of heterogeneous energy landscapes on the dynamics of group formation in active particles by leveraging optical tools. We found that by manipulating the spatial complexity of the landscape, we can control the size of groups and the exchange of individuals between them. Our results could open avenues in understanding the dynamics of active matter systems in resource-limited settings. In austere resource conditions (e.g., patchy environments), smaller groups may optimise the use of resources, yet their augmented stability and diminished individual exchange could potentially impede the flow of information among groups. Depending on the task at end, this could prove detrimental (e.g. in swarms of communicating robots$^{46,47}$ and stigmergic systems$^{35,48}$) or beneficial (e.g. to curtail the transmission of diseases in biological active matter$^{49}$). As our experimental approach provides a versatile and precise method to modulate the spatial dynamics of the energy landscape using light, it could be instrumental in studying search strategies in the presence of limited resources. Its applicability could span various contexts, ranging from animal foraging, to guiding robots through complex search-and-rescue missions, to testing crowd escape dynamics, and refining colloidal self-assembly.

## Methods

### Materials

Glass capillaries were purchased from CM Scientific (5005-050 and 5001-050 for single particle and cluster experiments, respectively). The lutidine was purchased and used as received: 2,6-lutidine (≥99%, Sigma-Aldrich). Deionised (DI) water (≥18 MΩ·cm) was collected from a Milli-Q purification system. Aqueous colloidal dispersions (5% w/v) of silica (SiO₂) colloids, used for sample preparation, were purchased from Microparticles GmbH. Additionally, carbon rods measuring 300 mm in length and 6.15 mm in diameter were procured from Agar Scientific and subsequently cut to a length of 50 mm and tapered for the coating of Janus particles through sputtering.

### Particles fabrication

Janus particles were synthesised from SiO₂ colloids with a diameter of $d = 4.77 \pm 0.20$ µm. Initially, a monolayer of colloids was deposited on a
clean glass slide by evaporating a 40 µL droplet containing a 2.5% w/v dispersion of the colloids in DI water. Subsequently, an automatic carbon coater (AGB7367A, Agar Scientific) was employed to coat the particles with a 90 nm thick layer of carbon. The thickness of the carbon layer was confirmed through atomic force microscopy (AFM) measurements. After coating, sonication was performed to dislodge the half-coated particles in DI water from the glass slide, facilitating their use for sample preparation. To reduce the interaction between particles, and the sticking of the particles to the substrate, the Janus colloids were functionalised with bovine serum albumin (BSA, Sigma Aldrich). This was done by replacing the water solvent of the colloidal suspension with a 1%w/v water solution of BSA. Prior to utilisation, the colloidal dispersions underwent centrifugation at 1000 relative centrifugal force (RCF) for 3 min, resulting in the formation of a pellet. The supernatant was subsequently discarded and replaced with a solution containing 28.6% w/v of water and 2,6-lutidine. This purification procedure was repeated three times to ensure the removal of any remaining BSA water solution from the original dispersion.

## Sample preparation

In single-particle experiments (Figs. 1 and 2), a suspension of Janus particles was confined in a rectangular capillary with a width of 500 µm, a length of 50 mm, and a thickness of 50 µm. The capillary was then sealed by applying a UV-curable glue to avoid evaporation and drifts. In the multiple-particles systems (Fig. 4), we reduced the sample's thickness by using a capillary with a width of 100 µm, a length of 50 mm, and a thickness of 10 µm. The reduced thickness mitigates potential convection effects that could arise from a higher number of particles, leading to increased heating.

## Experimental setup

Supplementary Fig. 1 shows a schematic of the experimental setup. A laser (Oxxius 532 nm, 300 mW of maximum output power) and a diffuser (1°, Newport 10DKIT-C1) are used to illuminate the Janus particles with a random optical field, also known as speckle. The laser is directed to the sample via two mirrors (M1, M2) and a 4f-lens configuration (L1=L2, Thorlabs, LA1461-A-ML, f = 250 mm) illuminating the back aperture of a 10x objective (Nikon, N10X-PF, NA = 0.3). By changing the position of the diffuser and that of the sample, it is possible to control both the dimension of the speckle grains and the size of the illumination envelope. To create a Gaussian illumination, we removed the diffuser and one lens (L1) to image the beam on the sample. The illumination envelope was fixed to be close to the acquisition area of the camera (≈200 × 200 µm² and ≈100 × 100 µm² in the single and multiple particles experiments, respectively) and it was kept the same for different patchiness of the landscape (Supplementary Fig. 2). The intensity of the laser-controlled by a half-waveplate (FOCtek, WPF212H) and a polarising beam splitter (FOCtek, BSC1204) was then adjusted to have a comparable energy density in the different optical landscapes, i.e. different values of $\sigma_e$. The active particles were imaged with a 20x objective (Nikon, N20X-PF, NA = 0.5) and a tube lens (L3, Thorlabs, LA1805-A-ML, f = 30 mm) on a camera (Basler, acA5472-17 µm). A white LED (Thorlabs, MWWHF2), for simplicity not depicted in Supplementary Fig. 1, coupled to a fibre (Thorlabs, M28L01) is used for imaging. The particles' dynamics were analysed by reconstructing their trajectories from videos (typically of the duration of 50 min at 2 frames per second) using a homemade code based on the python package Trackpy[20,51]. The position of the sample was controlled in three dimensions using an xyz-stage (Thorlabs, RB13M/M). The z-coordinate was adjusted with a stepper motor (Thorlabs, ZFS25B). For all experiments, the suspension of Janus particles was kept close to the critical temperature of the water-lutidine mixture ($T_{exp} \approx 31$ °C, $\Delta T \approx 3$ °C) by a heater driven via a temperature controller (Thorlabs, HT19R and TC200, respectively).

## Numerical model

We numerically implemented an Euler-Maruyama time integrator for the evolution of the positions $\mathbf{r}_i$ and orientations $\phi_i$ of each particle i in two

dimensions, defined by the following equations, based on ref. 39:

$$ \dot{\mathbf{r}}_i(t) = v(\mathbf{r}_i)\mathbf{n}_i - \frac{1}{\gamma'} \sum_{j \neq i} \nabla V(|\mathbf{r}_i - \mathbf{r}_j|) + \sqrt{2D}\xi_i(t), \quad (1) $$

$$ \dot{\phi}_i(t) = \omega(\phi_i, \mathbf{r}_i) + \sqrt{2D} \xi_i^\phi(t), \quad (2) $$

where $\mathbf{n}_i = (\cos(\phi), \sin(\phi))$, $\xi_i$ and $\xi_i^\phi$ represent Gaussian white noise. The translational and rotational diffusion coefficients $D$ and $D_r$ are defined as

$$ D = \frac{k_B T}{\gamma'}, \quad D_r = \frac{k_B T}{\beta'}, \quad (3) $$

where $\gamma' = \frac{16}{3}\pi\eta d$ and $\beta' = \frac{8}{7}\pi\eta d^3$ are respectively the translational and rotational friction coefficient, corrected by taking into account a distance from the substrate $s = d/2^{35}$, and $\eta = 2.1 \times 10^{-3}$ Pa s is the viscosity of water-lutidine. The torque $\omega$, which is defined as:

$$ \omega(\phi_i, \mathbf{r}_i) = \frac{\Omega d}{D} v(\mathbf{r}_i) [\nabla v(\mathbf{r}_i) \times \mathbf{n}_i] \cdot \hat{e}_z, \quad (4) $$

where the adimensional prefactor $\Omega$ determines whether the torque steers the particle towards the light ($\Omega < 0$) or away from it ($\Omega > 0$). The value of $\Omega$ that best fits the experimental change in the long-time mean squared displacement is $\Omega = 0.6$ (Fig. 3e). $V$ is a 6–12 Lennard-Jones potential with cutoff distance at five colloid diameters $d$ and depth $\epsilon \approx 8k_B T$. This value was chosen by fitting the experimental cluster aggregation and fragmentation rates for a Gaussian illumination. The intensity speckle field was generated by adding a Gaussian envelope to a scaled Fourier transform of a white noise map to match the specific characteristics of the optical fields in experiments: average intensity per unit of area and grain size. This intensity field was then translated into a motility field using the results from[39]. The gradient of the motility field acting on the particle $\nabla v(\mathbf{r}_i)$ was averaged over the square area where the particle is inscribed. Regarding the periodic landscapes discussed in Supplementary Fig. 6, they were generated as a grid pattern with a distance between energy sources of $2\sigma_e$, with each energy sources having a Gaussian distribution profile of width $\sigma_e$. This sets the average extension of the dark regions to be comparable with the size of the energy sources and with $\sigma_e$—therefore characterising the periodic environment with a single length scale. Note that in the case of a speckle field, the environment is fully-characterised by $\sigma_e$ as the size of the dark (low-energy) regions is directly comparable with the grain size.

## Cluster analysis

We defined the clusters by measuring all distances among particles and then creating bonds between all the particles with distances smaller than the cutoff radius 1.25d. Similarly to refs. 20,35, clusters made of 2 particles (i.e. dimers) were disregarded in the analysis as they are unstable in time. We determined whether a cluster survives from one timestep to the next by confronting its particles with those of all the clusters in the next timestep. We consider any of these clusters to be the same as a previous one if it satisfies two properties: (i) that more than half of its particles are shared with the old cluster (i.e. the cluster has not decreased more than half in size); (ii) that at least half of the particles of the new cluster are also present in the old one, i.e. the cluster has not grown more than double in size. We calculated mainly two properties regarding clusters for each experiment: the cluster size and the monomer acquisition/loss rate. The first is simply the average number of monomers for each cluster, while the second is defined as the number of monomer acquisition/loss events (i.e. the number of times clusters receive/lose a single monomer during the experiment) normalised by the total experiment time and the average number of particles.
**Data availability**

All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials, and can be found at the fol- lowing repository<sup>52</sup>.

**Code availability**

Codes for the simulations of active dynamics in complex optical environ- ments, based on the equations described in Figure, are available upon request.

Received: 12 March 2024; Accepted: 5 July 2024;

Published online: 17 July 2024

**References**

1. Sumpter, D. J. T. *Collective Animal Behavior* (Princeton University Press, 2010).

2. Rosenthal, S. B., Twomey, C. R., Hartnett, A. T., Wu, H. S. & Couzin, I. D. Revealing the hidden networks of interaction in mobile animal groups allows prediction of complex behavioral contagion. *Proc. Natl Acad. Sci. USA* **112**, 4690–4695 (2015).

3. Klamser, P. P. & Romanczuk, P. Collective predator evasion: Putting the criticality hypothesis to the test. *PLoS Comput. Biol.* **17**, e1008832 (2021).

4. Brown, C. R., Brown, M. B. & Shaffer, M. L. Food-sharing signals among socially foraging cliff swallows. *Anim. Behav.* **42**, 551–564 (1991).

5. Feinerman, O., Pinkoviezky, I., Gelblum, A., Fonio, E. & Gov, N. S. The physics of cooperative transport in groups of ants. *Nat. Phys.* **14**, 683–693 (2018).

6. Strandburg-Peshkin, A., Farine, D. R., Couzin, I. D. & Crofoot, M. C. Shared decision-making drives collective movement in wild baboons. *Science* **348**, 1358–1361 (2015).

7. Couzin, I. D. et al. Uninformed individuals promote democratic consensus in animal groups. *Science* **334**, 1578–1580 (2011).

8. Silk, M. J. & Fefferman, N. H. The role of social structure and dynamics in the maintenance of endemic disease. *Behav. Ecol. Sociobiol.* **75**, 122 (2021).

9. Brandell, E. E., Dobson, A. P., Hudson, P. J., Cross, P. C. & Smith, D. W. A metapopulation model of social group dynamics and disease applied to yellowstone wolves. *Proc. Natl Acad. Sci. USA* **118**, e2020023118 (2021).

10. Gordon, D. M. The ecology of collective behavior. *PLoS Biol.* **12**, e1001805 (2014).

11. Chapman, C., Chapman, L. & Wrangham, R. Ecological constraints on group size: an analysis of spider monkey and chimpanzee subgroups. *Behav. Ecol. Sociobiol.* **36**, 59–70 (1995).

12. Aureli, F. et al. Fission-fusion dynamics: new research frameworks. *Curr. Anthropol.* **49**, 627–654 (2008).

13. Romanczuk, P., Bär, M., Ebeling, W., Lindner, B. & Schimansky-Geier, L. Active Brownian particles: from individual to collective stochastic dynamics. *Eur. Phys. J. Spec. Top.* **202**, 1–162 (2012).

14. Bechinger, C. et al. Active particles in complex and crowded environments. *Rev. Mod. Phys.* **88**, 045006 (2016).

15. Santini, L., Isaac, N. J. B. & Ficetola, G. F. TetraDENSITY: a database of population density estimates in terrestrial vertebrates. *Glob. Ecol. Biogeogr.* **27**, 787–791 (2018).

16. King, A. J., Fehlmann, G., Biro, D., Ward, A. J. & Fürtbauer, I. Re-wilding collective behaviour: an ecological perspective. *Trends Ecol. Evol.* **33**, 347–357 (2018).

17. Northrup, J. M. et al. Conceptual and methodological advances in habitat-selection modeling: guidelines for ecology and evolution. *Ecol. Appl.* **32**, e02470 (2022).

18. Grégoire, G. & Chaté, H. Onset of collective and cohesive motion. *Phys. Rev. Lett.* **92**, 025702 (2004).

19. Palacci, J., Sacanna, S., Steinberg, A. P., Pine, D. J. & Chaikin, P. M. Living crystals of light-activated colloidal surfers. *Science* **339**, 936–940 (2013).

20. Ginot, F., Theurkauff, I., Detcheverry, F., Ybert, C. & Cottin-Bizonne, C. Aggregation-fragmentation and individual dynamics of active clusters. *Nat. Commun.* **9**, 696 (2018).

21. Buttinoni, I. et al. Dynamical clustering and phase separation in suspensions of self-propelled colloidal particles. *Phys. Rev. Lett.* **110**, 238301 (2013).

22. Vicsek, T., Czirók, A., Ben-Jacob, E., Cohen, I. & Shochet, O. Novel type of phase transition in a system of self-driven particles. *Phys. Rev. Lett.* **75**, 1226–1229 (1995).

23. Bricard, A., Caussin, J.-B., Desreumaux, N., Dauchot, O. & Bartolo, D. Emergence of macroscopic directed motion in populations of motile colloids. *Nature* **503**, 95–98 (2013).

24. Van Drongelen, R., Pal, A., Goodrich, C. P. & Idema, T. Collective dynamics of soft active particles. *Phys. Rev. E* **91**, 032706 (2015).

25. Zhang, J., Alert, R., Yan, J., Wingreen, N. S. & Granick, S. Active phase separation by turning towards regions of higher density. *Nat. Phys.* **17**, 961–967 (2021).

26. Durve, M., Saha, A. & Sayeed, A. Active particle condensation by non-reciprocal and time-delayed interactions. *Eur. Phys. J. E* **41**, 49 (2018).

27. Lavergne, F. A., Wendehenne, H., Bäuerle, T. & Bechinger, C. Group formation and cohesion of active particles with visual perception-dependent motility. *Science* **364**, 70–74 (2019).

28. Altemose, A. et al. Chemically controlled spatiotemporal oscillations of colloidal assemblies. *Angew. Chem. Int. Ed.* **56**, 7817–7821 (2017).

29. Ziepke, A., Maryshev, I., Aranson, I. S. & Frey, E. Multi-scale organization in communicating active matter. *Nat. Commun.* **13**, 6727 (2022).

30. Reichhardt, C. & Olson Reichhardt, C. J. Active matter transport and jamming on disordered landscapes. *Phys. Rev. E* **90**, 012701 (2014).

31. Morin, A., Desreumaux, N., Caussin, J.-B. & Bartolo, D. Distortion and destruction of colloidal flocks in disordered environments. *Nat. Phys.* **13**, 63–67 (2017).

32. Reichhardt, C. & Reichhardt, C. J. O. Clogging and depinning of ballistic active matter systems in disordered media. *Phys. Rev. E* **97**, 052613 (2018).

33. Frangipane, G. et al. Invariance properties of bacterial random walks in complex structures. *Nat. Commun.* **10**, 2442 (2019).

34. Kurzthaler, C. et al. A geometric criterion for the optimal spreading of active polymers in porous media. *Nat. Commun.* **12**, 7088 (2021).

35. Dias, C. S., Trivedi, M., Volpe, G., Araújo, N. A. M. & Volpe, G. Environmental memory boosts group formation of clueless individuals. *Nat. Commun.* **14**, 7324 (2023).

36. Pinçe, E. et al. Disorder-mediated crowd control in an active matter system. *Nat. Commun.* **7**, 10907 (2016).

37. Lozano, C., ten Hagen, B., Löwen, H. & Bechinger, C. Phototaxis of synthetic microswimmers in optical landscapes. *Nat. Commun.* **7**, 12828 (2016).

38. Gomez-Solano, J. R. et al. Tuning the motility and directionality of self-propelled colloids. *Sci. Rep.* **7**, 14891 (2017).

39. Jahanshahi, S., Lozano, C., Liebchen, B., Löwen, H. & Bechinger, C. Realization of a motility-trap for active particles. *Commun. Phys.* **3**, 127 (2020).

40. Volpe, G., Buttinoni, I., Vogt, D., Kuemmerer, H.-J. & Bechinger, C. Microswimmers in patterned environments. *Soft Matter* **7**, 8810 (2011).

41. Buttinoni, I., Volpe, G., Kümmel, F., Volpe, G. & Bechinger, C. Active Brownian motion tunable by light. *J. Phys.: Condens. Matter* **24**, 284129 (2012).

42. Lozano, C., Bäuerle, T. & Bechinger, C. *Active Brownian Particles with Programmable Interaction Rules* (eds. Tailleur, J., Gompper, G., Marchetti, M. C., Yeomans, J. M. & Salomon, C.) *Active Matter and Nonequilibrium Statistical Physics*, 219–229, 1 ed. (Oxford University Press Oxford, 2022).

43. Volpe, G., Volpe, G. & Gigan, S. Brownian motion in a speckle light field: tunable anomalous diffusion and selective optical manipulation. *Sci. Rep.* **4**, 3936 (2014).
44. Bianchi, S., Pruner, R., Vizsnyiczai, G., Maggi, C. & Di Leonardo, R. Active dynamics of colloidal particles in time-varying laser speckle patterns. *Sci. Rep.* **6**, 27681 (2016).

45. Bickel, T., Zecua, G. & Würger, A. Polarization of active Janus particles. *Phys. Rev. E* **89**, 050303 (2014).

46. Dorigo, M., Theraulaz, G. & Trianni, V. Reflections on the future of swarm robotics. *Sci. Robot.* **5**, eabe4385 (2020).

47. Talamali, M. S., Saha, A., Marshall, J. A. R. & Reina, A. When less is more: robot swarms adapt better to changes with constrained communication. *Sci. Robot.* **6**, eabf1416 (2021).

48. Marsh, L. & Onof, C. Stigmergic epistemology, stigmergic cognition. *Cogn. Syst. Res.* **9**, 136–149 (2008).

49. Bennett, P. M. Plasmid encoded antibiotic resistance: acquisition and transfer of antibiotic resistance genes in bacteria. *Br. J. Pharmacol.* **153**, S347–S357 (2008).

50. Crocker, J. C. & Grier, D. G. Methods of digital video microscopy for colloidal studies. *J. Colloid Interface Sci.* **179**, 298–310 (1996).

51. Allan, D. B., Caswell, T., Keim, N. C., van der Wel, C. M. & Verweij, R. W. soft-matter/trackpy: v0.6.1 https://doi.org/10.5281/zenodo.7670439 (2023).

52. Jacucci, G. et al. Research Data For: Patchy Energy Landscapes Promote Stability Of Small Groups Of Active Particles https://doi.org/10.5281/zenodo.12535039 (2024).

## Acknowledgements

The authors thank Dr. Raphaël Jeanneret and Dr. Jean Francois Allemand for suggesting the use of bovine serum albumin to reduce particles attraction and Alessia Gentili for insightful discussions on cluster analysis. This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 945298-ParisRegionFP, G.J. is a fellow of the Paris Region Fellowship Programme supported by the Paris Region. The work of H.L. was supported by the German Research Foundation (project LO 418/29-1). D.B. and S.H. acknowledge support by the EU MSCA-ITN ActiveMatter (Proposal No. 812780).

## Author contributions

Author contributions are defined based on the CRediT (Contributor Roles Taxonomy) and listed alphabetically. Conceptualisation: S.G., G.J., H.L. and G.V. Data curation: D.B. and G.J. Formal analysis: D.B. and G.J. Resources:

S.G., S.H., P.J., H.L., J.P. and G.V. Writing: G.J. wrote the manuscript with the help of all authors. Funding acquisition: S.G., G.J., H.L. and G.V.

## Competing interests

The authors declare no competing interests.

## Additional information

**Supplementary information** The online version contains supplementary material available at https://doi.org/10.1038/s42005-024-01738-y.

**Correspondence** and requests for materials should be addressed to Gianni Jacucci.

**Peer review information** *Communications Physics* thanks Changjin Wu and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available.

**Reprints and permissions information** is available at http://www.nature.com/reprints

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2024