Control of microswimmers by spiral nematic vortices: transition from individual to collective motion and contraction, expansion, and stable circulation of bacterial swirls

Active systems comprised of self-propelled units show fascinating transitions from Brownian-like dynamics to collective coherent motion. Swirling of swimming bacteria is a spectacular example. This study demonstrates that a nematic liquid crystal environment patterned as a spiral vortex controls individual-to-collective transition in bacterial swirls and defines whether they expand or shrink. In dilute dispersions, the bacteria swim along open spiral trajectories, following the pre-imposed molecular orientation. The trajectories are nonpolar. As their concentration exceeds some threshold, the bacteria condense into unipolar circular swirls resembling stable limit cycles. This collective circular motion is controlled by the spiral angle that defines the splay-to-bend ratio of the background director. Vortices with dominating splay shrink the swirls towards the center, while vortices with dominating bend expand them to the periphery. 45o spiraling vortices with splay-bend parity produce the most stable swirls. All the dynamic scenarios are explained by hydrodynamic interactions of bacteria mediated by the patterned passive nematic environment and by the coupling between the concentration and orientation. The acquired knowledge of how to control individual and collective motion of microswimmers by a nematic environment can help in the development of microscopic mechanical systems.


INTRODUCTION
Aqueous dispersions of self-propelled microswimmers such as motile flagellated bacteria that convert stored energy into mechanical motion are one of the most studied examples of active matter [1].Recent reports demonstrate intriguing examples of collective effects at length scales much larger than the size of an individual swimmer, such as coordinated motion and selfconcentration caused by hydrodynamic and steric interactions of bacteria among themselves and with bounding surfaces [2][3][4][5][6][7].These studies are of importance not only for the fundamental understanding of active matter [1,8] but also for potential future applications, since the power of collective motion can be harnessed to drive micromachines [9][10][11].To realize the full potential of the collective motion, one needs to learn how to control it.In an aqueous environment, a natural habitat of most microswimmers, this control can be achieved either by the gradients of nutrients which are usually transient and thus do not allow to support a sustained motion or by physical confinement such as microchambers, solid inclusions or obstacles [3,9,10,[12][13][14]. Another solution is to replace the isotropic aqueous medium with an anisotropic liquid crystalline environment that can guide the individual [15][16][17] and collective [17,18] dynamics of bacteria [19].Bacterial dispersions in lyotropic chromonic liquid crystals (LCLCs), called "living liquid crystals" or "living nematics," exhibit an intriguing interplay of bacterial activity with the underlying orientational order of the passive nonpolar nematic environment, specified by the director n with the properties ˆ− n n , 2 ˆ1 = n . In a uniformly aligned nematic, the rod-like bacteria such as P. mirabilis [20] and B. subtilis [17] prefer to swim along the director, as dictated by the elastic, surface anchoring and viscous interactions of their rod-like bodies with the surrounding anisotropic fluid [16][17][18]21].
When the nematic director is predesigned to be spatially-nonuniform [17,[22][23][24], it can trigger unidirectional flows of bacteria and cause their strongly non-uniform spatial distribution [25].In particular, Peng et al [23] demonstrated that 45 spiral vortices attract swimming bacteria and force them to swim along circular trajectories with a well-defined polarity.In contrast, circular vortices cause a qualitatively different bipolar circulation, with bacteria swimming both counterclockwise and clockwise in the same swirl [23].This dramatic difference, coupled with the fact that circular swirling is one of the most common examples of coherent spatiotemporal behavior of bacteria [2,3,12,14,26,27] and other active units [28][29][30] calls for a systematic study.
In this work, we explore the onset and time development of collective swirling motion by imposing vortex director patterns of a background LCLC on the motile bacteria B. subtilis.B.
subtilis is a rod-shaped microorganism that could swim in a nematic LCLC at ~15μm/s by coordinated rotation of about 10-20 helical filaments, called flagella; the head of the bacterium rotates in an opposite direction with a smaller frequency [17,31].B. subtilis swimming in a nematic LCLC generates a "hydrodynamic force dipole" pattern [17,31], typical for many flagellated bacteria swimming in water [32]: the surrounding fluid is pushed away from the bacterium along the axial direction and pulled towards the bacterium along the two perpendicular directions, as schematically shown in Fig. 1a.In dense isotropic aqueous dispersions, with concentration in excess of 10 15 m -3 , these hydrodynamic dipolar perturbations lead to spectacular collective effects of "bacterial turbulence", with vortices and jets [2,33].Theoretical modeling of these dense dispersions [34,35] reveals that the overlapping hydrodynamic force dipoles destabilize the mutual alignment of neighboring bacteria, making a parallel swimming motion unstable.Our work demonstrates that by replacing the isotropic environment with nematic vortices, which mediates the interactions of the hydrodynamic force dipoles through the underlying director, one can achieve a stable parallel polar swimming of bacteria with controllable scenarios, such as swirl expansion and swirl contraction.
The predesigned vortices range from radial to circular, with the spiral angle 0  varying from 0 to 90 .We demonstrate that any spiral director vortex with 0 0 90     congregates bacteria into a unidirectionally circulating swirl when the concentration of bacteria exceeds some threshold, (10 13 -10 14 ) m -3 , which is 10-100 times smaller than the critical concentration at which "bacterial turbulence" sets in isotropic systems.This concentration threshold corresponds to the expected range of bacterial interactions in the nematic LCLC, at which the fluid perturbations around the neighboring swimmers start to overlap.Below the threshold, the bacteria show only an individual behavior, as they swim parallel to the director and do not condense into circular swirls.
The spiral angle destines the long-term fate of the collective circular swimming above the threshold.
In patterns with 0 45   , as time goes by, the swirls shrink towards the center, while in 0 45   patterns, they expand.Vortices with 0 45 =  produce the most stable unidirectional circular motion of bacteria.The corresponding swirls are capable of self-healing: when the number of bacteria increases above some threshold and the circular trajectories start to undulate, the swirl releases the excess of bacteria to resume steady circulation.The experimental data are qualitatively explained by demonstrating that the hydrodynamic interactions among the bacteria and the ensuing active forces depend on the underlying director field.These interactions are described by an agentbased modeling and by an advection-diffusion model of a living liquid crystal [36] that incorporates the active forces created by the microswimmers.

Sample preparation.
We use Bacillus subtilis (wild-type strain 1085), which is a rod-shaped bacterium with a body length of 5-7 μm .The bacteria are initially grown on a lysogeny broth (LB, purchased from Teknova) agar plate, then transferred to a tube containing 10 mL of liquid medium terrific broth (TB, purchased from Sigma Aldrich).The tube is placed in a shaking incubator at 35 o C and extracted after 7-9 hours, once the maximum saturation of bacterial concentration is reached.The saturation of the bacterial concentration is measured using a custom-made optical density meter.
0.05 mL of the liquid medium containing the bacteria is then extracted from the tube, centrifuged for 2 minutes at 10,000 rpm.After centrifugation, the liquid medium which does not contain bacteria is removed, and a 0.5 mL 14wt% solution of disodium cromoglycate (DSCG, purchased from Alfa Aesar) in TB is added to the bacteria and carefully pipetted up and down several times.
TB provides nutrients to support motility of the bacteria, keeping the bacteria motile in a sealed cell with no additional oxygen supply for approximately 1-2 hours.

Director patterning and experimental design.
The bacterial solutions are confined in flat cells, formed by 1mm thick soda-lime glass sheets cleaned thoroughly in an ultrasonic bath for 30 minutes at 60 o C, rinsed with isopropanol, then placed in an oven to dry for 10 minutes at 80 o C. The glass is UV-ozone cured in a chamber for 10 minutes, then spin-coated with a solution of an azo-dye in dimethylformamide.We use either 0.5 wt% filtered solution of Brilliant Yellow dye (purchased from Sigma Aldrich) or SD-1 dye in dimethylformamide (purchased from Sigma Aldrich), depending on the humidity [37].The glass plates are hard-baked in the oven for 30 minutes at 100 o C to fully evaporate the solvent.
Photopatterning is used to impose the desired anchoring conditions onto the background LCLCs.The glass substrates with photoalignment dye layers are illuminated with a metal-halide X-Cite 120 lamp.The light beam is passing through a plasmonic photomask with nano-slits that produce a local polarization of light perpendicular to the long axes of slits.Upon irradiation, the spin-coated photosensitive dye molecules align perpendicularly to local polarization.The photoaligned dye coatings align the LCLC director; the director pattern reproduces the pattern on nano-slits in the plasmonic photomask.The glass substrates are carefully blown with a compressed nitrogen air gun and spin-coated with a toluene solution of 6.7wt% reactive mesogen RM-257 (purchased from Wilshire Tech.), containing also 0.35wt% photoinitiator Irgacure-651 (purchased from Ciba).Subsequently, the substrates are illuminated with a UV-lamp (365nm, 6W) for 30 minutes for polymerization of RM-257 to form a liquid crystal elastomer coating with the director that follows alignment of the azodye [38].The patterned substrates are assembled into cells, being separated by spherical and cylindrical spacers of diameter 20 μm or 5 μm.The thickness of the cells is measured using a spectrometer.The LCLC containing the bacteria is injected into the cell using capillary forces, and the open sides are sealed using an epoxy to prevent evaporation.The sample is heated to 43 o C using a hot stage (Linkam model PE94) to melt the LCLC into the isotropic phase, after which it was slowly cooled down to the nematic phase in order to achieve better alignment of the LCLCs.When the sample is slowly cooled from the isotropic phase, the nematic phase first forms as sublayers at the top and bottom plates, which merge to form a homogenous nematic phase.
While the sample is in the biphasic state, the bacteria swim along the imposed nematic director near the two bounding surfaces and continue to swim along the director after complete transition to the nematic phase.The interfaces that are parallel to the plates do not swipe away bacteria.
Occasionally, there might be a nematic-isotropic interface that is not parallel to the plates.Such an interface could swipe few bacteria from the field of view.However, the bacteria remain in the pool of the material and once the transition to the nematic is complete, they are free to swim anywhere, as dictated by the processes described in the paper.We verified and confirmed that the initial concentration and distribution of bacteria before and after the phase transition remain the same.
The desired alignment of DSCG establishes itself 15-20 seconds after the sample transitions completely into the nematic phase.Therefore, in order to assure that there is full alignment, we waited 60 seconds after the phase transition before starting to acquire any data.Note here that the bacteria show a steady level of activity for only a limited time, about 30 min, after being injected into the cells; we thus could not extend a reliable analysis to time intervals much longer than 10 min.
The alignment patterns are identical at the top and bottom surfaces.The pre-imposed director writes in cylindrical coordinates as 0 0 0 ˆ( , ,0) (cos ,sin ,0) where the constant spiral angle 0  is measured between the radius-vector r and the local director.
Nine different patterns were designed, with 0 =  0, 10 , 25 , 45 , 60 , 70 , 75 ,80 and 90 , Figs. 1,2.The size of the square patterned area is 1 mm 2 .The thickness d of the cells is 20 μm , unless specified otherwise.Since d is much smaller than the in-plane scale of deformations, the system is effectively two-dimensional.When 0 0 =  , the director deformation is a pure splay, . As 0  increases above 0, the splay .We also calculate the volume fractions v  and p  corresponding to v c and p c .We treat a bacterium as a cylindrical rod of a length 7 μm and a diameter 0.7 μm [17], so that its volume is approximately

Optical Microscopy and PolScope measurements.
For data acquisition and recording, we use a Nikon TE-2000 inverted microscope and a high-resolution camera (Emergent HR-20000C).The bacteria appeared as higher-intensity objects on a lower background intensity of the transparent liquid-crystal field.We found the average image over all frames and subtracted it from each frame of the video.With this, the background liquid crystal intensity becomes even more suppressed and we segregated the individual bacteria using an intensity thresholding technique.In order to obtain the optical retardation map and underlying director field, the samples are observed using an optical polarizing microscope (Nikon E600) mounted with a Cambridge Research Incorporated Abrio LC-PolScope package.The PolScope uses 546 nm monochromatic illumination to map out the optical retardance  and orientation of the slow axis of the sample, from which a 2D director field is reconstructed [39,40].The maximum optical retardance that can be measured using the PolScope is 273 nm, but measurements above 240 nm do not yield accurate results [41].Therefore, we restricted our retardance measurements to be range 0-240 nm by making thin cells of thickness 5μm d = .
To visualize the bacterial dynamics, we use bright-field optical microscopy in which the LCLC and swimming bacteria show different levels of transparency.The background transmitted light intensity is subtracted from the entire frame to make the LCLC environment "black", while the light intensity transmitted through the bacterial bodies is enhanced to the maximum "bright" level.The direction of bacterial motion is deduced by comparing subsequent video frames.

Description of computational model.
We validated our findings using the advection-diffusion model [36].In this model, the nematic dynamics is described by the following equations: ( ) Here 0 V is the bacterium swimming speed, c D is the diffusion coefficient, and τ is the direction reversal time (if a bacterium reverses a direction, it leaves the population c + and becomes c − or vice versa).Our experiments show that the reversal time is typically quite large, of the order of 30−60 sec.In Eqs. .Here p is fluid pressure, and the term ζ − v is a viscous friction term.For additional details, see Ref. [25].Equations ( 2) and (3) are complemented by two evolution equations for bacterial concentrations c c c +− =+, Eq. ( 4).
Each of the bacterial populations c  swims in opposite directions parallel to the director.Given the nematic angle  , there is freedom in choosing a In our previous work [25], we defined c + to swim to the right (and correspondingly c − to the left) and relabeled concentrations in the proximity of vertical nematic orientations.In this work, we take advantage of spiral nematic patterns and define c + to always swim clockwise and c −counterclockwise, which allows us to avoid non-physical bacterial clustering without c  relabeling.
In this case, c − bacteria swim away from the pattern center, while c + bacteria swim towards the center.

Individual-to-collective transition in swimming patterns.
In dilute dispersions, ), the bacteria simply swim along 0 n , as illustrated by six trajectories in the vortex pattern with 0 25 =  in Fig. 1b and Supplemental Movie S1 [42].The bacteria in this dilute regime do not interact with each other and do not distort the surface-imposed director, similarly to the previous studies [17,18,20,21].
When the number of bacteria increases above ten, the trajectories start to change from spiral to circular, Fig. 1c and Supplemental Movie S2 [42].The circular trajectories form a large angle  ), above which all bacteria condense into the circular swirl, as shown in Fig. 1d and Supplemental Movie S3 [42] for a group of ~60 bacteria, The observed unipolar circulation is different from the well-known effect of circular swimming that many bacteria, including B. subtilis, experience in diluted dispersions, while swimming as individuals near solid boundaries: this individual circling is caused by the interactions of the bacterium's clockwise-rotating head with the substrate [43][44][45].In our cells, the clockwise swimming is driven by the collective interactions between the bacteria mediated by the underlying spiraling director, which overcome any possible effects caused by the head counterrotation.
When the bacteria swim individually along 0 n in diluted samples, their average separation is large, 60μm  or more.Collective circular swimming, Fig. 1c,d, occurs when the separation decreases to 15 20μm − , which corresponds to a significant overlap of the hydrodynamic force dipoles of neighboring bacteria in the LCLC background [31].Hydrodynamic interactions of bacteria in proximity to each other, mediated by the patterned director field of the passive nematic environment, produce a net active force a F that first triggers and then drives the collective motion, as illustrated in Fig. 1a and explained below.
Because no net force is applied to a self-propelled object, a swimming bacterium represents a moving hydrodynamic force dipole as it produces two outward fluid streams coaxial with the bacterial body [3,5,17], as shown for bacteria 1 and 2 in Fig. 1a.The individual bacteria 1 and 2 are separated by large distances, their streams do not overlap, and they do not interact.These well separated bacteria experience only an alignment action of the passive nematic that orients them parallel to 0 n [15][16][17][18].This alignment and nonpolar character of 0 n explain the spiral open nonpolar trajectories that the individual swimmers follow in Fig. 1b.
The situation changes dramatically when the bacterial concentration increases and their force dipoles start to overlap, as illustrated in the top part of Fig. 1a for bacteria 3,4,5 and others nearly.Since each bacterium prefers to be parallel to 0 n , and since 0 n is predesigned with splay and bend, the force dipoles are titled with respect to each.The tilted force dipoles of closely located bacteria cannot compensate each other and produce a net active force.In the concrete example in Fig. 1a with the spiral angle 0 25 =  , bend and splay imposed onto the field of force dipoles, produce a net active force a F that is directed clockwise and towards the center of the vortex, as shown by red arrows in Fig. 1a,d.This net force triggers the transition from the individual to the collective clockwise circulation of the bacterial swarm.As we will see later, the qualitative picture of the bacterial interactions through the patterned director in Fig. 1a,d is validated by a rigorous consideration of the active force dependence on the director gradients in Eq. ( 5), and by a theory that accounts for variable concentration.
The hydrodynamic interactions of overlapping dipoles in Fig. 1a, mediated by the underlying passive director, also explain the dynamic phenomena that emerge when the transition to collective motion is complete.Among these are (i) clockwise circulation for any spiral angle in the range ; (ii) expansion and shrinkage of the swirls controlled by the spiral angle 0  . We described these effects below for samples with a higher concentration , Fig. 2-4.

