Unitary transform using displacement operator to get time-independent Hamiltonian? I am considering a driven cavity field with Hamiltonian
$$H = \hbar\omega a^{\dagger}a + f(t)(a + a^{\dagger})$$
where $f(t) = \epsilon e^{-i\omega_{d}t} + \epsilon^* e^{i\omega_{d}t}$ is a classical harmonic driving force with frequency $\omega_d$.
My goal is to make this Hamiltonian time-independent as to be able to use QUTIP's steady-state solver.
For that, I have to use the right unitary transform, i.e. choose the right rotating frame.
I can first choose $U = e^{-i\hbar\omega_{RF} a^{\dagger}a}$, yielding
$$\tilde{H}= \epsilon ae^{-i(\omega_{RF}-\omega_{d})t} + \epsilon a^{\dagger}e^{i(\omega_{RF}+\omega_{d})t} + \epsilon^* ae^{-i(\omega_{RF}+\omega_{d})t} + \epsilon^* a^{\dagger}e^{i(\omega_{RF}-\omega_{d})t}$$
Performing the RWA and using $\Delta = \omega_d - \omega_{RF}$, we get
$$\tilde{H} = \epsilon ae^{i\Delta t} + \epsilon^*a^{\dagger}e^{-i\Delta t}$$
Now, the thing that confuses me:
I can do another unitary transform using a displacement operator $D_{\beta}$, such that $UaU^{\dagger} \Rightarrow a - \beta$. If I then choose $\beta = -\frac{\epsilon^*e^{-i\Delta t}}{\hbar \Delta}$, I indeed get a time-independent Hamiltonian:
$$\tilde{H} = \frac{2|\epsilon|^2}{\hbar \Delta}$$
But now I don't have an operator anymore, just a number, so there must be something wrong.
 A: Start with the Schrodinger equation, given by
\begin{align*}
i\hbar\frac{d}{dt}\left\lvert \psi \right\rangle = \left(\hbar\omega a^{\dagger}a + f(t)(a + a^{\dagger})\right)\left\lvert \psi \right\rangle\,.
\end{align*}
We insert the identity $U^{\dagger}U$, where
$$
U = e^{i\omega_{RF} ta^{\dagger}a}\,,
$$
in front of the kets and multiply both sides by $U$.  On the left-hand side, we get
\begin{align*}
U\left(i\hbar\frac{d}{dt}U^{\dagger}U\left\lvert \psi \right\rangle\right)
&=
U\left(
U^{\dagger}i\hbar\frac{d}{dt}\lvert \tilde{\psi} \rangle
+i\hbar\frac{dU^{\dagger}}{dt}\left\lvert \psi \right\rangle
\right)
\\
&=
UU^{\dagger}i\hbar\frac{d}{dt}\lvert \tilde{\psi} \rangle
+
Ui\hbar\frac{dU^{\dagger}}{dt}\left\lvert \psi \right\rangle\,,
\end{align*}
where
\begin{align*}
\lvert \tilde{\psi} \rangle = U\left\lvert {\psi} \right\rangle\,,
\end{align*}
and since
\begin{align*}
\frac{dU^{\dagger}}{dt} = \frac{d}{dt} e^{-i\omega_{RF} ta^{\dagger}a}
=e^{-i\omega_{RF} ta^{\dagger}a}(-i\omega_{RF} a^{\dagger}a)
=-U^{\dagger}i\omega_{RF} a^{\dagger}a
\,,
\end{align*}
this becomes
\begin{align*}
U\left(i\hbar\frac{d}{dt}U^{\dagger}U\left\lvert \psi \right\rangle\right)
&=
UU^{\dagger}i\hbar\frac{d}{dt}\lvert \tilde{\psi} \rangle
+
Ui\hbar\left(-U^{\dagger}i\omega_{RF} a^{\dagger}a\right)
\left\lvert \psi \right\rangle\\
&=
i\hbar\frac{d}{dt}\lvert \tilde{\psi} \rangle
+\hbar\omega_{RF} a^{\dagger}a
\left\lvert \psi \right\rangle\,.
\end{align*}
On the right-hand side, noting that
\begin{align*}
UaU^{\dagger}\left\lvert n \right\rangle
&=
e^{i\omega_{RF} ta^{\dagger}a} a e^{-i\omega_{RF} ta^{\dagger}a}\left\lvert n \right\rangle
=e^{i\omega_{RF} ta^{\dagger}a} a e^{-i\omega_{RF} tn}\left\lvert n \right\rangle
=e^{i\omega_{RF} ta^{\dagger}a}e^{-i\omega_{RF} tn}\sqrt{n}\left\lvert n-1 \right\rangle\\
&=e^{i\omega_{RF} t(n-1)}e^{-i\omega_{RF} tn}\sqrt{n}\left\lvert n-1 \right\rangle
=e^{-i\omega_{RF} t}a\left\lvert n \right\rangle\,,
\end{align*}
so that $UaU^{\dagger} = e^{-i\omega_{RF} t}a$ and $Ua^{\dagger}U^{\dagger} = e^{i\omega_{RF} t}a^{\dagger}$, we get
\begin{align*}
\hbar\omega a^{\dagger}a + f(t)(a + a^{\dagger}) \to
\hbar\omega a^{\dagger}a + f(t)\left( e^{-i\omega_{RF} t}a + e^{i\omega_{RF} t}a^{\dagger}\right)\,.
\end{align*}
Combining the two transformations, we arrive at the transformed Hamiltonian
\begin{align*}
\tilde{H}
&=\hbar(\omega - \omega_{RF})a^{\dagger}a
+ \epsilon e^{-i(\omega_{d}+\omega_{RF})t}a
+\epsilon^* e^{i(\omega_{d}-\omega_{RF})t}a
+ \epsilon e^{-i(\omega_{d}-\omega_{RF})t}a^{\dagger}
+\epsilon^* e^{i(\omega_{d}+\omega_{RF})t}a^{\dagger}\,.
\end{align*}
Assuming that $\Delta =\omega_d - \omega_{RF}$ is ``small'', we make the RWA, leading to
\begin{align*}
\tilde{H}
&\approx\hbar(\omega - \omega_{RF})a^{\dagger}a
+\epsilon^* e^{i\Delta t}a
+ \epsilon e^{-i\Delta t}a^{\dagger}\,.
\end{align*}
Finally, applying the transformation
$$
U_2 = e^{i\Delta ta^{\dagger}a}\,,
$$
so that the derivative on the left-hand side creates a term $-\hbar\Delta a^{\dagger}a$ on the right-hand side, and
the right-hand side transforms according to $U_2aU_2^{\dagger} = e^{-i\Delta t}a$ and $U_2a^{\dagger}U_2^{\dagger} = e^{i\Delta t}a^{\dagger}$, the approximate Hamiltonian in RWA transforms into the time-independent form
\begin{align*}
\tilde{H}
&\approx\hbar(\omega - \omega_{RF}-\Delta)a^{\dagger}a
+\epsilon^* a
+ \epsilon a^{\dagger}\,.
\end{align*}
\begin{align*}
\tilde{H}
&\approx\hbar(\omega - \omega_{d})a^{\dagger}a
+\epsilon^* a
+ \epsilon a^{\dagger}\,.
\end{align*}
