Embedded chimera states in recurrent neural networks

Fully and partially synchronized brain activity plays a key role in normal cognition and in some neurological disorders, such as epilepsy. However, the mechanism by which synchrony and asynchrony co-exist in a population of neurons remains elusive. Chimera states, where synchrony and asynchrony coexist, have been documented only for precisely specified connectivity and network topologies. Here, we demonstrate how chimeras can emerge in recurrent neural networks by training the networks to display chimeras with machine learning. These solutions, which we refer to as embedded chimeras, are generically produced by recurrent neural networks with connectivity matrices only slightly perturbed from random networks. We also demonstrate that learning is robust to different biological constraints, such as the excitatory/inhibitory classification of neurons (Dale’s law), and the sparsity of connections in neural circuits. The recurrent neural networks can also be trained to switch chimera solutions: an input pulse can trigger the neural network to switch the synchronized and the unsynchronized groups of the embedded chimera, reminiscent of uni-hemispheric sleep in a variety of animals. Our results imply that the emergence of chimeras is quite generic at the meso- and macroscale suggesting their general relevance in neuroscience. Chimera states provide an intriguing physical platform to explore synchronization effects in neural networks and brain activity. Here, a recurrent neural network with embedded Chimera states is demonstrated, suggesting the generality and robustness of such states.


