← SCPN-Quantum-Control

The model in one equation

Each oscillator $i$ has a phase $\theta_i$ and its own natural frequency $\omega_i$. It advances at its own rate plus a pull toward the population's collective phase, scaled by the coupling $K$. The collective phase is captured by the complex order parameter $R\,e^{i\psi}$ — the average of every oscillator's unit phasor. Its magnitude $R$ runs from $0$ (a uniform blur) to $1$ (perfect lock).

$$\dot\theta_i \;=\; \omega_i \;+\; K\,R\,\sin(\psi-\theta_i),\qquad R\,e^{i\psi} \;=\; \frac{1}{N}\sum_{j=1}^{N} e^{i\theta_j}$$

The mean-field kernel writes the coupling in the algebraically identical form $K\big(\bar{s}\cos\theta_i-\bar{c}\sin\theta_i\big)$ with $\bar{c}=\langle\cos\theta\rangle,\ \bar{s}=\langle\sin\theta\rangle$, so a single pass over the population drives every oscillator. It is integrated with fixed-step fourth-order Runge–Kutta — the same kernel the platform pins its browser panel to.

Live — mean-field Kuramoto, RK4
order parameter R: coupling K: state:

The left wheel shows each oscillator as a dot on the unit circle; the arrow is the order-parameter vector $R\,e^{i\psi}$. The right trace is $R$ over time. Start with $K$ low and the dots scatter around the ring — $R$ hugs zero. Raise $K$ past the point where the pull overcomes the frequency spread and a cluster forms: the arrow lengthens and $R$ climbs toward one. Widen the frequency spread and you need more coupling to lock — the competition that sets the critical point.

Deeper: why the browser panel is checked to a tolerance, not bit-for-bit
This panel runs the same mean-field derivative, the same fixed-step RK4 step, and the same order-parameter definition as the library's Python reference and its Rust WASM kernel. The three are pinned to each other — but across languages the elementary $\sin$ and $\cos$ can differ in the last bit, so the reference deliberately checks the panel within a tolerance rather than demanding bit-identical output. Verified here against the Python reference over four trajectories (incoherent, partial, locked, and zero-coupling), the largest divergence in $R$ was under $2\times10^{-14}$ — roundoff, far inside the reference's own tolerance.
Higher-order coupling & explosive synchronisation

Real networks couple in more than pairs. Add a triadic term — each oscillator pulled by pairs of others through a simplicial coupling — and the transition changes character. Where pairwise coupling brings synchronisation on gradually, the higher-order term carries a factor of the order parameter squared, so it can only act once some coherence exists; that self-reinforcement makes the onset explosive and, crucially, hysteretic — the synchronised state survives to weaker coupling on the way down than it needed on the way up.

$$\dot\theta_i=\omega_i+K\,R\,\sin(\psi-\theta_i)+K_3\,R^2\,\sin\!\big(2(\psi-\theta_i)\big)$$
Live — pairwise + triadic Kuramoto, with the hysteresis loop
increasing K decreasing K current K
order parameter R: hysteresis width: onset:

The left wheel runs the combined dynamics at your chosen couplings; the right panel sweeps the pairwise coupling up and then back down at the current triadic strength, settling the system at each step. With $K_3=0$ the two sweeps lie on top of one another — a smooth, reversible transition. Turn up $K_3$ and they split into a loop: synchronisation snaps on abruptly as $K$ rises and holds on well past that point as $K$ falls. That gap is the fingerprint of higher-order interactions, and it is exactly the mean-field reduction of the library's triadic Kuramoto term.

Balanced gain and loss — a symmetric law with a broken outcome

Give each oscillator a complex amplitude and let half of them gain while the other half lose, with the two exactly matched so the coefficients sum to zero. That is a PT-symmetric law: nothing in the generator prefers gain over loss. Yet the renormalised dynamics does not stay balanced. Amplitude spontaneously funnels onto the gaining oscillators, and a population imbalance climbs to a fixed ceiling — the symmetry of the law is not the symmetry of its outcome. The coupling and the frequency spread do not stop that; they set only how phase-coherent the surviving cluster ends up.

