  It has long been known that to a complex cubic surface or threefold one can
canonically associate a principally polarized abelian variety. We give a
construction which works for cubics over an arithmetic base. This answers, away
from the prime 2, an old question of Deligne and a recent question of Kudla and
Rapoport. We further classify the Mumford-Tate groups of the abelian varieties
which arise, and give additional arithmetic applications.
