## Introduction

Active matter refers to systems composed of self-driven units, such as tissues, bacterial suspensions, or mixtures of biofilaments and motor proteins, that organise their textures and flows autonomously by consuming either stored or ambient free energy1,2. This distinctive hallmark sometimes conceals another significant, and often unappreciated, feature of active systems: their capability to adapt to the environments where they reside. For example, human cancer cells switch between distinct invasion modes when they encounter constrictions in the crowded environment of stroma3, and the growth of bacterial biofilms can be directed by their surroundings4. Moreover, geometrical confinement tends to control active flows, replacing the bulk chaotic flow state often termed active turbulence, by more regular flow configurations. Understanding the subtleties of how this occurs will have relevance to possible future applications of active materials in microfluidics and self-assembly, and in assessing the relevance of the concepts of active matter in the description of biological systems.

Recent contributions dealing with confinement in bacterial suspensions and cell layers have demonstrated a rich range of behaviour. Competition between wall orientation, hydrodynamic interactions, topology and activity lead to a wide variety of flow patterns: spiral vortices5,6, synchronised vortex lattices7, unidirectional flows8,9,10, shear flows11 and freezing12,13. Work on confining active mixtures of microtubules and motor proteins to circular domains14,15,16,17, in vesicles18 or droplets19,20 and to more complex geometries such as tori21,22, have already probed the specific effects of interfacial viscosity, curvature and 3D confinement. These experimental results have prompted parallel simulations23,24,25,26,27,28.

Here we concentrate on active nematics confined to two-dimensional channels. The system is composed of self-propelling elongated units formed by bundled microtubules powered by adenosine triphosphate (ATP)-consuming kinesin29. Early theoretical work predicted that laterally-confined active nematics undergo an instability to spontaneous laminar flow when the channel width reaches a typical length scale that depends on the strength of the activity30. This prediction has been recently confirmed in experiments with spindle-shaped cells11. On the other hand, simulations have predicted that, at higher activities or in wider channels, a structured ‘dancing’ state can be stable in active nematics31. Our aim here is to assess, in a well-controlled and tunable experimental system, and with the support of numerical simulations, the role of confinement in the patterns and dynamics of an active nematic. In particular, we explore the emergence of a new length scale different from the active length that characterizes the unconfined systems. We find a rich dynamical behaviour, depending on the channel width. More specifically, we uncover a defect-free regime of shear flow in narrow channels. This regime is unstable with respect to the nucleation of short-lived defects at the walls. By increasing the channel width, defect lifetime increases, developing a spatio-temporal organization that corresponds to the predicted state of dancing vortical flows31, before full disorganization into the active turbulence regime for still wider channels, as is typical of the unconfined active nematic. We stress the close interplay between the velocity field and the defect dynamics, and highlight the emergence of a new length scale that, contrary to the classical active length scale, does not depend on the activity level but merely on geometrical parameters.

## Results

### Experimental setup

The active system we use comprises microtubules powered by ATP-consuming, two headed kinesin molecular motors29. Addition of the depleting agent polyethylene glycol (PEG) concentrates the microtubules into bundles, hundreds of microns long. Within each bundle the kinesin motors bridge neighbouring microtubules and walk towards their positive ends leading to internal sliding of filaments of opposite polarity. The active nematic was prepared using an open-cell design32, in which 2 μL of the active aqueous microtubule-mixture was placed inside a custom-made pool of 5 mm diameter and was covered with 60 μL of 100 cSt silicon oil (see Methods). Within 30 min, an active nematic layer extends over the whole surface of the pool. Driven by the motors, the microtubule bundles at the interface continuously extend and buckle. This gives rise to a dynamical steady state, termed active turbulence, characterised by high vorticity and by the creation, translation and destruction of topological defects.

The layer of active nematic is confined in rectangular enclosures by means of micro-printed polymer grids of 100 μm thickness that are placed in contact with the oil/aqueous interface (see Fig. 1a). The active nematic is in contact with the active bulk solution underneath, thus ensuring activity and material parameters are equal in all channels. A detailed sketch of the experimental protocol is available in Supplementary Fig. 1.

### Computational setup

