Skip to content

Synchronization

Synchronization systems.

The package covers coupled phase oscillators, pulse-coupled oscillators, swarmalators, chaos, and Kuramoto order.

AdaptiveCouplingInteraction(label, *, among, along=True, K=1.0, alpha=0.0, beta=0.0, epsilon=0.01)

Bases: Interaction

Adaptive Kuramoto-Sakaguchi coupling.

The weights relax towards a phase-lagged sine of the phase difference.

On every directed link from j to i, the phase of i turns by -K kappa_ij sin(theta_i - theta_j + alpha) and the weight relaxes as kappa_ij' = -epsilon (kappa_ij + sin(theta_i - theta_j + beta)), so it grows between oscillators whose phases differ by about -beta - pi / 2.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
among Role

The path of the group of phase oscillators on the nodes, whose edges hold the adaptive links.

required
along bool | str | None

True for the edges of the network of the oscillators, or the name of a layer.

True
K float

The coupling strength, 1 / N for the mean coupling of N oscillators.

1.0
alpha float

The phase lag of the coupling.

0.0
beta float

The phase lag of the adaptation.

0.0
epsilon float

The rate of the adaptation.

0.01

Examples:

>>> from skcomplex.systems.physics.synchronization import AdaptiveCouplingInteraction
>>> AdaptiveCouplingInteraction('adaptation', among='nodes').epsilon
0.01
Source code in src/skcomplex/systems/physics/synchronization/_adaptive.py
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
def __init__(
    self,
    label: str,
    *,
    among: Role,
    along: bool | str | None = True,
    K: float = 1.0,
    alpha: float = 0.0,
    beta: float = 0.0,
    epsilon: float = 0.01,
) -> None:
    super().__init__(label, among=among, along=along)
    self.K = K
    self.alpha = alpha
    self.beta = beta
    self.epsilon = epsilon

