Introduction

In colloidal science, crystalline order is usually obtained from equilibrium self-assembly, when a system spontaneously forms an organized phase due to specific inter-particle interactions. This general phenomenon has proven to be simple, robust, and scalable, all appealing features that make colloidal crystals ideal candidates for photonic band gap materials, optical switches, or sensors. Investigating the assembly process of tunable colloidal systems may also shed light on fundamental mechanisms underlying melting1 and crystallization2, which are general phenomena occurring in a broad range of systems at different length scales3.

Recent trends in the field are now shifting the focus toward structure formation in systems driven out-of-equilibrium by external fields or forces. Examples are widespread and include the assembly induced by external electric4,5, magnetic6,7, optic8 fields, or the organization of active particles9,10,11,12,13. However, an important challenge that still remains to be tackled is whether it is possible to realize perfect crystalline lattices starting from a disordered collection of driven particles, where the individual units display a net propulsive dynamics. Such a feature would be important not only for practical means, i.e., to rapidly realize periodic system on the visible wavelength, but it will also provide a starting point for understanding the fundamental mechanisms behind crystal formation in driven or active out-of-equilibrium systems. We also note that a crystallization process induced by a few active dopants in a bath of passive particles has been demonstrated recently in computer simulation studies14,15. Recent experiments with active particles report melting16, clustering10,13, or interstitial dynamics17 but not annealing.

Here we advance in this field by demonstrating a novel field-induced annealing process where an ensemble of propelling particles is able to rapidly form a crystalline lattice upon magnetic command. In particular, we study the dynamics of magnetic colloidal rotors that are assembled into flat, two-dimensional propelling carpets due to external magnetic field modulations. In a previous work18, we demonstrate that the carpet could be used as an efficient drug-delivery vector for transporting biological cells across its surface. Beyond its technological applications, here we report the discovery that such carpet could be used as a general model system for nonequilibrium crystallization process, by demonstrating a self-healing process that can be controlled by an external magnetic field. We show that by increasing the field amplitude the carpet displays a tread-milling dynamics, where particles detach from the back of the carpet, travel across the lattice, and reattach at the moving front. The dynamic phases of the system may be understood from the delicate balance between magnetism and hydrodynamics. This regrowth process represents a novel annealing process that enables to rapidly regenerate colloidal structures upon magnetic command.

Results

Assembly and propulsion of colloidal carpets

We assemble the colloidal carpets from a dispersion of paramagnetic colloids having radius a = 1.4 μm and subjected to time-dependent external fields. The particles are initially dispersed in water and two-dimensionally confined above a glass substrate due to the balance between gravity and electrostatic interactions (see Methods). Figure 1a–f illustrate the complete process. To realize a propelling carpet we start to apply a rotating magnetic field circularly polarized in the plane of the substrate \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{y}}} \right)\), \({\boldsymbol{B}}_1(t) = B_0[{\mathrm{cos}}(2\pi ft)\widehat {\boldsymbol{x}} - {\mathrm{sin}}(2\pi ft)\widehat {\boldsymbol{y}}]\), where B0 is the field amplitude and f is its frequency. We use a narrow frequency range \(f \in [20,100]{\mathrm{Hz}}\), far away from resonance frequency (~400 KHz) as reported in the past19. For sufficiently high frequencies, the rotating field induces attractive dipolar interactions that are isotropic when time-averaged18. The dipolar interaction between two equal dipoles mi,j at a distance rijrirj is given by \(U_m = - \mu _0/4\pi \{ [3({\boldsymbol{m}}_i \cdot {\boldsymbol{r}}_{ij})({\boldsymbol{m}}_j \cdot {\boldsymbol{r}}_{ij})/r^5] - ({\boldsymbol{m}}_i \cdot {\boldsymbol{m}}_j)/r^3\}\), and becomes maximally attractive (repulsive) for particles with magnetic moments parallel (normal) to rij. Performing a time average of the potential gives an effective attractive interaction in this plane \(\langle U_m\rangle = - {\mu _0m^2/[8\pi (x + y)^3]}\). Thus, a random dispersion of particles that would otherwise perform simple Brownian motion, is forced to assemble into a compact cluster, as shown in Fig. 1a, b. Under the rotating field, the cluster is also observed to perform a spinning motion around its center, since the rotating field applies a magnetic torque, \({\boldsymbol{T}}_m\sim B_0^2\), due to the finite internal relaxation time of the particle, see Methods. Once the cluster is formed, propulsion of the carpet is obtained with the following strategy. The rotating in-plane field is transformed in a more complex modulation composed by a field that rotates in the \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{z}}} \right)\) plane plus an oscillating component along the \(\widehat {\boldsymbol{y}}\) direction with a different frequency fy. The full expression is given as \({\boldsymbol{B}}_2(t) = B_0[{\mathrm{cos}}(2\pi ft)\widehat {\boldsymbol{x}} + {\mathrm{sin}}(2\pi f_yt)\widehat {\boldsymbol{y}} - (B_z/B_0){\mathrm{sin}}(2\pi ft)]\), where \(f_y = f/2\) (see Fig. 1b, c). The rotating field in the perpendicular plane, \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{z}}} \right)\), is used to induce a magnetic torque on the individual particles, which now rotate close to the glass substrate. As the particles are hydrodynamically coupled to the plane20, this rotational motion is converted into a net translational one. As a consequence, all the cluster elements are now a collection of microscopic rotors that make the whole carpet translating at a constant average speed as shown in Fig. 1e, f (see also Supplementary Movie 1 in the Supplementary Information). On the other hand, the carpet is kept stable by the oscillating component By that avoids lateral separation of the rotors due to attractive dipolar interactions.

