In this article a method is implemented for computing load flows that does not rely on the full resolution of a linear system. Instead, we solve very quickly many local load flows corresponding to dipoles (the electrical power is injected at two nodes) with an algorithm based on a Hamiltonian formalism, as it is usually done in quantum physics. The computational burden is quadratic in the size of the network when the dipoles are defined by the lines of a spanning tree of the network. This leads to a considerable speedup when compared to traditional methods relying on the full system inversion as well as methods involving other subproblems.