To model the dynamics of the confined microtubule-motor system we use a continuum description of a two-dimensional, active gel1,2,33,34. The fields that describe the system are the total density ρ, the velocity u, and the nematic tensor Q = 2q(nn − I/2), that describes both the orientation (n) and the magnitude (q) of alignment of the nematogens.

The nematic tensor is evolved according to the Beris–Edwards equation35

$$\left( {\partial _{\mathrm{t}} + {\boldsymbol{u}} \cdot {\bf{\nabla }}} \right){\mathbf{Q}} - {\mathbf{S}} = {\mathrm{\Gamma }}_{\mathrm{{Q}}}{\mathbf{H}},$$
(1)

where S = ξE − (ΩQ − QΩ) is a generalised advection term, characterising the response of the nematic tensor to velocity gradients. Here, E = (u + uT)/2 is the strain rate tensor, Ω = (uT − u)/2 the vorticity tensor, and ξ is the alignment parameter representing the collective response of the microtubules to velocity gradients. ΓQ is a rotational diffusivity and the molecular field $${\mathbf{H}} = -\frac{\delta {\cal{F}}}{\delta {\mathbf{Q}}}+\frac{\mathbf{I}}{2}{\rm{Tr}} \left(\frac{\delta {\cal{F}}}{\delta {\mathbf{Q}}}\right)$$, models the relaxation of the orientational order to minimise a free energy $${\cal{F}}$$.

The free energy includes two terms. The first is an elastic free energy density, $$\frac{1}{2}K({\bf{\nabla }}{\mathbf{Q}})^2$$, which penalises any deformations in the orientation field of the nematogens and where we assume a single elastic constant K. We note that the free energy functional does not include any Landau-de Gennes bulk free energy terms: all the ordering in the simulations arises from the activity36. This is motivated by the fact that there is no equilibrium nematic order in the experimental system without ATP (i.e., in the absence of active driving). The second contribution to the free energy is a surface anchoring, $$\frac{1}{2}W{\mathrm{Tr}}({\mathbf{Q}} - {\mathbf{Q}}_{\mathrm{D}})^2$$. To correspond to the experiments QD is chosen so that the director prefers to align parallel to the boundary walls. The strength of anchoring at the boundaries, W, is set to values corresponding to weak anchoring so that the nematogens can re-orientate at the walls to allow defects to form there.

The total density ρ satisfies the continuity equation and the velocity u evolves according to

$$\rho (\partial _{\mathrm{{t}}} + {\boldsymbol{u}} \cdot {\bf{\nabla }}){\boldsymbol{u}} = {\bf{\nabla }} \cdot {\bf{{\Pi}}},$$
(2)

where Π is the stress tensor. The stress contributions comprise the active stress Πactive = −ζQ where ζ is the activity coefficient, viscous stress Πviscous = 2ηE, where η is the viscosity, and the elastic stresses $${\bf{\Pi}}^{\mathrm{elastic}} = - P{\mathbf{I}} - 2\xi q{\mathbf{H}} + {\mathbf{Q}}\cdot {\mathbf{H}} - {\mathbf{H}}\cdot {\mathbf{Q}} - {\bf{\nabla }}{\mathbf{Q}}\frac{{\delta {\cal{F}}}}{{\delta {\bf{\nabla }}{\mathbf{Q}}}}$$, where $$P = p - \frac{K}{2}({\bf{\nabla }}{\mathbf{Q}})^2$$ is the modified pressure. Equations (1) and (2) were solved numerically using a hybrid lattice–Boltzmann method37,38. In the experiments the microtubules slide over the walls and therefore free-slip boundary condition were imposed on the velocity field. See Methods for simulation parameters.

### Flow states

The main experimental control parameters of our system are the channel width, w, and the concentration of ATP, which determines the activity. In this section, we describe how both the defect landscape and flow patterns evolve as w is increased based on experiments (Fig. 1b–d) and simulations (Fig. 1e–g). We identify two well-defined regimes: a shear flow regime, observed for w < 80 μm, which is transiently defect-free (Fig. 1b, e, and Supplementary Movies 13), and the dancing defects regime, for w > 90 μm (Fig. 1c, f, and Supplementary Movies 4 and 5). The transition between these two regimes is not sharp. For values of w in the range 80−90 μm, the direction of the shear is not uniform along the channel, but rather composed of patchy domains where shear flow spontaneously arises with a random direction, and is then quickly disrupted by instabilities (see Supplementary Movies 6 and 7). Finally, the unconfined active nematics is obtained for w > 120 μm (Fig. 1d, g).