Fig. 1
figure 1

Realization of a propelling carpet and out-of-equilibrium phase diagram. ac Sequence of schematics showing the formation of a carpet due to a rotating field in the plane \(\left( {\widehat {{x}},\widehat {{y}}} \right)\) (a, b) and its propulsion induced by a field rotating in the perpendicular plane \(\left( {\widehat {{x}},\widehat {{z}}} \right)\) plus an oscillating component along the \(\widehat {\boldsymbol{y}}\) direction (b, c). d–f Corresponding optical microscope images of a carpet assembled by a rotating field with amplitude B0 = 1.6 mT and frequency f = 40 Hz (d, e), and transported by a field B2 with amplitudes B0, Bz = 1.7 mT, and frequencies fx = fz = f, fy = f/2 (e, f). In image f, the trajectory of one particle is superimposed. Scale bar is 20 μm, see Supplementary Movie 1 in the Supplementary Information. g Diagram showing the different assembled structure observed in the (B0, Bz) plane. The pink region denotes stable propelling structures (“2D carpet”), whereas the white region refers to the situation where the paramagnetic colloids flow above the monolayer (“tread-milling”). The blue region indicates the formation of three-dimensional structures (“broken carpet”). Scattered points are experimental data and continuous lines result from linear stability analysis as described in the text. Error bars are obtained from the statistical average of different experiments. h Schematic illustrating the definition of the angle θ and position vector r. Videos illustrating the tread-milling motion and formation of broken carpets (Supplementary Movie 2 and Supplementary Movie 3) are in the Supplementary Information. Scale bars of the experimental images at the top are 20 μm

The carpet speed vc can be varied mainly by changing the field amplitude B0 or the number of rotors N. In the latter case it becomes constant above N ~ 300, which corresponds to a carpet area \(S\sim 1800\,{\mathrm{\mu m}}^{\mathrm{2}}\). Although a previous work18 analyzed the dependence of vc on N, here we focus on much larger carpets (N ≥ 1000 particles) and use only B0 to tune vc. Moreover, previously the amplitude of the perpendicular field Bz was always kept below a threshold value, in order to stabilize the structure confined in two dimensions18. In contrast, here we show a series of remarkable new phenomena that emerge when the propelling carpet is forced to extend toward the third dimension by raising Bz. We also find that, for a certain range of field amplitudes close to the transition region in Fig. 1g, our method allows the relative motion of two lattice planes of colloidal particles. This phenomenon could offer new possibilities in the study of frictional effects at the microscale in the presence of hydrodynamic lubrication.

In Fig. 1g we show the different dynamic states observed in the (B0,Bz) space, where stable carpets with defects (vacancies) are found at low perpendicular field Bz (“2D carpet”). Increasing Bz forces the carpet to fold into a membrane in the third dimension. However, competition with gravity breaks the monolayer into a series of separate, rolling chains (“broken carpet”), see also Supplementary Movie 2 and Supplementary Movie 3 in the Supplementary Information. Between both dynamic states, we found a stationary phase where particles are transported above the carpet, while the entire structure continues to propel close to the plane (“tread-milling”). We explain the different dynamic phases observed in Fig. 1g by considering the balance between magnetic and hydrodynamic interactions. For a pair of paramagnetic particles located at a distance r, the dipole–dipole interaction averaged over one period of the rotating field is given by

$$\langle U_{\mathrm{m}}\rangle = \frac{{(V\chi B_0)^2}}{{4\pi \mu _0r^3}}\left[ {1 - \frac{{B_z^2}}{{B_0^2}} - \frac{3}{2}\left( {1 - \frac{{B_z^2}}{{B_0^2}}} \right){\mathrm{sin}}^2\theta } \right]{\kern 1pt} ,$$
(1)

