  We establish a general link between integrable systems in algebraic geometry
(expressed as Jacobian flows on spectral curves) and soliton equations
(expressed as evolution equations on flat connections). Our main result is a
natural isomorphism between a moduli space of spectral data and a moduli space
of differential data, each equipped with an infinite collection of commuting
flows. The spectral data are principal G-bundles on an algebraic curve,
equipped with an abelian reduction near one point. The flows on the spectral
side come from the action of a Heisenberg subgroup of the loop group. The
differential data are flat connections known as opers. The flows on the
differential side come from a generalized Drinfeld-Sokolov hierarchy. Our
isomorphism between the two sides provides a geometric description of the
entire phase space of the Drinfeld-Sokolov hierarchy. It extends the Krichever
construction of special algebro-geometric solutions of the n-th KdV hierarchy,
corresponding to G=SL(n).
  An interesting feature is the appearance of formal spectral curves, replacing
the projective spectral curves of the classical approach. The geometry of these
(usually singular) curves reflects the fine structure of loop groups, in
particular the detailed classification of their Cartan subgroups. To each such
curve corresponds a homogeneous space of the loop group and a soliton system.
Moreover the flows of the system have interpretations in terms of Jacobians of
formal curves.