We find that the relevant parameter setting the dynamic state in the system is λ/w, where λ is the mean defect separation (Fig. 2). The latter is defined as λ = (Lw/N)1/2, where L is the length of a given channel, w its width, and N the number of defects averaged in time. For unconfined active nematics, this length scale coincides with $$l_{\mathrm{a}} = \sqrt {K/\zeta }$$, often referred to as the active length-scale, which determines the vortex size distribution and corresponds to the mean defect separation14,38,39. However, we find that, in confined active nematics, λ is no longer equal to la. Instead, it significantly decreases with the channel width (see Supplementary Fig. 2).

In the following, the flow dynamics and the defect landscape are analysed, combining experiments and simulations, for the simple shear (Fig. 3a), flow switching (Fig. 3b), and defect dancing (Fig. 3c) regimes.

### Defect-free shear flow disrupted by instabilities

The shear flow regime is a defect-free state that appears for λ/w > 1 (Fig. 2), experimentally realized here for w < 80 μm. The active material is primarily aligned parallel to the walls over distances that can persist along the whole channel as shown in Fig. 3a. A global shear deformation is observed, with flows along the channel (Supplementary Fig. 3). The maximum velocities are measured at the walls, with opposite signs, and the velocity perpendicular to the walls is negligible. The shear rate, characterised by the slope of the velocity profile, is approximately constant over a relatively large range of channel widths. This is as expected because the activity, and hence the energy input per unit area, which must be balanced by the viscous dissipation due to the shear, is the same for all channels.

This aligned, defect-free configuration shares visual similarities with the banding patterns that emerge in simulations of dry systems of self-propelled particles with nematic alignment40,41. A fundamental difference with our system, which is continuous rather than composed of discrete particles, is the fact that, in our case, nematic order in intrinsic, and flow alignment is the result of hydrodynamic and elastic interactions with the boundaries. In contrast, in the mentioned dry systems, nematic order is restricted to bands that arise from giant density fluctuations allowed by the compressible nature of the particle ensembles.

Extensile active nematics, such as the one that we use here, are intrinsically unstable to bend deformations30,42,43,44 in aligned conformations. As a consequence, the sheared state eventually leads to local bend instabilities as shown in Fig. 3b. As a result, the velocity field repeatedly switches between two different states: longitudinal shear flow and a transversal instability regime (see Supplementary Movies 1 and 2). The dynamics of the switching behaviour and the coexistence of the shear and the instability states can be best illustrated in a space-time diagram of the averaged velocity components in the channel, as shown in Fig. 3d, e. In the shear state, the velocity perpendicular to the boundaries and averaged across the channel width, 〈Vy(x)〉y, vanishes, while the velocity component parallel to the channel walls and averaged along the channel length, 〈Vx(y)〉x, is maximum at the walls. Once bend instabilities are triggered, defect pairs form and +1/2 defects propagate across the channel and dismantle the shear state, which leads to the emergence of non-zero values of 〈Vy(x)〉y with a well-defined length scale along the channel. The defects eventually reach the opposing wall and annihilate, such that the shear state is reestablished. As is apparent from Fig. 3d, e, over time the active system alternates between the two regimes. Simulations allowed to test channel widths well below the experimental capabilities, allowing to explore the λw regime. For these conditions, we observed stable shear flow, as any pairs of defects that were generated at the channel walls immediately self-annihilated (see Supplementary Movie 8).

The instability takes the form of a sinusoidal deformation of the aligned nematic field, with a well-defined length-scale along the channel. As the perturbation progresses, defects are rapidly nucleated from the walls, at regularly-spaced positions coinciding with the maxima of the sinusoidal perturbation. We measured the wavelength of the instability and found that it scales with the channel width (Fig. 4a–c). This is strong evidence that the hydrodynamics is screened, and that the channel width is important in controlling the flows.