where V = (4/3)πa3, χ = 0.4 is the magnetic volume susceptibility and μ0 = 4π ×  10−7 Hm. We then assume that the hydrodynamic interactions between the two particles can be cast in terms of an effective energy potential given by

$$U_{\mathrm{h}} = 3\pi \eta a^3\omega _c\theta {\kern 1pt} ,$$
(2)

where η the solvent viscosity (water), θ is the angle between the two particles (see Fig. 1h). Here \({\boldsymbol{\omega }}_{c} = {B_{0} B_{z}}\chi \tau _r \omega [6\eta \mu _0(1 + \tau _r^{2} \omega^{2})]\widehat {\boldsymbol{y}}\) is the particle angular velocity, which is in general lower than the driving one, ω = 2πf, and τr is the magnetic relaxation time of the paramagnetic colloids (see Methods). By combining the contributions from the magnetic dipole–dipole interaction and hydrodynamics, the effective total energy of the colloid that is located at the edge becomes Utot = Um + Uh. This leads to the dynamic equation for the angle θ as

$$\dot \theta = - \frac{1}{{4\zeta a^2}}\frac{{\partial U_{tot}}}{{\partial \theta }}{\kern 1pt} {\kern 1pt} ,$$
(3)

where ζ is the friction coefficient, see Methods for a detailed derivation.

From Eq. (3), the condition for obtaining a stable θ is given by:

$$\left| {{\mathrm{sin}}2\theta } \right| = \left| {\frac{{ {6 B_0B_z}}}{{\chi \left( {B_0^2 - B_z^2} \right)}}\frac{{\tau _r\omega }}{{(1 + \tau _r^2\omega ^2)}}} \right| \le 1{\kern 1pt} .$$
(4)

Equation (4) allows us to understand how the particle behavior changes at the rear edge of the carpet by varying the ratio of field amplitudes, \(B_z^2/B_0^2\). (1) For small \(B_z^2/B_0^2\), there is a stable solution θπ/2 corresponding to a structure where the colloid at the rear edge tends to lie in the \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{y}}} \right)\) plane; (2) for moderate values of \(B_z^2/B_0^2\), there is no stable solution of θ and then the colloid at the rear edge of the carpet is transported toward the front edge (“tread-milling”); (3) for large \(B_z^2/B_0^2\), there is a solution θ∼0 and the colloid at the rear edge “stands up,” giving rise to a structure in the \(\left( {\widehat {\boldsymbol{y}},\widehat {\boldsymbol{z}}} \right)\) plane (“Broken carpet”). As shown in Fig. 1g, we find that the developed model is in excellent agreement with the experimental data with the following conditions: \(B_z/B_0 < 0.84\) for carpet confined in the \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{y}}} \right)\) plane, and \(B_z/B_0 > 1.19\) for a disk in \(\left( {\widehat {\boldsymbol{y}},\widehat {\boldsymbol{z}}} \right)\) plane. The fit to the data are obtained by using as sole adjustable parameter the relaxation time \(\tau _r \simeq 10^{ - 4}\,{\mathrm{s}}\), which is in agreement with the value found in separate experiments18.

Discussion

We next explore in more details the tread-milling phase and how it induces a regeneration of the propelling carpet. By increasing the amplitude of Bz, the particles are forced to detach from the back of the carpet and are transported above the surface by the hydrodynamic flow field. The detached particles move faster than the underlying monolayer, but do not leave the structure when they reach the end, as they remain strongly attracted there by dipolar interactions. Due to this attraction, the particles follow one of the crystallographic axes of the underlying lattice during transport. As shown in Fig. 2a, b, three different situations can be observed, illustrated also in Supplementary Movie 4 in the Supplementary Information. The particles can be adsorbed in the monolayer by filling vacancies that encounter during their excursion, they can change direction when they reach a grain boundary that merges domains with different crystalline orientations, or they can reach the moving front and reattach there. In the latter case, the particles form a growing interface that replicates the carpet wedge and shows no defect or vacancies. This process can be also appreciated from Supplementary Movie 2 in the Supplementary Information. Furthermore, we calculate the hydrodynamic flow field generated by the particles using a boundary element simulation technique; see Fig. 2c for the corresponding velocity profile and the Methods section for more details. The moving carpet generates a cooperative chiral flow field, which advects continuously the monolayer of particles in a similar way as a hydrodynamic conveyor belt. Although the flow velocity is small below the carpet given the short distance with the surface, it increases significantly close to the edge of the structure and thus forces particle detachment there. The average speed of the particles traveling above the carpet 〈vp〉 is twice the carpet speed 〈vc〉 as shown in Fig. 2d. This result, which is consistent with the kinematics of rolling motion, is confirmed in the numerical simulation.

Fig. 2
figure 2

