Using a single harmonic oscillator to implement a quantum gate. Confusion over concept I'm trying to simulate a quantum gate operation in mathematica using a harmonic oscillator and I have some confusion with how the physical system relates to the theory. This may be a bit long winded but I hope the question is clear. 
The solution to the Schrodinger equation for the Harmonic Oscillator is given by: 
$$ \langle x|\phi_k\rangle := \frac{1}{\sqrt{2^k k! \sqrt{\pi}\ }}  .e^{-x^2/2} . \operatorname{HermiteH}[k,x]  $$ where the $\text{HermiteH}[k,x]$ denotes the built in Mathematica function for finding the Hermite Polynomial at energy level $k$ and position $x$. (the fact I'm using mathematica is irrelevant to the question)
These energy levels can used as a physical representation of the qubits (In reality, it is not sufficient to use just one harmonic oscillator but it serves the purpose to demonstrate the technique).
The Hamiltonian for the oscillator is first defined as $ \textit{H} = \hbar \omega a^{\dagger} a $.
Using the Hamiltonian operator, we can then define the unitary time evolution operator $U(t) = e^{i\textit{H}t/\hbar}$ which determines the evolution of the system over time.
I have picked an example from Nielsen and Chuang's book on using a single harmonic oscillator to implement a CNOT gate.
By choosing an appropriate time interval, this operator can have the desired effect we require in order to implement a CNOT gate (or any other quantum gate) operation.
Now we must choose an appropriate representation for the qubits so that the time evolution operator will simulate the appropriate quantum gate. In the case of a CNOT gate, we would like our unitary operator to transform the qubit pairs in the following way: 
$$ |00\rangle \rightarrow |00\rangle $$ $$ |01\rangle \rightarrow |01\rangle $$ $$ |10\rangle \rightarrow |11\rangle $$ $$ |11\rangle \rightarrow |10\rangle \, . $$
These two qubits are then encoded by mapping them onto the following harmonic oscillator states: 
$$ |00 \rangle = |\phi_0 \rangle $$ 
$$ |01 \rangle = |\phi_2 \rangle $$ 
$$ |10 \rangle = \frac{ 1}{\sqrt{2}} (|\phi_4\rangle + |\phi_1\rangle) $$ 
$$ |11 \rangle = \frac{ 1}{\sqrt{2}} (|\phi_4\rangle - |\phi_1\rangle) \, .$$ 
At the start time $t=0$, the system will be in a state spanned by these basis states and then if we evolve the system forward to an appropriate time, in this case $t = \frac{\pi}{\omega}$, then the energy eigenstates of the oscillator will undergo the transformation: 
$$ |\phi_k\rangle \rightarrow e^{-i \pi a^{\dagger} a} |\phi_k\rangle = (-1)^k |\phi_k\rangle \, .$$
This means that even values of $k$ will remain unchanged whereas odd values will pick up a minus sign $(|\phi_1\rangle \rightarrow -|\phi_1\rangle)$ and thus we obtain the required transformation.
So finally here is the question:
If the qubits are represented by different energy levels of the harmonic oscillator, then where does the position come into play? ( as in what can be used as an $x$ value in the equation). The book just says that we map the qubits to the energy levels but I assume that the position needs to be defined. 
 A: The value of the position (represented here by $x$) is not really relevant for the operation of your gate. One way to look at it is that the gate operator $U(t)$ simply takes the state vector $|\phi_k\rangle$ to $(-1)^k |\phi_k\rangle$. At first glance, I would immediately assume from the notation that everything that has to do with $x$ is "absorbed" into the state vector, and we will see in a minute explicitly that it is. 
Qualitatively, the observable you care about is the energy level of the oscillator, not the position. While we usually define $a$ and $a^\dagger$ using $x$ and $p$, I'm not aware of any requirement that we do that; $H$ here is diagonal in the energy basis, without any required reference to position.
To see this more explicitly using the $x$ basis, try acting with $U(t)$ on the wavefunction. If you write out $e^{ia^\dagger a t / \hbar}$ using $a = \sqrt{\frac{m\omega}{2\hbar}} ( \hat{x} + \frac{i}{m\omega} \hat{p})$ you will find a factor of $e^{x^2}$, but that gets canceled out by the $e^{-x^2}$ in the wavefunction itself, leaving no remaining x-dependence in what remains of the time evolution operator.