Regime of steady unipolar circulation.
All vortices with impose the same unidirectional clockwise steady circulation of bacteria, provided their concentration exceeds some critical value which depends on 0  and is in the range ).The steady circulation persists till the concentration reaches a higher value max p c at which the swirls start to undulate, losing their circular shape; this effect is detailed in the next section.The trajectories of bacteria tracked using TrackMate [46] are shown in Fig. 2a-q, using different colors for different bacteria.
The bacteria circulate within a relatively narrow ring, Fig. 2s (Supplemental Movie S3, S4 [42]).The radial distribution of bacteria in each pattern is tracked for 60 s in order to find the correlation between the radius of maximum concentration ,max  A velocity map for each vortex was obtained by tracking each bacterium for 60 s using particle image velocimetry (PIV) MATLAB package [47], Fig. S4a-h [42].The speed  ).
This behavior differs from a theoretical prediction [48] that a Taylor swimmer, i.e., a deforming sheet which generates low-amplitude plane waves, placed in a uniform nematic , would swim faster if it were perpendicular to 0 n than when it were parallel to 0 n .In particular, the swimming speed is predicted to increase when the Taylor swimmer makes an angle between 45 and 135 with 0 n [48]; this regime corresponds to the splay-rich vortices  .Scale bar 50μm .