Tread-milling dynamics: particle flow and speed. a Optical microscope image of a traveling carpet with the superimposed trajectories of three particles illustrating the different situations encountered. The carpet translates under the action of a dynamic field with amplitudes B0 = 2 mT, Bz = 2 mT, and frequency f = 40 Hz. The scale bar is 20 μm; see Supplementary Movie 4 in the Supplementary Information. b Relative distance, xp − xc of the three paramagnetic colloids vs. time. Particle 1 enters and leaves a grain boundary above the carpet changing direction but not speed. Particle 2 fills an hole while particle 3 reaches the carpet edge. c Calculated flow field around the rotating colloids using boundary element simulation (see Methods). The vectors show the flow direction, while the color map illustrates the \(\widehat {\boldsymbol{z}}\)-component of velocity. The image shows the process of detachment of one particle at the back of the carpet. d Average particle speed 〈vp〉 above the colloidal monolayer normalized to the average carpet velocity 〈vc〉. Error bars are obtained from the statistical average of different experiments

The tread-milling phase generates a net colloidal flow above the carpet allowing to completely rebuild its structure in a relatively short time scale. This occurs as the growing front of the carpet crystallizes in a perfect periodic lattice of colloidal rotors, while it smoothen the edge of the structure. The process is illustrated in Fig. 3a, where an initially disordered structure composed by 1045 particles is propelled at a speed of 〈vc〉 = 5.7 μm s−1 and after t = 2 min it has regrown with a perfect crystalline order. We analyze this process in terms of bond-orientational correlation function

$$g_6(r_{ij}) = \left\langle {\Psi _6^ \ast (r_i)\Psi _6(r_j)} \right\rangle ,$$
(5)

where \(\Psi _6(r_j) = \left| {\frac{1}{{N_b}}\mathop {\sum}\nolimits_{k = 1}^{nn} {e^{6i\theta _{jk}}} } \right|\), Nb is the number of neighboring particles k, and θkj is the angle between a fixed axis and the bond joining particles k and j. The initial disordered state results from the assembly of the carpet due to the rotating field and gives rise to a hexatic structure, with an algebraic decay of \(g_6(r)\sim r^{ - \eta _6}\) that characterizes quasi-long-range order. Here we find an exponent \(\eta _6\sim 0.3\), which is higher than the threshold value 1/4 as predicted by the KTNHY theory1 of melting in two- dimensional (2D) at equilibrium. As time advances, the carpet front recrystallizes and the nominal exponent of the correlation function decreases (to values as small as \(\eta _6\sim 0.1\)). In this nonequilibrium situation, all rotors are characterized by six nearest neighbors and long-range order develops.

Fig. 3
figure 3

Annealing of magnetic carpet. a Experimental images showing an initial polycrystalline carpet (t = 0s, top) realized with an in-plane rotating field (B0 = 2.5 mT, f = 40 Hz), and a monocrystalline carpet obtained after t = 2 min of propulsion (B0 = 2.5 mT, Bz = 2.7 mT, f = 40 Hz). The scale bar is 20 μm, see Supplementary Movie 5 in the Supplementary Information. b Bond-orientational correlation functions g6(r) of the two carpets with superimposed corresponding peaks as solid disks and fits to an algebraic dependence \(g_6(r)\sim r^{ - \eta _6}\) as dashed lines. The exponent η6 can be used to distinguish the crystalline phase (η6 > 1/4) from the hexatic one3. c Average carpet speed 〈vc〉 vs. field amplitude B0 for different values of Bz. The continuous black line is a fit to the data using Eq. (16), with fixed parameters l = 3.2 μm, χ = 0.4, ω = 251.3 rads−1 and h = 2.6 μm. The small inset indicates the corresponding location of the experimental points in the diagram in Fig. 1g (B0Bz is taken). Error bars are obtained from the statistical average of different experiments. d Bond-orientational order parameter Ψ(t) vs. time t for different values of B0 (thus carpet speed vc). In the continuous lines in the graph is obtained by averaging the experimental data over a discrete time window. All experiments are conducted for carpets having a similar size of ~1000 particles. e Annealing time τc vs. field amplitude B0, with continuous black line is a fit to the data using Eq. (6)

We then monitor the ability of the monolayer to recrystallize or heal itself by varying the carpet speed vc via the external field amplitudes B0 and Bz. As shown in Fig. 3c, in order to keep the carpet within the tread-milling phase, we need to simultaneously vary both amplitudes, which allows us to increase vc from 2.5 to ~ 6 μm s−1. The carpet speed can be calculated by considering a triangular lattice of surface rotors, with lattice constant l (see Methods section for more details). We can fit the experimental data of Fig. 3c with Eq. (16) using l ~ 3.2 μm with the magnetic relaxation time τr as an adjustable parameter. We obtain a value of τr = 0.3 × 10−4 s that is consistent with the diagram in Fig. 1g.

