  We present a general mapping between continuous and lattice models of Bose-
and Fermi-gases in one dimension, interacting via local two-body interactions.
For s-wave interacting bosons we arrive at the Bose-Hubbard model in the weakly
interacting, low density regime. The dual problem of p-wave interacting
fermions is mapped to the spin-1/2 XXZ model close to the critical point in the
highly polarized regime. The mappings are shown to be optimal in the sense that
they produce the least error possible for a given discretization length. As an
application we examine the ground state of a interacting Fermi gas in a
harmonic trap, calculating numerically real-space and momentum-space
distributions as well as two-particle correlations. In the analytically known
limits the convergence of the results of the lattice model to the continuous
one is shown.