Active force induced by director-mediated hydrodynamic interactions.
The salient features of the bacterial dynamics in the predesigned vortex director field, namely, onset of collective swirl dynamics, clockwise swimming, shrinking and expansion of swirls, dependence of the azimuthal velocity on the spiral angle can be qualitatively explained by analyzing the active force that emerges when the bacterial force dipoles, being embedded into the passive director field, start to overlap. Figure 1a,d explains the mechanism of the individual-tocollective motion transition for the 0 25 =  vortex.In a general case, the active force as a function of the director gradients can be written in the approximation of a spatially-independent concentration [23,49], const c = , as where α λc =− is the activity coefficient defined as the product of bacterial concentration and force dipole 0 λ  exerted by each bacterium on the surrounding nematic; α is negative since B. subtilis microswimmers are pushers [50,51].The limitation const c = is lifted in the next section, which operates with the full description of the active force as a divergence of the active stress.Note that in strongly condensed systems, such as a condensed dispersion of filaments, α is often taken as proportional to 2 c , to stress that the activity arises from pairwise interactions [52].In our case, the active force in a relatively dilute subsystem of bacteria is mediated by the passive nematic environment, so that αc to reflect its superposition character.
For the director field in Eq. ( 1), which spirals counterclockwise when  Supplemental Material Fig. S2d [42], forming an immobilized dense cluster within a few minutes.
In the bend case ( 0 90 =  ), the bacteria swim in a bipolar fashion along circular trajectories that gradually displace to the periphery, see Supplemental Material Fig. S2b [42] and Fig. 2r.The absence of net flows, condensation at the cores, and expansion to the periphery are explained by an argument similar to the scheme in Fig. 1a and by Eq. ( 5).Namely, the active force a F in these cases is purely radial, either centripetal, 0 0 =  , or centrifugal, 0 90 =  , with no azimuthal component.