The dynamics of the ordering process is then characterized via both the nominal time-dependent exponent η6 of g6(r) (see Supplementary Fig. 1 in the Supplementary Information) and the global orientational order parameter averaged over all N particles, \(\Psi (t) = \frac{1}{N}\mathop {\sum}\nolimits_{i = 1}^N {\Psi _{6,i}}\) shown in Fig. 3d. In all cases we find that the increase in the carpet speed boosts the annealing process and allows the carpet to reach the crystalline phase more quickly. We confirm these observations by extracting the annealing time τc of the carpet as a function of the applied magnetic field (Fig. 3e). The time to eliminate a single defect in a carpet of area Lx × Ly can be approximated as \(\tau _p \simeq L_y/v_p\), with the tread-milling speed given by \(v_p\sim B_0^2\chi \tau _r\omega a/[6\eta \mu _0(1 + \tau _r^2\omega ^2)]\). For a carpet with Nd defects before annealing, the total annealing time can be approximated as the corresponding annealing time of one colloidal row along the y axis, given by

$$\tau _c = n\tau _p\sim \frac{{12N_d L_y\eta \mu _0(1 + \tau _r^2\omega ^2)}}{{L_xB_0^2\chi \tau _r\omega }}{\kern 1pt} {\kern 1pt} ,$$
(6)

where n = 2Nd a/Lx is the number of the defects along one colloid row. For \(L_x\sim L_y\), the annealing time can be simplified as \(\tau _c\sim \frac{{12N_d\eta \mu _0(1 + \tau _r^2\omega ^2)}}{{B_0^2\chi \tau _r\omega }}\) and can be used to fit the experimental data shown in Fig. 3e.

We also investigate the scalability of the carpet formation (Supplementary Fig. 2 in Supplementary Information), propulsion (Supplementary Fig. 3 in Supplementary Information), and the tread-milling motion (Supplementary Fig. 4 in Supplementary Information). By varying the number of particles in the carpet, we find that the initial self-assembly process could lead to an ordered crystalline structure below N = 150 particles, as shown in Supplementary Fig. 2 in the Supplementary Information. Larger carpets assembled by the rotating field display grain boundaries and vacancies that require the tread-milling motion to crystallize. The carpet speed increases with the number of particles, reaching a saturation value above N ~ 300 particles, as shown in Supplementary Fig. 3 in the Supplementary Information. Also, we found that the tread-milling behavior can be observed for all the carpet size, and until filling completely the observation area of our experimental system for N = 4000 particles (see Supplementary Fig. 4 in Supplementary Information).

In active colloidal systems, increasing particle activity via the propulsion speed leads to an increase in the effective diffusion coefficient or effective temperature of the system, which we might expect to give rise to a reduction of the global order. Here we report exactly the opposite effect: the faster the propelling carpets are, the more rapidly they form ordered structures. Our novel results demonstrate the versatility of our active magnetic system, as the governing interactions are based on a subtle interplay between hydrodynamics and magnetism

In conclusion, we investigate the collective dynamics of propelling magnetic carpets in a range of field parameters, where the colloidal structures are able to continuously transform into perfect crystalline lattices. The annealing process occurs due to the detachment of individual rotors from the back of the carpet, traveling above the carpet surface following a crystallographic direction, and either filling vacancies or reaching and rejoining the leading edge. We theoretically account for the out-of-equilibrium phase diagram by using a delicate balance between magnetism and hydrodynamics. The mechanism of the motility of our carpets is cooperative and is based on the rectification of the hydrodynamic flow generated by each rotor close to the bounding wall. Moreover, the use of external field allows us to steer and control the colloidal carpet and the corresponding flow of magnetic colloids that dictate the annealing process. From an application point of view, our annealing process could be easily extended to other types of recently engineered microscale particles with heterogeneous and functional properties21,22,23, or used to entrap, transport, and release non-magnetic particles across the carpet surface18. All in all, our out-of-equilibrium colloidal model system allows us to investigate crystallization in transported systems and could thus provide deep insight for similar processes occurring in systems at different length and time scales.

Methods

Experimental details