Upon their nucleation at the boundaries, the orientation of the +1/2 defects is strongly anisotropic (see Fig. 5a). They preferentially align perpendicular to the walls and, due to their active self-propulsion25,29,45, they move away from the walls into the bulk. On the contrary, because of their three-fold symmetric configuration, −1/2 defects have no self-propulsion and remain in the vicinity of the walls31. Eventually, the +1/2 defects reach the opposite wall and annihilate with negative defects residing close to it. In this way, the defect-free phase is periodically restored (see Supplementary Movie 3). Remarkably, even though no chirality is observed in the sheared state, as we repeat the experiments, the handedness of the shear flow initially selected is preserved through successive instability cycles. This memory can be explained by observing that the instability is triggered locally and that it is entrained by the neighbouring sheared regions.

In a recent paper Opathalage et al.17 have reported similar defect nucleation at the boundaries for a microtubule/kinesin mixture in circular confinement with no-slip boundary conditions and planar anchoring. They attribute the rate of defect formation to a combination of the build-up of microtubule density at the boundary increasing local active stresses and a change in the azimuthal force as circular flows wind the microtubules around the confining disk. In our experiments and simulations variation of microtubule density across the channel is small (except in defect cores) and the instability period is controlled by the time taken to realign the microtubules parallel to the walls after each instability. This realignement period not only decreases significantly for increasing channel width, but also for increasing activity as shown in Supplementary Fig. 4.

### The dancing state: a one-dimensional line of flow vortices

Increasing the channel width to values between 90 and 120 μm, one-dimensional arrays of vortices are observed as shown in Fig. 3c. A close look at the defect distribution reveals that the transition to the flow state with organised vorticity arrays corresponds to the point when the channel can accommodate more than one defect in its cross-section, i.e., λ/w < 1 (Fig. 2). One could expect that this criterion is reached when the channel width becomes comparable to the active length-scale. However as shown in Fig. 2, la/w is still much larger than 1 in the range of the dancing state, i.e., λla. Furthermore, contrary to the la/w curves, λ/w does not seem to depend on activity, supporting the idea that λ is indeed a pure geometrical feature. Dynamically, the system behaves as if two distinct populations of positive defects are travelling along the channel in opposite directions, passing around each other in a sinusoidal-like motion. A similar state had been predicted by simulations and was referred to as the dancing state31. However, contrary to the published simulations, the dancing state observed in our experiments is quite fragile, and vortex lattices are always transient and localised in space. Defects may annihilate with their negative counterparts, or even switch their direction of motion, thus perturbing the flow pattern (see Supplementary Movies 4 and 5). The difference between the spatial organisation of oppositely charged defects in the confined active nematic is manifest in their arrangement across the width of the channel (Fig. 5b and Supplementary Fig. 5a–c). The distribution of the +1/2 defects has a single peak at the centre of the channel (Fig. 5b, green). On the other hand, the −1/2 defect distribution has two peaks, one at each of the boundary walls (Fig. 5b, blue) and the profiles do not rescale with the channel width. Instead, the wall-peak distance is approximately constant at a separation ~18 μm from the wall, as shown in Supplementary Fig. 5d. This can be attributed to −1/2 defects having no self-propulsion and thus interacting elastically with the channel walls46. The distance of the −1/2 defect from the walls is therefore expected to be controlled by the intrinsic anchoring penetration length of the nematic ln = K/W, which is set by the competition between the orientational elastic constant K and the strength of the anchoring at the wall W, and is independent of the channel width and activity of the particles. As expected, for wider channels, w > 120 μm, the difference between the +1/2 and −1/2 defect distributions diminishes as active turbulence is established (see Supplementary Fig. 5c). We observed a similar behaviour in the simulations, but the −1/2 defects were more strongly localised near the walls, and the +1/2 defects consequently tended to lie towards the centre of the channel (Fig. 5b). Simulations have also allowed us to pinpoint the necessary boundary conditions at the channel walls to trigger defect nucleation. We find that such a localised defect formation at the walls is obtained only for free-slip boundary conditions for the velocity, and weak planar anchoring boundary conditions for the nematic director field. This is because the free-slip velocity, together with the parallel anchoring of the director, allows for strong tangential active flows, and hence strong tangential nematic order, to develop along the boundaries. This results in bend instabilities that grow perpendicular to the walls with the weak strength of the anchoring allowing the director to deviate from a planar configuration at the positions where the bend instability is developed. Our previous simulations that assumed no-slip velocity and strong alignment conditions on the confinement did not observe defect nucleation at the boundaries31,47, and showed insensitivity of the active nematic patterns to the boundary conditions47. This is because the strong anchoring used in these works prevented defects forming at the walls.

