  Planetary embryos embedded in gaseous protoplanetary disks undergo Type I
orbital migration. Migration can be inward or outward depending on the local
disk properties but, in general, only planets more massive than several
$M_\oplus$ can migrate outward. Here we propose that an embryo's migration
history determines whether it becomes a hot super-Earth or the core of a giant
planet. Systems of hot super-Earths (or mini-Neptunes) form when embryos
migrate inward and pile up at the inner edge of the disk. Giant planet cores
form when inward-migrating embryos become massive enough to switch direction
and migrate outward. We present simulations of this process using a modified
N-body code, starting from a swarm of planetary embryos. Systems of hot
super-Earths form in resonant chains with the innermost planet at or interior
to the disk inner edge. Resonant chains are disrupted by late dynamical
instabilities triggered by the dispersal of the gaseous disk. Giant planet
cores migrate outward toward zero-torque zones, which move inward and
eventually disappear as the disk disperses. Giant planet cores migrate inward
with these zones and are stranded at ~1-5 AU. Our model reproduces several
properties of the observed extra-solar planet populations. The frequency of
giant planet cores increases strongly when the mass in solids is increased,
consistent with the observed giant exoplanet - stellar metallicity correlation.
The frequency of hot super-Earths is not a function of stellar metallicity,
also in agreement with observations. Our simulations can reproduce the broad
characteristics of the observed super-Earth population.