We use paramagnetic colloidal particles (Dynabeads M-270, Invitrogen) with diameter d = 2.8 μm, density ρ = 1.3 g cm−3, and magnetic volume susceptibility χ = 0.4. The particles are coated with surface carboxylic acid group with an active chemical functionality of 150 μmol × g−1 per particle. When dispersed in highly deionized water (18.2 MΩ × cm−1, MilliQ system), hydrogen ions (H+) dissociate from such groups, leaving a negative charged surface and inducing the formation of a double layer. The solution containing the particles is introduced by capillarity in a rectangular microtube made of borosilicate glass (inner dimensions 0.1 × 2.0 mm; CMC Scientific) that is immediately sealed. The particles sediment close to a glass plate, where they remain quasi-2D confined due to gravity, displaying a small thermal motion. The sample is placed in the center of a triaxial coil system arranged on the stage of a light microscope (Eclipse Ni, Nikon). External time-dependent magnetic fields are generated by passing an alternate current through the coils via a waveform generator (TGA1244, TTi) connected to different power amplifiers (AMP-1800, AKIYAMA, and BOP 20-10M, Kepco). The particle position and dynamics are extracted using digital video-microscopy with a charge-coupled device camera (Scout scA640-74fc, Basler) working at 50 frames per second.

Theoretical model

Under a static external magnetic field B, a paramagnetic colloid of radius a acquires an induced moment m = B/μ0, where V = 4πa3/3 is the particle volume. For a dynamic field, such as the field B1(t) rotating in the \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{z}}} \right)\) plane, the paramagnetic colloid experiences a finite magnetic torque24

$${\boldsymbol{T}}_c = \frac{{ {B_0B_z}V\chi \tau _r\omega }}{{\mu _0(1 + \tau _r^2\omega ^2)}}\widehat {\boldsymbol{y}}$$
(7)

when the angular frequency of the magnetic field, ω = 2πf, is comparable with the inverse of the magnetization relaxation time, \(\omega \tau _r\sim 1\). Here, \(\tau _r\sim 10^{ - 4}\,{\mathrm{s}}\) for our paramagnetic colloids18. Thus, a colloidal particle suspended in a fluid of viscosity η will rotate with angular velocity ωc < ω. The hydrodynamic interaction with the substrate induces a translational motion of the particle with velocity \(v\sim \omega _ca\). In the case of translating carpet, the induced moment for the individual colloid is given by,

$${\boldsymbol{m}} = \frac{4}{{3\mu _o}}\pi a^3\chi B_0\left( {{\mathrm{cos}}\,\omega t,{\mathrm{sin}}\omega _2t, - \frac{{B_z}}{{B_0}}{\mathrm{sin}}\omega t} \right).$$
(8)

The energy due to the magnetic dipole–dipole interaction among the magnetized colloids is:

$$U_{\mathrm{m}} = - \mathop {\sum}\limits_{i,j \ne i} {\frac{{\mu _0\left[ {3({\boldsymbol{m}}_i \cdot {\boldsymbol{r}}_{ij})({\boldsymbol{m}}_j \cdot {\boldsymbol{r}}_{ij}) - {\boldsymbol{m}}_i \cdot {\boldsymbol{m}}_jr_{ij}^2} \right]}}{{4\pi r_{ij}^5}}} ,$$
(9)

where rij denotes the vector pointing from the ith colloid to the jth one. Due to the employed field strength, we will consider these interactions only at the level of nearest neighbors. For two close particles as depicted in Fig. 1h, the magnetic dipole–dipole interaction averaged over one period of the rotating magnetic field can be explicitly expressed by Eq. (1), with the vector pointing from one colloid to the other as,

$${\boldsymbol{r}} = r\left( {{\mathrm{sin}}\,\theta \,{\mathrm{cos}}\phi ,{\mathrm{sin}}\,\theta \,{\mathrm{sin}}\,\phi ,{\mathrm{cos}}\theta } \right),\,r \approx 2a.$$
(10)

Note that when \(B_z \ll B_0\), the averaged magnetic dipole–dipole interaction is attractive in the \(\left( {\widehat {\boldsymbol{x}},\widehat {\boldsymbol{y}}} \right)\) plane and the particles will form a carpet.

The flow field that the colloids at the edges experience can be approximately by a two-colloid model. Let us denote the colloid at the rear edge as colloid 1 and its nearest neighbor in \({\hat{\mathbf{x}}}\) direction as colloid 2. The rotating colloid 2 induces a flow field around it, which can be approximated by a rotlet. In this case, the flow velocity that colloid 1 (edge colloid) experiences is approximately:

$${\boldsymbol{v}} = \frac{{{\boldsymbol{T}} \times {\boldsymbol{r}}}}{{8\pi \eta r^3}} = \frac{{a{\boldsymbol{\omega }}_c \times \widehat {\boldsymbol{r}}}}{4}$$
(11)

where the distance between the colloids is taken as r ≈ 2a. As a result, colloid 2 will rotate around 1. Or effectively, it can be considered that there is an effective torque acting on colloid 2 by the rotating colloid 1,