$$\dot z_i=\big(g_i+i\,\dot\theta_i\big)z_i,\quad \dot\theta_i=\omega_i+\sum_j K_{ij}\sin(\theta_j-\theta_i),\quad \sum_i g_i=0,\quad I=\sum_i g_i\lvert z_i\rvert^{2}$$

After every step the state is renormalised to fixed total norm, so the gain does not blow the amplitude up — it redistributes it. The population imbalance $I$ is the diagnostic: zero when the mass is shared evenly, and rising toward its ceiling $n\,g$ as the gaining oscillators take it all. The coherence $r=\lvert\sum_i z_i\rvert/\sqrt{n\sum_i\lvert z_i\rvert^{2}}$ reports the phase order of whatever survives.

Live — balanced gain/loss Kuramoto: the imbalance climbs to its ceiling
gain oscillators (g>0) loss oscillators (g<0) imbalance I(t)
coherence r: imbalance I: ceiling n·g: generator: ∑g = 0 (balanced)

The left panel is $\lvert z_i\rvert^{2}$ for each of the six oscillators — three gaining, three losing — and you watch the blue bars swell as the green ones empty. The right panel traces $I(t)$ climbing to the dashed ceiling $n g$ and $r(t)$ settling at the coherence the coupling allows. Slide $g$ to zero and it is ordinary Kuramoto: $I\equiv0$, no funnelling. Any $g>0$ breaks the amplitude symmetry; more coupling or a tighter spread only tightens the phase order of the gaining cluster.

Read this precisely: it is not a coupling-driven phase transition. In this model the gain/loss term acts on the amplitude $\lvert z_i\rvert$ and the coupling acts only on the phase $\theta_i$, so coupling can never rebalance the amplitude — for any $g>0$ the imbalance approaches its ceiling $n g$. What the panel demonstrates is spontaneous PT-symmetry breaking of the state under a balanced generator, and the separate role of coupling in setting the phase coherence $r$. The trajectories are verified in-browser against the library's pt_symmetric_kuramoto kernel to ~1e-15.
Deeper: why it redistributes instead of diverging, and what balanced really buys
Each step applies $z_i\mapsto z_i+\mathrm{d}t\,(g_i+i\dot\theta_i)z_i$ and then rescales the whole vector back to $\lVert z\rVert=\sqrt{n}$, so the total norm is pinned (the library's pt_norm stays $\equiv1$) and unbounded gain shows up as concentration, not blow-up. Because $\sum_i g_i=0$, the fixed points are the pure gain-supported states, and the imbalance ceiling is $\sum_i g_i\lvert z_i\rvert^2$ evaluated there, $n g$ for the balanced three-and-three pattern. The balanced generator does buy one thing the panel makes visible: with $g=0$ the dynamics is norm-preserving and PT-trivial, the ordinary Kuramoto baseline the other two panels above run — this is the same kernel with the gain channel switched on.

Why it sits under everything here

The Kuramoto network is the workload the platform maps onto quantum and analog hardware. The same coupling problem compiles to a Trotterised circuit for a gate machine, to a native Hamiltonian for neutral-atom, circuit-QED and photonic backends, and to this classical mean-field kernel for a fast, honest baseline. Synchronisation is the quantity every one of those routes is trying to reproduce and steer.

RouteWhat carries the dynamicsWhere it runs
Classical mean-fieldthis RK4 kernel over $\theta_i$browser / CPU baseline
Trotterised circuitXY Hamiltonian, gate decompositiongate-based QPU
Native analogRydberg / exchange / beam-splitter couplersneutral-atom, circuit-QED, photonic
Networked classicalper-pair coupling matrix $K_{nm}$CPU, arbitrary topology

Evidence boundary: this is the classical mean-field simulator, run live in your browser from the library's exact kernel — a baseline and a teaching tool, not a hardware result. It makes no quantum-advantage claim; the hardware observations live on the results pages, with their own raw counts and statistics. Frequencies and initial phases are generated on the page; the physics you see is the integrator, which is checked against the Python reference to better than $2\times10^{-14}$.