Spiral vortices: regime of undulations and population oscillations.
The circulating swirls deviate from a circle to an undulating shape, Fig. 6, when the number of bacteria increases above some threshold max p c that depends on 0  .In order to observe the undulations, we use a higher initial concentration .The undulations arise from bending instability that is typical of the dynamics of "pushers" [17,36].) in one-dimensional "C"-patterns with alternating splay and bend stripes [25].In other words, the vortices of the background passive director help to stabilize the collective unipolar motion as compared to the uniform director environment, but not as strongly as the C-patterns of alternating bend and splay.These differences illustrate that the undulation threshod is different in different geometries, a fact that can be used to stabilize or destabilize the dynamics of bacteria by a suitable design of the director field.

Numerical simulations of the individual-to-collective motion: agent-based approach.
The experiment, Fig. 1, demonstrates that the transition from an individual bidirectional swimming to a collective unipolar circular swirling occurs at a relatively small number of microorganisms, on the order of 10.The effect of the spiral angle on swirls is also evident for relatively small number of bacteria involved, Figs.4,5.These data suggests that in order to capture best these striking effects, one should use a model based on discrete active units.These units interact through the underlying passive director pattern 0 ˆ() nr.
The director tends to align the dispersed rod-like bacteria along itself because of the tangential anchoring of the director at the bacteria's bodies [17,18].
We simulate individual and collective dynamics of a finite number B n of swimming bacteria in the 2D prepatterned passive director field  is the dipolar strength of a bacterium (unit of length is normalized by the length of a bacterium; the unit of velocity is normalized by the bacterial swimming speed; and the unit of force is normalized by the bacterial propulsion force); the "-" sign corresponds to the pusher nature of the swimmers, B ˆˆ/2 =− Q pp I is the tensorial order parameter of the bacteria, I is the identity tensor, and () f r is anisotropic Gaussian distribution which models the anisotropic shape of a bacterium: , with the parameters 2.2l g = and 1.0l g ⊥ = that define the width of the distribution along p and perpendicular to p , respectively.The active stress generates a realigning force act act where the sum is taken over all bacteria.A relaxation equation in the Landau-Lifshitz-Gilbert form for the director in the bulk writes ( ) , where s  is the director relaxation rate dependent on the director anchoring strength at the bounding plates and a is a coefficient dependent on the surface anchoring strength at the bacterial body [18], K is the Frank elastic constant of the nematic normalized by rotational friction (for more details, see Supplemental Material [42]).This form automatically ensures the director normalization condition ˆˆ1 = nn .The Landau-Lifshitz-Gilbert dynamic equation is fully equivalent to the Leslie-Ericksen description of the director realignments but it is easier to use in numerical simulations since it does not encounter the angle discontinuity intrinsic to the nematic angle description; it can be applied as long as the director field does not contain half-integer disclinations, which is the case under consideration.
Note that our model does not include bacterial interactions among themselves nor the effects of random noise, because of the following reasons.The multi-body bacterial interactions are important in dense systems in which the microorganisms are in constant contact with each other, see, for example, Li et al [53].Our system is much more dilute, with the volume fractions even in the condensed swirls being less than 0.01.Random reorientations of the bacteria are suppressed by the surrounding passive director field and finite anchoring of the director at the bacterial bodies [17,18,31].
Numerical simulations reproduce the most salient feature of the bacterial dynamics in vortices, namely, a transition from the individual swimming parallel to the pre-imposed director 0 n at small concentrations to a collective circular swirling above some concentration threshold.In the numerical simulations for 0 45 =  vortex, we use  7 and Supplemental Movie S5 [42], the surface anchoring and elasticity of the passive nematic environment are sufficient to align and guide the swimming bacteria strictly along 0 n , along bipolar trajectories, as in Fig. 1b.Once B n increases above 10 in Fig. 7 and Supplemental Movie S5 [42], the hydrodynamic force dipoles of neighbouring bacteria that are aligned by the spiraling 0 n at some angle to each other, start to overlap and produce an active azimuthal force that sets a collective polar circular swimming.At this stage, the trajectories are no longer along the director and cut the substrate-imposed 0 ˆ() nr at 45 .

