Emergent and controllable behaviors of Janus swarmalator collectives Authors: Steven Ceron, Wei Xiao, Holden Watson, Daniela Rus Published: 2026 ABSTRACT AbstractPrevious swarmalator models have uncovered diverse behaviors, but they have assumed that agents interact through a single internal phase variable and are point-like particles, but most natural and robot swarms consist of agents with multiple internal coupling states and have bodies that take up space. Here, we study swarmalators that are space-filling, exhibit an orientation, have multiple spatially separated internal phases, and exhibit asymmetric phase coupling. We focus on the simplest case, where agents couple through two internal phases and demonstrate that this can be used to mimic the behaviors of real-world Janus swarmalators, but demonstrate that the model extends to any number of phases and characterize the behaviors for three, four, and five-phase agents as well as explore how the behaviors change when the model is extended to 3D. We also consider the inverse problem and exploit the control barrier function method to enable global and local control strategies. These strategies enable desired spatial orientation and motion that allow collectives to automatically traverse a complex environment while avoiding obstacles. We characterize several unexpected emergent collective behaviors and demonstrate how a swarmalator collective might be controlled to safely navigate complex environments.Subject terms: Computer science, Mechanical engineering Introduction Swarming1 and synchronization (sync)2,3 are representations of spatial and temporal self-organization that occur at all length scales and in many instances exhibit a co-dependence on each other; natural and artificial collective systems exhibiting dual sync/swarm phenomena include social slime mold4, spermatozoa5,6, and chorusing frogs7,8. Spatial coupling through cohesion or alignment enables swarming, and it has been studied through various frameworks like the Vicsek model9 and Craig Reynold’s algorithm10,11 which produce collective behaviors like those exhibited by flocking birds and schooling fish. Temporal coupling through internal oscillatory state interaction, or phase interaction, enables synchronization, and it has been studied through diverse coupled oscillator models12,13 which have been applied to biology14, physics, and robotics to understand and enable systems in which agents reach consensus and produce global patterns from local, spatially static interactions. Swarming oscillators, swarmalators15, enable us to study the emergent collective behaviors of agents’ whose motions are a function of their pairwise phase interactions and their phase interactions are a function of their relative positions. Recently, swarmalator research has enabled the discovery of diverse behaviors that mimic those exhibited by various natural and artificial collective systems16–21, other studies have revealed novel emergent phenomena in simulations22–27, and some studies have replicated behaviors through robotic experiments28–30. Recently, a Janus coupled oscillator model31 revealed exotic collective behaviors in systems of static agents that couple through two internal oscillating states; we take inspiration from that study and introduce a Janus swarmalator model, where agents spatially and temporally couple to each other through multiple internal states lying at distinct ends, such that each agent translates and rotates as a function of its phase interactions. Although the model can be used to study the collective behavior of agents composed of any number of phases onboard, we mostly focus on the simplest case where agents are rod-like and exhibit two internal phases at opposite ends. The model enables several behaviors that are like those exhibited by various real-world collective systems of Janus nanorods32, predator-prey microrobot swarming behaviors33, and Dictyostelium Discoideum34. We study the emergent collective behaviors within a small portion of the possible exploration space and focus in on two unintuitive oscillatory behaviors, bouncing clusters (agents self-organize into two distinct clusters and oscillate between attraction and repulsion) and radial switching (agents self-organize into a circular formation and proceed to oscillate their positions between the center and the exterior, like convective heat flows). We also demonstrate that the model can be extended to a higher number of phases on each agent, and can enable self-organization in 3D. Using the control barrier function (CBF) method35–40, we also demonstrate that we can control the orientations and motions of the Janus swarmalators so the collective can move through complex 2D and 3D environments. The CBF method allows us to map a constraint defined over system states to a control input constraint (the control inputs being the coupling and orientation parameters of the Janus swarmalator model); past works have used the CBF method to guarantee safety for a system and create a desired formation41,42, but here it enables us to control the model parameters so the collective moves, orients its agents in the desired fashion, and avoids obstacles. This work helps bridge the gap between bottom-up and top-down collective behaviors by introducing a swarmalator model and an applied control method that could be useful for robot swarms across various length scales. Results Model overview Each Janus swarmalator is a space-filling agent that follows an equation of motion and an equation of phase behavior; to help readers understand the model, we have included Supplementary Table 1 in the supplementary material with the relevant symbols and their definitions. Although most of this study focuses on cases where agents are made up of two components (component 1 and component 2) that each exhibit an independent phase and are spatially separated from each other by a fixed distance to form a rod-like agent, as shown in Fig. 1, the model extends to any higher number of components on each agent. The following is agent i’s equation of motion, based on the average of the prescribed velocities for its component 1 (pi,1) and component 2 (pi,2): Overview of Janus Swarmalators. A Two-phase Janus swarmalators are made up of two components that each have independent phases (phases are represented by the color) and whose positions are spatially separated from each other by a distance 2 L; when an agent has two phases, it is a rod. Each rod agent translates and rotates as a function of its phase interactions with the other rod agents in the collection (lower right). B Graphical description of the four types of phase coupling (Kw−z) and spatial-phase coupling (Jw−z) interactions between two rod agents; each agent in the depiction has component 1 on the left and component 2 on the right. (Top) The two agents exhibit symmetric phase coupling and spatial-phase coupling on each other when considering the pairwise interactions between the agents’ component 1’s and between the agents’ component 2’s. (Bottom left) The phase and spatial-phase coupling exhibited by component 2 on component 1 from one agent to another. (Bottom right) The phase and spatial-phase coupling exhibited by component 1 on component 2 from one agent to another. To reduce the size of the exploration space, there is no coupling between components 1 and 2 within a single agent; however, interesting behaviors applicable to robots that couple several of their internal states to each other could emerge if there were coupling between components 1 and 2 within a single agent. Here, each agent is rod-like, which means that in a two-dimensional setting, it has three degrees of freedom, translation along the x and y directions and rotation about the agent’s center. This results from the cumulative effect of pi,1 and pi,2, which are the velocities calculated for components 1 and 2 of an agent based on their interactions with the components of other agents. In Eq. 2, the instantaneous angular velocity of each agent is determined by the difference between the velocities of components 1 and 2; here, ri is the vector normal to the line running between the positions of components 1 and 2 of agent i, as defined in Eq. 3 and shown in Fig. 1A. The positions of components 1 and 2 on each agent (xi,1 and xi,2) can be computed from each agent’s center position xi and its orientation αi; these positions are computed through Eq. 4. In the following, Eq. 5 dictates the prescribed velocity of each component z of agent i as a function of its interaction with component w of another agent j. Here, N is the number of agents in the collective, xi,z is the position of component z of agent i, and xj,w is the position of component w of agent j, θi,z is the phase of component z of agent i, and θj,w is the phase of component w of agent j. The global attraction and repulsion interactions are controlled by the coefficients A and B, respectively, and both parameters are equal to 1. The global spatial attraction and phase-dependent spatial interaction are scaled by a unit vector between two agents’ components’ positions, and the spatial repulsion decreases with distance through a power law model; this enables us to prevent the collapse of the collective and to set a characteristic aggregate length scale. This choice is based on the standard simplified interaction laws commonly used in the swarmalator literature and is not intended to represent a specific physico-chemical potential. When there is no phase-dependent spatial interaction (when Jw−zcos(θj,w−θi,z)=0), the balance between A and B enables agents to attract to each other equally across the collective, but repel as a function of distance, so that the collective does not converge to a small area in space, but instead into a circular cluster. As shown in the heatmap of induced velocities for single-phase and double-phase agents in Supplementary Fig. 1, the single-phase agents are point-like agents that attract/repel to/from a single source while the two-phase agents would have two spatially separated sources such that there are variable levels of attraction/repulsion across the length of the rod agent. The phase-dependent spatial interaction portion of Eq. 5 is controlled by the parameter Jw−z, which has a value of 1 throughout all cases in the main text but is tested with values between −1 and 1 in the Supplementary Information, and reveals a rich set of behaviors. In the cases of two-component Janus swarmalators, there are four sources of interaction between any two agents, and as a result, the equation of prescribed velocity, pi,w−z, has the following four instances: pi,1−1, pi,1−2, pi,2−1, and pi,2−2. The expression for pi,1−1 dictates the prescribed velocity of agent i’s component 1 in response to its interaction with all other agents’ component 1; pi,1−2 dictates the prescribed velocity of agent i’s component 2 in response to its interaction with all other agents’ component 1; pi,2−1 dictates the prescribed velocity of agent i’s component 1 in response to its interaction with all other agents’ component 2; and pi,2−2 dictates the prescribed velocity of agent i’s component 2 in response to its interaction with all other agents’ component 2. The total prescribed velocity of each component is the sum of its two forms of interactions with other agents, defined as pi,1=pi,1−1+pi,2−1 and pi,2=pi,1−2+pi,2−2. These prescribed velocities are then plugged into Eqs. 1 and 2 to find the translational and rotational motion of agent i. Like Eq. 5, two-phase Janus swarmalators enable four instances of the equation of prescribed phase behavior (Eq. 6) that correspond to the phase interaction between component z of agent i and component w of agent j. The total phase behavior of each component is dependent on its two instances of phase interaction with other agents’ components, such that for two agents θ°i,1=ωi,1+θ°i,1−1+θ°i,2−1 and θ°i,2=ωi,2+θ°i,1−2+θ°i,2−2, where ωi,1 is the natural frequency of component 1 on agent i and ωi,2 is component 2’s natural frequency; for simplicity, we keep ωi,z = 0 throughout this initial study on Janus swarmalators. Each component follows a distance-dependent version of the Kuramoto model, such that Kw−z is the phase coupling parameter between components w and z on different agents. Positive Kw−z enables agents’ components w and z to synchronize their phases to each other, while negative Kw−z enables the components to anti-couple. Additional details on the mechanisms of phase interactions and phase-dependent spatial interactions, and their corresponding coupling parameters, are explained in the following section. If there is asymmetry between synchronizing (positive Kw-z) and anti-synchronizing (negative Kw-z) interactions, then this generates spatial-phase frustration in Janus swarmalators. Because each agent contains two components whose phases may simultaneously attract one population of neighbors while repelling another, the collective cannot satisfy all pairwise phase constraints at once. This frustration creates persistent imbalances in the phase-dependent interactions and produces time-varying spatial organization that underlies the bouncing and radial-switching behaviors explored later in the study. Pairwise interactions This model presents sync and swarm agents with homogeneous morphologies but heterogeneous coupling properties. Two-component Janus swarmalators are rod-like agents that exhibit two independent phases, each exhibit independent coupling parameters from one component to another. Asymmetric interactions are enabled through their pairwise spatial and phase coupling interactions controlled through the Jw−z and Kw−z parameters, respectively. The two components on each agent mean there are four possible values for Jw−z and Kw−z, each. The phase coupling parameter, Kw−z represents the four values K1−1, K1−2, K2−1, and K2−2. We explain the pairwise phase coupling behavior between two agents through an example phase coupling matrix, K=K1−1K1−2K2−1K2−2=10−1−1. Here, component 1 synchronizes its phase with other agents’ component 1 (K1−1), component 1 anti-couples with component 2 of other agents (K2−1), component 2 does not change as a function of its phase interaction with other agents’ component 1 (K1−2 = 0), and component 2 anti-couples with other agents’ component 2 phase (K2−2). Similarly, Jw−z represents the four values J1−1, J1−2, J2−1, and J2−2, and can be defined as a matrix: J=J1−1J1−2J2−1J2−2. Throughout the main text, we keep J=1111 since this enables the highest strength for the phase-dependent spatial interaction in the Janus swarmalator model, but in the supplementary information, we explored with other values for J. Simply exploring these two parameters opens an eight-dimensional parameter space. If the number of phases on each agent were increased to three, there would be nine tunable pairwise interactions between agents, which would increase this to an 18-dimensional parameter space. We introduce the effect of heterogeneity on swarmalators through sets of tests within two-dimensional slices of the parameter space (Supplementary Note 1) and quantify the behaviors through several order parameters and metrics of interest (Methods section and Supplementary Note 2). Although we find many unique behaviors (Supplementary Fig. 2), there may be many other useful collective behaviors in alternative slices of the parameter space; however, those other sections of the parameter space are beyond the scope of this study. In the following section, Self-organization in K-Space through cross-component coupling, we explore the heterogeneous phase coupling between the differing components on each agent such that K=0K1−2K2−10 and J=1111, where K1−2 ∈ [−1, 1] and K2−1 ∈ [−1, 1]; we also tested two-dimensional slices in which K1−1 = K2−2 = − 1 and K1−1 = K2−2 = 1 (Supplementary Movie 1). In the Self-organization in K-Space through same-component coupling section, we explore phase coupling heterogeneity between same-phase components by setting K=K1−100K2−2, where K1−1 ∈ [−1, 1] and K2−2 ∈ [−1, 1]; we also tested two-dimensional slices in which K1−2 = K2−1 = − 1 and K1−2 = K2−1 = 1 (Supplementary Movie 2). These slices of controlled heterogeneity enable us to explore a set of symmetric and asymmetric spatial and phase coupling interactions; these are further explored in Supplementary Notes 3–8 and Supplementary Figs. 3–24. We explored similar two-dimensional slices across J-space and found a rich set of behaviors that are further explored in Supplementary Figs. 25–35 and Supplementary Movies 3–4. Self-organization in K-space through cross-component coupling Cross-component coupling refers to the K1−2 - K2−1 parameter space (Supplementary Notes 3–5, Supplementary Figs. 3–7 and Supplementary Movie 1), where there is coupling between opposite components but no coupling between like components. Figure 2 shows a heat map of the orientation order (ρ) (defined in the Materials and Methods section) when K1−1 = K2−2 = 0, which highlights phase coupling-enabled alignment. The quadrant-like separation in the heat map of ρ in Fig. 2A occurs because of the phase coupling of component 1 on component 2 and vice versa; this causes the heat map to be reflected across the line running from [K1−2, K2−1] = [−1, −1] to [K1−2, K2−1] = [1, 1]. The orientation order and the collective behaviors are similar on both sides of the line of symmetry; noteworthy behaviors include radial switching, phase waves, sync states, and swirling. Self-Organization in K-Space Through Cross-component Coupling. A π-bound orientation order (ρ) across K1−2 − K2−1 parameter space when K1−1 = K2−2 = 0. B Radial switching. C Static phase wave. D Static sync. E Static phase wave. F Radial switching. G Vortex static phase wave. H Anti-phase static sync. I Swirling. Source data are provided as a Source Data file. The radial switching behavior (Fig. 2B, F) is distinguished by a circular aggregation in which agents align radially; over time, agents display convection current-like behaviors, where they oscillate between the group’s center and edges because of the simultaneous coupling and anti-coupling between agents’ components. Here, component 1 couples its phase to component 2, but component 2 anti-couples its phase from component 1 ([K1−2, K2−1] = [−1, 1]); the opposite occurs when [K1−2, K2−1] = [1, −1]. The static phase waves (Fig. 2C, E) occur because the two phases within each agent are very similar to each other; this enables the collective to self-organize as if each agent exhibited only one phase. At or close to [K1−2, K2−1] = [0, 1], component 2 freezes its phase while component 1 synchronizes its phase with other agents’ component 2; the opposite occurs at [K1−2, K2−1] = [1, 0]. Two types of static phase waves emerge along these regions of the parameter space; one is a ribbon-like shape (Fig. 2C) and the other is an annulus (Fig. 2E). The two collective formations are common because the individual agents take up space as rods and this causes asymmetric attraction along their individual axes; the point particles in prior studies enabled symmetric attraction. Agents within the annulus formation align along the tangential direction; this occurs because of the attractive interaction between neighboring agents. The asymmetry that enables agents to affect each other more along their axes and form locally parallel groups is visualized through the heat map in Supplementary Fig. 1. The sync states are similar but have key differences that result from phase coupling between opposite components ([K1−2, K2−1] = [1, 1] for Fig. 2D) and anti-coupling between opposite components ([K1−2, K2−1] = [−1, −1] for Fig. 2H). The behavior in Fig. 2H, anti-phase static sync, occurs because there is no phase coupling among like components ([K1−1, K2−2] = [0, 0]) and components 1 and 2 anti-couple between separate agents. The dual anti-coupling causes both components to independently synchronize, but with a phase difference of π between each other; this causes the collective to expand in size because there is higher spatial repulsion and to align along a single direction. The sync state in Fig. 2D has agents pointing along random directions because they are all attracted to each other, which causes a much smaller collective radius than in Fig. 2H. More related details and characterization about these behaviors are included in Supplementary Notes 3–5 and Supplementary Fig. 24. The vortex-like formation occurs at [K1−2, K2−1] = [0, 0] (Fig. 2G) because agents’ phases remain frozen and those with similar phases attract and align along the collective’s local tangential direction. Agents further from the collective centroid tend to be made up of two components that have similar phases to each other, while agents closer to the center tend to have higher inter-component phase differences. This occurs because agents made up of components with two similar phases exhibit a higher overall attraction towards other agents that have two similar phases and a higher overall repulsion towards other agents with differing phases. This enables an annulus-like formation like the one exhibited by the static phase wave; however, agents that are made up of two components with a large phase difference move towards the center because of the global attraction toward other agents. Agents at the center tend to aggregate and align with other agents that have similar phases; however, there is no very clear phase order in this area of the collective. The swirling state ([K1−2, K2−1] = [−1, 0] for Fig. 2I) occurs because component 2 anti-couples with component 1, but component 1 remains frozen; this causes the agents to continually change one of their phases, which enables constant motion. Aggregation and alignment occur among agents with similar phases; however, anti-coupling causes these sites within the collective to self-organize and dissolve; the same behaviors occur at the opposite end of the parameter space at [K1−2, K2−1] = [0, −1]. Self-organization in K-space through same-component coupling Same-component coupling refers to the K1−1 − K2−2 parameter space (Supplementary Notes 6–8, Supplementary Figs. 13–17 and Supplementary Movie 2), where there is coupling between like components but no coupling between opposite components. Figure 3A also exhibits a line of symmetry extending from [K1−1, K2−2] = [−1, −1] to [K1−1, K2−2] = [1, 1] and a quadrant-like separation between trends of the spatial-orientation correlation order (Sρ), which is formally defined in Metrics of Interest in the Methods section. The spatial-orientation correlation order parameter allows us to measure the extent to which an agent’s spatial position is correlated with its spatial orientation, thus allowing us to distinguish between states where all the agents are pointing radially or tangentially (high radially or tangentially) vs. when they are all pointing in the same direction or random directions (low Sρ). The lower left quadrant produces active async states, where the collective is in constant motion because of the anti-coupling (Fig. 3B); this state has some similarities to the swirling behavior; however, when there is swirling, there is high local alignment, whereas in the active async state, agents have random orientations throughout and there seems to be no correlation between the two phases on each agent. When [K1−1, K2−2] = [1, 1], each component independently synchronizes, and the collective reaches the separate-phase static sync mode. Each phase group synchronizes independently, which means that the two phases the collective locks on can have an absolute phase difference ranging between 0 and π. If the phase difference is low, then the collective radius is small, and alignment is disordered; if it is close to π, then the collective radius is larger, and the group has high ρ but low Sρ. Relevant cases and characterizations are shown in Supplementary Figs. 20, 21. The radial switching behavior is also found in the second and fourth quadrants of this parameter space (Fig. 3C, G) because the coupling parameters are like those in the same regions of the K1−2 − K2−1 parameter space. Self-Organization in K-space Through Same-Component Coupling. A π-bound spatial-orientation correlation order (Sρ) across K1−1 − K2−2 parameter space when all K1−2 − K2−1 parameter space is equal to zero. B Active async. C Radial switching. D Dipole cluster. E Separate-phase static sync. F Dipole cluster. G Radial switching. Source data are provided as a Source Data file. When K1−1 > 0 and K2−2 = 0 or K2−2 > 0 and K1−1 = 0, the collective forms a dipole cluster (Fig. 3D, F) that has several resembling features to the static phase waves in the K1−2 − K2−1 parameter space (Fig. 2C, E). When the collective synchronizes one of the two components, several agents made up of two phases that are almost equal attract, align along their axes, and form a dense cluster at the center, while other agents with higher phase difference between their two components pile on further from the center (characterization for the dipole cluster behavior is shown in Supplementary Fig. 22). In simple terms, synchronized components enable the dense cluster, and the frozen phases enable the phase wave band; since agents align their position and orientation according to the phase wave band, there ends up being higher local attraction towards the component of each agent that follows the phase wave band. Agents with the highest phase difference between their two components lie on the sides of the middle band of agents, and these agents point toward the center of the collective. It is worth noting that the component with the synchronized phase always points toward the center of the collective. At the opposite end of the parameter space, when K1−1 < 0 and K2−2 = 0 or K2−2 < 0 and K1−1 = 0, vortices form in which one of the components anti-couples with similar components, and the other component’s phase remains frozen. The anti-coupling components form an async cluster, while the frozen-phase components rearrange throughout the cluster to form a vortex-like phase wave. Oscillatory Janus swarmalators Many of the behaviors that emerge through the model can be understood as two distinct manifestations of oscillatory Janus swarmalators. Because each Janus component participates in phase-dependent attraction or repulsion with specific symmetry (synchronizing or anti-synchronizing), the collective’s global morphology becomes governed by how these coupled oscillators drive time-varying forces. Under equal-and-opposite cross-component coupling, this coupling produces two phase-synchronized groups that periodically chase, repel, and overtake each other, giving rise to the bouncing cluster oscillation. Under opposite-sign same-component coupling, the same oscillatory mechanism instead drives agents to oscillate between the center and outer edges of the collective. In both cases, the emergent behavior arises from heterogeneity in the phase coupling parameters. Bouncing clusters emerge when the coupling parameters fit the conditions K=a−bba. In previous works with point-like swarmalators, bouncing clusters emerged because of heterogeneous natural frequencies (16); here, they result from equal and opposite phase coupling interactions (K1−2 = − K2−1), and all agents have natural frequencies equal to zero. The snapshots shown in Fig. 4A correspond to a collective in which a = 1 and b = 2; the collective splits into two groups of agents that oscillate between attraction and repulsion of each other, and in each group, the agents share similar phases and point along the same general direction. The collective tends to remain in two similar-sized groups when the magnitude of a is low and b is high. At magnitudes of higher a and lower b, the collective splits into two groups, but one group consumes most of the agents from the other group so that the collective instead enters a state in which it is mostly static but oscillates its internal phases. The scatter plot in Fig. 4B demonstrates that the agents share just about the same phase regardless of their angular position about the collective centroid; they synchronize their phases and oscillate together as a function of a and b. Oscillatory Janus Swarmalators. Bouncing clusters are shown in the top panel while the Radial Switching behavior is shown in the bottom panel. A Evolution of bouncing clusters when K1−1 = 1, K1−2 = − 2, K2−1 = 2, and K2−2 = 1. B Scatter plot of phases vs. radial distance from collective centroid for the instance shown in (A). C Heat map of bouncing order across K1−1 − K2−1 parameter space. D Heat map of kinetic energy across K1−1 − K2−1 parameter space. Snapshot of representative collective behavior throughout various regions of the K1−1 − K2−1 parameter space. E Partial bouncing clusters. F Disordered radial oscillation. G Bouncing clusters. H Two-phase groups synchronize independently, and one phase group chases the other phase, while the other outruns it. Scatter plots of ϕ vs. θ when I K1−1 = 2 and K2−1 = 1 and J K1−1 = 1 and K2−1 = 2. K Cluster exhibiting both bouncing cluster and radial switching behaviors; K=100−1. L Collective from (K) with overlaid trajectories of seven agents during the last 2000 time steps of the simulation. M Cluster exhibiting radial switching behavior when K=300−3. N Collective from (M) with overlaid trajectories of seven agents during the last 2000 time steps of the simulation. O Plots of radial position (top) and angular position (bottom) over time for the seven agents whose trajectories are marked in Fig. 4N. P Heat map of the angular position order (AO) across the K1−1 − K2−2 parameter space when K1−2 = K2−1 = 0. Q Heat map of the radial switching order (RO) across the same parameter space. R Heat map of the kinetic energy. Source data are provided as a Source Data file. The heat map of the bouncing order (BO) (Fig. 4C), which is explained in Metrics of Interest in the Methods section, demonstrates a clear demarcation of the region in which the collective splits into two groups of phases that chase and outrun each other with positive and negative frequencies. As shown from the snapshots and the heat map, high BO does not imply two separate clusters; if a = 0, then the synchronization forces are not enough to enable separate clusters (Fig. 4F). Higher magnitude of a enables the two clusters (Fig. 4G); however, the magnitude of b must be higher than a so that the phase-chasing and phase-outrunning behaviors can be exhibited. If the coupling factors do not meet these conditions, then the collective falls into a state like the one shown in Fig. 4H where agents tend to align, and the components synchronize independently, but one phase group chases the other phase group while the second phase group outruns the first. If a = b, then the collective may exhibit a partial bouncing cluster behavior, like what is shown in Fig. 4E. When the collective exhibits partial bouncing cluster behavior, most of the collective aggregates into a single cluster while a small number of agents remain in the periphery. After running many tests for these conditions for a high number of time steps, we found that the collective sometimes converges to a single cluster and other times it remains in the partial bouncing cluster state; this depends on the initial phase conditions. Although the bouncing order enables us to isolate the general region in which the collective separates into two phase groups, with one component increasing its phase over time while the other decreases its phase over time (which is central to the bouncing cluster behavior), the kinetic energy heat map (Fig. 4D) enables us to determine the region of the parameter space with the fastest bouncing behavior exhibited by the two clusters. As shown in the angular position vs. phase scatter plots in Fig. 4I and J, the level of spatial-phase order drastically reduces as the magnitude of b increases. When the magnitude is low, the two phases synchronize independently and oscillate at the same frequency (Fig. 4I). The sign of the instantaneous frequency depends on the initial phase conditions; throughout this study, all agents have a natural frequency equal to zero for both of their phases, so any phase oscillation is the result of the phase coupling constants. Throughout the a-b parameter space, component 1’s couple with component 2’s, while component 2 anti-couples with component 1; in simpler terms, component 1 phases chase component 2 phases while component 2 phases outrun component 1 phases. As shown in Eq. 6, each agent’s phase dynamics is dependent on the phase coupling factors and its distance to other agents. Therefore, at higher magnitudes of b, agents tend to influence each other’s phase behavior more strongly if they are closer in distance. The sign of the instantaneous phase oscillation frequency depends on the agents’ relative phase positioning on the unit circle; with higher magnitude b, the collective can split, with one group of agents having a positive frequency and the second group a negative frequency. As depicted in Fig. 4J, the group of agents with a negative frequency (or moving towards the left in the phase diagram) tends to have more similar angular positions about the collective centroid. More details about this behavior are in Supplementary Note 5, Supplementary Figs. 8–10, and Supplementary Movies 5, 6. Radial switching occurs when there is no cross-component coupling and the same-component coupling factors have opposite signs, such that K=a00−b. This behavior was shown in Figs. 2 and 3 at the upper left and lower right regions of both parameter spaces, where the pairs of cross-component or same-component coupling factors had equal magnitude and opposite sign. As shown in Fig. 4K–N, the magnitudes of a and b determine how agents oscillate between the center and outer regions of the collective. When a and b are unequal to zero, the behavior emerges because each agent has one component that synchronizes with like-components, and the other component anti-couples with like-components. The synchronized phases enable high attraction among the agents, which leads to a circular cluster, especially higher coupling magnitudes; however, the anti-coupling phases enable the collective to remain in constant motion because of the changing phase-dependent spatial attraction and repulsion. Notice in Fig. 4K–N that all agents point the synchronized phase radially inward; this occurs because the synchronized phases hold higher attraction toward each other than the asynchronous phases, and the average location of spatial attraction is the collective’s centroid. Figure 4K shows that when K1−1 = − K2−2 = 1, the collective exhibits an intermediate behavior between radial switching and bouncing clusters. Indeed, from the trajectories of seven agents in Fig. 4L, we see that the agents move between different sides of the collectives, but do not have a clear oscillatory trajectory. When the coupling magnitude is higher (K1−1 = − K2−2 = 3), as is the case for the trajectories shown in Fig. 4N, the agents have a clear oscillatory trajectory between the collective’s center and its periphery. In Fig. 4O, the plots of the radial position (Ri) and angular position about the collective centroid (ϕi) for the seven agents shown in Fig. 4N demonstrate that even as the agents take on noisy radial oscillations, their angular position remains relatively constant. This means that by programming the magnitude of the same-component coupling factors, we can control whether agents have a cyclic radial oscillation while maintaining their orientation and overall similar angular position. The AO order parameter (Fig. 4P) measures the coherence in agents’ angular positions about the collective centroid; AO is defined by Eq. 12 in Metrics of Interest in the Methods section. Since agents can remain static and generate an order of AO = 1, it is also necessary to look at the fraction of agents that oscillate between the inner and outer parts of the collective; this is captured by the radial switching order (RO), which is shown in Fig. 4Q and is defined in the Methods section. By looking at both order parameters, we can find the regions of the parameter space in which agents oscillate most between inner and outer regions and remain around the same angular position. The heat map of the kinetic energy (Fig. 4R) demonstrates the same trend as the one for RO because the amount of motion in the collective within this parameter space is linked to how much agents oscillate between the center and the periphery (Supplementary Movies 7–9). Higher-dimensional Janus swarmalators To demonstrate the power of the model, we explore higher-dimensional Janus swarmalators through two separate avenues, spatially and temporally. We enable the agents to translate and rotate in three dimensions (spatially), and we enable the Janus swarmalators to couple to each other through more than two phases (temporally). Janus swarmalators translating and rotating in three dimensions were enabled by the modified model defined through Eqs. 13–17 in ‘3D Model’ in the Methods section. The emergent collective behaviors shown in Fig. 5 demonstrate that similar behaviors to those seen in 2D emerge in 3D. The vortex formation in 3D is an ellipsoid with equal axes along two dimensions and a smaller axis in the third dimension. The organization of agents about the centroid is like what was observed in the 2D case; agents’ orientation is perpendicular to the radial vector from the collective centroid, and since there is no phase coupling, K=0000, agents organize by phase in a static formation. The scatter plot in Fig. 5B demonstrates how the collective self-organizes radially as a function of the phase difference between an agent’s two components across 10 trials. The sine of the phase difference vs. the radial position exhibits a cone-like self-organization with an open oval region farther away from the center. This occurs because agents with a higher phase difference (close to π) between their two components are closer to the center. Agents with a smaller difference between their two components can create an annulus-like formation, so they tend to be on the outer parts of the collective. This enables agents to either make up the annulus-like formation or get pushed closer towards the center, as shown through the scatter plot. Higher-dimensional Janus swarmalators. Three-dimensional Janus swarmalators are shown in the left panel, while Janus swarmalators coupling through higher numbers of phases are shown on the right panel. (The collective’s final formation for static and dynamic states. A Phase wave. C Dipole cluster. E Bouncing clusters. B, D, F Scatter plots of the sine phase difference between the two components on each agent vs. their radial distance from the collective centroid (Ri). G Scatter plot of the agents’ phases vs. their radial distance from the collective centroid for the case shown in (E). H–J Phase waves exhibited by agents with three, four, and five phases, respectively. K–M Bouncing Clusters. N, O Scatter plots of the angular position about the collective centroid vs. phase for the cases shown in (K) and (M), respectively. Source data are provided as a Source Data file. The dipole cluster (Fig. 5C) exhibits a similar scatter plot (Fig. 5D), but with a larger open space and less organization at lower radial distances. This occurs because in this case, there is phase coupling, which enables all agents to synchronize one phase and some agents to move towards the collective center and create a phase wave-like formation down the collective’s middle. At higher distances, agents form two dispersed clusters that split the collective into two halves. In each of these clusters, phase 1 synchronizes while phase 2 anti-couples. In this case, the dipole cluster is not fully static but exhibits some radial switching behavior since K=−1001. Most likely, the radial switching behavior is not as obvious as in the 2D cases because the distance between agents in 3D is higher and thus agents affect each other less through phase coupling than they did otherwise. Further exploration of the parameter space in 3D will yield the parameters at which high radial switching behavior occurs and will most likely reveal new behaviors that were not observed in 2D. The bouncing clusters also extend to 3D; two hemispheres form, and the agents orient themselves toward the collective’s centroid. The collective has many agents with a sine phase difference equal to 1 or -1 because the bouncing behavior tends to move agents toward an internal phase difference of π. For the 2D cases, there was not much self-organization of phases as a function of radial position; however, for the 3D cases, there is linear alignment in the scatter plot (Fig. 5G) at higher distances away from the centroid. Supplementary Movie 10 shows videos of these diverse behaviors in three dimensions. The Janus swarmalator model can be extended to any higher number of phases, and as shown in Fig. 5, agents with three, four, and five phases can exhibit the static phase wave and bouncing clusters behaviors (Supplementary Figs. 48–61 and Supplementary Movies 11, 12). The phase wave shown in Fig. 5H–J, demonstrates that even though each agent starts out with higher numbers of randomly generated phases, the collective can still self-organize into the classic phase wave/vortex formations. Higher phase differences between the phase components on each agent tend to cause those agents to move towards the center, while those with lower phase differences between their components tend to move towards the outer regions of the collective to form the annulus-like formation. This is very similar to the behavior observed with two-phase Janus swarmalators; however, in the two-phase cases, there was high spatial-orientation correlation order. Here, it is evident from the final formations that the correlation order is much lower for higher numbers of phases. This is because of the higher density of pairwise interactions between different phases, which pull agents in random orientations, especially when there are no synchronization forces at play. When the collective exhibits the bouncing cluster behavior (Fig. 5K–M), the final state demonstrates that the agents align even when they are five-phase Janus swarmalators. The collective splits into two clusters; half the collective has a negative instantaneous frequency, and the other half a positive instantaneous frequency. The higher number of phases ensures that there is higher disorder throughout the collective, which makes it more difficult for the collective to converge into a single cluster with all phases having the same sign for the frequency. As shown in Fig. 5N, O, each of the phase components synchronizes within its cluster and chases/outrun the other phase component (Supplementary Note 10). Controllable behaviors within complex environments Discrete sections of the coupling parameter space have revealed diverse behaviors; however, from a robotics perspective, the true power of this model is revealed when we specify the desired behavior for a particular situation, and the collective is automatically controlled to execute the desired behavior. Figure 6 demonstrates several ways in which the Janus swarmalators can be controlled so the collective formation adjusts according to the surrounding environment, so the orientations of the agents are along a specified direction according to the motion of the collective or the user’s desires, and so the motion of the collective follows some desired trajectory given the surrounding environment. To accomplish controllable behaviors, we can rewrite the model in controllable form: Controllable Janus swarmalators. A Global control for collective motion and obstacle avoidance; the collective switches to a synchronized cluster so it fits between two obstacles, while automatically generating a path that avoids intersecting the collective with the obstacles. B Local control to enable each agent to control its orientation so that it points along a desired direction depending on its position within the collective. C Global and local control to enable motion through a 2D maze: a collective of 20 agents forms a synchronized cluster in which the agents traverse the maze from start to finish; this is done while the agents change their orientation according to the direction of the hallways in which the collective needs to travel. The final trajectory is generated through feedback from the barrier function constraints, which control the swarmalators so they avoid obstacles as they move toward the pre-scripted waypoints that will enable the group to make it from one end of the maze to the other end of the maze. D The collective moves through a 3D maze-like environment; its trajectory is automatically generated for the given environment, and it changes its size so it can fill up open spaces and cross through narrow gaps in the walls. Here, u∈RD is a global controller shared among all the agents, and ui is a local controller for each agent i. This local controller is designed such that the orientation control of the agent will not change its location, which can minimally affect the formation. There are two main objectives in controlling a swarmalator: (1) making the swarm track an arbitrary trajectory while avoiding a collision with any of the surrounding obstacles, and (2) changing the orientation of a subset of the swarm to a desired direction. Details about the global and local control are included in Controllable Janus Swarmalators in the Methods section. Global control can be used to achieve the collective motion indicated in Fig. 6A, where the collective transitions from a disordered group to a sync state and moves in between two obstacles. The collective needs to transition to a sync state to shrink its radius and be able to pass between the two obstacles. The collective’s trajectory fulfills the requirement that it must move from the left to the right side of the obstacles and that none of the agents can collide with the objects. Figure 6B demonstrates local control by starting off with a collective in which agents are oriented in random directions, then they point along the same direction, and then they point along a direction depending on their distance to the collective’s centroid. The stage in which all agents point in the same direction is enabled by [K1−2, K2−1] = [−1, −1], and the next stage is enabled by local control. By combining both global and local control for the 2D and 3D versions of the model, we can enable the collective to move through tight spaces and complex trajectories, as shown in Fig. 6C, D. In Fig. 6C, the agents change their orientation so that it aligns in the same direction as the nearby walls of the maze they are moving through. The agents also change their orientations for the implementation in Fig. 6D, depending on whether they are passing through one of the circular holes in the wall. These behaviors are best visualized through Supplementary Movie 13. Discussion The Janus swarmalator model provides a general framework for bridging theoretical studies of coupled oscillators with the physical realizations of active and robotic swarms composed of anisotropic, rod-like agents. By coupling two spatially separated internal states, this model captures behaviors reminiscent of experimental active-matter systems where polarity and geometry drive complex emergent dynamics. This connection establishes a foundation for extending swarmalator theory toward systems that can be realized in laboratory settings, such as magnetic or optical Janus colloids with programmable feedback. The emergent behaviors observed in the Janus swarmalator model are programmed through global coupling parameters, such that the collective’s shape, motion, and phase coherence can be controlled on-demand. We found 12 different behaviors, including bouncing clusters, radially switching clusters, and vortex phase waves. By characterizing the collective’s behavior through various metrics and order parameters, including kinetic energy, orientation coherence, and spatial-phase correlation, we were able to understand many of the underlying mechanisms that lead the collective to exhibit these behaviors for specific coupling parameters. We found a variety of static and dynamic states, exploited antagonistic coupling to discover new collective behaviors, and studied how the model behaved in a three-dimensional setting. Moreover, we demonstrated how the Janus swarmalators could be controlled for robotic applications using the CBF method; specifically, we demonstrated that we could enable global control to guide the collective in and around an obstacle course, and local control to change each agent’s orientation depending on its position within the collective or the collective’s motion through a certain 2D or 3D environment. Beyond reproducing spontaneous collective behaviors, the integration of control enables a new direction for swarmalator-based systems and helps transform them from passive to controllable collectives that can be steered in real time. Such feedback-based control could be directly applied to experimental active colloid systems, where optical or magnetic fields modulate particle motion, akin to demonstrations by Bechinger and others43. In this context, the control barrier function framework developed here provides a principled way to ensure collision-free, goal-directed behaviors in active matter systems. This work may help guide future swarmalator studies that consider agents that exhibit orientation, multiple temporal variables, and take up space, and will help bridge the gap between active matter self-organization and controllable swarming behaviors. Methods Metrics of Interest Throughout the main text, we characterize the emergent collective behaviors of the Janus swarmalators through several general metrics across two-dimensional slices of the pairwise coupling parameter space. Most of the metrics are defined and further discussed in Supplementary Note 2; they enable us to quantify the amount of order that a population of Janus swarmalators exhibits with a given set of pairwise coupling parameters. For clarity, several of the emergent behaviors within the phase coupling parameter space are mapped to heat maps of one of the metrics. In the main text, we are concerned with orientation order (ρ), spatial-orientation correlation order (Sρ), and kinetic energy (KE). In Eq. 8, ρ is the degree of coherence in the agents’ orientations. This order parameter is better defined as the π-bound orientation order because any two agents with an orientation (αi) difference of π will be regarded as having the same orientation for this metric. ρ has a value between 0 and 1, with ρ ≈ 0 meaning they are all oriented along random directions (or possibly half the agents are aligned along a single linear direction and the other half are aligned along a perpendicular direction), and ρ ≈ 1 meaning all agents are aligned along a single direction. Equation 9 defines Sρ, which quantifies how organized the agents’ orientations (π-bound) are about the collective’s circumference. Here, ϕj is agent j’s angular position about the collective centroid within the global reference frame. Sρ ≈ 0 either means the agents are oriented in random directions or they are all aligned along a particular direction. If all agents have the same orientation (or are offset by π), then there is no correlation between spatial position about the collective centroid and an agent’s orientation. When Sρ ≈ 1, the agents’ orientations are well-distributed around the circumference. This could mean that the agents are pointing out radially or are each perpendicular to the radial vector passing through them. The third general metric is kinetic energy and is defined in Eq. 10. Since agents can translate and rotate, their speed and angular velocity are considered through x°i and αi°, respectively. Each of these metrics are calculated and averaged across the last 600 time steps of each 3000-time step test; the collective has reached a steady state in this time period. We also include heat maps of other order parameters that are relevant to distinguishing behaviors; however, we define those parameters in the relevant sections. In the Supplementary Information, we define other relevant order parameters, plot their heat maps across the various parameter spaces, and explain the mechanisms that lead the collective to exhibit the various behaviors. The bouncing order (BO) is defined by the following function in Eq. 11 to compute how much the collective splits into two groups. Here, Nθ°1,2>0 denotes the number of components with an instantaneous positive frequency and Nθ°1,2<0 is the number of components with an instantaneous negative frequency. This is computed for the last 1000 timesteps of each test and averaged across those time steps and across all trials. If the collective is perfectly split into two groups, BO = 1; this means half the components have a phase that is positively changing and half the components have a phase that is negatively changing. To quantify how well-organized agents move within the parameter space relevant to the radial switching order, we developed two order parameters, angular position order (AO) and radial switching order (RO). AO is defined by Eq. 12 and RO in the following paragraph. Here, Tf is the final time step and Ts is the first time step of interest for the order parameter (Ts = 1000 was chosen across all tests to exclude the transient period). AO indicates how much each agent remains close to the same angular position throughout a test. AO = 1 when all agents remain at constant angular positions once the collective has reached a steady state; AO = 0 when each agent moves all the way around the collective’s circumference. This order parameter is only useful for short time windows; if we extend the simulation time and increase the time window of interest too much, then AO will lose any meaning because, although each path is linear between the periphery and the center in the cleanest radial switching state, over time each agent shifts angular position and may make its way around the centroid if given enough time. Therefore, when evaluating this metric, we were careful to start after the transient period and choose a time period in which agents could only make 1–2 treks between the periphery and center. The order parameter RO is computed by determining the fraction of agents that have fulfilled each of the following conditions at least twice during a test, Ri < 0.3 R and Ri > 0.7 R, where Ri is each agent’s radial position with respect to the centroid and R is the collective radius. Using these two metrics, we can isolate the regions of the a − b parameter space in which the collective exhibits the cleanest radial switching behavior. Model for 3D Janus swarmalators In the model for the 3D Janus swarmalators, the definition for the prescribed velocity of each component stayed the same as it was for the 2D Janus swarmalators, except that now the components affected each other in three dimensions. Each agent’s orientation (αi) was defined by Eq. 13; it is a unit vector pointing from component 2 to component 1. For each time step, Eq. 14 was used to compute the new orientation for each agent. When the agents were interacting in 2D, there was one axis of rotation; however, in 3D there are three axes of rotation. Since agents are rod-like elements with an infinitesimally thin rod, there is only rotation along two axes, the angular velocity along these two axes can be defined by the vector, α°i (Eq. 15). Ωi is defined in Eq. 16 and it is the vector quantity of the rotational torque about the axis of rotation, k, which is defined in Eq. 17; Ωi is the equivalent of an applied torque on the rod (τ = r × F). A graphical representation of the rotation of these elements is shown in Supplementary Fig. 62 and more information about behaviors in 3D can be found in Supplementary Figs. 63–64. Controllable Janus Swarmalators Global control is the first objective, and it consists of making the swarm track an arbitrary trajectory (given by a sequence of waypoints) while avoiding a collision with any of the surrounding obstacles. Local control is the second objective, and it consists of changing the orientation of a subset of the swarm to a desired direction (it can also be used to change the location of a subset of the swarm). The methods for accomplishing both objectives are defined here, and they break new ground for cyber-physical active colloidal feedback systems, such as those investigated experimentally43. For the first objective, there is no control over the agents’ orientations, so we set ui to zero, and there are several safety specifications defined by hkxi≥0,k∈S, where hk:RD\toR, S is the subset of environmental obstacles for each agent, and a desired location xd∈R2 (or a sequence of waypoints) for the collective. The safety specification for each agent can be transformed by the following constraint to a specification of the whole collective: where μ:RnxD→RD is a mean function over the position of all the agents, r:RnxD\toR is the radius of the collective with respect to the center calculated by μ, and ∘ denotes the composition of two functions. We impose obstacle avoidance and tracking with the Lyapunov method by taking the Lie derivative of the specification along the dynamics (Eq. 7). The safety functions hk(xi) define a minimum allowable distance between each agent and obstacle boundaries. The swarmalator coupling (Eq. 7) remains active and governs how agents reorganize spatially while the barrier-function constraint biases collective motion to satisfy hk(xi)≥0. Thus, obstacle avoidance and shape adaptation emerge jointly from swarmalator interactions and feedback control, rather than from a pre-defined trajectory. Specifically, we define each bk(x) as a barrier function, and we get the following state-feedback controller: Here, γ>0 is a scalar gain constant that determines the rate of convergence (Lyapunov term) and constraint enforcement (barrier term), respectively. The function x°(x,u) corresponds directly to the first-order swarmalator dynamics in Eq. 7, where the control input u enters linearly as an additive velocity term. In other words, γ>0 has a scalar value, and x°x,u is a linear function on the global control u given in Eqs. 1, 2, and 7. We can show that if bkx0≥0, then any global control u that satisfies the above constraint can ensure bkxt≥0,∀t≥0 (i.e. hkxi≥0). To enforce the tracking task for the collective, we define a Lyapunov function in the form V∘μx=∣μx−xd∣2, and then we can get a similar constraint as in Eq. 19. Where ϵ>0 is some scalar, x°x,u is also a linear function on u following Eq. 18. We can also show that any global control on u that satisfies the above constraint stabilizes the state μ(x) to xd. Equation 20 is obtained by taking the Lie derivative of the safety function bkx along the swarmalator dynamics of Eq. (7), which yields a constraint on u ensuring that the time derivative of bkx remains non-negative. Now we can formulate the following (global) optimization to achieve the first objective: Here, δ\inR is a relaxation variable that ensures the constraints will not conflict (we always relax the tracking task when it conflicts with the obstacle avoidance task). umin∈R2 and umax∈R2 denote the minimum and maximum control bounds, respectively. This optimization becomes a Quadratic Program (QP) at a given x. Thus, we can solve the problem efficiently by finding a reactive global controller. Intuitively, these conditions define a convex optimization at each timestep that finds the smallest change to the desired swarm velocity while maintaining safety. Therefore, this approach could be made compatible with other agent models such as active Brownian particles or phototactic colloids. The local control method follows similarly to the global control method given in the form of Eq. 21. For local control, the global controller u does not have much effect on the agents’ orientations; therefore, we set u=0. In this case, we define a Lyapunov function Viαi=(αi−αd)2 for each agent to achieve the desired orientation αd∈R, and the local controller ui should satisfy the following constraint to enforce this objective: where ϵi>0,αi°αi,ui is a linear function on ui. We can also formulate a local optimization for each agent as was done in Eq. 21: where δi∈R is a relaxation variable that ensures the constraints will not conflict. ui,min∈R2, ui,max∈R2 denote the local minimum and maximum control bounds, respectively. The above becomes a QP at a given x and we can solve it similarly as in Eq. 21. If we wish to introduce the Janus swarmalators to situations in which both objectives are necessary, then we can solve Eq. 21 and then Eqs. 22–23 so we can find the global and local controllers u and ui, respectively. To ease the understanding of the above formalism for those not in the control theory community, we describe here in more general language how the two control methods work. Our intention is to enable researchers from the active matter community to take advantage of the control methods presented here. The first control method presented is global control, which is used to steer the whole group; it treats the collective as a deformable body for which its position is defined by the average position of all agents and its size is defined by the collective’s radius. We define constraints that keep the collective’s center and its outer agents away from obstacles, and we express these as functions that need to remain non-negative over time. The collective is made to move toward a desired target location or through a set of waypoints by employing a Lyapunov function, which is essentially a virtual “energy” that measures the squared distance between the collective’s center and the goal location, and we require it to decrease over time with the motion of the collective. To ensure that the collective remains safe and continues moving toward its goal, we look at how the safety and tracking functions change over time. This means that the safety function’s value is not allowed to decrease below zero, since this would mean the collective has collided with obstacles, and that the tracking function also decreases over time, even with the safety constraint, so that the collective moves toward the target location. These constraints impact how the collective moves over time, and the controller must automatically choose inputs at each time step that satisfy those constraints. We then formulate an optimization problem that seeks the control inputs that minimize effort (i.e., the size of the control signal) while satisfying these constraints. This problem is expressed as a QP and is solved for each time step. Our local control method focuses on adjusting the agents’ orientation. We do this by defining a Lyapunov-like function for each agent so that it measures the squared difference between the agent’s current orientation and the desired orientation. Just like with the global control method, we require this to decrease over time. The control methods presented here can be employed on any kind of swarmalator model, as well as on other types of agent-based active matter models like active Brownian particles, the Vicsek model9, any other model that may be applicable to only specific systems like the run-and-tumble particles model (for E. Coli)44, and possibly an experimentally realized active colloidal system with programmable alignment interactions and tunable collective states43. Using the control method presented here, Eqs. 1, 2, and 7, which describe the dynamics of the Janus swarmalators, simply need to be replaced by the equations corresponding to the dynamics of the agent-based active matter model that the user wishes to apply control to. Simulations More information about the simulation parameters and methods can be found in the supplementary information. All simulations were run on MATLAB. Supplementary information Supplementary Information Description of Additional Supplementary Files Movie 1 Movie 2 Movie 3 Movie 4 Movie 5 Movie 6 Movie 7 Movie 8 Movie 9 Movie 10 Movie 11 Movie 12 Movie 13 Transparent Peer Review file Source data Source Data Acknowledgements We thank Gaurav Gardi, Kevin O’Keeffe, and Alexandra Nilles for fruitful discussions about the Janus swarmalator framework and its potential uses. Author contributions S.C., W.X., H.W., and D.R. designed the study; S.C. and H.W. constructed the Janus swarmalator model; S.C. and W. X. integrated the control barrier function method with the model; S.C. performed data processing and analysis; S.C. and W.X wrote the manuscript; all authors discussed the results and contributed to the editing of the manuscript; D.R. supervised the research. Peer review Peer review information Nature Communications thanks the anonymous reviewers for their contribution to the peer review of this work. A peer review file is available. Funding This work was funded by the Office of Naval Research (ONR) Grant N00014-18-1-2830 and the MIT Postdoctoral Fellowship for Engineering Excellence. Data availability Source data are provided with this paper. Data relevant to this paper is also available at 10.6084/m9.figshare.27914118. Source data are provided with this paper. Code availability Code relevant to this paper is available at 10.6084/m9.figshare.27914118. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. These authors contributed equally: Steven Ceron, Wei Xiao, Holden Watson. Supplementary information The online version contains supplementary material available at 10.1038/s41467-026-73671-3. References Associated Data Supplementary Materials Supplementary Information Description of Additional Supplementary Files Movie 1 Movie 2 Movie 3 Movie 4 Movie 5 Movie 6 Movie 7 Movie 8 Movie 9 Movie 10 Movie 11 Movie 12 Movie 13 Transparent Peer Review file Source Data Data Availability Statement Source data are provided with this paper. Data relevant to this paper is also available at 10.6084/m9.figshare.27914118. Source data are provided with this paper. Code relevant to this paper is available at 10.6084/m9.figshare.27914118.