Contents

Close

ESEN

← Lab

QWCM

Done · Started , updated

A quantum algorithm for reconfiguring power grids, with a complete census of its configurations, an exact spectral gap and the boundary drawn against the classical method.

Fig. 1From tree to tree

Drag to turn it. Try branch exchange.Walk · 1 of 192 trees visited

Reconfiguring a distribution network means choosing which switches to close so that power reaches everyone without forming loops, and every valid choice is a spanning tree of the network. At each exchange the pick closes a line, which forms a loop, then opens another line in that loop, and the network moves on to another tree. The walk picks the exchange at random. Classical branch exchange picks the one that lowers losses the most and soon settles on the optimum, which lights the pilot lamp. This 9-node network has 192 trees, counted with Kirchhoff’s theorem, and the 33-node test network has 50,751, far beyond its 37 lines. The size of the network, the resistances, the loads and the counter belong to the drawing.

The 33-bus test network has room for 50,751 different configurations, and the 69-bus one for 407,924. I counted them all, with no sampling or estimates, using an enumerator built to refuse an answer before it would pass off a sample as a census. Everything that followed depended on having those numbers complete, and that count was the foundation of an experiment that had begun with an algorithm I published in December 2025.

A power distribution network has switches that decide which sections are live. Every valid configuration has to reach every house without forming a single loop, and in mathematics that has a name, the spanning trees of the network’s graph, which are the ways of joining every point without closing any circle. Picking the best one, for example the one that loses least energy along the way, means looking for a needle in a haystack of tens or hundreds of thousands of trees. My idea was to search that haystack with a quantum random walk in place of a classical one. A random walk hops from one configuration to a neighbouring one at random, and the theory promises that, if the classical walk mixes quickly, meaning that in a few hops it could be in any corner of the haystack, the quantum version finds what it is looking for with a quadratic advantage, which comes down to taking the square root of the number of steps.

The field of quantum computing for power grids is full of work that is never compared with the serious classical methods, and I wanted something that would survive that comparison, whichever way it went. The rule was written down on day one, mathematical rigour first and results that could be defended, without getting carried away by quantum euphoria.

The measure that rules

From here the text goes into pure mathematics, and readers who pass over it can take away that the speed of the walk depends on the number of loops in the network and that 2 new theorems came out along the way.

With the census in hand, the next question was what sets the speed of the walk. It is set by the number of independent loops in the network, which in a real network is usually between 5 and 15, and to see it you have to look at the problem from its dual, a version of the same problem that counts the sections left out in place of the ones left in. The configurations are the same seen from either side, but from the dual the sums come out clean and the quantum advantage is tied to a quantity that can be defended. That change of viewpoint also demanded a comparison with the serious classical methods, on top of checking the trees one by one.

Looking from the dual also produced new mathematics. How fast a walk mixes is measured by a number, the spectral gap, and the larger it is the sooner the walk forgets where it started, and the theory only boxed it in between 2 values. I proved that a single pair of sections in series, 2 branches in a row with a bus between them that does nothing else, is enough for the gap to drop to the lower value precisely, and real networks are full of buses like that. At the other end, a family of matroids, the mathematical structures that describe which combinations of parts are valid, such as the ways of connecting a network without leaving anyone in the dark, reaches the ceiling, so both edges of the window are occupied by explicit families. In one of the runs the screen printed the gap of a realistic network and, next to it, the value the theorem predicted. Both said 0.166667.

Counting the same for both

That left the question of whether any of this is any use on a real network. The classical branch exchange method, which swaps one section for another for as long as the losses keep falling and is close to 40 years old, finds the exact optimum of the 2 published networks from 21 out of 21 starts in under 0.2 seconds. I built networks designed to jam it, and they do jam it, but the networks that are hard for it and the networks where the quantum method gains an edge turned out to be 2 independent axes.

Then I put together a panel of 22 real operating problems, such as restoring power after a fault or losing less energy, and compared how many times each method had to solve the power flow of the network, the calculation of how current spreads through it, which is where the real cost lies. The first pass gave a quantum advantage in 19 of 44 comparisons, some of them huge. A result like that earns the right to be attacked, so I redid the sums giving the classical competitor the shortcuts any engineer would have and counting the same way for both, and with that symmetric accounting the score fell to 0 of 44. Against the classical random walk, the separation in number of queries that the theorem promises is there, it is real and it grows the rarer the configuration being sought. Against branch exchange, counting power flow solves, the classical method wins.

I published both in August 2026, a note of pure mathematics with the theorems and the full revision of the algorithm as the second version of the same record as my December manuscript, so that anyone who reaches it reads the complete result straight away, with the exact counts and the classical comparison in the headline. Every published number comes from an experiment with a fixed seed, meaning the computer’s randomness always starts from the same point so the run comes out the same each time, and it can be reproduced from the packages archived with each paper. There are open questions I wrote into the papers, such as whether some network problem exists without a cheap classical shortcut, where quantum search could win. We now know where to look for it, and a map with the boundary drawn on it serves more people than a promise without one.

Log

  1. · v2, done, replaces v1

    The revision, in the same record

    I published the full revision as the second version of the same record, with the exact counts, the measure that governs the problem and the comparison with classical methods as the headline. Anyone who reaches the December manuscript lands on this version.

  2. · done

    The 2 theorems along the way

    I published the pure mathematics separately, a note on the exact spectral gap of walks on matroids, which came out of looking at the problem from its dual.

  3. · done

    The rival's shortcuts

    I gave the classical competitor the shortcuts any engineer would have and the same accounting for both. Counting power flow solves, branch exchange wins all 44 comparisons, and the query separation against the classical walk still stands.

  4. · done

    The full census

    I began by counting every configuration of the test networks, with no sampling, and found 50,751 in the 33-bus network and 407,924 in the 69-bus one.

  5. · v1, redesign, matures in v2

    The starting idea

    I published the algorithm, a quantum walk over the configurations of the network with a speedup measured against its size. v2 measures it against the independent loops, which are what set the speed of the walk.

Links