Numerical simulations of the effect of the spiral angle: agent-based approach.
The agent-based model also describes the effect of the spiral angle in the range

Numerical simulations of the bacterial swirls: continuum approach.
Despite its simplicity and clear underlying physical mechanisms, the agent-based model fails to capture the behavior of relatively dense swirls that show undulatory instabilities, Fig. 6.To explore this part of the rich dynamic spectrum of the bacterial dynamics in living liquid crystals, we employ the advection-diffusion model [25], see Eqs. ( 2)-( 4) in the Materials and Methods section below.The advection-diffusion model directly incorporates the fluid velocity and makes an experimentally tested prediction that this velocity in stable swirls is directed clockwise parallel to the bacterial velocity, thus helping the swirl's circulation.Furthermore, the advection-diffusion model successfully captures the onset of undulations of condensed swirls, Fig. 6, as demonstrated below.
We numerically integrated Eqs. ( 2)-( 4), on graphical processor units (GPUs), see Ref. [36] for numerical implementation details.Starting with random initial conditions, the system selforganizes and exhibits behavior similar to that observed in the experiment: when the concertation exceeds some threshold, bacteria form a circular swirl.In the swirls, all bacteria swim unidirectionally and create unidirectional fluid flows, Fig. 9a,b.This behavior is consistent within the range 0 [65 ,85 ]     , Fig. 9c.Furthermore, we observe a monotonous decrease of the swirl radius while decreasing 0  towards 45 .
At higher bacterial concentrations, the circular trajectories start to undulate, Fig. 9d and Supplemental Movie S7 [42].In agreement with the experiment, bacterial distribution in undulating swirls is non-uniform along the swirl arclength, Fig. 9d.As in the agent-based simulations, we do not observe persistent circular collective motion for small 0  , as in these vortices, the model shows that the bacterial concentration reaches its maximum in the vortex center.This is likely due to the limitations discussed in the previous section on agent-based approach and because of the oversimplified expression for the active stress act B σQ .In the last expression, the radial part of

IV. DISCUSSION AND CONCLUSION
In this work, we demonstrate the transition between an individual and collective modes of motion of bacteria in a spiral director field of a passive nematic background.In the individual regime, bacteria simply follow the pre-inscribed director, remaining parallel to it.This regime is observed when the concentration of bacteria is small, i.e., the separation distance between bacteria is considerably larger than the range of hydrodynamic interactions, which is on the order of a few tens of micrometers (the typical length of fluid perturbations in the form of hydrodynamic force dipoles produced by an individual motile bacterium in the LCLC [31]).Once the concentration exceeds some threshold cr The experimental findings for the short-time dynamics of the bacterial swirls are well described by the theoretical models.Some disagreement for long-time behavior and swimming in vortices with a small 0  can be attributed to the limitations of the theory, such as the omission of steric interactions between the bacteria in condensed swirls and relatively small integration domains.Large angular discrepancies between the alignment of the bacterial bodies and the prepatterned 0 n add to the complexity of the problem.The long term behavior is also influenced by the experimental factors that make modeling harder, such as decrease of activity with time due to the depletion of nutrients.
Our results stipulate new design concepts on how to harness individual and collective motion of microswimmers, both living and synthetic, to extract a useful mechanical work that might power microscopic systems.Several realizations of active matter powered microdevices were proposed recently in Refs.[10,11,54].As we have demonstrated, a liquid crystalline environment with patterned surface alignment enables self-concentration of bacteria in predesigned locations, without hindering the space with impenetrable walls, thus facilitating energy transduction.Note that the liquid crystal under consideration is a non-toxic aqueous solution of disodium cromoglycate (used as an inhaled anti-inflammatory agent for the treatment of asthma), in which water occupies about 86% of volume.Such a material can be easily interfaced with other microfluidic elements.
Of course, bacteria can be replaced with artificial swimmers, which would expand the spectrum of potential liquid crystalline environments for controlled microdynamics..Thus, the average speed of bacteria increases with concentration.This trend is in agreement with the study by Sokolov et al [1] of the concentration dependence of the bacterial velocity in isotropic aqueous medium.The second conclusion is that the concentration In what follows, we consider the →  limit (a very large reversal time).The equations for c  decouple.Let us assume that one of the populations swims away from the center (e.g. for the experimental configurations as in Fig. 3 it is c − ) and consider only the population c + .We can integrate stationary Eq. ( S3) and obtain The constant 1 C is zero in order to obey the condition at r →.In the steady state there is no radial flow, i.e.
where Q is the tensor order parameter of the nematic, I is the identity matrix, 0   is the dipolar strength (sign " − " corresponds to pushers such as bacteria).The active stress will generate the realigning active force a act ct =   σ F .To describe this effect and ensure ˆˆ1 = nn , we apply a relaxation equation in the Landau-Lifshitz-Gilbert form [5] for the director in the bulk, ( ) Eq. (S8) relaxes the actual director n towards the direction defined by a combination of the preferred direction 0 n and active force and automatically fulfils the normalization condition ˆˆ1 = nn . Here s  is the director relaxation rate dependent on the director anchoring strength at the bounding plates and a is a coefficient dependent on the surface anchoring strength at the bacterial body.In Eq. (S8) we neglect for simplicity the elastic response of the nematic and set the elastic constant 0 K = .A stationary solution to Eq. (S8) for Note that due to director identity , − nn , the definitions with opposite signs are both valid, as in Ref. [6].Since in 2D the Q-tensor is of the form . Equation (S12) was solved in a rectangular domain by qausi-spectral split-step method based on the fast Fourier transformation, see Refs.[7,8].In order to find the value of  between the computational grid points, qubic spline interpolation was used.The algorithm is implemented in MATLAB computational package.
pattern, another important factor controlling the dynamics of bacteria is their concentration.In addition to the overall concentration v c measured as a number of bacteria per unit volume, which does not depend on the particular director pattern, we introduce a local vortex-specific volume concentration p c measured by counting the bacteria within a box marked by red circles in Fig.2, 4, and 6.The v p cond ,,    quantities are less precise as compared to v c and p c but help to understand the separation distances between the bacteria.
(2) and (3), n can differ from the prescribed 0 n because of the torques and forces imposed by the bacteria.Equation (2) describes the evolution of the tensorial nematic order parameter Q , where v is the fluid velocity, tensor S accounts for the nematic alignment with the fluid flow, H is the molecular field that accounts for the nematic elasticity.Equation (3) is the linear momentum balance, where s σ and a σ are the symmetric and antisymmetric elastic contributions, respectively, visc σ is the viscous contribution, act c =− σQ  is the active stress that depends on bacterial concentration c c c ~65 with the director field 0 n pre-inscribed at the bounding plates, a behavior clearly at odds with steady swimming parallel to 0 n at low concentrations.

