The runtime’s advantage grows with dimension in both modes, by two distinct mechanisms. In regulation, tracking quality stays flat as channels scale into the thousands at linear cost, and the measurement-efficiency advantage over gradient methods grows without bound — one measurement per update where finite-difference needs n+1. In optimization, a score-weighted measurement-feedback estimator reaches a usable solution at ~n1.2 total measurements within its envelope — sub-quadratic, holding on structured and coupled problems — where sequential digital search needs O(n²) work for comparable quality. And under a starved budget, where a classical solver has too few evaluations to search and stalls, the runtime keeps improving as the problem grows: it overtakes simulated annealing past a crossover and the margin widens with dimension. All results below are reproducible on your own hardware, from controlled benchmarks against fairly-tuned baselines.
For a precise map of where the runtime beats each classical method — and where it does not — see the baselines page.
Under a fixed deadline, the largest problem a sequential solver can handle grows only as the square root of the time budget — it saturates quickly. The runtime’s reachable size grows linearly. The practical consequence: at a tight deadline, digital search is capped at small problems while the runtime keeps producing usable solutions on instances one to two orders of magnitude larger. The advantage is not a percentage — it is the difference between a decision made on time and none at all.
Because cost scales as n1.3 versus n², the decisions-per-second advantage grows linearly with problem size: of order 60× at n=16, 240× at n=64, approaching 1000× at n=256. Larger inner-loop problems mean a wider margin, not a narrower one.
Scope, stated plainly. The n1.3 exponent is measured within the runtime’s envelope — objectives resolvable from the measured marginals, light-to-moderate coupling. On objectives dominated by dense cross-correlations the runtime hits a quality ceiling instead, and a classical local-search solver is the right tool; we are explicit about that boundary on the QUBO and envelope pages. The measured interval on the exponent is also wide (it is a small-sample fit), so we report it as “sub-quadratic, ~n1.3” rather than a precise figure.
In regulation mode the scaling story is different and, if anything, stronger: tracking quality stays flat as dimension grows. Across benchmarked problem sizes from a handful of channels to several thousand, the steady-state tracking error holds in a narrow band (RMS ≈ 0.02) while compute cost grows only linearly (about 1.5µs per channel per round). A 2000× increase in dimension barely moves the error — the per-channel residual update does not get harder as you add channels. This is the property that makes large photonic meshes and sensor arrays tractable: you are not trading accuracy for size.
The clearest way the advantage widens with scale is measurement efficiency. To make one update, the runtime needs one measurement, independent of dimension. A finite-difference gradient method needs n+1 measurements to estimate a single step; SPSA needs two but with a far noisier estimate. So the measurement cost to keep a drifting target tracked diverges as the problem grows: at a few channels the gap is single-digit, at a thousand channels the runtime extracts a usable update from one measurement where finite-difference needs over a thousand. Under a fixed per-round measurement budget — the real constraint on hardware — the gradient method simply falls behind the drift once the dimension is more than a few dozen, while the runtime keeps tracking. These figures are from controlled benchmarks; hardware validation is the next step.
This is the full, self-contained script behind the scale-flat tracking and measurement-efficiency figures. It runs on any machine with the licensed wheel installed — no special hardware. Replace the plant() and target() stand-ins with your own measurement and setpoint to test your system. Absolute numbers depend on your plant and noise; the shape — flat SWC error as n grows, a widening ratio over finite-difference — is the reproducible result.
copyimport math, random
from swc import SWCOptimizer # pip-installed from your licensed wheel
def rms(m, t):
return math.sqrt(sum((a - b) ** 2 for a, b in zip(m, t)) / len(m))
# A drifting multi-channel plant. Each channel: observable = -0.5 sin(phi) + noise.
# Swap in your own measure()/target() to test your hardware.
def plant(phi, n, noise=0.01):
return [-0.5 * math.sin(phi[i]) + random.gauss(0, noise) for i in range(n)]
def target(r, n):
return [-0.5 * math.sin(0.5 * math.sin(r * 0.015 + i * 0.4)) for i in range(n)]
def run_swc(n, rounds, seed=5):
random.seed(seed)
opt = SWCOptimizer(license_key="EVAL-...", n=n, mode="regulation", target=[0.0] * n)
x = opt.start([0.0] * n); errs = []
for r in range(rounds):
x = opt.step(plant(x, n), target=target(r, n)) # ONE measurement / round
if r > rounds - 40:
errs.append(rms(plant(x, n, 0.0), target(r, n)))
opt.end(); return sum(errs) / len(errs)
# Finite-difference baseline: needs n+1 measurements to estimate one gradient step.
def run_findiff(n, rounds, seed=5, eps=0.08, lr=0.5):
random.seed(seed); x = [0.0] * n; errs = []
phase = 0; base = None; grad = [0.0] * n; coord = 0
for r in range(rounds):
tgt = target(r, n)
if phase == 0:
base = plant(x, n); phase = 1; coord = 0
elif phase <= n:
probe = list(x); probe[coord] += eps; mp = plant(probe, n)
ce = sum((base[j] - tgt[j]) ** 2 for j in range(n))
pe = sum((mp[j] - tgt[j]) ** 2 for j in range(n))
grad[coord] = (pe - ce) / eps; coord += 1; phase += 1
if phase > n:
x = [x[j] - lr * grad[j] for j in range(n)]; phase = 0
if r > rounds - 40:
errs.append(rms(plant(x, n, 0.0), tgt))
return sum(errs) / len(errs)
print(f"{'n':>6} {'SWC RMS':>9} {'finite-diff RMS':>16} {'ratio':>7}")
for n in [8, 64, 256, 1024]:
rounds = max(400, 4 * (n + 1))
s = run_swc(n, rounds); f = run_findiff(n, rounds)
print(f"{n:>6} {s:>9.4f} {f:>16.4f} {f / s:>6.1f}x")
# Expected shape (your absolute numbers will vary with hardware/noise):
# SWC RMS stays ~flat near 0.02 as n grows from 8 to 1024;
# finite-diff RMS climbs and saturates; the ratio grows ~7x -> ~20x.The convergence exponent is measured. The translation to wall-clock value depends on one hardware-dependent factor: the cost of an optical measurement relative to a digital evaluation. The algorithmic advantage (n1.3 vs n²) holds even when that ratio is one; any physical parallelism in the measurement is additional upside. We state this separation explicitly rather than fold an unmeasured speedup into the headline.
The exponent is the one number the value projection rests on, so measure it yourself. Time the runtime to a fixed quality bar across a few problem sizes and fit the slope on a log-log scale — a slope below 2 means you are sub-quadratic and the feasibility advantage is real for your workload.
copyimport numpy as np
from swc import SWCOptimizer
def rounds_to_quality(n, bar=0.8, max_rounds=2000):
opt = SWCOptimizer(license_key="EVAL-...", n=n)
phi = opt.start([1.5708] * n)
for k in range(1, max_rounds + 1):
bits = sample(read_response(phi))
phi = opt.step(list(bits), score=-cost(bits, problem(n)))
if recovery(phi, n) >= bar:
opt.end(); return k
opt.end(); return max_rounds
sizes = [12, 18, 24, 32, 40, 48]
rounds = [rounds_to_quality(n) for n in sizes]
b, _ = np.polyfit(np.log(sizes), np.log(rounds), 1)
print(f"convergence exponent: n^{b:.2f}") # < 2.0 == sub-quadratic