  Experimental investigation of the nonlinear dynamics of a quantum oscillator
is a long standing goal of quantum physics. We propose a conditional method for
inducing an arbitrary nonlinear potential on a quantum oscillator weakly
interacting with light. Such an arbitrary nonlinear potential can be
implemented by sequential repetition of an elementary conditional $X$-gate. To
implement the $X$-gate, a single photon is linearly coupled to the oscillator
and is subsequently detected by optical homodyne detection.
