SWC is a retained-state feedback runtime for wave hardware. On quantum and photonic substrates it has a precise fit — strong in some regimes, structurally wrong in others. We map both so you can tell in a minute whether it is for you.
Mesh phase stabilization. Programmable MZI meshes drift with temperature and suffer thermal crosstalk; a small phase error destroys the intended interference. SWC holds each tap at its setpoint at one measurement per round, model-free, with no per-chip gain tuning. It natively handles the cos² transfer whose slope sign varies across the range — the runtime measures each tap’s drive direction at the start of the session, so no calibration step is required.
The mesh as an optimizer. For QUBO / diagonal objectives encoded in the optical output, the mesh physically realizes the landscape and SWC drives it toward a good configuration under a tight measurement deadline — the regime where a classical solver has no time to search. See QUBO & diagonal optimization.
Retained-state memory. When you track a stream of related target transforms, the carried phase configuration gives a re-convergence advantage that grows with how related the targets are and vanishes when they are unrelated — the signature that the effect is memory, not tuning. This is what makes a photonic mesh adaptive rather than merely stabilized.
One phase tap per channel, one detector read per round. The runtime measures each tap’s sign-varying response at the start, then regulates each tap to its target power as the chip drifts.
copyfrom swc import SWCOptimizer
N = 16 # mesh phase taps
target_power = measure_reference() # desired per-tap optical power
opt = SWCOptimizer(license_key="EVAL-...", n=N,
mode="regulation", target=list(target_power))
phi = opt.start(current_phases())
while running: # holds lock as the chip drifts
power = read_detectors(phi) # one detector pass
phi = opt.step(list(power), target=list(target_power))
apply_phases(phi) # write back to the heaters
opt.end()Where it fits: calibration and stabilization. Holding a single-rotation observable — a gate angle, a readout discrimination point — at setpoint as the device drifts, one measurement per round. This is regulation, and it is the regime SWC is built for.
Where it does NOT fit: variational energy minimization (VQE / QAOA). We tested this thoroughly and it does not work — marginal steering cannot see energy that lives in two-qubit correlations, and on degenerate or unreachable targets the loop does not descend. We do not sell SWC as a VQA optimizer. If someone tells you a marginal-feedback runtime minimizes VQE energy, be skeptical — we were, and the experiments settled it.