  We study the generation of magnetic fields during the stage of particle
production resulting from spinodal instabilities during phase transitions out
of equilibrium. The main premise is that long-wavelength instabilities that
drive the phase transition lead to strong non-equilibrium charge and current
fluctuations which generate electromagnetic fields. We present a formulation
based on the non-equilibrium Schwinger-Dyson equations that leads to an exact
expression for the spectrum of electromagnetic fields valid for general
theories and cosmological backgrounds and whose main ingredient is the
transverse photon polarization out of equilibrium. This formulation includes
the dissipative effects of the conductivity in the medium. As a prelude to
cosmology we study magnetogenesis in Minkowski space-time in a theory of N
charged scalar fields to lowest order in the gauge coupling and to leading
order in the large N within two scenarios of cosmological relevance. The
long-wavelength power spectrum for electric and magnetic fields at the end of
the phase transition is obtained explicitly.
  It follows that equipartition between electric and magnetic fields does not
hold out of equilibrium. In the case of a transition from a high temperature
phase, the conductivity of the medium severely hinders the generation of
magnetic fields, however the magnetic fields generated are correlated on scales
of the order of the domain size, which is much larger than the magnetic
diffusion length. Implications of the results to cosmological phase transitions
driven by spinodal unstabilities are discussed.
