  Recently it has been proposed to construct quantum error-correcting codes
that embed a finite-dimensional Hilbert space in the infinite-dimensional
Hilbert space of a system described by continuous quantum variables [D.
Gottesman et al., Phys. Rev. A 64, 012310 (2001)]. The main difficulty of this
continuous variable encoding relies on the physical generation of the quantum
codewords. We show that ponderomotive interaction suffices to this end. As a
matter of fact, this kind of interaction between a system and a meter causes a
frequency change on the meter proportional to the position quadrature of the
system. Then, a phase measurement of the meter leaves the system in an
eigenstate of the stabilizer generators, provided that system and meter's
initial states are suitably prepared. Here we show how to implement this
interaction using trapped ions, and how the encoding can be performed on their
motional degrees of freedom. The robustness of the codewords with respect to
the various experimental imperfections is then analyzed.
