Docs/Build/PennyLane & photonics
CLIENT 0.4.3PYTHON 3.8+

PennyLane & photonics

Use per-channel response profiles as the measured input.

Use TrueLoop when the circuit or photonic system exposes a vector of per-channel measurements with a feasible desired profile. The runtime regulates that measured profile through the same five-line loop.

The useful regime includes drift and shot noise when each acquisition remains resolved enough to support stable control. Registered simulated response-profile cells remain scale-flat through 16,384 controls with a four-to-six-response floor.

Do not use this pattern to steer a variational search from one scalar energy, an edge-coupled QAOA objective, or an extremal target near response saturation.

PYTHON
def measure(x):
    return qml.math.toarray(circuit(x)).tolist()

opt = SWCOptimizer(key, n=len(x0), mode="regulation", target=target)
x = opt.start(x0)
for _ in range(rounds):
    x = opt.step(measure(x), target=target)
opt.end()
Need the answer on your plant?

Run the envelope, then race the runtime and your incumbent under the same measured budget.

Start evaluation