It is, however, interesting to note that a recent computational study, based on a kinetic approach, has reported a special case of defect nucleation at the boundaries of an active nematic confined within a circular geometry with no-slip velocity boundary condition and free anchoring48. However, in that work the wall-bound defect nucleation was observed only for confining disks of small sizes and had a very different dynamics than that reported here: the +1 defect imposed by the circular geometry was first dissociated into two +1/2 defects and then, for sufficiently small confinement one of the +1/2 defects kept moving into and out of the boundary. This is in contrast to our results that show regularly-spaced defect pair nucleation sites at the boundaries for a range of channel widths. Moreover, we find that the corresponding defect spacing is governed by an instability wavelength that is no longer given by the conventional active length scale.

## Discussion

We have presented experimental results, supported by continuum simulations, investigating the flow and defect configurations of an active nematic confined to rectangular channels of varying width. Our experiments have identified a new dynamical state, where well-defined shear flow alternates in a regular way with bursts of instability characterised by +1/2 topological defects moving across the channel. We have also shown that, for wider channels, it is possible to identify the dancing state31, although the particular boundary conditions considered in the present work make it less stable.

Our work highlights the importance of topological defects in controlling the confined flows. Because the microtubules have weak planar anchoring and can freely slide along the channel walls, pairs of ±1/2 defects form at the walls of the channel. The +1/2 defects are self-propelled and move away from the walls whereas the −1/2 defects remain close to the boundaries. The distance to the boundaries is set by the anchoring penetration length. In bulk active nematics the defect spacing is set by the active length scale and, although there is some evidence of long-range ordering49,50,51, defect motion is primarily chaotic. In confinement, however, the defect spacing and the wavelength of the instability are set by the channel width and the defect trajectories are more structured.

Together, experiments and simulations demonstrate a surprisingly rich topological defect dynamics in active nematics under channel confinement, and a sensitive dependence on both channel width and boundary conditions. Therefore, confinement provides a way of controlling active turbulence and defect trajectories, a pre-requisite for using active systems in microfluidic devices.

## Methods

Complementary information about the preparation of active samples and grid manufacturing is given in Supplementary information, together with additional comments on image acquisition and data analysis. Details pertaining to the simulations including a table with all parameter values and a discussion on boundary conditions are also provided.

### Protein preparation

Microtubules (MTs) were polymerized from heterodimeric (ζ, β)-tubulin from bovine brain [a gift from Z. Dogic’s group at Brandeis University (Waltham, MA)], incubated at 37 °C for 30 min in aqueous M2B buffer (80 mM Pipes, 1 mM EGTA, 2 mM MgCl2) prepared with Milli-Q water. The mixture was supplemented with the reducing agent dithiothrethiol (DTT) (Sigma; 43815) and with guanosine-5-[(ζ, β)-methyleno]triphosphate (GMPCPP) (Jena Biosciences; NU-405), a slowly hydrolysable analogue of the biological nucleotide guanosine-5′–triphosphate (GTP) that completely suppresses the dynamic instability of the polymerized tubulin. GMPCPP enhances spontaneous nucleation of MTs, obtaining high-density suspensions of short MTs (1–2 μm). For fluorescence microscopy, 3% of the tubulin was labelled with Alexa 647. Drosophila melanogaster heavy-chain kinesin-1 K401-BCCP-6His (truncated at residue 401, fused to biotin carboxyl carrier protein (BCCP), and labelled with six histidine tags) was expressed in Escherichia coli using the plasmid WC2 from the Gelles Laboratory (Brandeis University) and purified with a nickel column. After dialysis against 500 mM imidazole aqueous buffer, kinesin concentration was estimated by means of absorption spectroscopy. The protein was stored in a 60% (wt.vol−1) aqueous sucrose solution at −80 °C for future use.

### Imaging

Images were acquired using a laser scanning confocal microscope Leica TCS SP2 AOBS with a 10× objective at typical frame rates of 1 image per second. For each experiment and at each time, a frame is acquired in both fluorescence and reflection mode. Fluorescence is used to visualize the nematic field, and reflection images are used for Particle Image Velocimetry (PIV) measurements as explained in the data analysis section.

### Grid manufacturing

