  Using an ensemble of atoms in an optical cavity, we engineer a family of
nonlocal Heisenberg Hamiltonians with continuously tunable anisotropy of the
spin-spin couplings. We thus gain access to a rich phase diagram, including a
paramagnetic-to-ferromagnetic Ising phase transition that manifests as a
diverging magnetic susceptibility at the critical point. The susceptibility
displays a symmetry between Ising interactions and XY (spin-exchange)
interactions of the opposite sign, which is indicative of the spatially
extended atomic system behaving as a single collective spin. Images of the
magnetization dynamics show that spin-exchange interactions protect the
coherence of the collective spin, even against inhomogeneous fields that
completely dephase the non-interacting and Ising systems. Our results
underscore prospects for harnessing spin-exchange interactions to enhance the
robustness of spin squeezing protocols.
