Notes:
Here is how a 2-dimensional array of liquid-crystal cells would be used to make an electronically-controlled lens to flatten an aberrated wavefront. In those parts of the wavefront which are retarded, we would program a low value of refractive index so that the wavefront would propagate relatively rapidly as it passes through that part of the crystal. On the other hand, in those parts of the wavefront which are too far advanced, we would program the crystal to have a high refractive index in order to slow the propagation of light in that part of the wavefront so the rest of the wavefront can catch up.
Fortunately, the type of liquid crystal arrays I've been describing became commercially available recently and we have been exploring this new technology to see how well it performs.