  Several recent experiments have demonstrated the promise of atomic ensembles
for quantum teleportation and quantum memory. In these cases the collective
internal state of the atoms is well described by continuous variables $X_1,
P_1$ and the interaction with the optical field ($X_2, P_2$) by a quadratic
Hamiltonian $X_1X_2$. We show how this interaction can be used optimally to
create entanglement and squeezing. We derive conditions for the efficient
simulation of quadratic Hamiltonians and the engineering of all Gaussian
operations and states.