Figure 1 .F..
Figure 1.Transition from individual to collective motion caused by the increased bacterial the condensed swirl.Importantly, in contrast to the individual regime that produces no net flows, the collective circulation is unipolar, namely, clockwise when the sample is viewed "from above", Fig.1d.This unipolar circulation settles in all patterns with (1), Fig.1a.Occasionally, there might be a reversal of an individual bacterial velocity, but these events are rare.
defines the ratio of bend to splay, Fig. 2s.The data from each pattern are normalized by setting the value of maximum concentration to 1.Each concentration distribution shows a prominent peak at ,max c rr = , Fig. 2s; ,max c r increases with 0  , as the bend deformation overcomes splay.


Fig. S4.The maps clearly show a clockwise circulation in each vortex.The azimuthal velocity v  changes non-monotonously with the radial distance and 0 3a.As discussed in the next subsection, a plausible reason is that the azimuthal active force reaches a maximum at 0 large angle and thus need to overcome a stronger viscoelastic resistance [18].

Figure 3 .
Figure 3. (a) Azimuthal component of velocity v  for each pattern as a function of radial direction in our case the speed in splay-rich vortices is actually smaller than that at 0 45 =.There are many reasons for the discrepancy: (i) surface anchoring at the bacterial body is strong enough to keep the local director parallel to the bacterial body[18] and thus different from 0 n , while in the considered model of Taylor swimmer this anchoring is weaker; (ii) the director in our case is prepatterned, while in Ref. [48] it is uniform; (iii) the modes of propulsion are different, etc.The observed speed dependence on the anisotropy direction of environment demonstrates a rich potential of an orientationally ordered media to control active flows.The diameter of circular swarms of bacteria increases with the spiral angle 0  , as clear from Fig.3b, in which each velocity dependency () vr  peaks at a certain radius max rr = that increases with 0  , for a similar duration of observation (60 s).So far, we described short-term dynamics, mostly within the time interval [0, 60 s].The circular swirls also show long-term dynamics that is dramatically dependent on 0  , Fig. 4. Namely, bacterial swirls tend to condense towards the center in the vortices with a prevailing splay, 0 45   , Fig. 4a-c, j, while they expand and move away to the periphery in the vortices of a predominant bend, 0 45   , Fig. 4g-h, k.The condensing swirls at 0 45   show two types of behavior.In the pure radial geometry, the bacteria could form an immobilized dense cluster with the volume fraction approaching 1, after 5-6 minutes from the start of the experiment.In vortices with continue swimming in the azimuthal direction in the shrunk swirls and do not form dense immobilized clusters, as some bacteria escape the swirls and swim away.The swirls are most stable in the vortices of splay-bend parity, 0 45 =  , Fig. 4d-f, where their inner and outer radii remain unchanged for more than 10 min.

Figure 4 .F
Figure 4. Long-term evolution of circulating swirls at different 0  's ( 13 -3 v 0.8 10 m c  , Fig.4i, thus facilitating shrinking or expansion of the swirls, respectively.The radial component is

Figure 5 .
Figure 5. Swirling-induced director deviations from surface-imposed 0 n in a spiral vortex 0 45 =  ; data accumulated over the interval [0, 60 s].(a) Optical microscopy texture of bacteria (white) in a steady swirl (confined between two yellow dashed circles) overlapped with the actual director (red), determined by PolScope.Scale bar 50 μm .(b) Azimuthal variations of the angle β between the actual director field in the bacterial swirl and 0 n ; β is calculated by dividing the swirl into segments of 18  =   and finding the angle in each segment.

