  The dynamics of two traps with ultracold atoms and connected by Josephson
type coupling, is shown to exhibit a transition from dispersive dynamics to
localized coherent oscillations. This transition is controlled by coupling
strength and energy offset between the traps. The dynamics is also shown to be
exactly that of a Heisenberg chain with a linear magnetic field. Possible
applications for ``quantum-state engineering'' are discussed.