The grids are printed using a two-photon polymerization printer, a Nanoscribe GT Photonic Professional device, with a negative-tone photoresist IP-S (Nanoscribe GmbH, Germany) and a ×25 objective. The grids were directly printed on silicon substrates without any preparation to avoid adhesion of the resist to the substrate (plasma cleaning of the substrate, for example, would increase the adhesion). After developing 30 min in propylene glycol monomethyl ether acetate (PGMEA 99,5%, Sigma Aldrich) and 5 min in isopropanol (Technical, VWR), a batch polymerization is performed with UV-exposure (5 min at 80% of light power). After printing onto a silicon wafer, the grids are bound to a vertical glass capillary with a UV-curable glue. The capillary is then delicately manipulated to detach the grids from the printing support. The grids are washed in three steps (iso-propanol, DI water, ethanol) and dried with a nitrogen stream before each experiment. The thickness of the grids is 100 μm, to ensure good mechanical resistance. We have used grids with rectangular openings 1.5 mm long and widths ranging from 30 to 300 μm. Each grid contains different channel widths so that simultaneous experiments can be performed with the same active nematic preparation, thus ensuring that material parameters remain unchanged when comparing different confinement conditions. The micropatterning has a resolution of around 50 nm, much higher than the needs of the experiment. The boundary conditions also appear to be very well defined. We never observe microtubules sticking to the wall. As shown by the flow profiles measured in the shear state, the shear profile extends up to the wall, attesting for a free slip boundary condition. The thickness of the active nematic layer is of the order of a few microns, much thinner than the grids. When the grid comes to the interface, we observe that the bound interface tends to lie somewhere in between the top and bottom of the grid, as shown in Fig. 1c. When the grid impacts the interface, uncontrolled flows may destabilize the active nematic layer. These flows mostly depend on the parallelism upon impact, but also on the wetting properties of the grid. The parallelism is relatively easy to control with micro-screw adjustment. On the other hand, the wetting properties of the grid are still under scrutiny. In our experience, the surface of the grids deteriorates after the first use, therefore the samples are considered single-use.

### Active gel preparation

Biotinylated kinesin motor protein and tetrameric streptavidin (Invitrogen; 43-4301) aqueous suspensions were incubated on ice for 30 min at the specific stoichiometric ratio 2:1 to obtain kinesin–streptavidin motor clusters. MTs were mixed with the motor clusters that acted as cross-linkers, and with ATP (Sigma; A2383) that drove the activity of the gel. The aqueous dispersion contained a nonadsorbing polymeric agent (PEG, 20 kDa; Sigma; 95172) that promoted the formation of filament bundles through depletion. To maintain a constant concentration of ATP during the experiments, an enzymatic ATP-regenerator system was used, consisting on phosphoenolpyruvate (PEP) (Sigma; P7127) that fueled pyruvate kinase/lactate dehydrogenase (PK/LDH) (Invitrogen; 434301) to convert ADP back into ATP. Several antioxidant components were also included in the solution to avoid protein denaturation, and to minimize photobleaching during characterization by means of fluorescence microscopy. Anti-oxydant solution 1 (AO1) contained 15 mg.mL−1 glucose and 2.5 M DTT. Antioxidant solution 2 contained 10 mg.mL−1 glucose oxydase (Sigma G2133) and 1.75 mg.mL−1 catalase (Sigma, C40). Trolox (Sigma, 238813) was used as an additional antioxidant. A high-salt M2B solution was used to raise the MgCl2 concentration. The PEG-based triblock copolymer surfactant Pluronic F-127 (Sigma; P-2443) was added to procure a biocompatible water/oil interface in subsequent steps. Buffer for stock solutions of PEP, DTT, ATP, PEG and Streptavidin was M2B, and we added 20 mM of K2HPO4 to the buffer of catalase, glucose, glucose oxydase and trolox. A typical recipe is summarized in Table 1.

### Data analysis