Figure 6 illustrates
6a.As time goes by, the swarm attracts more bacteria, Fig.point the circular shape begins to undulate, Fig. 6c.Once the swirl starts to undulate, the bacteria escape from it, through openings in the most developed protrusions, Fig.6d,e.After releasing some bacteria, the swarm becomes less populated, Fig.6f, with the concentration dropping down to swarm restores its circular closed shape, resuming steady swirling, Fig. 6h.The circulation remains steady until the concentration increases to which the cycle of undulations and population oscillation repeats itself.The entire cycle can be repeated multiple times.Similar undulations and population oscillations can also be observed for other vortices with Fig.S5[42].However, after the initial undulation and release of some bacteria, the swarms form circular swirls with a radius larger than the initial one.The reason is that the swirls are expanded by the outward radial component of the active force that is present at any 0 45 the center occurs before the undulations could develop.

Figure 6 .
Figure 6.Optical microscopy textures of time sequence of cyclic population oscillation through undulations and partial release of bacteria in 0 45 =  swirls; the sample is prepared with a high goal is to explore whether the agent-based model could describe a transition from the nonpolar individual to collective unipolar circular swimming in a system with finite number of bacteria that interact through the underlying director pattern.Each bacterium is specified by its position ( ) unit vector parallel to the long bacterial axis,  is the angle between the x -axis and the vector p .We use a nematic type of interactions between the bacteria and the passive director, so that the evolution of the bacterial orientation  with respect to the director angle 0  is described by the equation depends on the surface anchoring strength at the bacterial body ( B → ) when the bacteria follow the local director at any moment of time); factor 2 reflects the nematic nature of interactions, in which the outcome does not depend on a realignment of  by  .In the vector form, this relaxation dynamics equation for the bacterial orientation writes ˆˆˆˆ() onto the nematic surrounding, where

n,
Fig.7and Supplemental Movie S5[42], the surface anchoring and elasticity of the passive nematic

Figure 7 .
Figure 7.The individual-to-collective swimming transition in a the 0 45 =  swirls, as illustrated for B 256 n = in Fig. 8 and Supplemental Movie S6 [42].In the circular vortices, 0 90 =  , the bacterial swirl expands with time, Fig. 8g, which is consisted with the experiment and the qualitative active force description, since the radial outward component of the active force is maximum at 0 90 =  .The radii of toroidal swirls, determined at the maximum simulation time T , increase with 0  , again in agreement with the experiment, Fig. 3b.Despite the successful description of the individual-to-collective transition and dependence of swirls dynamics on 0  , we also find certain disagreements between the model and the experiments.minor change with time at the late stages of simulations, Fig. 8g.Once formed, the swirls remain stable and show no undulations as long as the simulations run.Furthermore, in vortices with 0 40   , the simulated microswimmers follow the director 0 n and do not form closed circular swirls, even if their number is as high as 900.The most probable reasons for the discrepancy are that the simulations (i) neglect the finite size and steric interactions of the microswimmers and (ii) do not capture fully the length scale of hydrodynamic interactions of bacteria and the complex pattern of surface anchoring at their bodies (which is especially important at 0 45   since in this case the rod-like bacterium in a swirl forms the pre-patterned director).Further insights are obtained in the continuum (mean-field) analytical approximation of the agent-based model, see Supplemental Material [42].In this approximation, one derives an equation for the concentration of bacteria and the director n ; n is generally different from the prescribed 0 n because of the torques and forces imposed by bacteria.Neglecting the elastic response of the 30 nematic, one obtains an analytical expression for the director n vs concentration, Eq. (S11).The resulting relation is used to solve the problem analytically.The steady-state distributions of concentration vs the radius r for different values of the prepatterned spiral angle are shown in Supplemental Material Fig. S6 [42].In faithful agreement with the agent-based model, one obtains a monotonic increase of the swirl radius with the concentration and the angle 0  , Fig. 8h.

Figure 8 .
Figure 8. Simulation of the agent-based model.Stable circulations settle around vortices with (a) the active force changes sign at 0 45 =  , which leads to accumulation of bacteria at the origin for 0 45  .Higher-order corrections to act σ should improve the agreement.

Figure 9 .
Figure 9. Simulation results of full advection-diffusion model Eqs.(2)-(4).(a) Bacterial concentration (colormap) and nematic field (lines).(b) Full velocity field (colormap and arrows) is a superposition of bacterial self-propulsion speed (magnitude normalized by 1) and hydrodynamic velocity.Panels (a,b) show the regime of stable circulation at 0 80 =  .(c) The dependence of bacterial concentration (maximum value normalized by 1) on distance from the vortex center for various 0  's.(d) Bacterial concentration (colormap) and nematic field (lines) for the regime with undulations.

