We show that by displacing two optical lattices with respect to each other,
we may produce interactions similar to the ones describing ferromagnetism
and antiferromagnetism in condensed matter physics. We also show that parti
cularly simple choices of the interaction lead to spin squeezing, which may
be used to improve the sensitivity of atomic clocks. Spin squeezing is gen
erated even with partially, and randomly, filled lattices, and our proposal
may be implemented with current technology.