Statistical information on defect unbinding and defect orientation (Fig. 5) were obtained using the defect detection and tracking Matlab codes developed by Ellis et al.21,22, coupled with a custom-made direction detection Matlab code derived from Vromans and Giomi’s method50. PIV measurements in Fig. 3a–c were obtained using confocal images in reflection mode. In this mode, the active nematic layer exhibits textures that can quite efficiently act as tracers for PIV software. The images were treated with ImageJ PIV plugin52. The data was then processed with custom Matlab codes. Flow profiles were computed using a custom ImageJ plugin. PIV measurements failed to give reliable measurements close to the walls for narrow channels because of a substantial drop of resolution that we attribute to artefacts in the reflection mode. Because of this, for a system in the shear flow state, the longitudinal velocity Vx(y) was determined as follows. For each y position, a kymograph is built by assembling the image profile along the channel (x coordinate) at different times. The inhomogeneous reflected-light intensity results in traces in the x − t plane of the kymograph, whose slope gives Vx(y). The average value of this slope is obtained by computing the FFT of the kymograph image and finding at which angle the FFT has the highest intensity. We repeat the same process for each y coordinate, resulting in the desired flow profile. The kymograph in Fig. 3d was obtained with a custom Matlab code using PIV data from ImageJ as an input. Defect spacing in Fig. 2 was obtained by manually counting the number of defects in a given channel, for at least 10 random frames. Velocities were computed using ImageJ plugin Manual Tracking, averaging the velocities of 10 defects per experiment over their lifetime, typically 15 s.

### Simulations

The Eqs. (1) and (2) of the manuscript are solved using a hybrid lattice–Boltzmann (LB) method. A finite difference scheme was used to solve Eq. (2) on a five-point stencil to discretize the derivatives on a square grid. These are coupled to Navier–Stokes equations, that are solved using lattice–Boltzmann method with the Bhatnagar–Gross–Krook (BGK) approximation and a single relaxation time for the collision operator53. The time integration is performed using PECE predictor–corrector method. The discrete space and time steps are chosen as unity for the LB method. The algorithm is implemented using the C++ programming language.

All simulations were performed on a 1800 × w rectangular grid, where w varied from 30 to 160 lattice sites. The boundary conditions for the velocity field along all walls and corners are free-slip. The boundary conditions for the director field are weak planar along the channel walls, which is implemented via the free energy term $$\frac{1}{2}W{\mathrm{Tr}}({\mathbf{Q}} - {\mathbf{Q}}_{\mathrm{D}})^2$$. The corners have QD such that the director field aligns at an angle of 45 degrees to the length of the channel, on the front-right and back-left corners, and at an angle of 135 degrees on the front-left and back-right corners. The left and right walls have no free energy term applied, and have Neumann boundary conditions.

The parameters used in the simulations are given in Table 2. Initially, we chose parameters in a range that has previously been successful in reproducing the dynamics of experiments in microtubule bundles54,55, and then further refined the parameters via a search in phase space. All simulations were run for up to 300,000 simulation time steps. Some simulations were performed up to 1,000,000 time steps to further test the stability of the simulations.

The initial velocity field was set to zero everywhere in the domain. The orientation of the director field was initialised at an angle of either 0, 35 or 90 degrees to the length of the channel, up to some noise. The noise was implemented using the uniform_real_distribution() function in the standard C++ library. In all simulations, the parameters were set to lattice units.

The figures of the simulations in Figs. 1 and 3a–c were created using the programme Paraview. In Fig. 1, the director field was overlaid on the order parameter field q. In Fig. 3a–c, the director field was overlaid on the vorticity field. The kymograph of the velocity components Vx and Vy in Fig. 3d, e was created using Matlab, by calculating the mean value of the velocity components in a subsection of the channel at any given time. The distributions of the defect positions across the channel width in simulations shown in Fig. 5 and Supplementary Fig. 5 were created using Matlab. Each bar represents the normalised number of defects along a strip of lattice sites parallel to the channel length, of width one lattice site. The supplementary movies of the simulations were created using Paraview, and any defect tracking was created by overlaying the Paraview images with markers from Matlab.

In the simulations, λi was calculated as follows. At any given channel width and time-step, the distance between each +1/2 defect and its nearest neighbour was calculated. The mean of this quantity was then taken, to give the mean defect-defect distance at a fixed time. Then an average over time was taken to give λi for a single simulation. This process was repeated for three different simulations with different initial conditions. The initial conditions were distinguished by the initialisation angle of the director field, which was selected to be 0, 45 and 90 degrees to the length of the channel. The mean value of these λi’s was then taken to give the value plotted in Fig. 4. The standard deviation of these values were used to get the error bars.