F
director spiraling counterclockwise, begin to swim collectively, forming swirls that circulate around the vortex center in a clockwise manner.The transition from individual apolar swimming with no net flow to collective unipolar circulation with a net flow is triggered by interactions of bacterial force dipoles in close proximity to each other, mediated by the underlying passive director.The overlap of their hydrodynamic force dipoles, aligned at an angle to each other because of the underlying director pattern, produces an azimuthally-and radially-resolved active force illustrated schematically in Figs.1a,d, 4c,f,i and detailed in the proposed models and simulations.For any director that spirals counterclockwise, in Eq.(5), that coerces the bacteria to swim clockwise.The unipolar circulation is absent in radial vortices, 0 0 =  , in which the bacteria accumulate at the core, and in circular vortices, circulation is bipolar.The active force in these two cases is purely radial, no azimuthal component.The described outcome of bacterial hydrodynamic interactions mediated by the underlying passive director is dramatically different from the case of an isotropic environment.In an isotropic fluid, such as water, the interactions of hydrodynamic force dipoles prevent stable parallel swimming of bacteria and produce turbulent-like incoherent flows[34,35].In contrast, surface anchoring and orientational elasticity of the nematic streamline the interactions of the hydrodynamic force dipoles into coherent dynamic patterns.Although the transition from an individual to collective swimming is associated with realignment of the bacterial bodies from being realignment is steady, as the bacterial swirls maintain their circular shape in a broad range of concentrations and spiral angles.Swirls' radii for a given concentration of bacteria and for the same moment of time increase monotonously with the spiral angle 0  .As a function of 0 and time, the swirls demonstrate three profoundly different long-term scenarios.In the splay-dominated vortices, goes by, the swirls shrink towards the center.In the bend-dominated vortices, expand to the periphery.The collective circular swirling is most stable in vortices with 0 45 =  , where it persists unchanged for a steady level of bacterial activity.These vortices also show the highest speed of collective circulation, which we associate with the fact that the azimuthal component of of a stable limit cycle.If one considers the entire set of vortices, with the spiral angle as a parameter, then this set singles the 0 45 =  vortex as an example of an unstable limit cycle: an increase of 0 expels the bacterial trajectories to the periphery, while a decrease of 0 moves the trajectories closer to the center, in both cases departing the stable circulation with a constant radius.The differences in expansion/contraction is caused by the sign change of the radial component of the active force,  , causing an expansion of swirls.When 0 45 =  , there is no net radial force, so the radius of the bacterial swirl remains constant.The bacterial concentration impacts their collective dynamics very strongly.Steady circulation occurs only within a limited concentration range cr max pp range, the bacteria swim individually, following apolar trajectories parallel to the passive spiral director and creating no net flow.Above this range, the circular bacterial swirls exhibit undulations.The undulating swirls can heal themselves back to the circular shape by opening up and releasing some bacteria, thus reducing the concentration below max p cycle of population oscillations through steady circulation -> undulation -> bacterial release->healing->circulation can repeat itself multiple times.

.
DE-SC0019105 (development of patterned liquid crystal elastomer coatings).This research was completed while RK and ODL participated in KITP Active 20 program, supported in part by the NSF grant PHY-1748958 and NIH grant R25GM067110.The work of ISA was supported by the NSF grant PHY-1707900.begin to undulate and acquire nearly periodic bend with a wavelength of 160μm   , Fig. S1b, while their average speed reaches 9.4μm/s v  S1c, and the average speed increases to 16.6μm/s v 

,
concentration at which the bacterial dynamics becomes unstable with respect to bending instabilities; this result is in good agreement with the data by Zhou et al[2].Radial vortex (aster).In the case of splay, the bacteria swim in and out of the vortex core along the radial directions, Fig.S2c.The bacterial concentration peaks at ~0μm r , and decays quickly with the increase in r , Fig.S2a.The absolute average value of the radial component of velocity, obtained by taking the population average over 90 sec, is 4μmbacteria begin to accumulate in the center[3], Fig.S2d.With time, more bacteria are attracted towards the core, forming an immobilized dense cluster, as shown for 50 s t = in Fig.2eand 70 s t = in Fig.S2f; here the time 0s t = is defined as the starting main text, here c  are the concentrations of bacteria swimming clock/counterclockwise, n is the actual director, 0 V is the bacterium swimming speed, c D is the diffusion coefficient, and  is the direction reversal time (if a bacterium reverses a direction, it leaves the population c + and joins c − or vice versa).

.
case, the experiment demonstrates that the actual director n coincides with the This solution shows a maximum concentration at 0 r = and corresponds to the experiment with individual bacteria.Now let us consider the collective effects.Since the bacteria exert dipolar stresses on the surrounding fluid, they produce an active stress act σ in the form[4] act

2 r.
component of the tensorial divergence is of the form 2 By substituting Eq. (S11) into Eq.(S6) we obtain an implicit first-order nonlinear ordinary differential equation for c + which can be solved numerically.The solutions can be quantified by the total amount of bacteria condition for c + at 0 r =).Plot of c + vs r for different values of total amount of bacteria is shown Fig.S6a.Respectively, the position of the maximum moves right with the increase in 0  , see Fig. S6b.The obtained results exhibit qualitative agreement with experiment and more detailed agent-based and advectiondiffusion models of living liquid crystal.Numerical solution of the Landau-Lifshitz-Gilbert equation for agent-based simulation.The evolution of pre-patterned director is described by the Landau-Lifshitz-Gilbert equation in the formEq.(S8).However, its numerical integration is computationally challenging because Eq. (S8) is higly nonlinear and not too well behaved in topological defects.Instead of Eq. (S8) we solved wellbehaved regularized Ginzburg-Landau equation for the complex order parameter The last term implemets the Landau-Lifshitz-Gilbert dynamics.

Figure S1 .,
Figure S1.Optical microscopy textures demonstrating effects of bacterial concentration on their collective dynamics.(a) In dilute dispersions, 1 V 43 0.3 10 m

Figure S4 .
Figure S4.Velocity map of bacteria averaged over a time interval [0, 60s] and moving in (a)

Figure S5 .
Figure S5.Optical microscopy textures of time sequence of undulations and population change in 50 μm .The video is recorded at 1frame/s and played back at 10 frames/s.Movie S3.Movie of bacteria swimming in a circular swirl ( 50 μm .The video is recorded at 1 frame/s and played back at 10 frames/s.Movie S4.Movie of unidirectional circular swirling of bacteria for 0 bar 50 μm .The video is recorded at 1 frame/s and played back at 10 frames/s.Movie S5.Numerical simulation for 0 45 =  with different number of bacteria.(a) B n = 4, 9, 16; (b) B n = 25, 36, 64; (c) B n = 100, 196, 256.Movie S6.Numerical simulation of B 256 n = bacteria in vortices with different 0  .Numerical simulation of the advection-diffusion model in the regime of undulation instability for 0 85 =  .(a) Director orientation (lines) and amplitude (color); (b) Bacterial concentration difference w c c