$${\boldsymbol{T}}_{\mathrm{h}} = 3\pi \eta a^3{\boldsymbol{\omega }}_c = \frac{{\pi a^3 {B_0B_z}\chi \tau _r\omega }}{{2\mu _0(1 + \tau _r^2\omega ^2)}}\widehat {\boldsymbol{y}}.$$
(12)

We thus write an effective hydrodynamic potential as, Uh = Thθ that gives rise to the total potential Utot = Um + Uh. The dynamic equation in terms of the orientation of the colloid, i.e., Eq. (3) can be expressed as:

$$\dot \theta = \frac{1}{{4\zeta a^2}}\frac{{3(V\chi B_0)^2}}{{64\mu _0\pi a^3}}\left( {1 - \frac{{B_z^2}}{{B_0^2}}} \right)\sin 2\theta - \frac{1}{{4\zeta a^2}}\frac{{\pi a^3 {B_0B_z}\chi \tau _r\omega }}{{2\mu _0(1 + \tau _r^2\omega ^2)}}.$$
(13)

Thus, the conditions for obtaining stable θ become:

$$\frac{B_{z}}{B_{0}}\leq \frac{-c+\sqrt{c^{2}+4}}{2},$$
(14)
$$\frac{B_{z}} {B_{0}} \geq \frac{c+\sqrt{c^{2}+4}}{2},\quad c =6\tau_{r}\omega/[\chi(1+\tau_{r}^{2}\omega^{2})]$$
(15)

or alternatively Eq. (4) in the manuscript.

Carpet speed

Here we calculate the mean speed of a carpet composed by a triangular lattice of rotating paramagnetic colloids. An individual particle close to a surface and subjected to a magnetic torque Tcex acquires a propulsion speed \({\bf{v}}_0 = \frac{{T_ca^2}}{{32\pi \eta h^4}}{\bf{e}}_y\), where a is the radius of the particle and h its elevation from the surface. We consider the hydrodynamic interactions of the particle in presence of the surface and extend the calculations in ref. 25 to a 2D triangular lattice. If we consider that the rotating particles form a triangular lattice with lattice constant l, the particle position can be denoted by: l(iu + jv), −N ≤ i, j ≤ N, where u = (1, 0) and \({\bf{v}} = (1/2,\sqrt 3 /2)\) are the base unit vectors of the lattice. By treating each rotating colloid as a rotlet, the velocity of the colloid at the lattice center (0, 0) is given by:

$$\begin{array}{*{20}{l}} {\mathbf{v}} \hfill & = \hfill & {{\mathbf{v}}_0 + \mathop {\sum}\limits_{i = - N}^N \mathop {\sum}\limits_{j = - N}^N \left( {\frac{a}{h}} \right)^{ - 2}\frac{{3\varepsilon ^2(i + j/2)^2}}{{\{ 1 + [(i + j/2)^2 + (\sqrt 3 j/2)^2]\varepsilon ^2\} ^{5/2}}}{\mathbf{v}}_0} \hfill \\ {} \hfill & {} \hfill & { \simeq T_c\left( {\frac{{a^2}}{{32\pi \eta h^4}} + \frac{1}{{4\eta l^2}}} \right){\mathbf{e}}_y.} \hfill \end{array}$$
(16)

where ε = δ/2h with δ being the the center-to-center separation between consecutive colloids in the array.

Boundary element simulation

We describe the flow field v at a given point x using a boundary integral formulation 26, which is a surface integral on the particle surface as

$$v_i({\boldsymbol{x}}) = - \frac{1}{{8\pi \eta }}\mathop {\sum}\limits_m^M {{\int}_{A_m} {G_{ij}} } ({\boldsymbol{x}},{\boldsymbol{y}})q_j({\boldsymbol{y}})dA$$
(17)

where G is the Blake tensor27, Am is the surface of m-th particle, and q is the viscous traction acting at a point y on the surface. Integrating the traction force q over a sphere surface gives the hydrodynamic force Fh and torque Th acting on the particle. As each particle is in force- and torque-free conditions, these satisfy

$${\boldsymbol{F}}_h + {\boldsymbol{F}}_m = \mathop {\int}\limits_{A_m} {\boldsymbol{q}} dA + {\boldsymbol{F}}_m = {\mathbf{0}},$$
(18)
$${\boldsymbol{T}}_h + {\boldsymbol{T}}_m = \mathop {\int}\limits_{A_m} {\{ {\boldsymbol{q}} \times ({\boldsymbol{x}} - {\boldsymbol{x}}_0)\} } dA + {\boldsymbol{T}}_m = {\mathbf{0}}$$
(19)

where x0 is the hydrodynamic center of the particle, and Fm and Tm are external force and torque acting on m-th particle, respectively. The motion of the particles are described by 6 degrees of freedom: i.e., three translational velocities U = (Ux, Uy, Uz) and three rotational velocities Ω = (ωx, ωy, ωz). Therefore, as the boundary condition, a given surface material point xs on the particle moves with a velocity