AdaptiveKuramotoSystem(n_oscillators=50, *, alpha=0.3 * math.pi, beta=0.23 * math.pi, epsilon=0.01, omega=0.0, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Globally coupled phase oscillators with adaptive coupling weights.

The weights adapt to the phase differences.

The oscillators follow the Kuramoto-Sakaguchi model theta_i' = omega - (1 / N) Σ_j kappa_ij sin(theta_i - theta_j + alpha), and every weight of the directed link from j to i adapts as kappa_ij' = -epsilon (kappa_ij + sin(theta_i - theta_j + beta)), Eqs. 28-29 of Berner et al. The weights are states of a group on the edges of the complete directed graph. Even identical oscillators split into frequency clusters: groups whose members share one mean frequency, strongly coupled within and weakly coupled across, with the weights inside a cluster near -sin(theta_i - theta_j + beta). The phases and the weights start uniformly at random in [0, 2 pi) and [-1, 1]. The system has the phases nodes.theta and the weights links.kappa, one per directed link.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

50
alpha float

The phase lag of the coupling.

0.3 * pi
beta float

The phase lag of the adaptation.

0.23 * pi
epsilon float

The rate of the adaptation, slow for small values.

0.01
omega float

The natural frequency of every oscillator.

0.0
seed int

The seed of the random initial phases and weights.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import AdaptiveKuramotoSystem
>>> AdaptiveKuramotoSystem(5).prepare().system_.elements[1].space.graph.number_of_edges()
20
Source code in src/skcomplex/systems/physics/synchronization/_adaptive.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
def __init__(
    self,
    n_oscillators: int = 50,
    *,
    alpha: float = 0.3 * math.pi,
    beta: float = 0.23 * math.pi,
    epsilon: float = 0.01,
    omega: float = 0.0,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.alpha = alpha
    self.beta = beta
    self.epsilon = epsilon
    self.omega = omega
    self.seed = seed

AdaptiveLinkElement(label, *, kappa=0.0, space=None, on=None)

Bases: Element

Directed link of an adaptive network with the coupling weight kappa.

The weight is a state that the phases of its ends adapt.

Parameters:

Name Type Description Default
label str

The label of the link or the group on the links.

required
kappa object

The initial coupling weight, or one weight per link.

0.0
space BaseSpace | None

The network of the links, or None for one link.

None
on str | None

'edges' for one link on every edge of the network, or None.

None

Examples:

>>> from skcomplex.systems.physics.synchronization import AdaptiveLinkElement
>>> AdaptiveLinkElement('link', kappa=0.5).kappa
0.5
Source code in src/skcomplex/systems/physics/synchronization/_adaptive.py
53
54
55
56
57
58
59
60
61
62
def __init__(
    self,
    label: str,
    *,
    kappa: object = 0.0,
    space: BaseSpace | None = None,
    on: str | None = None,
) -> None:
    super().__init__(label, space=space, on=on)
    self.kappa = kappa

AggregateAveragingInteraction(label, *, source, target, r=4.0, kappa=0.4, kind='logistic', delay=0)

Bases: Interaction

Logistic or Bernoulli map of an aggregate of a target value and a source value.

The value of the source is possibly delayed.

The map sets x_t(t + 1) = f(a) with the aggregate a = (1 - kappa) x_t(t) + kappa x_s(t - delay), and with the logistic map f(a) = r a (1 - a) or the Bernoulli shift f(a) = r a mod 1. A delayed source reads its past values.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
source Role

The path of the unit whose value the aggregate reads.

required
target Role

The path of the unit whose value the map sets.

required
r Annotated[float, closed_open(0, oo)]

The growth rate of the logistic map.

4.0
kappa Annotated[float, closed_open(0, oo)]

The weight of the source in the aggregate.

0.4
kind str

The map, 'logistic' or 'bernoulli'.

'logistic'
delay int

The number of steps by which the source is delayed.

0

Raises:

Type Description
ValidationError

The map is unknown, or the delay is not a nonnegative integer.

Examples:

>>> from skcomplex.systems.physics.synchronization import AggregateAveragingInteraction
>>> AggregateAveragingInteraction('averaging', source='a', target='b', kind='bernoulli').kind
'bernoulli'
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
def __init__(
    self,
    label: str,
    *,
    source: Role,
    target: Role,
    r: Annotated[float, RealSet.closed_open(0, oo)] = 4.0,
    kappa: Annotated[float, RealSet.closed_open(0, oo)] = 0.4,
    kind: str = 'logistic',
    delay: int = 0,
) -> None:
    super().__init__(label)
    self.source = source
    self.target = target
    self.r = r
    self.kappa = kappa
    self.kind = kind
    self.delay = delay

AggregateAveragingSynchronizationSystem(x1=0.3, x2=0.6, *, r=4.0, kappa=0.4, kind='logistic', delay=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Two chaotic maps coupled by aggregate averaging.

The maps synchronize their chaos for strong coupling.

Each map iterates on the aggregate of its own value and the other's, x_i(t + 1) = f(a_i) with a_1 = (1 - kappa) x_1(t) + kappa x_2(t - T) and a_2 = (1 - kappa) x_2(t) + kappa x_1(t - T), for the delay T. The logistic map is f(a) = r a (1 - a). Without delay, its synchronized orbit is stable for kappa > (r - 1) / (2 r), which is 3 / 8 for r = 4, and the maps agree in one step for kappa = 1 / 2. The Bernoulli shift f(a) = r a mod 1 has the constant slope r, so a difference d of the maps follows d(t + 1) = r ((1 - kappa) d(t) - kappa d(t - T)) exactly, and the maps synchronize when every root of z^(T + 1) - r (1 - kappa) z^T + r kappa lies in the unit disk, which for T = 0 is |r (1 - 2 kappa)| < 1. The delay shrinks the window of synchronizing couplings: for r = 1.5 it is 0.17 < kappa < 0.83 without delay, 0.17 < kappa < 0.66 for T = 1, and 0.17 < kappa < 0.44 for T = 2, and it closes for T >= 5. Before the start, the delayed values equal the initial values. An integer slope such as 2 loses one binary digit of the value per step in floating point and falls onto 0, so a slope that is not an integer, such as 1.5, keeps the chaos. The system has the values first.x and second.x, and their past values first.x[-<j>] and second.x[-<j>] for a delay.

Parameters:

Name Type Description Default
x1 float

The initial value of the first map.

0.3
x2 float

The initial value of the second map.

0.6
r float

The growth rate of the logistic map.

4.0
kappa float

The coupling strength.

0.4
kind str

The map, 'logistic' or 'bernoulli'.

'logistic'
delay int

The delay T of the coupling, in steps.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import AggregateAveragingSynchronizationSystem
>>> trajectory = AggregateAveragingSynchronizationSystem(kappa=0.5).prepare().simulate(until=2)
>>> bool(trajectory.get_values('first.x')[-1] == trajectory.get_values('second.x')[-1])
True
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
def __init__(
    self,
    x1: float = 0.3,
    x2: float = 0.6,
    *,
    r: float = 4.0,
    kappa: float = 0.4,
    kind: str = 'logistic',
    delay: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x1 = x1
    self.x2 = x2
    self.r = r
    self.kappa = kappa
    self.kind = kind
    self.delay = delay

ChargingInteraction(label, *, target, S=2.0, gamma=1.0)

Bases: Interaction

Leaky charging x' = S - gamma x towards the level S / gamma.

It charges a capacitor through a resistor, the membrane of a neuron, or the clock of a firefly.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator or the group whose charge x rises.

required
S Annotated[float, open(0, oo)]

The charging input.

2.0
gamma Annotated[float, open(0, oo)]

The leak rate.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import ChargingInteraction
>>> ChargingInteraction('charging', target='oscillators', S=3.0).S
3.0
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
81
82
83
84
85
86
87
88
89
90
91
92
def __init__(
    self,
    label: str,
    *,
    target: Role,
    S: Annotated[float, RealSet.open(0, oo)] = 2.0,
    gamma: Annotated[float, RealSet.open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.S = S
    self.gamma = gamma

CoupledMapLatticesOnNetworksSystem(n_nodes=100, *, network='erdos_renyi', degree=20, rewiring=0.1, r=4.0, epsilon=0.9, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Chaotic logistic maps on the nodes of a network.

Each map is pulled towards the mean of its neighbours.

Node i follows x_i(t + 1) = (1 - epsilon) f(x_i) + (epsilon / k_i) sum_j A_ij f(x_j) with the logistic map f(x) = r x (1 - x), a mean over the neighbours of the network. For a coupling epsilon large enough against the Lyapunov exponent of the map and the spectral gap of the network, the maps synchronize on one chaotic orbit, and the variance of the states over the nodes falls to zero. Below it they stay incoherent. The system has the states maps.x and their variance over the nodes, spread.

Parameters:

Name Type Description Default
n_nodes int

The number of maps, the nodes of the network.

100
network str

The generator, 'watts_strogatz', 'erdos_renyi', or 'barabasi_albert'.

'erdos_renyi'
degree int

The mean degree of the network.

20
rewiring float

The probability of rewiring every edge of the Watts-Strogatz ring.

0.1
r float

The parameter of the logistic map, chaotic at 4.

4.0
epsilon float

The coupling between 0 and 1.

0.9
seed int

The seed of the network and the initial states.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ValueError

The network is unknown.

Examples:

>>> from skcomplex.systems.physics.synchronization import CoupledMapLatticesOnNetworksSystem
>>> CoupledMapLatticesOnNetworksSystem(20).prepare().system_.elements[0].space.graph.number_of_nodes()
20
Source code in src/skcomplex/systems/physics/synchronization/_networks.py
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
def __init__(
    self,
    n_nodes: int = 100,
    *,
    network: str = 'erdos_renyi',
    degree: int = 20,
    rewiring: float = 0.1,
    r: float = 4.0,
    epsilon: float = 0.9,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_nodes = n_nodes
    self.network = network
    self.degree = degree
    self.rewiring = rewiring
    self.r = r
    self.epsilon = epsilon
    self.seed = seed

CoupledRosslerSystem(n_oscillators=2, *, k=0.04, mismatch=0.02, a=0.2, b=0.2, c=5.7, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Chaotic Rössler oscillators on a ring.

The oscillators are diffusively coupled through their second variable.

Oscillator i follows x1' = -ω_i x2 - x3, x2' = ω_i x1 + a x2 + k sum_j (x2_j - x2_i), and x3' = b + x3 (x1 - c), summed over its neighbours on the ring. Two oscillators with frequencies 1 ± mismatch pass from no synchronization to chaotic phase synchronization as k grows. Identical oscillators, with no mismatch, synchronize completely when every nonzero eigenvalue of the ring's Laplacian times k falls where the master stability function is negative. The system has the states oscillator_<i>.x1, oscillator_<i>.x2, and oscillator_<i>.x3.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators on the ring.

2
k float

The coupling strength.

0.04
mismatch float

The half width of the interval of natural frequencies around 1.

0.02
a float

The first Rössler parameter.

0.2
b float

The second Rössler parameter.

0.2
c float

The third Rössler parameter.

5.7
seed int

The seed of the initial states.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import CoupledRosslerSystem
>>> trajectory = CoupledRosslerSystem(k=0.5, mismatch=0.0).prepare().simulate(until=80.0)
>>> first, second = trajectory.get_values('oscillator_0.x1'), trajectory.get_values('oscillator_1.x1')
>>> bool(abs(first[-1] - second[-1]) < 1e-4)
True
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
def __init__(
    self,
    n_oscillators: int = 2,
    *,
    k: float = 0.04,
    mismatch: float = 0.02,
    a: float = 0.2,
    b: float = 0.2,
    c: float = 5.7,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.k = k
    self.mismatch = mismatch
    self.a = a
    self.b = b
    self.c = c
    self.seed = seed

DelayedCouplingInteraction(label, *, source, target, K=1.0, tau=1.0)

Bases: Interaction

Delayed sine coupling of one phase oscillator to another.

The coupling is theta_t' += K sin(theta_s(t - tau) - theta_t).

The target reads the phase of the source as it was a delay tau earlier, as a signal that travels along a nerve or a cable.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
source Role

The path of the oscillator whose delayed phase the coupling reads.

required
target Role

The path of the oscillator whose phase the coupling turns.

required
K float

The coupling strength.

1.0
tau Annotated[float, open(0, oo)]

The delay.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import DelayedCouplingInteraction
>>> DelayedCouplingInteraction('coupling', source='a', target='b', tau=2.0).tau
2.0
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
185
186
187
188
189
190
191
192
193
194
195
196
197
198
def __init__(
    self,
    label: str,
    *,
    source: Role,
    target: Role,
    K: float = 1.0,
    tau: Annotated[float, RealSet.open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.source = source
    self.target = target
    self.K = K
    self.tau = tau

DelayedKuramotoSystem(n_oscillators=5, *, K=2.0, tau=1.0, spread=0.2, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Kuramoto phase oscillators coupled all to all through delayed signals.

The signals arrive after a delay.

Oscillator i follows theta_i' = omega_i + (K / N) sum_j sin(theta_j(t - tau) - theta_i), with natural frequencies spread evenly around 1 and initial phases spread around the circle. The system has the phases oscillator_<i>.theta.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

5
K float

The coupling strength.

2.0
tau float

The delay of the coupling.

1.0
spread float

The width of the interval of natural frequencies around 1.

0.2
seed int

The seed of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import DelayedKuramotoSystem
>>> len(DelayedKuramotoSystem(n_oscillators=3).prepare().system_.interactions)
9
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
def __init__(
    self,
    n_oscillators: int = 5,
    *,
    K: float = 2.0,
    tau: float = 1.0,
    spread: float = 0.2,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.K = K
    self.tau = tau
    self.spread = spread
    self.seed = seed

DiffusiveCouplingInteraction(label, *, source, target, state='x2', k=0.1)

Bases: Interaction

Diffusive coupling of a state of one element to the same state of another.

The coupling is x_t' += k (x_s - x_t).

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
source Role

The path of the element whose state the coupling reads.

required
target Role

The path of the element whose state the coupling changes.

required
state str

The name of the coupled state.

'x2'
k Annotated[float, closed_open(0, oo)]

The coupling strength.

0.1

Examples:

>>> from skcomplex.systems.physics.synchronization import DiffusiveCouplingInteraction
>>> DiffusiveCouplingInteraction('coupling', source='a', target='b', k=0.5).k
0.5
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
345
346
347
348
349
350
351
352
353
354
355
356
357
358
def __init__(
    self,
    label: str,
    *,
    source: Role,
    target: Role,
    state: str = 'x2',
    k: Annotated[float, RealSet.closed_open(0, oo)] = 0.1,
) -> None:
    super().__init__(label)
    self.source = source
    self.target = target
    self.state = state
    self.k = k

DriveInteraction(label, *, source, target, read='x2', write='y', k=1.0)

Bases: Interaction

Drive of a state of the target by a state of the source, x_t' += k x_s.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
source Role

The path of the element that drives.

required
target Role

The path of the element that is driven.

required
read str

The name of the state of the source that drives.

'x2'
write str

The name of the state of the target whose rate the drive adds to.

'y'
k float

The strength of the drive.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import DriveInteraction
>>> DriveInteraction('coupling', source='drive', target='response', k=8.0).k
8.0
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
def __init__(
    self,
    label: str,
    *,
    source: Role,
    target: Role,
    read: str = 'x2',
    write: str = 'y',
    k: float = 1.0,
) -> None:
    super().__init__(label)
    self.source = source
    self.target = target
    self.read = read
    self.write = write
    self.k = k

EdgeCouplingInteraction(label, *, among, along=True, K=1.0, alpha=0.0)

Bases: Interaction

Kuramoto coupling along the weighted edges of a network.

The coupling is theta_i' += K w_ij sin(theta_j - theta_i - alpha) at both ends of every edge.

The coupling runs once per edge of the network of its oscillators and reads the weight w of the edge from the element on the edges, as the lines of a power grid or the gap junctions of neurons.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
among Role

The path of the group of oscillators on the nodes.

required
along bool | str | None

True for the edges of the network of the oscillators, or the name of a layer.

True
K float

The coupling strength.

1.0
alpha float

The phase lag.

0.0

Examples:

>>> from skcomplex.systems.physics.synchronization import EdgeCouplingInteraction
>>> EdgeCouplingInteraction('coupling', among='nodes', K=0.5).K
0.5
Source code in src/skcomplex/systems/physics/synchronization/_networks.py
111
112
113
114
115
116
117
118
119
120
121
122
def __init__(
    self,
    label: str,
    *,
    among: Role,
    along: bool | str | None = True,
    K: float = 1.0,
    alpha: float = 0.0,
) -> None:
    super().__init__(label, among=among, along=along)
    self.K = K
    self.alpha = alpha

GlobalCouplingInteraction(label, *, target, state='x', K=1.0)

Bases: Interaction

Diffusive coupling of one state of every member to the mean of the group.

The coupling is x_i' += K (mean_j x_j - x_i).

The mean runs over every member, the member itself included, as for oscillators that share one medium, such as cells that exchange a chemical or lasers that share a cavity.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the group.

required
state str

The name of the coupled state.

'x'
K Annotated[float, closed_open(0, oo)]

The coupling strength.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import GlobalCouplingInteraction
>>> GlobalCouplingInteraction('coupling', target='oscillators', state='y').state
'y'
Source code in src/skcomplex/systems/physics/synchronization/_amplitude_death.py
64
65
66
67
68
69
70
71
72
73
74
75
def __init__(
    self,
    label: str,
    *,
    target: Role,
    state: str = 'x',
    K: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.state = state
    self.K = K

HeterogeneousGlobalCouplingSystem(n_systems=100, *, k=2.0, beta=0.1, gamma=2.0, heterogeneity=0.8, random_state=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Globally coupled oscillators with heterogeneous time scales.

The coupling restabilizes their fixed point.

System j follows x_j' = τ_j g(x_j, y_j) + k (X - x_j) and y_j' = τ_j h(x_j, y_j) + k (Y - y_j), where X and Y are the population means and g + ih = (beta + i gamma) z - |z|² z is the Hopf normal form of z = x + iy. Its fixed point 0 is an unstable focus with eigenvalues beta ± i gamma. The time scales τ_j are spread evenly over [1 - heterogeneity, 1 + heterogeneity], with mean 1 and variance sigma². The order parameters X, Y, V = <δτ δx>, and W = <δτ δy> close on four equations. The global fixed point is stable when their eigenvalues nu - k / 2 ± √(k² / 4 + sigma² nu²), for nu = beta ± i gamma, have negative real parts, which holds roughly for 2 beta (1 + sigma) < k < (gamma² - beta²) sigma² / beta. The system has the states systems.x and systems.y and the observables amplitude, the mean amplitude, and the order parameters X, Y, V, and W.

Parameters:

Name Type Description Default
n_systems int

The number of coupled systems.

100
k float

The coupling constant.

2.0
beta float

The growth rate β of the unstable focus.

0.1
gamma float

The rotation rate gamma of the unstable focus.

2.0
heterogeneity float

The half width of the interval of time scales, below 1.

0.8
random_state int | Generator | None

The seed or generator of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import HeterogeneousGlobalCouplingSystem
>>> HeterogeneousGlobalCouplingSystem(4).prepare().system_.elements[0].values['tau']
array([0.4, 0.8, 1.2, 1.6])
Source code in src/skcomplex/systems/physics/synchronization/_amplitude_death.py
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
def __init__(
    self,
    n_systems: int = 100,
    *,
    k: float = 2.0,
    beta: float = 0.1,
    gamma: float = 2.0,
    heterogeneity: float = 0.8,
    random_state: int | np.random.Generator | None = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_systems = n_systems
    self.k = k
    self.beta = beta
    self.gamma = gamma
    self.heterogeneity = heterogeneity
    self.random_state = random_state

HypergraphKuramotoSystem(n_oscillators=60, *, K1=0.0, K2=8.0, width=0.5, links=1.0, triangles=1.0, phases=None, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Kuramoto oscillators coupled in pairs and by three-body interactions.

The three-body interactions act on the triangles of a hypergraph.

Oscillator i follows theta_i' = omega_i + (K1 / <k1>) sum_j sin(theta_j - theta_i) + (K2 / <k2>) sum_jk sin(theta_j + theta_k - 2 theta_i) over the links ij and the triangles ijk of a random hypergraph, where <k1> and <k2> are the mean numbers of links and of triangles of a node. All-to-all, the triangle term is the three-body coupling of Skardal and Arenas, and the Ott-Antonsen reduction of Lorentzian frequencies of half width width gives r' = -width r + K1 (r - r^3) / 2 + K2 (r^3 - r^5) / 2. Without links, the incoherent state stays stable for every K2, and for K2 > 8 width a synchronized state of r^2 = (1 + sqrt(1 - 8 width / K2)) / 2 coexists with it, so the order parameter depends on the initial phases and sweeps of the coupling show hysteresis. The system has the phases oscillators.theta and the order parameter order.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators, the nodes of the hypergraph.

60
K1 float

The pairwise coupling, divided by the mean number of links of a node.

0.0
K2 float

The three-body coupling, divided by the mean number of triangles of a node.

8.0
width float

The half width of the Lorentzian distribution of the natural frequencies.

0.5
links float

The probability that a pair of oscillators is a link.

1.0
triangles float

The probability that a triple of oscillators is a triangle.

1.0
phases Sequence[float] | None

The initial phases, or None for phases drawn uniformly from the circle.

None
seed int

The seed of the hypergraph, the frequencies, and the phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import HypergraphKuramotoSystem
>>> system = HypergraphKuramotoSystem(6).prepare().system_
>>> len(system.elements[0].space.prepare().hyperedges_)
35
Source code in src/skcomplex/systems/physics/synchronization/_hypergraphs.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
def __init__(
    self,
    n_oscillators: int = 60,
    *,
    K1: float = 0.0,
    K2: float = 8.0,
    width: float = 0.5,
    links: float = 1.0,
    triangles: float = 1.0,
    phases: Sequence[float] | None = None,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.K1 = K1
    self.K2 = K2
    self.width = width
    self.links = links
    self.triangles = triangles
    self.phases = phases
    self.seed = seed

IntegrateAndFireOscillatorElement(label, *, x=0.0, size=None)

Bases: Element

Integrate-and-fire oscillator with the charge x, alone or in a group of size members.

ChargingInteraction charges the oscillator and PulseFiringInteraction fires it at 1.

Parameters:

Name Type Description Default
label str

The label of the oscillator or the group.

required
x object

The initial charge, or one charge per member.

0.0
size int | None

The number of members of the group, or None for one oscillator.

None

Examples:

>>> from skcomplex.systems.physics.synchronization import IntegrateAndFireOscillatorElement
>>> IntegrateAndFireOscillatorElement('oscillators', x=[0.1, 0.5], size=2).size
2
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
50
51
52
def __init__(self, label: str, *, x: object = 0.0, size: int | None = None) -> None:
    super().__init__(label, size=size)
    self.x = x

KuramotoCouplingInteraction(label, *, target, K=1.0, alpha=0.0, reduce='sum', include_self=False, neighborhood=None)

Bases: Interaction

Kuramoto coupling theta_i' += K sum_j sin(theta_j - theta_i - alpha) of the phases of a group.

The sum, or the mean, runs over every other member of the group, or over the members within a neighbourhood such as RadiusNeighborhood(r). With include_self it also runs over j = i, whose term -K sin(alpha) slows every phase. Over the whole group, the coupling reads the group sums of sin theta and cos theta once, so it costs time linear in the size of the group, as for fireflies that all see each other or the generators of one grid.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the group of oscillators.

required
K float

The coupling strength of one pair.

1.0
alpha float

The phase lag.

0.0
reduce str

'sum' or 'mean'.

'sum'
include_self bool

Whether the sum also runs over the member itself.

False
neighborhood BaseNeighborhood | None

The neighbourhood of every member, or None for the whole group.

None

Raises:

Type Description
ValidationError

The reduction is neither 'sum' nor 'mean'.

Examples:

>>> import numpy as np
>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.physics.common.oscillators import PhaseOscillatorElement
>>> from skcomplex.systems.physics.synchronization import KuramotoCouplingInteraction
>>> phases = PhaseOscillatorElement('phases', theta=[0.0, 1.0, 2.0, 3.0], size=4)
>>> coupling = KuramotoCouplingInteraction('coupling', target='phases', K=2.0, reduce='mean')
>>> system = System(elements=[phases], interactions=[coupling]).prepare()
>>> theta = system.simulate(until=20.0, dt=1.0).get_values('phases.theta')
>>> round(float(np.ptp(theta[-1])), 6)
0.0
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
def __init__(
    self,
    label: str,
    *,
    target: Role,
    K: float = 1.0,
    alpha: float = 0.0,
    reduce: str = 'sum',
    include_self: bool = False,
    neighborhood: BaseNeighborhood | None = None,
) -> None:
    super().__init__(label)
    self.target = target
    self.K = K
    self.alpha = alpha
    self.reduce = reduce
    self.include_self = include_self
    self.neighborhood = neighborhood

KuramotoOnNetworksSystem(n_oscillators=200, *, network='watts_strogatz', degree=6, rewiring=0.1, K=1.0, sigma=0.5, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Kuramoto oscillators coupled along the edges of a network.

The oscillators follow theta_i' = omega_i + K sum_j A_ij sin(...).

Oscillator i follows theta_i' = omega_i + (K / <k>) sum_j w_ij sin(theta_j - theta_i) over its neighbours j, where the weights w_ij = 1 live on a group on the edges and <k> is the mean degree. The coupling runs once per edge. The natural frequencies are drawn from a normal distribution of width sigma, and the phases uniformly from the circle. Above a critical coupling of the order of the all-to-all value 2 sigma sqrt(2 / pi), the order parameter r = |<exp(i theta)>| grows from about 1 / sqrt(N) towards 1, and small-world shortcuts lower it. The system has the phases oscillators.theta, the weights links.w, and the order parameter order.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators, the nodes of the network.

200
network str

The generator, 'watts_strogatz', 'erdos_renyi', or 'barabasi_albert'.

'watts_strogatz'
degree int

The mean degree of the network, even for the Watts-Strogatz ring.

6
rewiring float

The probability of rewiring every edge of the Watts-Strogatz ring.

0.1
K float

The coupling strength, divided by the mean degree.

1.0
sigma float

The standard deviation of the natural frequencies.

0.5
seed int

The seed of the network, the frequencies, and the phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ValueError

The network is unknown.

Examples:

>>> from skcomplex.systems.physics.synchronization import KuramotoOnNetworksSystem
>>> system = KuramotoOnNetworksSystem(20, degree=4).prepare().system_
>>> system.elements[1].space.graph.number_of_edges()
40
Source code in src/skcomplex/systems/physics/synchronization/_networks.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
def __init__(
    self,
    n_oscillators: int = 200,
    *,
    network: str = 'watts_strogatz',
    degree: int = 6,
    rewiring: float = 0.1,
    K: float = 1.0,
    sigma: float = 0.5,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.network = network
    self.degree = degree
    self.rewiring = rewiring
    self.K = K
    self.sigma = sigma
    self.seed = seed

KuramotoSakaguchiChimeraSystem(n_oscillators=32, *, A=0.2, beta=0.1, spread=0.1, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Two populations of identical phase oscillators with phase lag.

One population synchronizes and one drifts.

Oscillator i of population p follows theta_i' = sum_q (K_pq / N) sum_j sin(theta_j - theta_i - alpha), with the stronger coupling mu = (1 + A) / 2 inside a population, the weaker nu = (1 - A) / 2 between them, and the lag alpha = pi / 2 - beta. Every population reads the means of cos theta and sin theta of both populations. The first population starts nearly synchronized and the second spread over the circle. The populations settle in a chimera, where one is fully synchronized and the other keeps drifting with a partial order parameter, which breathes for A = 0.2. Which population ends up coherent depends on the initial phases. The system has the phases first.theta and second.theta and the order parameters first_order and second_order.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators of every population.

32
A float

The disparity of the couplings inside and between the populations.

0.2
beta float

The distance of the phase lag from pi / 2.

0.1
spread float

The width of the initial phases of the first population.

0.1
seed int

The seed of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import KuramotoSakaguchiChimeraSystem
>>> len(KuramotoSakaguchiChimeraSystem(4).prepare().system_.interactions)
4
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
def __init__(
    self,
    n_oscillators: int = 32,
    *,
    A: float = 0.2,
    beta: float = 0.1,
    spread: float = 0.1,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.A = A
    self.beta = beta
    self.spread = spread
    self.seed = seed

KuramotoSystem(n_oscillators=50, *, K=4.0, sigma=1.0, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Kuramoto oscillators coupled all to all.

The oscillators follow theta_i' = omega_i + (K / N) sum_j sin(theta_j - theta_i).

Every oscillator reads the group means of cos theta and sin theta, so the coupling costs time linear in the number of oscillators. The natural frequencies are drawn from a normal distribution of width sigma, and the phases uniformly from the circle. Above the critical coupling K_c = 2 sigma sqrt(2 / pi) a synchronized cluster forms, and the order parameter r, the modulus of the mean of exp(i theta), grows from about 1 / sqrt(N) towards 1. The system has the phases oscillators.theta and the order parameter order.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

50
K float

The coupling strength.

4.0
sigma float

The standard deviation of the natural frequencies.

1.0
seed int

The seed of the natural frequencies and the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import KuramotoSystem
>>> system = KuramotoSystem(10).prepare().system_
>>> system.elements[0].size, system.space
(10, None)
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
def __init__(
    self,
    n_oscillators: int = 50,
    *,
    K: float = 4.0,
    sigma: float = 1.0,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.K = K
    self.sigma = sigma
    self.seed = seed

LinkCouplingInteraction(label, *, links, nodes, triangles=None, K=1.0)

Bases: Interaction

Coupling of the phases on the links of a cell complex through its nodes and its triangles.

The link phases turn by K (R_nodes d(sin(codifferential(phi))) - codifferential(sin(d phi))), Eq. 6 of the review of Majhi, Perc, and Ghosh. With triangles, Eq. 8, the coupling through the nodes is scaled by R_nodes R_up and the coupling through the triangles by R_links, where R_up is the order parameter of the projection d phi of the link phases on the triangles.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
links Role

The path of the phases on the links.

required
nodes Role

The path of the phases on the nodes.

required
triangles Role | None

The path of the element on the triangles, or None for the coupling of Eq. 6.

None
K float

The coupling.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import LinkCouplingInteraction
>>> LinkCouplingInteraction('coupling', links='links', nodes='nodes').triangles is None
True
Source code in src/skcomplex/systems/physics/synchronization/_topological.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
def __init__(
    self,
    label: str,
    *,
    links: Role,
    nodes: Role,
    triangles: Role | None = None,
    K: float = 1.0,
) -> None:
    super().__init__(label)
    self.links = links
    self.nodes = nodes
    self.triangles = triangles
    self.K = K

LinkElement(label, *, w=1.0, space=None, on=None)

Bases: Element

Edge of a network with a weight w.

Couplings along the edge read the weight, as the strength of a power line or of a synapse.

Parameters:

Name Type Description Default
label str

The label of the edge or the group on the edges.

required
w Annotated[object, closed_open(0, oo)]

The weight of the edge, or one weight per edge.

1.0
space BaseSpace | None

The network of the edges, or None for one edge.

None
on str | None

'edges' for one member on every edge of the network, 'hyperedges' for one on every hyperedge, or None.

None

Examples:

>>> from skcomplex.systems.physics.common.oscillators import LinkElement
>>> LinkElement('link', w=0.5).w
0.5
Source code in src/skcomplex/systems/physics/common/oscillators/_link.py
42
43
44
45
46
47
48
49
50
51
def __init__(
    self,
    label: str,
    *,
    w: Annotated[object, RealSet.closed_open(0, oo)] = 1.0,
    space: BaseSpace | None = None,
    on: str | None = None,
) -> None:
    super().__init__(label, space=space, on=on)
    self.w = w

LogisticCouplingInteraction(label, *, target, state='x')

Bases: Interaction

Coupled logistic maps.

The maps follow x_i(t + 1) = (1 - epsilon) f(x_i) + epsilon mean_j f(x_j) with f(x) = r x (1 - x).

The map of every node mixes with the mean of the maps of its neighbours j on its lattice or network, with the parameters r and epsilon of the node. A node with no neighbours keeps (1 - epsilon) f(x_i). It is the map form of coupling, as for populations on islands that exchange migrants or chaotic lasers that share light.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the maps, on the nodes of a lattice or network.

required
state str

The name of the state that the maps iterate.

'x'

Examples:

>>> import networkx as nx
>>> from skcomplex.core.components.spaces import NetworkSpace
>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.physics.synchronization import LogisticCouplingInteraction, LogisticNodeElement
>>> maps = LogisticNodeElement('maps', x=[0.25, 0.5], epsilon=0.5, space=NetworkSpace(nx.path_graph(2)))
>>> system = System(elements=[maps], interactions=[LogisticCouplingInteraction('coupling', target='maps')])
>>> system.prepare().simulate(until=1).get_values('maps.x')[-1].tolist()
[0.875, 0.875]
Source code in src/skcomplex/systems/physics/synchronization/_networks.py
173
174
175
176
def __init__(self, label: str, *, target: Role, state: str = 'x') -> None:
    super().__init__(label)
    self.target = target
    self.state = state

LogisticNodeElement(label, *, x=0.5, r=4.0, epsilon=0.5, space=None)

Bases: Element

Logistic maps on the nodes of a network, with their values, growth rates, and weights of the neighbours.

LogisticCouplingInteraction iterates x_i(t + 1) = (1 - epsilon) f(x_i) + epsilon mean_j f(x_j), where the map f(x) = r x (1 - x) of the node mixes with the mean of the maps of its neighbours j on the network.

Parameters:

Name Type Description Default
label str

The label of the maps.

required
x object

The initial value, or one value per node.

0.5
r float

The growth rate of the logistic map.

4.0
epsilon Annotated[float, closed_open(0, oo)]

The weight of the neighbours.

0.5
space BaseSpace | None

The network or lattice with one map on every node, or None for one map.

None

Examples:

>>> from skcomplex.systems.physics.synchronization import LogisticNodeElement
>>> LogisticNodeElement('node').epsilon
0.5
Source code in src/skcomplex/systems/physics/synchronization/_networks.py
64
65
66
67
68
69
70
71
72
73
74
75
76
def __init__(
    self,
    label: str,
    *,
    x: object = 0.5,
    r: float = 4.0,
    epsilon: Annotated[float, RealSet.closed_open(0, oo)] = 0.5,
    space: BaseSpace | None = None,
) -> None:
    super().__init__(label, space=space)
    self.x = x
    self.r = r
    self.epsilon = epsilon

LogisticUnitElement(label, *, x=0.3, values=None)

Bases: Element

Value x in [0, 1] of a logistic map.

The maps of the coupling iterate the value.

Parameters:

Name Type Description Default
label str

The label of the unit.

required
x float

The initial value.

0.3
values Mapping[str, object] | None

Further values by name, such as the past values 'x[-1]' that a delayed coupling reads, or None.

None

Examples:

>>> from skcomplex.systems.physics.synchronization import LogisticUnitElement
>>> LogisticUnitElement('unit').x
0.3
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
53
54
55
def __init__(self, label: str, *, x: float = 0.3, values: Mapping[str, object] | None = None) -> None:
    super().__init__(label, values=values)
    self.x = x

LorenzFlowInteraction(label, *, target, sigma=10.0, rho=28.0, beta=8 / 3)

Bases: Interaction

Lorenz flow x' = sigma (y - x), y' = x (rho - z) - y, z' = x y - beta z.

For sigma = 10, rho = 28, and beta = 8/3 the runs never settle and never repeat, the strange attractor of Lorenz.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the element whose values x, y, and z the flow moves.

required
sigma float

The Prandtl number.

10.0
rho float

The Rayleigh number relative to its critical value.

28.0
beta float

The geometric factor.

8 / 3

Examples:

>>> from skcomplex.systems.physics.synchronization import LorenzFlowInteraction
>>> LorenzFlowInteraction('flow', target='response', beta=2.666).beta
2.666
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
def __init__(
    self,
    label: str,
    *,
    target: Role,
    sigma: float = 10.0,
    rho: float = 28.0,
    beta: float = 8 / 3,
) -> None:
    super().__init__(label)
    self.target = target
    self.sigma = sigma
    self.rho = rho
    self.beta = beta

MirolloStrogatzSystem(n_oscillators=5, *, S=2.0, gamma=1.0, epsilon=0.1, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Integrate-and-fire oscillators coupled by pulses.

The oscillators end up firing in unison.

Every oscillator of the group charges as x' = S - gamma x, a concave rise, and fires when it reaches 1. Firing is an event whose guard is the group maximum of the charges, and it resets the most charged oscillators to 0 and lifts every other one by epsilon. An oscillator lifted to 1 fires at the same instant and is absorbed into the group that fired, so the groups merge until all oscillators fire together. The system has the charges oscillators.x of the group members and the firings as fire events.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

5
S float

The charging input.

2.0
gamma float

The leak rate, below S so that the oscillators fire.

1.0
epsilon float

The strength of a pulse.

0.1
seed int

The seed of the initial charges.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import MirolloStrogatzSystem
>>> MirolloStrogatzSystem(3).prepare().system_.elements[0].size
3
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
def __init__(
    self,
    n_oscillators: int = 5,
    *,
    S: float = 2.0,
    gamma: float = 1.0,
    epsilon: float = 0.1,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.S = S
    self.gamma = gamma
    self.epsilon = epsilon
    self.seed = seed

NodeCouplingInteraction(label, *, nodes, links, K=1.0)

Bases: Interaction

Coupling of the phases on the nodes of a cell complex through its links.

The node phases turn by K R_links codifferential(sin(d theta)), where R_links is the order parameter of the projection codifferential(phi) of the link phases on the nodes, as in the topological synchronization of Ghorbanchian et al.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
nodes Role

The path of the phases on the nodes.

required
links Role

The path of the phases on the links.

required
K float

The coupling.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import NodeCouplingInteraction
>>> NodeCouplingInteraction('coupling', nodes='nodes', links='links', K=2.0).K
2.0
Source code in src/skcomplex/systems/physics/synchronization/_topological.py
68
69
70
71
72
def __init__(self, label: str, *, nodes: Role, links: Role, K: float = 1.0) -> None:
    super().__init__(label)
    self.nodes = nodes
    self.links = links
    self.K = K

NonlocalRingChimeraSystem(n_oscillators=100, *, R=14, alpha=1.46, omega=0.0, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Identical phase oscillators on a ring.

Each oscillator is coupled to its R nearest neighbours on both sides.

Oscillator i follows phi_i' = omega - (1 / 2R) sum_{j = i - R}^{i + R} sin(phi_i - phi_j + alpha), where the sum includes the oscillator itself. Near alpha = pi / 2, coherent and incoherent domains coexist on the ring as a chimera state, which is a long transient on small rings. The system has the phases ring.theta and the places of the oscillators ring.x.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators on the ring.

100
R int

The range of the coupling.

14
alpha float

The phase lag.

1.46
omega float

The natural frequency.

0.0
seed int

The seed of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import NonlocalRingChimeraSystem
>>> NonlocalRingChimeraSystem(20, R=3).prepare().system_.interactions[1].neighborhood.radius
3.5
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
def __init__(
    self,
    n_oscillators: int = 100,
    *,
    R: int = 14,
    alpha: float = 1.46,
    omega: float = 0.0,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.R = R
    self.alpha = alpha
    self.omega = omega
    self.seed = seed

OscillatorDeathSystem(n_oscillators=100, *, K=3.0, width=1.5, distribution='lorentzian', random_state=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Globally coupled Stuart-Landau oscillators.

Their oscillations all die for strong coupling and spread.

Oscillator j follows z_j' = (1 + iω_j) z_j - |z_j|² z_j + (K / N) Σ_k (z_k - z_j) for z_j = x_j + i y_j. Alone it settles on the unit circle. The frequencies are the midpoint quantiles of a density of width ω0, the Lorentzian ω0 / (π (ω² + ω0²)) or the quartic g0 / (ω⁴ + ω0⁴). For many oscillators, the common fixed point z = 0 is stable for K > 1 and ω0 above a critical width, 1 for the Lorentzian and (1 + √(2K - 1)) / √2 for the quartic density, and every amplitude then decays to zero. For the Lorentzian, the slowest perturbation decays at the rate ω0 - 1. The system has the states oscillators.x and oscillators.y and the observables amplitude, the mean amplitude, X and Y, the mean field, and order, its modulus.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

100
K float

The coupling strength.

3.0
width float

The width ω0 of the density of frequencies.

1.5
distribution str

The density of frequencies, 'lorentzian' or 'quartic'.

'lorentzian'
random_state int | Generator | None

The seed or generator of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ValidationError

The distribution is neither 'lorentzian' nor 'quartic'.

Examples:

>>> from skcomplex.systems.physics.synchronization import OscillatorDeathSystem
>>> OscillatorDeathSystem(4, distribution='quartic').prepare().system_.elements[0].size
4
Source code in src/skcomplex/systems/physics/synchronization/_amplitude_death.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
def __init__(
    self,
    n_oscillators: int = 100,
    *,
    K: float = 3.0,
    width: float = 1.5,
    distribution: str = 'lorentzian',
    random_state: int | np.random.Generator | None = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.K = K
    self.width = width
    self.distribution = distribution
    self.random_state = random_state

OttAntonsenSystem(r=0.1, *, K=2.0, Delta=0.5, omega=0.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Ott-Antonsen equation for the order parameter of Kuramoto oscillators.

The oscillators are infinitely many.

For natural frequencies with a Lorentzian distribution of center omega and half width Delta, the complex order parameter z = x + i y follows exactly z' = (i omega - Delta) z + (K / 2)(1 - |z|²) z, a Stuart-Landau oscillator with the growth rate K / 2 - Delta and the saturation K / 2. Its modulus settles at sqrt(1 - 2 Delta / K) above the critical coupling K_c = 2 Delta, and at 0 below it. The system has the real part field.x and the imaginary part field.y of the order parameter.

Parameters:

Name Type Description Default
r float

The initial modulus of the order parameter.

0.1
K float

The coupling strength.

2.0
Delta float

The half width of the distribution of natural frequencies.

0.5
omega float

The center of the distribution of natural frequencies.

0.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import OttAntonsenSystem
>>> OttAntonsenSystem(K=3.0).prepare().system_.elements[0].values['kappa']
1.5
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
def __init__(
    self,
    r: float = 0.1,
    *,
    K: float = 2.0,
    Delta: float = 0.5,
    omega: float = 0.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.r = r
    self.K = K
    self.Delta = Delta
    self.omega = omega

PopulationCouplingInteraction(label, *, target, source, K=1.0, alpha=0.0)

Bases: Interaction

Kuramoto-Sakaguchi coupling of a population to the mean of a population of one size.

Oscillator i of the target turns as theta_i' += (K / N) sum_j sin(theta_j - theta_i - alpha), a sum over every member j of the source, the oscillator itself included when the source is the target. The coupling reads the sums of sin theta and cos theta of the source once, so it costs time linear in the size of the populations, as for two groups of fireflies or two hemispheres of a brain.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the population whose phases the coupling turns.

required
source Role

The path of the population whose phases the coupling reads, of the size of the target.

required
K float

The coupling strength.

1.0
alpha float

The phase lag.

0.0

Examples:

>>> from skcomplex.systems.physics.synchronization import PopulationCouplingInteraction
>>> PopulationCouplingInteraction('coupling', target='first', source='second', alpha=1.5).alpha
1.5
Source code in src/skcomplex/systems/physics/synchronization/_kuramoto.py
439
440
441
442
443
444
def __init__(self, label: str, *, target: Role, source: Role, K: float = 1.0, alpha: float = 0.0) -> None:
    super().__init__(label)
    self.target = target
    self.source = source
    self.K = K
    self.alpha = alpha

PulseFiringInteraction(label, *, target, epsilon=0.1)

Bases: Interaction

Firing of a group of integrate-and-fire oscillators when the most charged one reaches 1.

The firing resets the most charged oscillators to 0 and lifts every other one by the pulse epsilon. An oscillator lifted to 1 fires at the same instant and resets to 0 with the others, as fireflies that flash together or pacemaker cells of a heart.

Parameters:

Name Type Description Default
label str

The label of the interaction, which also names the firings in the trajectory.

required
target Role

The path of the group of oscillators.

required
epsilon Annotated[float, closed_open(0, oo)]

The strength of a pulse.

0.1

Examples:

>>> from skcomplex.systems.physics.synchronization import PulseFiringInteraction
>>> PulseFiringInteraction('fire', target='oscillators', epsilon=0.2).epsilon
0.2
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
131
132
133
134
135
136
137
138
139
140
def __init__(
    self,
    label: str,
    *,
    target: Role,
    epsilon: Annotated[float, RealSet.closed_open(0, oo)] = 0.1,
) -> None:
    super().__init__(label)
    self.target = target
    self.epsilon = epsilon

RosslerDrivenLorenzSystem(k=8.0, *, auxiliary=True, p=1 / 6, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A chaotic Rössler system that drives a Lorenz-63 system.

The drive acts through the second variable.

The drive follows p x1' = -x2 - x3, p x2' = x1 + 0.2 x2, p x3' = 0.2 + x3 (x1 - 5.7), with the time scale p = 1 / 6 that brings it close to the Lorenz system, and the response follows y1' = 10 (y2 - y1), y2' = 28 y1 - y2 - y1 y3 + k x2, y3' = y1 y2 - 2.666 y3. The two systems have nothing in common, yet for a coupling above k ≈ 6.66 the response forgets its initial state and becomes a function of the state of the drive, generalized synchronization. With auxiliary, a second copy of the response from another initial state receives the same drive, and the two copies converge to each other exactly when generalized synchronization holds, the auxiliary system method. The system has the drive drive.x1, drive.x2, drive.x3, the response response.x, response.y, response.z, and with auxiliary the copy auxiliary.x, auxiliary.y, auxiliary.z.

Parameters:

Name Type Description Default
k float

The strength of the coupling.

8.0
auxiliary bool

Whether a second copy of the response, auxiliary, receives the drive too.

True
p float

The time scale of the drive.

1 / 6
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import RosslerDrivenLorenzSystem
>>> trajectory = RosslerDrivenLorenzSystem(auxiliary=False).prepare().simulate(until=1.0, dt=0.5)
>>> [round(float(value), 1) for value in trajectory.get_values('response.x')]
[1.0, -0.1, -8.9]
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
707
708
709
710
711
712
713
714
715
716
717
718
719
720
def __init__(
    self,
    k: float = 8.0,
    *,
    auxiliary: bool = True,
    p: float = 1 / 6,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.k = k
    self.auxiliary = auxiliary
    self.p = p

RosslerFlowInteraction(label, *, target, omega=1.0, a=0.2, b=0.2, c=5.7, p=1.0)

Bases: Interaction

Rössler flow x1' = -omega x2 - x3, x2' = omega x1 + a x2, x3' = b + x3 (x1 - c).

The flow is chaotic for a = b = 0.2 and c = 5.7. The time scale p divides every rate, p x' = f(x), so p < 1 speeds the oscillator up.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator whose variables x1, x2, and x3 the flow moves.

required
omega float

The natural frequency.

1.0
a float

The first Rössler parameter.

0.2
b float

The second Rössler parameter.

0.2
c float

The third Rössler parameter.

5.7
p Annotated[float, open(0, oo)]

The time scale, which divides every rate.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import RosslerFlowInteraction
>>> RosslerFlowInteraction('flow', target='oscillator').c
5.7
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
def __init__(
    self,
    label: str,
    *,
    target: Role,
    omega: float = 1.0,
    a: float = 0.2,
    b: float = 0.2,
    c: float = 5.7,
    p: Annotated[float, RealSet.open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.omega = omega
    self.a = a
    self.b = b
    self.c = c
    self.p = p

RosslerOscillatorElement(label, *, x1=1.0, x2=0.0, x3=0.0)

Bases: Element

Rössler oscillator with the three variables x1, x2, and x3.

RosslerFlowInteraction moves the variables.

Parameters:

Name Type Description Default
label str

The label of the oscillator.

required
x1 float

The initial first variable.

1.0
x2 float

The initial second variable.

0.0
x3 float

The initial third variable.

0.0

Examples:

>>> from skcomplex.systems.physics.synchronization import RosslerOscillatorElement
>>> RosslerOscillatorElement('oscillator', x1=2.0).x1
2.0
Source code in src/skcomplex/systems/physics/synchronization/_chaos.py
82
83
84
85
86
def __init__(self, label: str, *, x1: float = 1.0, x2: float = 0.0, x3: float = 0.0) -> None:
    super().__init__(label)
    self.x1 = x1
    self.x2 = x2
    self.x3 = x3

SimplexCouplingInteraction(label, *, target, K1=0.0, K2=1.0)

Bases: Interaction

Kuramoto coupling through the simplices of a hypergraph, pairs and triangles.

On a link, the focal oscillator i gets K1 sin(theta_j - theta_i), and on a triangle K2 sin(theta_j + theta_k - 2 theta_i) from its two other members j and k, as for neurons that fire in groups or species that compete in threes.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the group of oscillators on the nodes of a network with hyperedges.

required
K1 float

The coupling of every link.

0.0
K2 float

The coupling of every triangle.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import SimplexCouplingInteraction
>>> SimplexCouplingInteraction('coupling', target='oscillators', K2=0.5).K2
0.5
Source code in src/skcomplex/systems/physics/synchronization/_hypergraphs.py
63
64
65
66
67
def __init__(self, label: str, *, target: Role, K1: float = 0.0, K2: float = 1.0) -> None:
    super().__init__(label)
    self.target = target
    self.K1 = K1
    self.K2 = K2

SwarmalatorCouplingInteraction(label, *, target, cutoff=1000000.0, A=1.0, B=1.0, J=1.0, K=0.0, n_units=1)

Bases: Interaction

Coupling of swarmalators through their separations r and their phase differences dtheta.

Each swarmalator moves toward every other at the speed (A + J cos(dtheta)) / N, away from it at B / (N |r|), and turns its phase toward the other's at the rate K sin(dtheta) / (N |r|), as in O'Keeffe, Ceron, and Petersen. The sums run over the others within the cutoff, as fireflies that swarm or sperm cells that swim and beat together.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the group of swarmalators.

required
cutoff Annotated[float, open(0, oo)]

The distance beyond which pairs do not interact, large for the all-to-all system.

1000000.0
A Annotated[float, closed_open(0, oo)]

The strength of the attraction.

1.0
B Annotated[float, closed_open(0, oo)]

The strength of the repulsion.

1.0
J float

The influence of the phase similarity on the attraction.

1.0
K float

The phase coupling, synchronizing when positive.

0.0
n_units int

The number of swarmalators N that normalizes the coupling.

1

Examples:

>>> from skcomplex.systems.physics.synchronization import SwarmalatorCouplingInteraction
>>> SwarmalatorCouplingInteraction('coupling', target='units', J=0.5).J
0.5
Source code in src/skcomplex/systems/physics/synchronization/_swarmalators.py
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
def __init__(
    self,
    label: str,
    *,
    target: Role,
    cutoff: Annotated[float, RealSet.open(0, oo)] = 1000000.0,
    A: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    B: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    J: float = 1.0,
    K: float = 0.0,
    n_units: int = 1,
) -> None:
    super().__init__(label)
    self.target = target
    self.cutoff = cutoff
    self.A = A
    self.B = B
    self.J = J
    self.K = K
    self.n_units = n_units

SwarmalatorElement(label, *, theta=0.0, omega=1.0, x=0.0, size=None, space=None, values=None)

Bases: SitedOscillatorElement

Phase oscillator whose place x is a position.

The position moves by the rates of interactions, and the phase wraps around the circle.

Parameters:

Name Type Description Default
label str

The label of the swarmalator or the group.

required
theta Annotated[object, Period(2 * pi)]

The initial phase.

0.0
omega object

The natural frequency.

1.0
x object

The initial position, one row per member or shared.

0.0
size int | None

The number of swarmalators, or None for one.

None
space BaseSpace | None

The continuous space of the swarmalators, or None for none.

None
values Mapping[str, object] | None

Further values by name, or None.

None

Examples:

>>> from skcomplex.systems.physics.synchronization import SwarmalatorElement
>>> SwarmalatorElement('unit', x=[0.0, 1.0]).x
[0.0, 1.0]
Source code in src/skcomplex/systems/physics/common/oscillators/_sited_oscillator.py
49
50
51
52
53
54
55
56
57
58
59
60
61
def __init__(
    self,
    label: str,
    *,
    theta: Annotated[object, Period(2 * math.pi)] = 0.0,
    omega: object = 1.0,
    x: object = 0.0,
    size: int | None = None,
    space: BaseSpace | None = None,
    values: Mapping[str, object] | None = None,
) -> None:
    super().__init__(label, theta=theta, omega=omega, size=size, space=space, values=values)
    self.x = x

SwarmalatorsSystem(n_units=100, *, J=1.0, K=0.0, A=1.0, B=1.0, random_state=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Swarmalators.

The phases of identical oscillators set their attraction and their positions their coupling.

Every swarmalator i moves by (1 / N) sum_j [(x_j - x_i) / |x_j - x_i| (A + J cos(theta_j - theta_i)) - B (x_j - x_i) / |x_j - x_i|^2] and turns by (K / N) sum_j sin(theta_j - theta_i) / |x_j - x_i|. With J > 0 like phases attract. With K = 0 and J = 1 the swarm settles into a static phase wave, a disk whose phase winds once around its center, so one of the order parameters S± = |mean(exp(i (phi ± theta)))| of the spatial angle phi and the phase approaches 1. With K > 0 the phases synchronize into a uniform disk, and with K < 0 and small J they stay asynchronous. The system has the positions units.x and the phases units.theta.

Parameters:

Name Type Description Default
n_units int

The number of swarmalators N.

100
J float

The influence of the phase similarity on the attraction.

1.0
K float

The phase coupling.

0.0
A float

The strength of the attraction.

1.0
B float

The strength of the repulsion.

1.0
random_state int | Generator | None

The seed or generator of the initial positions in the square of side 2 and of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import SwarmalatorsSystem
>>> SwarmalatorsSystem(10, K=-0.1).prepare().system_.interactions[0].K
-0.1
Source code in src/skcomplex/systems/physics/synchronization/_swarmalators.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
def __init__(
    self,
    n_units: int = 100,
    *,
    J: float = 1.0,
    K: float = 0.0,
    A: float = 1.0,
    B: float = 1.0,
    random_state: int | np.random.Generator | None = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_units = n_units
    self.J = J
    self.K = K
    self.A = A
    self.B = B
    self.random_state = random_state

TopologicalKuramotoSystem(n_nodes=30, *, density=0.4, coupling=2.0, width=1.0, seed=0, model='NL', label='system', solver='auto', backend='auto')

Bases: BaseSystem

Phases on the nodes and links of a clique complex.

The phases are coupled through its incidence by order parameters.

Node phases follow theta' = omega + K R_links codifferential(sin(d theta)). Link phases follow phi' = omega + K R_nodes d(sin(codifferential(phi))) - K codifferential(sin(d phi)). With the signs of codifferential, these are the Nodes-Links system of Ghorbanchian et al. (2021), Eq. 6 of the review of Majhi, Perc, and Ghosh (2022, arXiv 2203.06601 §III), which is the source at hand. Here R_nodes is the order parameter of the node phases and R_links that of the projection of the link phases on the nodes. The review takes frequencies of mean Omega and standard deviation 1 / tau, with Omega = 2 and tau = 1 for its Fig. 2, on complexes of 500 nodes. The mean 0, the size, and the random graph are choices of this system.

The Nodes-Links-Triangles system, model='NLT', Eq. 8 of the review, scales the coupling of the link phases through the nodes by R_nodes R_up and through the triangles by R_links, where R_up is the order parameter of the projection of the link phases on the triangles. Every projection then couples to another, so all three order parameters jump together at one explosive transition, while in the Nodes-Links system R_up moves on its own. The system has a group triangles of unit weights on the faces for the Nodes-Links-Triangles system, which only gives the order parameter of the projection on the triangles.

Parameters:

Name Type Description Default
n_nodes int

The number of nodes of the random graph.

30
density float

The probability of every edge of the random graph.

0.4
coupling float

The coupling K.

2.0
width float

The standard deviation of the natural frequencies of the nodes and the links.

1.0
seed int

The seed of the graph, the frequencies, and the initial phases.

0
model str

The coupling, 'NL' for the Nodes-Links system or 'NLT' for the Nodes-Links-Triangles system.

'NL'
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ValidationError

The model is neither 'NL' nor 'NLT'.

Examples:

>>> from skcomplex.systems.physics.synchronization import TopologicalKuramotoSystem
>>> system = TopologicalKuramotoSystem(6, density=0.8).prepare().system_
>>> [len(element.theta) for element in system.elements]
[6, 13]
Source code in src/skcomplex/systems/physics/synchronization/_topological.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
def __init__(
    self,
    n_nodes: int = 30,
    *,
    density: float = 0.4,
    coupling: float = 2.0,
    width: float = 1.0,
    seed: int = 0,
    model: str = 'NL',
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_nodes = n_nodes
    self.density = density
    self.coupling = coupling
    self.width = width
    self.seed = seed
    self.model = model

WinfreeMeanFieldInteraction(label, *, target, K=1.0)

Bases: Interaction

Winfree dynamics theta_i' = omega_i + K mean_j P(theta_j) R(theta_i).

The mean runs over every member j of the group.

The phases turn at the natural frequencies omega of the target, and the influence P(theta) = 1 + cos(theta) that an oscillator sends and the sensitivity R(theta) = -sin(theta) with which it responds make every oscillator respond to the mean influence of the group, as crickets that chirp or cells of a heart that beat.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the group of oscillators, with the phases theta and the natural frequencies omega.

required
K float

The coupling strength.

1.0

Examples:

>>> from skcomplex.systems.physics.synchronization import WinfreeMeanFieldInteraction
>>> WinfreeMeanFieldInteraction('coupling', target='oscillators', K=2.0).K
2.0
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
182
183
184
185
def __init__(self, label: str, *, target: Role, K: float = 1.0) -> None:
    super().__init__(label)
    self.target = target
    self.K = K

WinfreeSystem(n_oscillators=50, *, K=0.5, spread=0.1, seed=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Winfree system.

The system follows theta_i' = omega_i + (K / N) sum_j P(theta_j) R(theta_i), with the sum over all j.

The influence P(theta) = 1 + cos(theta) and the sensitivity R(theta) = -sin(theta) make every oscillator respond to the mean influence of the population, which every oscillator reads as a group mean. The natural frequencies are spread evenly over [1 - spread, 1 + spread]. Weak coupling leaves the oscillators incoherent, moderate coupling locks them to one frequency, and strong coupling stops them, which is oscillator death. The system has the phases oscillators.theta and the order parameter order.

Parameters:

Name Type Description Default
n_oscillators int

The number of oscillators.

50
K float

The coupling strength.

0.5
spread float

The half width of the interval of natural frequencies around 1.

0.1
seed int

The seed of the initial phases.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.synchronization import WinfreeSystem
>>> len(WinfreeSystem(5).prepare().system_.interactions)
1
Source code in src/skcomplex/systems/physics/synchronization/_pulses.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def __init__(
    self,
    n_oscillators: int = 50,
    *,
    K: float = 0.5,
    spread: float = 0.1,
    seed: int = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_oscillators = n_oscillators
    self.K = K
    self.spread = spread
    self.seed = seed