I
n Greek mythology, a chimera is a hybrid creature composed of the components of more than one animal.Abrams and Strogatz 1 aptly utilized the term 'chimera' to label a hybrid solution consisting of localized synchronized and unsynchronized dynamics to an otherwise homogeneous network of oscillators 2 .The systems showing chimera states are often also multi-stable, meaning that the system exhibits a synchronized or a chimera state depending on the initial conditions 3,4 .
Chimeras offer a modeling framework to study complex oscillating systems such as the brain, where coherent and incoherent dynamics are often found [21][22][23] .Chimeras have been previously linked to normal brain dynamics such as unihemispheric sleep in some mammals and birds, where half of the brain is active and showing asynchronized activity while the other half is asleep, in a synchronized state 20,[24][25][26] .More pathologically, chimeras have been linked to the onset of epileptic seizures, where the brain region implicated in the onset is unsynchronized while the others brain regions are not [27][28][29] .Yet, whether there are truly chimeras in the brain, how such chimeras at the macroscale arise from the underlying microscopic dynamics of the neurons, and what their general relevance in the brain is-or more generally in biological systems-are all open questions.
We aim to train the connections weights of artificial recurrent neural networks (RNNs)-which allow for self-sustained dynamical behavior-to output a collective chimera that is otherwise embedded into the network.In particular, the neurons of the RNN can be seen as the microscale and the output of the network as the meso-or macroscale.We use state-of-art techniques in the mimicry of dynamical systems or behaviors in RNNs [30][31][32][33][34][35] .These techniques stabilize an otherwise chaotic RNN to mimic the complex dynamics of a chimera by determining the weights to achieve this.We specifically use the FORCE (First-Order Reduced and Controlled Error) method, which has been previously implemented to output different types of dynamics, ranging from human motion, chaotic systems 30 and birds songs 33 .It has been applied to networks of continuous rate neurons 30,36,37 and to networks of spiking neurons 33,[38][39][40][41] .For example, Maslennikov and Nekorkin 35 used FORCE training to train a recurrent network of rate neurons to generate spontaneous and elicited sequences similar to the ones proposed in ref. 33 , which are based on discrete sequential states and different from the classical and continuous chimera dynamics considered here.
To summarize, we use the FORCE method to train a recurrent network of continuous rate neurons to output a chimera state.Indeed, we demonstrate that a chimera can be embedded into a RNN, and we show that its emergence is generic and robust to different biological constraints, such as the excitatory/inhibitory classification of neurons (Dale's law) and the sparsity of connections in neural circuits.The RNN can also be trained to switching chimera states: every time the network receives a random pulse there is a switch between the synchronized and the unsynchronized groups of the embedded chimera.

Results
Chimera state.In order to train a RNN to display a chimera, we first selected a suitable supervisor.Following ref. 4 , we used a system of Kuramoto oscillators consisting of two coupled populations of n = 3 identical oscillators (Fig. 1, Methods).Each oscillator is coupled with strength μ within the subpopulation and ν between subpopulations, with μ > ν (Fig. 1B).By using chimeralike initial conditions (see Supplementary Fig. 1), a chimera state is easily achieved where one sub-population synchronizes, while the other is asynchronously oscillating (schematically represented in Fig. 1A by six coupled metronomes.)The phases generated by the oscillators, θ i (t) (orange/synchronous population) and ϕ i (t) (purple/asynchronous population), will be critical for constructing the supervisor for the RNN (Fig. 1C-E and Supplementary Movie 1).
Prior to RNN training, we confirmed the simulated network was indeed displaying a chimera with two well-known measures: the mean phase velocity 42 , which captures the frequency of the oscillators for a given time period and the order parameter R 2,4 , which characterizes the synchronization of the system: for fully synchronized systems R = 1 and for asynchronous systems 0 < R < 1 (Methods).The mean phase velocity (Fig. 1F distinct profiles for the two groups and with two different regimes: nodes from the asynchronous group oscillate faster than nodes from the synchronized group.The order parameter (Fig. 1G) also confirms distinct behaviors for the asynchronous group [0.4 < R(t) < 0.8] and for the synchronous group [R(t) = 1].Thus, the two-population Kuramoto network displays a chimera state which will become the supervisor for the RNN.
Recurrent neural networks can be trained to display chimeras.
With the chimera solution in hand, we investigated if it could serve as a m dimensional supervisor to train a RNN to collectively display a chimera.First, as the oscillators' phases are discontinuous, and wrapped around the interval [0, 2π), the unit circle transformations (cos θ i , sin θ i ), and (cos ϕ i , sin ϕ i ) were applied to the phases.With 2n oscillators, this results in a m = 4n dimensional supervisor for a RNN (throughout the paper we use n = 3 and n = 25).We use the FORCE method 30 to train a RNN to autonomously mimic the time series produced by the supervisor.The training is considered successful if the network alone, unguided by the supervisor, can produce an identical chimera.
The RNN is a N autonomous dynamical system: The network is initially sparsely connected with a set of static weights ω 0 which initiates the neuron's currents z i (t) into a high dimensional chaotic regime [43][44][45] (Fig. 2A).During learning a lowrank perturbation ηd ⊤ is added to the weight matrix ω 0 , where η and d are both N × m (Fig. 2B).The matrix d is used to decode the output of the network, with d > r ¼ ŝ (Fig. 2C).This output is simultaneously fed back into the network: The components of η are fixed and random whereas the components of d are learned with Recursive Least Squares (RLS), which minimizes the sum-squared difference between the network output ŝ, and the chimera supervisor s (see Supplementary Fig. 2).Training is considered successful when a constant value of the matrix d allows the network to mimic the dynamics of the chimera.
We found that a RNN with N = 1500 could indeed autonomously display a chimera dynamics, i.e., the chimera state with n = 3 as shown in Fig. 2D, G (see also Supplementary Movie 2).We found that smaller network sizes (N = 500 and N = 1000) did not learn this chimera state, while larger ones did as well (N = 2000).Note that the necessary N changes depending on the supervisor's size (n = 3 or n = 25) and on the constraints we enforce in the RNN (see section FORCE method robustness for the specific N that we used in each case).This is in line with what was discovered in ref. 30 , where for more complex supervisors, more neurons were required in a RNN for accurate dynamical fitting.
We refer to the chimera dynamics displayed by the RNN (e.g., Fig. 2D, G and Supplementary Movie 2) as an embedded chimera within the RNN.The chimera is embedded in the sense that a linear decoder (d) is used to extract the chimera state from the network as a whole with a linear combination of the firing rates (Fig. 2C, D).The phases of the individual oscillators can also be reconstituted with a Hilbert Transform (Fig. 2E).To confirm the

Pre-learning
Post-learning . . . . . .Fig. 2 Embedded Chimera state from network output using the FORCE method.A In the FORCE method an initial sparse matrix ω 0 initializes the neurons to chaotic firing rates.B A secondary set of weights ηd ⊤ is learned online with the Recursive Least Squares technique.These learned weights are added to the initial sparse matrix, leading to the firing rates r(t) which are used to compute the network output.For both matrices in panels A and B blue and red edges (dark and light gray for b/w printing) indicate respectively excitatory (positive) or inhibitory (negative) connections.Edge thickness represents the weight of each connection.C The network output is given by d ⊤ r(t), which is a s x n t matrix (s is the total number of supervisors).Each network output column i is n t time units long and is a linear combination of the firing rates r 1 (t), ⋯, r N (t) with d iN as coefficients.D Network output cos φðtÞ (purple or dark gray for b/w printing) and cos θðtÞ (orange or light gray for b/w printing) and the correspondent supervisors (black).E Embedded chimera from network output: φðtÞ ¼ arctan sin φðtÞ cos φðtÞ h i and θðtÞ ¼ arctan sin θðtÞ cos θðtÞ h i .F Mean phase velocity profile for the embedded chimera (identical profiles as in Fig. 1F).
G Trajectories of the order parameter for the embedded chimera (identical trajectories as in Fig. 1G).
network indeed learned the chimera shown in Fig. 1, we computed both the mean phase velocity and the order parameter (Fig. 2F, G), which are identical to those in Fig. 1.
FORCE method robustness.Next, we investigated if chimeras states could be generically embedded within RNNs that enforced specific biological constraints.We considered three different constraints.We first enforced Dale's law, which states that a neuron can be either excitatory or inhibitory, not both.In our model this translates to the final learned synaptic weights ω 1 = ω 0 + ηd ⊤ being constrained by the excitatory/inhibitory nature of each neuron.If neuron i is excitatory (inhibitory), all of its outgoing connections will be positive (negative): 3A, B).See Methods for more details.We found that the chimera from Figs. 1 and 2 could be reliably trained with Dale's law enforced (Fig. 3C) using a RNN of N = 3500.This was confirmed with the mean-phase velocity (Fig. 3D) and Kuramoto order parameter (Fig. 3E).Thus, chimeras can be generically embedded by a RNN respecting Dale's Law.
Second, biological circuits are often sparsely connected 43,44,46,47 .This constraint is not immediately satisfied by FORCE training as the perturbation to ω 0 is low rank, which yields all-to-all connectivity.To constrain the network to sparse connectivity, we enforced sparsity to the post-learning weight matrix ω 1 (Fig. 3F) as in ref. 33 and tested if a sparsely coupled RNN could still learn the chimera state.In particular, the matrices η and d were kept at a sparsity value of 90% during and after learning.See Methods for more details on the implementation.Post learning, both weight matrices ω 0 and ω 1 were observed to have the same Gaussian-like distribution and that ω 1 was successfully kept at 82% sparse (Fig. 3G).The sparse RNN with N = 3000 was still able to learn how to embed a chimera (Fig. 3H-J).
Finally, we investigated if a RNN could learn more complex chimeras.The supervisor was changed to a larger chimera from two populations of 25 identically coupled Kuramoto oscillators (Fig. 4A and Supplementary Movie 3).The RNN could again successfully reproduce the chimera (Fig. 4B and Supplementary Movie 4).This was confirmed with mean-phase velocity and Kuramoto order parameter for the higher-dimensional supervisor (Fig. 4C, D).Collectively, these results imply that the different chimeras may be generically embedded into RNNs while satisfying some of the main biological constraints in real neural circuits.
Characteristics of the recurrent neural network.With RNNs successfully and robustly trained to display an embedded chimera, we next investigated if such a chimera can be detected from the micro to the macro scale.To analyze the underlying dynamics of the RNN for chimera signatures, a Fast Fourier Transform (FFT) was applied to both the network output and the original chimera in the Kuramoto system, which allowed us to extract the fundamental frequencies.We observed identical frequencies in the Kuramoto network (Fig. 5A, B) as in the RNN output (Fig. 5C, D).The frequencies correspond to the frequency of the synchronous population, f 1 = 0.021 and to the main frequencies of the asynchronous population (Fig. 5A, B), f 1 = 0.021, f 2 = 0.059 and f 3 = 0.096, which can be qualitatively identified in Fig. 1C.
Next, we searched for these fundamental frequencies in experimentally accessible quantities across different scales.First, we considered a common reduction of high-dimensional neural data: Principal Component Analysis (PCA).This was applied to the set of individual firing rates in the network, with the 1st, 3rd, and 5th principal components shown in Fig. 5E.The three main frequencies found in the original Kuramoto system were found in the FFTs of these principal components (marked with dashed lines, Fig. 5F).Note that the 2nd, 4th and 6th components are B Fraction of the post-learning weight matrix ω 1 = ω 0 + ηd ⊤ , which respects Dale's law: an excitatory (inhibitory) neuron (columns in the plotted matrix) will only excite (inhibit) its connections, regardless of the neuron target type.C Embedded chimera from network output subject to Dale's law.D Mean phase velocity profile for the embedded chimera (bright colors) obtained from the network output subject to Dale's law and for the supervisor (light colors).E Order parameter trajectory for the embedded chimera (bright colors) obtained from the network output subject to Dale's law and for the supervisor (light colors).F Schematic representation of sparsity enforcement in ω 1 .Blue and red edges (dark and light gray for b/w printing) indicate respectively excitatory (positive) or inhibitory (negative) connections.Edge thickness represents the weight of each connection.G Density distribution for the non-zero weights for ω 0 and ω 1 , sparsity is decreased only by 8%.H Embedded chimera from network output subject to sparsity.I Mean phase velocity profile for the embedded chimera (bright colors) obtained from the network output subject to sparsity and for the supervisor (light colors).J Order parameter trajectory for the embedded chimera (bright colors) obtained from the network output subject to sparsity and for the supervisor (light colors).
orthogonal phase shifts of the 1st, 3rd and 6th components since both the cosine and the sine of the oscillators phases were used as supervisors.
The main three frequencies can also be obtained through the FFT of the firing rates of single neurons in our RNN (Fig. 5G, H).Depending on the neuron, all three frequencies are present or only a subset of them.This implies that the individual neurons can not be generally separated into a synchronized and an unsynchronized subgroup and characteristics of the embedded chimeras can permeate the different scales.This suggests that a possible origin of chimera states in the brain is state switching of neural components: the firing rates change dynamically between low and high values and these dynamics can collectively implement a decodable embedded chimera.
Next, we considered if truly macroscopic quantities somehow yielded information about the embedded chimera.To that end, the mean of the firing rates was computed with the resulting time series being highly irregular.Once again, the three main frequencies of the Kuramoto system were identified through the FFT of the spatial mean of the firing rates (Fig. 5I, J).These results show that if a chimera is embedded into a RNN, it may be detected from observations made at the micro-scale of neurons to the macro-scale of average activities.
Switching chimera state.Inspired by uni-hemispheric sleep observed in some aquatic mammals and birds 48,49 , where one hemisphere is awake, showing asynchronous electroencephalographic (EEG) activity, while the other is sleep, showing synchronized EEG activity, we sought to determine if the RNN could be trained to switch the synchronized and unsynchronized populations with an input.In uni-hemispheric sleep, the two hemispheres switch states due to an external input 48,49 (Fig. 6A).The RNN was trained to learn the switching chimera state: any time an external pulse c was provided to the network (Fig. 6, gray line), the synchronized group (from the network output) changed to unsynchronized and the unsynchronized to synchronized.The supervisor was generated with homogeneous Kuramoto oscillators (as in Fig. 1) and the pulse was random (with some constraints, see Methods).The input pulse is configured nominally to c = 0, and changes randomly to c = 10 or to c = −10 to switch the synchronized and unsynchronized populations in the embedded chimera (Fig. 6B, note that we only show the positive pulse).In particular, for c = 10, the embedded chimera would change θ to the synchronized state and φ to the unsynchronized one and viceversa for c = −10.Two subsequent pulses could not have the same sign (see Methods for details).
The network was successfully trained to switch the synchrony profiles (Fig. 6B and Supplementary Movie 5) due to the external pulse, and thus a sufficiently strong perturbation to the system can induce a transition from one low-dimensional attractor (i.e., a low-dimensional projection of the RNN's multidimensional attractor) to another.The RNN trained to switch chimera showed evidence of only two different low-dimensional attractors (for more information about the underlying dynamics or attractor of the trained RNN see Supplementary Note 2 and Supplementary Fig. 3).One attractor was defined by θ being synchronized and φ being unsynchronized, and the other attractor was defined by θ being unsynchronized and φ being synchronized (Supplementary Fig. 4).However, we found that for some pulses, the embedded chimera did not switch indicating that switching success may depend on the specific state of the system at the time of a pulse 50 .For those pulses where the embedded chimera did not switch, the following pulse switched the chimera state regardless of the state of θ and φ.In other words, any time an unsuccessful pulse occurred, the −10 pulse would act as a +10 pulse, and the +10 pulse would act as a −10 pulse (Supplementary Fig. 5).We tested the RNN with only positive pulses and with only negative pulses and it switched states independently of the pulse sign (Supplementary Fig. 6).Altogether, it proves that it is the size rather than the direction/sign of the pulse what leads to a switch in the chimera state.
Finally, we sought to determine how the low-dimensional projection of the RNN's multidimensional attractor (see Supplementary Fig. 3) would change in the case of the switching chimera (Supplementary Fig. 4).We analyzed the underlying activity by computing the PCA of the RNN firing rates (Fig. 6C, D).The neuronal dynamics themselves readily display a change after the external input.At the network level, this change of dynamics is manifested on the temporal evolution of the 3rd and 5th principal components.The first principal component does not change after the input, and we believe this is due to the fact it accounts for the main frequency of both groups (the synchronized and unsynchronized populations), which is identical for both as we have shown in the FFT of the embedded chimera state (Fig. 5D).

Discussion
So far, chimera states in the brain have been studied from bottom-up approaches, using networks of individual neurons described with simple mathematical models and using specific coupling schemes 27,28 , which are not directly applicable to real biological systems.Some exceptions apply and chimera states have been studied using biological coupling schemes 51,52 and on the human brain macroscale using in silico experiments and personalized brain networks 26 .Yet, the question how individual neurons could organize themselves such that a chimera state emerges on the macroscale-or more generally, how macroscopic chimeras can arise from the underlying dynamics in large complex networks-has remained unanswered up to now.
Fig. 4 FORCE method robustness: enforcing a larger supervisor.A Schematic representation of the chimera state with n = 25 in each group: each metronome represents an oscillator with phase θ i (light orange or light gray for b/w printing, synchronous group) or ϕ i (light purple or dark gray for b/w printing, asynchronous group).B Embedded chimera from the network output using a larger supervisor.C Mean phase velocity profile for the embedded chimera (bright colors) obtained from the network output using a larger supervisor (light colors).D Order parameter trajectory for the embedded chimera (bright colors) obtained from the network output using a larger supervisor (light colors).
Our work shows that chimeras can emerge on the macroscale of a network as a result of interactions between the nodes without the necessity of high-order couplings (such as non-pairwise interactions, multilayer interactions, or time-varying interactions 53 ) and without using a specific coupling or model.We demonstrated that this result is robust to different biological constraints such as the excitatory/inhibitory neural classification known as Dale's law and the sparsity of connections in a neural circuit.An interesting result, is that the individual neurons do not show any modular structure, suggesting that chimeras states can emerge on the macroscale even if no community structure is present.
Inspired by the uni-hemispheric sleep observed in some aquatic mammals and birds 48,49 , which has been linked to chimera states 24 , we showed that a RNN can learn to switch the synchronized and unsynchronized populations with an input.Previously, a switching chimera was modeled using two coupled groups of heterogeneous oscillators, coupled to an external periodic signal, which determined the period of the switching chimera 25 .Here, we demonstrated how the training we used is generic as the oscillators can be homogeneous and the period of the switching chimera is not tied to the period of the pulses (which were randomly applied).Regardless of the pulse sign, a sufficiently strong pulse is enough to change the state of each population by switching between two attractors.
In summary, while it has been theoretically proven that RNNs can act as universal approximators of any dynamical system 54,55 , our results collectively show that RNNs can embed chimeras, generically, robustly, and even in the presence of relevant biological constraints.This suggests that chimeras have a general relevance in neuroscience and, potentially, in large networks in general.

Methods
Two coupled Kuramoto-Sakaguchi populations.The system studied in ref. 4 was used as a supervisor.It consists of two groups of n Kuramoto oscillators each.The phases of the oscillators for group 1 and group 2 are given by θ ¼ fθ i g n i¼1 and ϕ ¼ fϕ i g n i¼1 , which are governed by the following equations: The intrinsic frequency ρ = 1 is kept the same for all oscillators.The coupling between groups is given by ν ¼ 1ÀA 2N and within groups by μ ¼ 1þA 2N , with ν < μ and 0 ⩽ A ⩽ 1.The coupling is the Kuramoto-Sakaguchi type: sinðφ þ αÞ ¼ cosðφ À βÞ 3,4,24 , where φ refers to the phase difference between two oscillators and β = π/2 − α.Depending on the values of β and A the system undergoes different dynamics.To obtain a stable chimera, we simulated (4) and (5)  with appropriate initial conditions (see Note 1 in the Supplementary Material) and we fixed β = 0.025 and A = 0.1.Figure 1A, B illustrate the network architecture and Fig. 1C depicts the chimera state.The equations were integrated using the Euler method with an integration step of dt = 10 −3 .Note that all equations are dimensionless.
Order parameter z.Two different metrics were used to characterize the chimera state: the order parameter and the mean phase velocity.The order parameter z is given by and quantifies the synchronization of any oscillatory system with phases fθ i g n i¼1 .For synchronized systems |z| = 1 and for systems that are not fully synchronized, Fig. 5 Recurrent Neural Network features.A Network supervisor.B Fast Fourier Transform (FFT) of the network supervisor.Each FFT is normalized to the highest peak and plotted in a log y-scale.The three dashed vertical lines indicate the three highest frequencies (f 1 = 0.021, f 2 = 0.059 and f 3 = 0.096), which correspond to the frequency of the synchronized (f 1 ) and to the frequencies of the unsynchronized groups (f 1 , f 2 and f 3 ).C Network output.D FFT of the network output.E Principal component analysis (PCA) of the network's firing rates.We plot the 1rst, the 3rd and the 5th components vs time (dark red, turquoise and yellow or black, dark and light gray for b/w printing).F FFTs (dark red, turquoise and yellow or black, dark and light gray for b/w printing) of the 1rst, 2nd and 3rd components, respectively.G Individual firing rates vs time.H FFTs of the individual firing rates.I Mean of the firing rates vs time.J FFT of the mean of the firing rates.0 ⩽ |z| < 1.In a chimera state the oscillators of one group are complete synchronized while the other group is not synchronized.

Fast Fourier Transforms
Mean phase velocity Ω θ .The mean phase velocity 42 for a given oscillator with phase θ i is defined as where M i is the number of complete rotations around the origin performed by the ith oscillator during the time interval Δt = 1000.Having different mean phase velocities for the two populations is typical for chimera states 11,56,57 .
Recurrent neural network equations and the FORCE method.To train a chimera state, the RNN was used: The network will serve as the basis to output m dimensional dynamics ŝi .The neuronal dynamics z i (t) can be seen as a neuronal current with firing rate r i (t).The parameter G scales ω 0 a N × N static and sparse weight matrix drawn from a normal distribution with mean 0 and variance 1 Np 2 (Supplementary Fig. 2A), where p is the sparsity degree (set to 90%).This sets the initial network dynamics into high-dimensional chaos.The variable G controls the chaotic behavior with G < 1 being the subcritical regime, and G > 1 being the supercritical regime 58 .The coupling was set in the supercritical regime (G = 1.5).The network was trained with the FORCE method 30 , which trains a second set of weights ω 1 = Qηd ⊤ (Supplementary Fig. 2B) such that eq. ( 8) can be rewritten as where the parameter Q scales η a N × m matrix drawn randomly and uniformly from [−1, 1] m .By increasing Q, the feedback applied to the network is strengthened.A value of Q = 1 was used for all simulations.The network output ( 9) is defined as The FORCE method enforces ŝ % s; ð11Þ by determining d in an online fashion with Recursive Least Squares (RLS) 30 .
Online here means d is being computed as the network is being simulated.The RLS algorithm has an online solution for the optimal d, the one that minimizes the squared error e between the network output ŝ and the supervisor s (Supplementary Fig. 2D).The RLS updates to d at each time step n are where d 0 = 0 and P 0 = I n /λ.The parameter λ controls the rate of the error 30 and we set it to λ = 1.The parameter I n is a N × N identity matrix.As soon as RLS algorithm is switched on the firing rates go from a chaotic to a regular dynamics (Supplementary Fig. 2C).The FORCE method is successful if the network is able to reproduce the supervisor once RLS is off.The network under these conditions is completely autonomous, with the weight matrix ω 0 + Qηd T .

Enforcing biologically motivated constrains
Dale's law.The initial weight matrix is generated to satisfy the Dale's law constraint, where the first half of the population of neurons only projects positive weights (excitatory): and the second half only negative weights (inhibitory): The second set of weights ω 1 = ηd ⊤ is constrained to project either positive or negative weights, as well.We achieve that by first defining η as η = η − + η + where η − and η + have only negative or positive entries, respectively.Second, we set d such that d ≥ 08i 2 ½0; N 2 and d ij ≤ 08i 2 ½ N 2 ; N. For more details refer to ref. 33 and to Additional Information, where the link to the code is available.
Sparsity.The learned weight matrix ω 1 is sparse by setting a random subset of weights (90%) to be 0, and therefore not projecting an all-to-all connectivity.As well, we keep the auxiliary function P needed to perform the RLS algorithm sparse (by setting a random subset to be 0).For more details, refer to ref. 30 and to Additional Information, where the link to the code is available.
Switching Chimera.In order to train the RNN to learn the switching chimera, an external input pulse was added to Eq. ( 9): where ω in is a N × N matrix drawn randomly and uniformly from [−1, 1].The external pulse is c, which is set to c = 0 except when it randomly changes to either 10 or −10 for 100 time steps dt = 0.1 of the simulation.The inputs are configured such that two subsequent pulses with the same sign never occur.Also, any subsequent pulse has to happen at least after a time window of 5000 time-steps.
Individual firing rates  59 : one hemisphere is synchronized (white) and the other one is unsynchronized (gray).The state of each hemisphere can change (synchronized to unsynchronized and vice-versa) due to an external perturbation (here depicted as a gray arrow).B Embedded switching chimera from the network output: the two groups (orange and purple or light and dark gray for b/w printing) change state (synchronized to unsynchronized and vice-versa) if it receives an external pulse (gray line) otherwise it does not change the state.C Individual firing rates of the recurrent neural network before and after the pulse (gray line).D PCA of the network's firing rates before and after the pulse.We plot the 1st, the 3rd and the 5th components (dark red, turquoise and yellow or black, dark and light gray for b/w printing) vs time before and after the pulse (gray line).
Depending on the value of c, the chimera state changes as follows:

Fig. 1
Fig.1Chimera state.A Schematic representation of the chimera state: each metronome represents an oscillator with phase θ i (orange or light gray for b/w printing, synchronous group) or ϕ i (purple or dark gray for b/w printing, asynchronous group).B Diagram showing the coupling scheme of the two groups (n = 3): oscillators are coupled with strength μ within the same group and ν between groups, note that μ > ν.C Time-series of the 6 different oscillator's phases θ i (orange) and ϕ i (purple).D Snapshot of phases θ i and ϕ i for the 6 oscillators at t = 4500.E Same as panel D in polar coordinates.F Mean phase velocity profile.G Trajectories of the order parameter for both groups.

Fig. 3 FORCE
Fig. 3 FORCE method robustness: enforcing different constraints.A Dale's law schematic representation.Blue and red edges (dark and light gray for b/w printing) indicate respectively excitatory (positive) or inhibitory (negative) connections.Edge thickness represents the weight of each connection.B Fraction of the post-learning weight matrix ω 1 = ω 0 + ηd ⊤ , which respects Dale's law: an excitatory (inhibitory) neuron (columns in the plotted matrix) will only excite (inhibit) its connections, regardless of the neuron target type.C Embedded chimera from network output subject to Dale's law.D Mean phase velocity profile for the embedded chimera (bright colors) obtained from the network output subject to Dale's law and for the supervisor (light colors).E Order parameter trajectory for the embedded chimera (bright colors) obtained from the network output subject to Dale's law and for the supervisor (light colors).F Schematic representation of sparsity enforcement in ω 1 .Blue and red edges (dark and light gray for b/w printing) indicate respectively excitatory (positive) or inhibitory (negative) connections.Edge thickness represents the weight of each connection.G Density distribution for the non-zero weights for ω 0 and ω 1 , sparsity is decreased only by 8%.H Embedded chimera from network output subject to sparsity.I Mean phase velocity profile for the embedded chimera (bright colors) obtained from the network output subject to sparsity and for the supervisor (light colors).J Order parameter trajectory for the embedded chimera (bright colors) obtained from the network output subject to sparsity and for the supervisor (light colors).

Fig. 6
Fig.6Embedded switching chimera.A Schematic representation of the cortex of a bottlenose dolphin undergoing uni-hemispheric sleep, reproduced from ref.59 : one hemisphere is synchronized (white) and the other one is unsynchronized (gray).The state of each hemisphere can change (synchronized to unsynchronized and vice-versa) due to an external perturbation (here depicted as a gray arrow).B Embedded switching chimera from the network output: the two groups (orange and purple or light and dark gray for b/w printing) change state (synchronized to unsynchronized and vice-versa) if it receives an external pulse (gray line) otherwise it does not change the state.C Individual firing rates of the recurrent neural network before and after the pulse (gray line).D PCA of the network's firing rates before and after the pulse.We plot the 1st, the 3rd and the 5th components (dark red, turquoise and yellow or black, dark and light gray for b/w printing) vs time before and after the pulse (gray line).