$${\boldsymbol{v}}({\boldsymbol{x}}_s) = {\boldsymbol{U}} + {\boldsymbol{\Omega }} \times ({\boldsymbol{x}}_s - {\boldsymbol{x}}_0).$$
(20)

The surface of each sphere is divided into NE = 512 triangular elements and NN = 258 nodes. According to Eqs. (17) and (20), the i-th node xi on the particle surface has to satisfy a boundary condition

$${\boldsymbol{U}} + {\boldsymbol{\Omega }} \times ({\boldsymbol{x}}_i - {\boldsymbol{x}}_0) + \frac{1}{{8\pi \eta }}\mathop {\sum}\limits_m^M {\left\{ {\mathop {\sum}\limits_e^{N_E} {\boldsymbol{G}} ({\boldsymbol{x}}_i,{\boldsymbol{y}}_e){\boldsymbol{q}}({\boldsymbol{y}}_e)\Delta A_e} \right\}} = {\mathbf{0}}$$
(21)

where ΔA is the surface area of the element, subscript e is the index of elements, and ye is the position of the element e. The force- and torque-free conditions (18), (19) can be discretized as

$$\mathop {\sum}\limits_e^{N_E} {\boldsymbol{q}} ({\boldsymbol{x}}_e){\mathrm{\Delta }}A_e = - {\boldsymbol{F}}_m,$$
(22)
$$\mathop {\sum}\limits_e^{N_E} {\left\{ {{\boldsymbol{q}}({\boldsymbol{x}}_e) \times ({\boldsymbol{x}}_e - {\boldsymbol{x}}_0)} \right\}} {\mathrm{\Delta }}A_e = - {\boldsymbol{T}}_m.$$
(23)

Note that four-point Gaussian quadrature is used to calculate the surface integral over each element. For singular elements, we work in polar coordinates to remove the 1/r singularity28.

The external magnetic field is imposed in xz-plain, Bex(t) = (B cos (2π ft), 0, −B sin(2π ft)), and the torque acting on each particle can be obtained as

$${\boldsymbol{T}}_m = {\boldsymbol{m}} \times \{ {\boldsymbol{B}}^{ex} + {\boldsymbol{B}}_m^{dd}\}$$
(24)

where Bdd is the magnetic field that is created by other particle:

$${\boldsymbol{B}}_m^{dd} = \mathop {\sum}\limits_{j \ne m} {\frac{{\mu _0}}{{4\pi r^3}}} \{ 3({\boldsymbol{m}}_j \cdot {\boldsymbol{n}}){\boldsymbol{n}} - {\boldsymbol{m}}_j\}$$
(25)

where μ0 is the vacuum permeability, r is the particle distance, and n is the normal vector pointing from particle m to j. We have three components for the external force: the gravitational force \({\boldsymbol{F}}_m^g\), the magnetic dipolar force \({\boldsymbol{F}}_m^{dd}\), and the repulsive force \({\boldsymbol{F}}_m^{rep}\), as follows

$${\boldsymbol{F}}_m^g = - \frac{4}{3}\pi a^3{\mathrm{\Delta }}\rho g\widehat {\boldsymbol{z}},$$
(26)
$${\boldsymbol{F}}_m^{dd} = \mathop {\sum}\limits_{j \ne m} {\frac{{3\mu _0}}{{4\pi r^4}}} \{ 5({\boldsymbol{m}}_j \cdot {\boldsymbol{n}})({\boldsymbol{m}}_m \cdot {\boldsymbol{n}}){\boldsymbol{n}} - ({\boldsymbol{m}}_m \cdot {\boldsymbol{n}}){\boldsymbol{m}}_j - ({\boldsymbol{m}}_j \cdot {\boldsymbol{n}}){\boldsymbol{m}}_m - ({\boldsymbol{m}}_m \cdot {\boldsymbol{m}}_j){\boldsymbol{n}}\} ,$$
(27)
$${\boldsymbol{F}}_m^{rep} = \mathop {\sum}\limits_{r < r_0} k (r - r_0){\boldsymbol{n}}$$
(28)

where \(\widehat {\boldsymbol{z}}\) is a normal vector pointing +z direction, k is the spring constant, and r0 is the natural length. The repulsive force is introduced in order to avoid overlap between sphere–sphere and sphere–wall, and the force is present only when the distance is less than the natural length.

The velocities are obtained by solving the linear equations Ax = b with a known vector b = {v, −Fm, −Tm} and an unknown vector x = {q, U, Ω}, where A is the dense matrix of size M(3NN + 6) based on Eqs. (21)–(23). For details, see previous works26,29,30.