Introduction

The quantum harmonic oscillator (QHO) is an essential physical modeling tool for a wide range of theoretical and experimental problems from electrodynamics1 to cosmology2. Since the quantization of the classical harmonic oscillator for time-independent parameters3,4,5,6, the QHO evolved to meet the needs of the time. The push to describe non-conservative systems7 lead to the Caldirola-Kanai model8,9, where the mass is time-dependent and decays exponentially, that, in time, proved to arise from parametric processes and not dissipation10. Nevertheless, it served as a standard model for trying to introduce dissipation11,12,13,14,15. After the Caldirola–Kanai model, describing the motion of a charged particle motivated the study of the QHO with time-dependent frequency, like quantum motion in a Paul trap16, that led to the Lewis–Riesenfield–Ermakov invariant17,18,19, and models with both time-dependent mass and frequency19,20,21,22,23,24,25. Time-dependent forcing in the position lead to the driven QHO26,27,28,29,30,31,32,33 where the first solution involved a Gaussian ansatz34.

We are interested in a general quadratic time-dependent QHO35,36,37,38,39,40,41,

$$\begin{aligned} {\hat{H}}(t) = \frac{1}{2 m(t)} {\hat{p}}^{2} + \frac{1}{2} m(t) \omega ^{2}(t) {\hat{x}}^{2} + \alpha _{x}(t) {\hat{x}} + \alpha _{p}(t) {\hat{p}} + \alpha _{xp}(t) \left\{ {\hat{x}}, {\hat{p}} \right\} + \alpha _{0}(t), \end{aligned}$$
(1)

including driving to the position and momentum, third and fourth terms in the right-hand-side in that order, as well as parametric processes, fifth right-hand-side term. It is possible to solve a simpler version of this Hamiltonian, without the parametric processes, using different approaches like the Feynman Path integral37,42,43,44, generalizations of the Lewis-Riesenfield-Ermakov invariant45,46, or unitary transformations that diagonalize the model35,36,41 with the help of algebraic Lie methods47,48,49. Understanding the model may help optimizing plasmon lifetimes in nanostructures50, bring forward new schemes for quantum machines51 and heat engines52 to explore quantum thermodynamics53,54, improve quantum data transmission and processing55,56,57,58,59, bring forward new approaches to condensed matter60, quantum field theory61, or even gravitational interactions62,63.

Here, we aim to diagonalize our full general quadratic time-dependent QHO using algebraic Lie methods64,65 in first quantization. In the “Results” section, we present the time-independent model and its symmetries. We use these symmetries to diagonalize the time-independent model and establish a road map for the diagonalization of the time-dependent model. Then, we diagonalize the time-dependent model and calculate the expectation value of its observables and its variances. We analytically solve the time-dependent harmonically driven QHO without the rotating wave approximation, the Caldirola-Kanai model, and a quadratic QHO with random time-dependent parameter functions in the “Discussion” section in order to exemplify and discuss our method. We close with our conclusions.

Results

Time-independent model

We are interested in a family of QHOs including all possible position and momentum combinations up to second order49,

$$\begin{aligned} {\hat{H}} = \frac{ 1 }{ 2m } {\hat{p}}^{2} + \frac{ 1 }{ 2 } m \omega ^{2} {\hat{x}}^{2} + \alpha _{x} {\hat{x}} + \alpha _{p} {\hat{p}} + \alpha _{xp} \{ {\hat{x}} , {\hat{p}} \} + \alpha _{0}, \end{aligned}$$
(2)

where the mass is given by m, the oscillator frequency by \(\omega\), the external driving of the position by \(\alpha _{x}\) with units of \(\text{energy} \cdot \text{position}^{-1}\), the constant shift of the momentum by \(\alpha _{p}\) with units of \(\text{energy} \cdot \text{momentum}^{-1}\), the external scaling constant or parametric drive \(\alpha _{xp}\) with units of \(\text{time}^{-1}\) and a constant energy \(\alpha _{0}\). We use the standard notation for the anti-commutator \(\{{\hat{x}},{\hat{p}}\} = {\hat{x}} {\hat{p}} + {\hat{p}} {\hat{x}}\).

The Hamiltonian model shows a closed underlying algebra,

$$\begin{aligned} \begin{aligned} \left[ {\hat{x}},{\hat{p}}\right]&=i\hbar ,&\left[ \{{\hat{x}},{\hat{p}}\},{\hat{x}}\right]&=-2i\hbar {\hat{x}},\\ \left[ {\hat{x}},{\hat{p}}^{2}\right]&=2i\hbar {\hat{p}},&\left[ \{{\hat{x}},{\hat{p}}\},{\hat{p}}\right]&=2i\hbar {\hat{p}},\\ \left[ {\hat{p}},{\hat{x}}^{2}\right]&=-2i\hbar {\hat{x}},&\left[ \{{\hat{x}},{\hat{p}}\},{\hat{x}}^{2}\right]&=-4i\hbar {\hat{x}}^{2}, \\ \left[ {\hat{x}}^{2},{\hat{p}}^{2}\right]&=2i\hbar \{{\hat{x}},{\hat{p}}\},&\left[ \{{\hat{x}},{\hat{p}}\},{\hat{p}}^{2}\right]&=4i\hbar {\hat{p}}^{2}, \\ \end{aligned} \end{aligned}$$
(3)

that help us define a group with three types of unitary transformations. First, a translation,

$$\begin{aligned} \begin{aligned} e^{ \frac{i}{\hbar } \left[ \beta _{p} {\hat{x}} + \beta _{x} {\hat{p}} \right] } \, {\hat{x}} \, e^{ - \frac{i}{\hbar } \left[ \beta _{p} {\hat{x}} + \beta _{x} {\hat{p}} \right] }&= {\hat{x}} + \beta _{x}, \\ e^{ \frac{i}{\hbar } \left[ \beta _{p} {\hat{x}} + \beta _{x} {\hat{p}} \right] } \, {\hat{p}} \, e^{ - \frac{i}{\hbar } \left[ \beta _{p} {\hat{x}} + \beta _{x} {\hat{p}} {\hat{x}}\right] }&= {\hat{p}} - \beta _{p}, \end{aligned} \end{aligned}$$
(4)

where the real constant displacement parameters \(\beta _{x}\) and \(\beta _{p}\) have units of \(\text{position}\) and \(\text{momentum}\), respectively. A rotation,

$$\begin{aligned} \begin{aligned} e^{\frac{i}{\hbar } \left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2} \right] } \, {\hat{x}} \, e^{-\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2} \right] }&= \cos {\left( 2 \theta _{x} \theta _p \right) } \, {\hat{x}} + \frac{ \theta _{p}}{\theta _{x} } \sin {\left( 2 \theta _{x} \theta _p \right) } \, {\hat{p}}, \\ e^{\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2}\right] } \, {\hat{p}} \, e^{-\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2}\right] }&= \cos {\left( 2 \theta _{x} \theta _p \right) } \, {\hat{p}} - \frac{\theta _{x}}{ \theta _{p}} \sin {\left( 2 \theta _{x} \theta _p \right) } \, {\hat{x}}, \end{aligned} \end{aligned}$$
(5)

where the rotation parameters \(\theta _{x}^{2}\) and \(\theta _{p}^{2}\) have units of \(\text{momentum} \cdot \text{position}^{-1}\) and \(\text{position} \cdot \text{momentum}^{-1}\), respectively. It will be helpful later to note that these rotations take a simpler form,

$$\begin{aligned} \begin{aligned} \lim _{\theta _{x} \rightarrow 0} e^{\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2}\right] } \, {\hat{x}} \, e^{-\frac{i}{\hbar }\left[ \theta _{x} {\hat{x}}^{2} + \theta _{p} {\hat{p}}^{2}\right] }&= {\hat{x}} + 2 \theta _{p}^{2} \, {\hat{p}}, \\ \lim _{\theta _{p} \rightarrow 0} e^{\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2}\right] } \, {\hat{p}} \, e^{-\frac{i}{\hbar }\left[ \theta _{x}^{2} {\hat{x}}^{2} + \theta _{p}^{2} {\hat{p}}^{2}\right] }&= {\hat{p}} - 2 \theta _{x}^{2} \, {\hat{x}}, \end{aligned} \end{aligned}$$
(6)

when one of the parameters is zero. Finally, we have a squeezing transformation,

$$\begin{aligned} \begin{aligned} e^{ \frac{ i }{ \hbar } \beta \{{\hat{x}},{\hat{p}}\} } \, {\hat{x}} \, e^{ - \frac{ i }{ \hbar } \beta \{ {\hat{x}} , {\hat{p}} \} }&= {\hat{x}} e^{2 \beta }, \\ e^{ \frac{ i }{ \hbar } \beta \{ {\hat{x}} , {\hat{p}} \} } \, {\hat{p}} \, e^{ - \frac{ i }{ \hbar } \beta \{ {\hat{x}} , {\hat{p}} \} }&= {\hat{p}} e^{ -2 \beta }, \end{aligned} \end{aligned}$$
(7)

that provides inverse scaling for position and momentum with a dimensionless real scaling parameter \(\beta\).

In order to create insight, we use these transformations to diagonalize our Hamiltonian in Eq. (2). First, we move into a reference frame,

$$\begin{aligned} \vert {\Psi } \rangle = e^{-\frac{i}{\hbar } \alpha _{0} t} \vert {\psi _{1}} \rangle , \end{aligned}$$
(8)

rotating at the constant frequency \(\alpha _{0}\) to obtain the effective Hamiltonian,

$$\begin{aligned} \hat{H_{1}} = {\hat{H}} - \alpha _{0}, \end{aligned}$$
(9)

without the constant bias. In order to deal with the forced position and momentum terms proportional to \({\hat{x}}\) and \({\hat{p}}\), we apply the translation,

$$\begin{aligned} \vert {\psi _{1}} \rangle = e^{-\frac{i}{\hbar } \left( \beta _{p} {\hat{x}} + \beta _{x} {\hat{p}} \right) } \vert {\psi _{2}} \rangle , \end{aligned}$$
(10)

with parameters,

$$\begin{aligned} \begin{aligned} \beta _{x}&= \frac{ 2 m \alpha _{p} \alpha _{xp} - \alpha _{x} }{m(\omega ^{2} - 4 \alpha _{xp}^{2}) } , \\ \beta _{p}&= m\alpha _{p} - \frac{2\alpha _{xp}(\alpha _{x}-2 m \alpha _{p}\alpha _{xp})}{\omega ^2-4\alpha _{xp}^2} , \end{aligned} \end{aligned}$$
(11)

that yields an effective Hamiltonian,

$$\begin{aligned} \hat{H_{2}} = \frac{1}{2m} {\hat{p}}^{2} + \frac{1}{2} m \omega ^{2} {\hat{x}}^{2} + \alpha _{xp} \{{\hat{x}},{\hat{p}}\} + l, \end{aligned}$$
(12)

where the accumulation constant,

$$\begin{aligned} l = \frac{1}{2m}\beta _{p}^{2} + \frac{1}{2} m \omega ^{2} \beta _{x}^{2} + \alpha _{x} \beta _{x} - \alpha _{p} \beta _{p} - 2 \alpha _{xp} \beta _{x} \beta _{p}, \end{aligned}$$
(13)

defines a new reference frame,

$$\begin{aligned} \vert {\psi _{2}} \rangle = e^{-\frac{i}{\hbar } l t} \vert {\psi _{3}} \rangle , \end{aligned}$$
(14)

with an effective Hamiltonian,

$$\begin{aligned} \hat{H_{3}} = \frac{1}{2m} {\hat{p}}^{2} + \frac{1}{2} m\omega ^{2}{\hat{x}}^{2} + \alpha _{xp} \{{\hat{x}},{\hat{p}}\}, \end{aligned}$$
(15)

that a rotation,

$$\begin{aligned} \vert {\psi _{3}} \rangle = e^{-\frac{i}{\hbar }(\theta _{x}^{2} {\hat{p}}^{2} + \theta _{p}^{2} {\hat{x}}^{2})} \vert {\psi _{4}} \rangle , \end{aligned}$$
(16)

with parameters fulfilling the transcendental equation,

$$\begin{aligned} \tan \left( 4 \theta _{x} \theta _{p} \right) = \frac{m \alpha _{xp}}{\theta _{x}^{2} - m^{2} \omega ^{2} \theta _{p}^{2}} \, 4 \theta _{x} \theta _{p}, \end{aligned}$$
(17)

translates into the standard harmonic oscillator,

$$\begin{aligned} {\hat{H}}_{4} = \frac{1}{2 M} {\hat{p}}^{2} + \frac{1}{2} M \Omega ^{2} {\hat{x}}^{2}, \end{aligned}$$
(18)

with effective mass and frequency,

$$\begin{aligned} \begin{aligned} M =&2m \left[ 1 + m^{2} \omega ^{2} \frac{\theta _{p}^{2}}{\theta _{x}^{2}} + \left( 1 - m^{2} \omega ^{2} \frac{\theta _{p}^{2}}{\theta _{x}^{2}} \right) \cos \left( 4 \theta _{x} \theta _{p} \right) + 4 m \alpha _{xp} \frac{\theta _{p}}{\theta _{x}} \sin \left( 4 \theta _{x} \theta _{p} \right) \right] ^{-1}, \\ \Omega ^{2} =&\frac{1}{2 m M} \frac{\theta _{x}^{2}}{\theta _{p}^{2}}\left[ 1 + m^{2} \omega ^{2} \frac{\theta _{p}^{2}}{\theta _{x}^{2}} - \left( 1 - m^{2} \omega ^{2} \frac{\theta _{p}^{2}}{\theta _{x}^{2}} \right) \cos \left( 4 \theta _{x} \theta _{p} \right) - 4 m \alpha _{xp} \frac{\theta _{p}}{\theta _{x}} \sin \left( 4 \theta _{x} \theta _{p} \right) \right] , \end{aligned} \end{aligned}$$
(19)

in terms of the real parameters from our original general quadratic time-independent QHO model. At this point, it is important to realize that three simple parameter choices are available at hand. First, we may choose to perform the rotation with just the position term, \(\theta _{p} = 0\), to obtain,

$$\begin{aligned} \begin{aligned} \theta _{x}^{2}&= m \alpha _{xp} , \\ \lim _{\theta _{p} \rightarrow 0} M&= m , \\ \lim _{\theta _{p} \rightarrow 0} \Omega ^2&= \omega ^2 - 4 \alpha _{xp}^{2} , \\ \end{aligned} \end{aligned}$$
(20)

a harmonic oscillator with effective mass identical to that in the original frame and effective frequency that tells us the dimensional external scaling should not overcome a fourth of the resonant frequency, \(\omega ^{2} > 4 \alpha _{xp}^2\), in order to have a proper harmonic oscillator in the diagonal frame. We may choose to perform the rotation with just the momentum term, \(\theta _{x} = 0\),

$$\begin{aligned} \begin{aligned} \theta _{p}^{2}&= -\frac{\alpha _{xp}}{m \omega ^{2}} , \\ \lim _{\theta _{x} \rightarrow 0} M&= \frac{m \omega ^2}{\omega ^2 - 4 \alpha _{xp}^{2}} , \\ \lim _{\theta _{x} \rightarrow 0} \Omega ^2&= \omega ^2 - 4 \alpha _{xp}^{2} , \\ \end{aligned} \end{aligned}$$
(21)

and recover an effective mass scaled by the effective frequency square, that is identical to the later case. We may take the parameter values equal in magnitude, \(\theta _{x} = \theta _{p} = \theta\), and realize that the effective frequency remains the same but the effective mass becomes more complicated in shape. We feel it is important to stress that the absolute value of the dimensional external scaling \(\alpha _{xp}\) must be restricted to half the value of the free oscillator frequency, \(\vert \alpha _{xp} \vert < \omega / 2\), in order deal with a harmonic oscillator and avoid dealing with a free particle or an oscillator with complex effective frequency.

Time-dependent model

Now, let us focus on our general quadratic time-dependent QHO Hamiltonian, Eq. (1),

$$\begin{aligned} {\hat{H}}(t) = \frac{1}{2 m(t)} {\hat{p}}^{2} + \frac{1}{2} m(t) \omega ^{2}(t) {\hat{x}}^{2} + \alpha _{x}(t) {\hat{x}} + \alpha _{p}(t) {\hat{p}} + \alpha _{xp}(t) \left\{ {\hat{x}}, {\hat{p}} \right\} + \alpha _{0}(t), \end{aligned}$$

where the units of all the coefficients are the same as in the time-independent Hamiltonian but they are now well-behaved functions of time.

In order to diagonalize our Hamiltonian, we follow a road map similar to the time-independent diagonalization. Our first transformation, again, moves into a rotating frame,

$$\begin{aligned} \vert {\Psi } \rangle = e^{-\frac{i}{\hbar } \int _0^t \alpha _{0} \left( \tau \right) d \tau } \vert {\psi _{1} } \rangle , \end{aligned}$$
(22)

yielding an effective Hamiltonian,

$$\begin{aligned} {\hat{H}}_1(t) = \frac{1}{2 m(t)} {\hat{p}}^{2} + \frac{1}{2} m(t) \omega ^{2}(t) {\hat{x}}^{2} + \alpha _{x} (t) {\hat{x}} + \alpha _{p} (t) {\hat{p}} + \alpha _{xp} (t) \{ {\hat{x}} , {\hat{p}} \}, \end{aligned}$$
(23)

without the time-dependent energy bias term. Now, a time-dependent translation,

$$\begin{aligned} \vert {\psi _{1}} \rangle = e^{- \frac{i}{\hbar } \left[ \beta _{p}(t) {\hat{x}} + \beta _{x}(t) {\hat{p}} \right] } \vert {\psi _2} \rangle , \end{aligned}$$
(24)

with parameters solving the differential equation set,

$$\begin{aligned} \begin{aligned} \ddot{\beta }_{x}(t)&+ \frac{{\dot{m}} (t)}{m (t)} {\dot{\beta }}_{x} (t) - \left[ 2 {\dot{\alpha }}_{xp} (t) - \omega ^{2} (t) + 4 \alpha _{xp}^{2} (t) + \frac{2 \alpha _{xp} {\dot{m}} (t)}{m (t)} \right] \beta _{x} (t) \ldots \\&={\dot{\alpha }}_{p}(t) - \frac{\alpha _{x}(t)}{m(t)} + 2 \alpha _{p}(t) \alpha _{xp}(t) + \alpha _{p}(t) \frac{{\dot{m}}(t)}{m(t)},\\ \beta _{p}(t)&= m (t) \left[ - {\dot{\beta }}_{x}(t) + 2 \alpha _{xp}(t) \beta _{x}(t) + \alpha _{p}(t) \right] , \end{aligned} \end{aligned}$$
(25)

where the boundary conditions are given by Eq. (11) in the time-independent case. It helps us obtain an effective Hamiltonian without the linear driving of the configuration variables,

$$\begin{aligned} {\hat{H}}_{2} (t) = \frac{1}{2 m (t)} {\hat{p}}^{2} + \frac{1}{2} m (t) \omega ^{2} (t) {\hat{x}}^{2} + \alpha _{xp} (t) \{ {\hat{x}}, {\hat{p}} \} + \ell (t), \end{aligned}$$
(26)

where the accumulation time-dependent energy bias term,

$$\begin{aligned} \ell (t) = \frac{1}{2 m (t)} \beta _{p}^{2} (t) + \frac{1}{2} m (t) \omega ^{2} (t) \beta _{x}^{2} (t) + \alpha _x (t) \beta _{x} (t) - \alpha _{p} (t) \beta _{p} (t) - 2 \alpha _{xp} (t) \beta _{x} (t) \beta _{p} (t), \end{aligned}$$
(27)

commutes with all other terms, and help’s define a rotating frame,

$$\begin{aligned} \vert {\psi _{2}} \rangle = e^{ - \frac{ i }{ \hbar } \int _0^{t} \ell ( \tau ) d \tau } \vert {\psi _{3}} \rangle , \end{aligned}$$
(28)

which yields the effective Hamiltonian,

$$\begin{aligned} {\hat{H}}_{3} \left( t \right) = \frac{ 1 }{ 2 m (t) } {\hat{p}}^{2} + \frac{ 1 }{ 2 } m(t) \omega ^{2} (t) {\hat{x}}^{2} + \alpha _{xp} (t) \{ {\hat{x}} , {\hat{p}} \}, \end{aligned}$$
(29)

that is the well-known time-dependent QHO with an extra driving in the anti-commutation term; that is, a driven parametric QHO. Here, we need to take a slight deviation from the previous road map and use the squeezing transformation,

$$\begin{aligned} \vert {\psi _{3}} \rangle = e^{- \frac{i}{\hbar } \frac{\ln \left[ \gamma \left( t \right) \right] }{2} \left\{ {\hat{x}} , {\hat{p}} \right\} } \vert {\psi _{4}}\rangle , \end{aligned}$$
(30)

where the new dimensionless parameter,

$$\begin{aligned} \gamma ^{2} (t) = \frac{m(0)\omega (0)}{m (t) \omega (t)}, \end{aligned}$$
(31)

given in terms of the time-dependent mass and frequency of the system as well as their initial time values, yields the effective parametric QHO Hamiltonian,

$$\begin{aligned} {\hat{H}}_4 (t) = \frac{\omega (t)}{\omega (0)} \left[ \frac{1}{2 m(0) } {\hat{p}}^{2} + \frac{1}{2} m(0) \omega ^{2}(0) {\hat{x}}^2 \right] + \frac{1}{2}\kappa (t) \left\{ {\hat{x}}, {\hat{p}}\right\} , \end{aligned}$$
(32)

where we define an effective parametric drive,

$$\begin{aligned} \kappa (t) = \frac{1}{2}\left[ \frac{{\dot{m}}(t)}{m(t)} + \frac{{\dot{\omega }}(t)}{\omega (t)} + 4\alpha _{xp}(t) \right] , \end{aligned}$$
(33)

for the sake of space. The first right-hand-side of this effective Hamiltonian is the factor of a time-dependent term and a time-independent QHO term suggesting a rotation,

$$\begin{aligned} \vert {\psi _4} \rangle = e^{- \frac{i}{\hbar \omega (0)} \left[ \frac{{\hat{p}}^{2}}{2 m(0)} + \frac{1}{2} m(0) \omega ^{2}(0) {\hat{x}}^2 \right] \frac{\pi }{4}} \vert {\psi _{5}} \rangle , \end{aligned}$$
(34)

yielding the standard time-dependent QHO,

$$\begin{aligned} {\hat{H}}_{5} (t) = \frac{1}{2 m_{5}(t)} {\hat{p}}^{2} + \frac{1}{2} m_{5}(t) \omega _{5}^{2}(t) {\hat{x}}^2, \end{aligned}$$
(35)

with effective mass and frequency,

$$\begin{aligned} \begin{aligned} m_{5}(t)&= \frac{m(0)\omega (0)}{\omega (t) + \kappa (t) }, \\ \omega _{5}^{2}(t)&= \omega ^{2}(t) - \kappa ^2(t) , \end{aligned} \end{aligned}$$
(36)

where we must be careful to work with well-behaved functions that provide us with positive effective parameters, \(m_{5}(t) >0\) and \(\omega _{5}^{2}(t) > 0\). Now, we may factorize the time-dependence using a transformation composed by a squeezing and a rotation66,

$$\begin{aligned} \vert {\psi _{5}} \rangle = e^{\frac{i}{\hbar } \frac{m_{5} (t) {\dot{\rho }} (t)}{2 \rho (t)} {\hat{x}}^{2}} e^{-\frac{i}{\hbar } \frac{\ln \left[ \frac{\rho \left( t \right) }{\rho (0)} \right] }{2}\{{\hat{x}},{\hat{p}}\}} \vert {\psi _{6}} \rangle , \end{aligned}$$
(37)

in that order, where we introduce the auxiliary function \(\rho \left( t\right)\) fulfilling the Ermakov equation,

$$\begin{aligned} {\ddot{\rho }} (t) + \frac{{\dot{m}}_{5} (t)}{m_{5} (t)} {\dot{\rho }} (t) + \omega _{5}^{2} (t) \rho (t) = \frac{1}{m_{5}^{2} (t) \rho ^{3} (t)}. \end{aligned}$$
(38)

with boundary conditions,

$$\begin{aligned} \begin{aligned} \rho (0)&= \frac{1}{\sqrt{m_{5} (0)\omega _{5} (0)}}, \\ {\dot{\rho }}(0)&= 0. \end{aligned} \end{aligned}$$
(39)

that provides us with a diagonal Hamiltonian,

$$\begin{aligned} {\hat{H}}_{6}\left( t\right) = \frac{1}{\omega _{5} (0) m_{5} (t) \rho ^{2} (t)}\left[ \frac{1}{2 m_{5} (0)} {\hat{p}}^{2} + \frac{1}{2} m_{5} (0) \omega _{5}^{2} (0) {\hat{x}}^{2} \right] , \end{aligned}$$
(40)

where the time dependence is factorized from the operators. The second factor in the right-hand-side is a time-independent QHO that yields an effective Hamiltonian,

$$\begin{aligned} {\hat{H}}_{6}(t) = \hbar \Omega (t) \left( {\hat{a}}^{\dagger } {\hat{a}} + \frac{1}{2} \right) , \end{aligned}$$
(41)

in second quantization with effective time-dependent frequency,

$$\begin{aligned} \Omega (t) = \frac{\omega (t) + \kappa (t)}{m(0)\omega (0)\rho ^{2}(t)}, \end{aligned}$$
(42)

with creation and annihilation operators,

$$\begin{aligned} \begin{aligned} {\hat{a}}&= \frac{\rho (0)}{\sqrt{2 \hbar }}\left( \frac{1}{\rho ^2(0)}{\hat{x}} + i{\hat{p}} \right) , \\ {\hat{a}}^\dagger&= \frac{\rho (0)}{\sqrt{2 \hbar }}\left( \frac{1}{\rho ^2(0)}{\hat{x}} - i{\hat{p}} \right) , \end{aligned} \end{aligned}$$
(43)

provided by the initial value of the Ermakov parameter with units of \(\text{mass}^{-1/2} \cdot \text{frequency}^{-1/2}\). We want to stress that we use this second quantization with effective time-independent mass and frequency in the diagonal frame just to recover an expression for the time-dependent effective frequency. This mathematical gimmick will not be used for the calculation of expectation values or their variances that will be calculated in first quantization.

At this point, it is straightforward to write the time evolution of the initial state of the system in the original frame,

$$\begin{aligned} \vert {\Psi (t)} \rangle&= {\hat{U}}_{1} (t) {\hat{U}}_{2} (t) {\hat{U}}_{3} (t) {\hat{U}}_{4} (t) {\hat{U}}_{5} (t) {\hat{U}}_{6} (t) {\hat{U}}_{3}^{\dagger } (0) {\hat{U}}_{1}^{\dagger } \left( 0 \right) \vert {\Psi } \left( 0 \right) \rangle , \end{aligned}$$
(44)

in terms of six unitary transformations,

$$\begin{aligned} \begin{aligned} {\hat{U}}_{1} (t)&= e^{- \frac{i}{\hbar } \left[ \beta _{x} (t) {\hat{p}} + \beta _{p} (t) {\hat{x}} \right] },\\ {\hat{U}}_{2} (t)&= e^{-\frac{i}{\hbar } \ln {\left[ \sqrt{\frac{\rho (t)}{\rho (0)} \gamma (t)}\right] } \{{\hat{x}}, {\hat{p}}\}}, \\ {\hat{U}}_{3} (t)&= e^{-\frac{i}{\hbar } \left[ \frac{1}{2 m(0) \omega (0) m_{5} (0) \omega _{5} (0) \rho ^{2} (t)}{\hat{p}}^{2} + \frac{1}{2} m(0) \omega (0) m_{5} (0) \omega _{5} (0) \rho ^{2} (t) {\hat{x}}^{2} \right] \frac{\pi }{4}}, \\ {\hat{U}}_{4} (t)&= e^{\frac{i}{\hbar } \frac{m_{5} (0) \omega _{5} (0)}{2}{\dot{\rho }}(t) \rho (t) m_{5} (t) {\hat{x}}^{2}},\\ {\hat{U}}_{5} (t)&= e^{-\frac{i}{\hbar } \int _0^t \{ \alpha _{0} \left( \tau \right) + \ell \left( \tau \right) \} d \tau }, \\ {\hat{U}}_{6} \left( t \right)&= e^{-\frac{i}{\hbar }\left[ \frac{1}{2m_{5} (0) \omega _{5} (0)}{\hat{p}}^{2} + \frac{1}{2}m_{5} (0) \omega _{5} (0) {\hat{x}}^{2} \right] \int _0^t \Omega (\tau ) d\tau }, \end{aligned} \end{aligned}$$
(45)

where we group together and simplify some of the transformations defined above, that helps us calculate the expectation values for both position and momentum,

$$\begin{aligned} \begin{aligned} \langle {\hat{x}}(t) \rangle =&A(t) \left[ \langle {\hat{x}}(0) \rangle - \beta _{x}(0)\right] + B(t) \left[ \langle {\hat{p}}(0) \rangle + \beta _{p}(0)\right] + \beta _{x} (t), \\ \langle {\hat{p}}(t) \rangle =&D(t) \left[ \langle {\hat{x}}(0) \rangle - \beta _{x}(0)\right] + E(t) \left[ \langle {\hat{p}}(0) \rangle + \beta _{p}(0)\right] - \beta _{p} (t), \end{aligned} \end{aligned}$$
(46)

where we use the notation \(\langle {\hat{o}}(\tau ) \rangle = \langle \psi (\tau ) \vert {\hat{o}} \vert \psi (\tau ) \rangle\) for the expectation values and define the following auxiliary functions,

$$\begin{aligned} \begin{aligned} A(t)&= \frac{\xi (t)}{2} \left\{ \left[ \eta \rho ^{2}(0) + \frac{\varepsilon (t)\rho ^{2}(0)}{\rho ^{2}(t)} - \frac{1}{\eta \rho ^{2}(t)} \right] S(t) + \left[ 1 + \frac{\varepsilon (t)}{\eta \rho ^{2}(t)} + \frac{\rho ^{2}(0)}{\rho ^{2}(t)} \right] C(t) \right\} ,\\ B(t)&= \frac{\xi (t)}{2\eta } \left\{ \left[ \eta \rho ^{2}(0) + \frac{\varepsilon (t)\rho ^{2}(0)}{\rho ^{2}(t)} + \frac{1}{\eta \rho ^{2}(t)} \right] S(t) - \left[ 1 + \frac{\varepsilon (t)}{\eta \rho ^{2}(t)} - \frac{\rho ^{2}(0)}{\rho ^{2}(t)} \right] C(t) \right\} ,\\ D(t)&= \frac{\eta }{2\xi (t)}\left\{ \left[ 1 + \frac{\varepsilon (t)}{\eta \rho ^{2}(0)} - \frac{\rho ^{2}(t)}{\rho ^{2}(0)} \right] C(t) - \left[ \eta \rho ^{2}(t) - \varepsilon (t) + \frac{1}{\eta \rho ^{2}(0)} \right] S(t) \right\} , \\ E(t)&= \frac{1}{2\xi (t)}\left\{ \left[ 1 - \frac{\varepsilon (t)}{\eta \rho ^{2}(0)} + \frac{\rho ^{2}(t)}{\rho ^{2}(0)} \right] C(t) - \left[ \eta \rho ^{2}(t) - \varepsilon (t) - \frac{1}{\eta \rho ^{2}(0)} \right] S(t) \right\} , \\ \end{aligned} \end{aligned}$$
(47)

with parameter set,

$$\begin{aligned} \begin{aligned} \eta&= m(0)\omega (0), \\ \xi (t)&= \frac{\rho (t)}{\rho (0)}\gamma (t), \\ S (t)&= \sin {\left( \int _{0}^t \Omega \left( \tau \right) d\tau \right) }, \\ C (t)&= \cos {\left( \int _{0}^t \Omega \left( \tau \right) d\tau \right) }, \\ \varepsilon (t)&= m_{5}(t){\dot{\rho }}(t)\rho (t), \end{aligned} \end{aligned}$$
(48)

in terms of the functions used to diagonalize the time-dependent Hamiltonian. The variances for position and momentum,

$$\begin{aligned} \begin{aligned} \sigma _{x}^{2}(t) =&A^{2}(t) \sigma _{x}^{2}(0) + B^{2}(t) \sigma _{p}^{2}(0) + A(t)B(t)\left[ \langle \left\{ {\hat{x}}(0), {\hat{p}}(0) \right\} \rangle - 2 \langle {\hat{x}}(0) \rangle \langle {\hat{p}}(0) \rangle \right] , \\ \sigma _{p}^{2}(t) =&D^{2}(t) \sigma _{x}^{2}(0) + E^{2}(t) \sigma _{p}^{2}(0) + D(t)E(t)\left[ \langle \left\{ {\hat{x}}(0), {\hat{p}}(0) \right\} \rangle - 2 \langle {\hat{x}}(0) \rangle \langle {\hat{p}}(0) \rangle \right] . \end{aligned} \end{aligned}$$
(49)

are given in terms of the expected values of position and momentum, \(\langle {\hat{x}}(0) \rangle\) and \(\langle {\hat{p}}(0) \rangle\), and their variances, \(\sigma _{x}^{2}(0)\) and \(\sigma _{p}^{2}(0)\), for the initial state. These expectation values and variances provide a characterization for the time-evolution of initial states where it is straightforward to identify scaling related to the auxiliary function \(\xi (t)\) and rotations to S(t) and C(t).

Discussion

In order to provide examples to support our results, we discuss two iconic time-dependent harmonic oscillators, the driven QHO and the Caldirola–Kanai QHO. A driven catity is described by the following Hamiltonian,

$$\begin{aligned} {\hat{H}}{\left( t \right) } = \frac{1}{2m}{\hat{p}}^{2} + \frac{1}{2}m\omega ^{2} {\hat{x}}^{2} + \Omega \cos {\left( \omega _{d}t\right) } {\hat{x}}, \end{aligned}$$
(50)

where the real constant \(\Omega\) is the driving strength of the pump with frequency \(\omega _{d}\). We obtain this Hamiltonian starting from our general model and considering constant mass, \(m(t) = m\), and frequency, \(\omega (t) = \omega\), harmonic driving strength, \(\alpha _{x}(t) = \Omega \cos (\omega _{d} t)\), of the position, and null values for all other processes, \(\alpha _{p}(t) = \alpha _{xp}(t) = \alpha _{0}(t) = 0\). This system is usually solved under the rotating wave approximation in second quantization and may be feasible of solution following standard Wei-Norman factorization methods used for Floquet engineering67. However, it is straightforward to solve it in first quantization using the unitary transformation in Eq. (24) with time-dependent parameters,

$$\begin{aligned} \beta _{p}\left( t \right)&= \frac{\Omega \omega _{d} \left[ \omega _{d} \sin {\left( \omega t \right) } - \omega \sin {\left( \omega _{d} t \right) }\right] }{\omega ^3 - \omega \omega _{d}^{2}}, \end{aligned}$$
(51)
$$\begin{aligned} \beta _{x}\left( t \right)&= \frac{\Omega \omega _{d}^{2} \cos {\left( \omega t \right) } - \omega ^{2} \Omega \cos {\left( \omega _{d} t \right) }}{m \omega ^4 - m \omega ^{2} \omega _{d}^{2}}, \end{aligned}$$
(52)

arising from the differential equation set,

$$\begin{aligned} \begin{aligned} \ddot{ \beta }_{ x } (t) + \omega ^{2} \beta _{x} (t)&= - \frac{\Omega }{m} \cos {\left( \omega _{d} t \right) },\\ \beta _{ p } \left( t \right)&=- m {\dot{\beta }}_{x} (t) , \end{aligned} \end{aligned}$$
(53)

with initial conditions,

$$\begin{aligned} \begin{aligned} \beta _{x}\left( 0 \right)&= -\frac{\Omega }{m \omega ^{2}},\\ \beta _{p} \left( 0 \right)&= 0, \end{aligned} \end{aligned}$$
(54)

leading to the standard harmonic oscillator Hamiltonian,

$$\begin{aligned} {\hat{H}}_{1} (t) = \frac{1}{2m}{\hat{p}}^{2} + \frac{1}{2}m\omega ^{2} {\hat{x}}^{2}. \end{aligned}$$
(55)

Since the mass and frequency are time-independent and the external scaling term is zero, the auxiliary functions from Eq. (47) take the following forms,

$$\begin{aligned} \begin{aligned} A_{d}(t)&= \cos {\left( \omega t \right) }, \\ B_{d}(t)&= \frac{\sin {\left( \omega t \right) }}{m \omega }, \\ D_{d}(t)&= -m\omega \sin {\left( \omega t \right) }, \\ E_{d}(t)&= \cos {\left( \omega t \right) }, \\ \end{aligned} \end{aligned}$$
(56)

allowing us to obtain the expectation values and variances using the general forms in Eqs. (46) and (49), in that order. It is straightforward to see that the uncertainty principle will depend on the resonant and driving frequencies and the initial variances.

Let us figure out the dynamics of an initial state given by the ground state of the harmonic oscillator,

$$\begin{aligned} \psi (0) = \left( \frac{m \omega }{\hbar \pi } \right) ^{1/4} \exp \left( - \frac{m \omega x^{2}}{2 \hbar } \right) , \end{aligned}$$
(57)

with null expectation values at initial time, \(\langle {\hat{x}}(0) \rangle = \langle {\hat{p}}(0) \rangle = 0\), and variances, \(\sigma _{x}^{2}(0) = \hbar / ( 2 m \omega )\) and \(\sigma _{p}^{2}(0) = m \omega \hbar /2\), that minimize Heisenberg uncertainty principle, \(\sigma _{x}^{2}(0) \sigma _{p}^{2}(0) = \hbar ^{{2}}/4\). The time evolution of these expectation values,

$$\begin{aligned} \langle {\hat{x}}(t) \rangle =&\frac{\Omega }{m \left( \omega ^{2} - \omega _{d}^{2} \right) } \left[ \cos \left( \omega t \right) - \cos \left( \omega _{d} t \right) \right] , \end{aligned}$$
(58)
$$\begin{aligned} \langle {\hat{p}}(t) \rangle =&- \frac{\Omega }{ \omega ^{2} - \omega _{d}^{2} } \left[ \omega \sin \left( \omega t \right) - \omega _{d} \sin \left( \omega _{d} t \right) \right] , \end{aligned}$$
(59)

provide constant variances,

$$\begin{aligned} \begin{aligned} \sigma _{x}^{2}(t)&= \hbar / ( 2 m \omega ), \\ \sigma _{p}^{2}(t)&= m \omega \hbar /2, \end{aligned} \end{aligned}$$
(60)

that minimize Heisenberg uncertainty principle, \(\sigma _{x}^{2}(t) \sigma _{p}^{2}(t) = \hbar ^{2}/4\) , as expected from a coherent state.

Figure 1 shows the evolution of the ground state under resonant driving, \(\omega _{d} = \omega\). We show the evolution of the probability to find the oscillator in the position x, Fig. 1a; numerical values are shown in shades of green while the analytic expectation value for the position is shown in a solid blue line with thinner lines for its standard deviation. The expectation values of position and momentum from analytic calculations,

$$\begin{aligned} \langle {\hat{x}}(t) \rangle =&-\frac{\Omega t}{2 m \omega } \sin \left( \omega t \right) , \end{aligned}$$
(61)
$$\begin{aligned} \langle {\hat{p}}(t) \rangle =&-\frac{\Omega }{2 \omega } \left[ \omega t \cos \left( \omega t \right) + \sin \left( \omega t \right) \right] , \end{aligned}$$
(62)

are shown in solid blue and red lines, while numerical simulations are shown in blue and red squares, in that order, with its respective variances as shaded regions for analytic and whiskers for numeric values in Fig. 1b. We show the uncertainty principle from analytic and numerical results in solid black line and squares, in that order, in Fig. 1c.

Figure 1
figure 1

Time evolution of (a) the probability amplitude to find the resonator in the position x \(\vert \psi (x) \vert ^{2}\), (b) expectation value for the position, \(\langle x(t) \rangle\) in blue, and momentum, \(\langle p(t) \rangle\) in red, with solid lines and squares for analytic and numeric results, in that order; we show standard deviations, \(\sigma _{x}(t)\) and \(\sigma _{p}(t)\), as shaded regions or error bars for analytic and numeric results, and (c) Heisenberg uncertainty relation, \(\sigma _{x}(t) \sigma _{p}(t)\), for an initial state provided by the ground state of the standard harmonic oscillator for a resonant driven QHO, \(\omega _{d} = \omega\).

Figure 2 shows the evolution of the ground state under far off-resonance driving, \(\omega _{d} = \omega / 2\), following the same color coding. We show the evolution of the probability to find the oscillator in the position x, Fig. 2a, the expectation values of position and momentum from analytic and numeric calculations, Fig. 2b, and the uncertainty principle, Fig. 2c.

Figure 2
figure 2

Time evolution of (a) the probability amplitude to find the resonator in the position x \(\vert \psi (x) \vert ^{2}\), (b) expectation value for the position, \(\langle x(t) \rangle\) in blue, and momentum, \(\langle p(t) \rangle\) in red, with solid lines and squares for analytic and numeric results, in that order; we show standard deviations, \(\sigma _{x}(t)\) and \(\sigma _{p}(t)\), as shaded regions or error bars for analytic and numeric results, and (c) Heisenberg uncertainty relation, \(\sigma _{x}(t) \sigma _{p}(t)\), for an initial state provided by the ground state of the standard harmonic oscillator for an off-resonant driven QHO, \(\omega _{d} = \omega /2\).

For the sake of curiosity, we compare the results from our exact solution to the driven quantum harmonic oscillator and the one using the rotating wave approximation (RWA) in Fig. 3. We show our analytic results for the driven QHO without the RWA as box and whisker points and the expectation value of position (momentum) in solid green (orange) lines and its variance in shadow green (orange) under the RWA. Driving the position of the QHO under resonance conditions, Fig. 3a produce no relative error for the expected value of the position but an error in the expected value of the momentum appears soon after the initial time. Resonant driving of the momentum produces a similar behavior, the expectation value of the momentum will show no relative error between exact and RWA values. Off-resonant driving, Fig. 3b, shows relative error for both expected values of position and momentum for driving in the position or momentum.

Figure 3
figure 3

Time evolution of the expected value for our exact analytic solution, box and whisker points, and the analytic rotating wave approximation, solid lines and shadows under (a) resonant driving of the position, \(\omega _{d} = \omega\), and off-resonant driving of the position, \(\omega _{d} = \omega /2\). Blue (red) box and whisker points show our exact analytic values and Green (orange) solid lines and shadows the analytic values under the RWA for position (momentum).

Now, let us consider the historical Caldirola–Kanai QHO8,9,

$$\begin{aligned} {\hat{H}}{\left( t \right) } = \frac{1}{2m e^{\gamma t}}{\hat{p}}^{2} + \frac{1}{2} m e^{\gamma t} \omega ^{2} {\hat{x}}^{2}, \end{aligned}$$
(63)

where the mass is scaled by a time-dependent factor with an exponential form with constant mass m and parameter \(\gamma\) with units of \(\text{frequency}\) that usually is a decay process, \(\gamma < 0\), a constant frequency, \(\omega (t)= \omega\) and null values for all other processes, \(\alpha _{x}(t) = \alpha _{p}(t) = \alpha _{xp}(t) = \alpha _{0}(t) = 0\).

Before we focus on our approach, we want to show that it is straightforward to realize that an unitary squeezing,

$$\begin{aligned} \vert {\psi (t)}\rangle = e^{\frac{i}{\hbar }\frac{\gamma t}{4}\left\{ {\hat{x}},{\hat{p}}\right\} }\vert {\phi }(t)\rangle , \end{aligned}$$
(64)

yields an effective time-independent parametric QHO,

$$\begin{aligned} {\hat{H}} = \frac{1}{2m}{\hat{p}}^{2} + \frac{1}{2}m\omega ^{2} {\hat{x}}^{2} + \frac{\gamma }{4} \left\{ {\hat{x}}, {\hat{p}} \right\} , \end{aligned}$$
(65)

feasible of diagonalization using our time-independent approach in the “Results” section,

$$\begin{aligned} {\hat{H}}_{5} = \frac{1}{2 m_{5}} {\hat{p}}^{2} + \frac{1}{2} m_{5} \omega _{5}^{2} {\hat{x}}^2, \end{aligned}$$
(66)

with effective constant mass and frequency,

$$\begin{aligned} \begin{aligned} m_{5}&= \frac{m\omega }{\omega + \frac{\gamma }{2} }, \\ \omega _{5}^{2}&= \omega ^{2} - \frac{\gamma ^{2}}{4} , \end{aligned} \end{aligned}$$
(67)

to study, for example, the energy spectrum for the model68. This expression allows us to realize that, in order to deal with a well-behaved QHO, the absolute value of the Caldirola-Kanai parameter should be less than twice the QHO resonant frequency, \(\left| \gamma \right| < 2 \omega\), which agrees with results in the literature16,69. Furthermore, a generalized Caldirola–Kanai QHO,

$$\begin{aligned} H_{CK} = \frac{1}{2 m e^{-\zeta (t)}} {\hat{p}}^{2} + \frac{1}{2} m e^{-\zeta (t)} \omega _{0}^{2} {\hat{x}}^{2}, \end{aligned}$$
(68)

with dimensionless parameter \(\zeta (t)\), under a change of reference frame composed by a scaled displacement of the canonical momentum and a squeezing of the canonical pair,

$$\begin{aligned} \vert \psi _{CK} \rangle = e^{- \frac{i}{4 \hbar } \zeta (t) \left\{ {\hat{x}} , {\hat{p}} \right\} } e^{ \frac{i}{\hbar } \frac{m\dot{\zeta (t)}}{4} {\hat{x}}^{2}} \vert \psi _{PT} \rangle , \end{aligned}$$
(69)

takes the form of the Paul trap Hamiltonian,

$$\begin{aligned} H_{PT} = \frac{1}{2 m} p^{2} + \frac{1}{2} m \omega ^{2}(t) q^{2}, \end{aligned}$$
(70)

with effective frequency,

$$\begin{aligned} \omega ^{2}(t) = \omega _{0}^{2} + \frac{ {\dot{\zeta }}^2(t)}{4} + \frac{\ddot{\zeta }(t)}{2}, \end{aligned}$$
(71)

in terms of the time-dependent Caldirola-Kanai parameter as long as it yields a positive real squared effective frequency for all times under the unitary transformation.

We want to test our approach starting from the Caldirola–Kanai QHO and realizing that the absence of driving and energy bias renders the first steps into the identity and allows us to start from the Hamiltonian class in Eq. (29) with null parametric driving and a time-dependent mass with linear exponential time-dependence that yields the following expectation values for the position and momentum,

$$\begin{aligned} \begin{aligned} \langle {\hat{x}} (t) \rangle&= \frac{1}{2 e^{\frac{\gamma t}{2}}} \left\{ \sin {\left( \omega _{5}t\right) } \left[ \Gamma _{-} \langle {\hat{x}} (0) \rangle + \Gamma _{+} \frac{\langle {\hat{p}} (0) \rangle }{m\omega } \right] + 2 \cos {\left( \omega _{5}t\right) } \langle {\hat{x}} (0) \rangle \right\} , \\ \langle {\hat{p}} (t) \rangle&= \frac{1}{2 e^{\frac{\gamma t}{2}}} \left\{ 2 \cos {\left( \omega _{5}t\right) } \langle {\hat{p}} (0) \rangle - \sin {\left( \omega _{5}t\right) } \left[ \Gamma _{-} \langle {\hat{p}} (0) \rangle + \Gamma _{+} m\omega \langle {\hat{x}} (0) \rangle \right] \right\} , \end{aligned} \end{aligned}$$
(72)

where, for the sake of space, we have defined the auxiliary parameters,

$$\begin{aligned} \Gamma _{\pm } = \frac{m\omega }{m_{5}\omega _{5}} \pm \frac{m_{5}\omega _{5}}{m\omega }. \end{aligned}$$
(73)

The variances for the position and momentum,

$$\begin{aligned} \begin{aligned} \sigma _{x}^{2}(t) = \frac{1}{4e^{\gamma t}}&\left\{ \left[ 2 \cos {\left( \omega _{5} t \right) } + \Gamma _{-} \sin {\left( \omega _{5} t\right) } \right] ^{2} \sigma _{x}^{2}(0) + \frac{\Gamma _{+}^{2}}{m^{2}\omega ^{2}} \sin ^{2}{\left( \omega _{5} t\right) } \sigma _{p}^{2}(0) + \right. \ldots \\&\left. \frac{\Gamma _{+}}{m \omega } \left[ \Gamma _{-}\sin ^{2}{\left( \omega _{5} t\right) } +\sin {\left( 2\omega _{5} t\right) }\right] \left[ \langle \left\{ {\hat{x}}(0), {\hat{p}}(0) \right\} \rangle - 2 \langle {\hat{x}}(0) \rangle \langle {\hat{p}}(0) \rangle \right] \right\} , \\ \sigma _{p}^{2}(t) = \frac{e^{\gamma t}}{4}&\left\{ \left[ 2 \cos {\left( \omega _{5} t \right) } - \Gamma _{-} \sin {\left( \omega _{5} t\right) } \right] ^{2} \sigma _{p}^{2}(0) + m^{2}\omega ^{2}\Gamma _{+}^{2} \sin ^{2}{\left( \omega _{5} t\right) } \sigma _{x}^{2}(0) + \right. \ldots \\&\left. m\omega \Gamma _{+} \left[ \Gamma _{-}\sin ^{2}{\left( \omega _{5} t\right) } - \sin {\left( 2\omega _{5} t\right) }\right] \left[ \langle \left\{ {\hat{x}}(0), {\hat{p}}(0) \right\} \rangle - 2 \langle {\hat{x}}(0) \rangle \langle {\hat{p}}(0) \rangle \right] \right\} , \end{aligned} \end{aligned}$$
(74)

allows us to realize that, depending on the initial state, it will be probable to obtain a harmonic oscillation of Heisenberg uncertainty with the effective frequency of the Caldirola-Kanai QHO.

Using the ground state of the standard QHO in Eq. (57) as the initial state, the expectation values of the position and momentum are zero,

$$\begin{aligned} \begin{aligned} \langle {\hat{x}}(t) \rangle&= 0, \\ \langle {\hat{p}}(t) \rangle&= 0, \\ \end{aligned} \end{aligned}$$
(75)

and their variances,

$$\begin{aligned} \begin{aligned} \sigma _{x}^{2}(t)&= \frac{\hbar }{8m\omega e^{\gamma t}} \left[ 4\cos {\left( 2\omega _{5} t \right) } + 2\Gamma _{-} \sin {\left( 2\omega _{5} t\right) } + 2 \Gamma _{+}^{2} \sin ^{2}{\left( \omega _{5} t\right) } \right] , \\ \sigma _{p}^{2}(t)&= \frac{m\omega \hbar e^{\gamma t}}{8} \left[ 4 \cos {\left( 2\omega _{5} t \right) } - 2\Gamma _{-} \sin {\left( 2\omega _{5} t\right) } + 2 \Gamma _{+}^{2} \sin ^{2}{\left( \omega _{5} t\right) } \right] , \end{aligned} \end{aligned}$$
(76)

will decrease and increase (increase and decrease) exponentially for a negative (positive) Caldirola-Kanai parameter \(\gamma\) for the position and momentum, in that order. They also suggest that the Heisenberg uncertainty relation for the variances,

$$\begin{aligned} \begin{aligned} \sigma _{x}^{2}(t) \sigma _{p}^{2}(t)&= \frac{\hbar ^2}{64}\left[ 4\left( 2\cos {\left( 2\omega _{5}t\right) } + \Gamma _{+} \sin {\left( \omega _{5}t\right) }\right) ^{2}\ - 4\Gamma ^{2}_{-} \sin {\left( 2\omega _{5}t\right) } \right] , \end{aligned} \end{aligned}$$
(77)

will oscillate harmonically with the effective frequency \(\omega _{5}\) for the ground initial state, and will minimize it, \(\sigma _{x}^{2}(t) \sigma _{p}^{2}(t) = \hbar ^2 / 4\), periodically for \(\omega _{5} t = m \pi\).

Figure 4 shows the evolution of the ground state of the standard QHO under Caldirola-Kanai QHO dynamics following the color code in Figs. 1 and 2. The probability amplitude is centered around the original, \(x=0\), and disperses as it propagates undergoing oscillations, Fig. 4a. Figure 4b shows the expectation values for the position and momentum from analytic calculations, solid blue and red lines, and numeric simulations, blue and red squares in that order, with their respective variances. We show the uncertainty principle from analytic and numeric results, solid black line and squares in that order, that undergoes a single frequency oscillation as expected, in Fig. 4c.

Figure 4
figure 4

Time evolution of (a) the probability amplitude to find the resonator in the position x \(\vert \psi (x) \vert ^{2}\), (b) expectation value for the position, \(\langle x(t) \rangle\) in blue, and momentum, \(\langle p(t) \rangle\) in red, with solid lines and squares for analytic and numeric results, in that order; we show standard deviations, \(\sigma _{x}(t)\) and \(\sigma _{p}(t)\), as shaded regions or error bars for analytic and numeric results, and (c) Heisenberg uncertainty relation, \(\sigma _{x}(t) \sigma _{p}(t)\), for an initial state provided by the ground state of the standard harmonic oscillator in a Caldirola–Kanai QHO with \(\gamma = - \omega / 4\).

In order to further demonstrate the advantages of our approach, let us explore the full system. We generate a random sequence of values for each one of the time-dependent parameters, that is, mass, frequency, driving strength, and parametric pumping, and use spline interpolation to generate continuous, differentiable parameter functions for our Hamiltonian class model, Fig. 5. We use these as input to numerically generate the auxiliary functions for our analytic factorization scheme, Fig. 6, and, in consequence, find the observables of interest, Fig. 7a,b. We want to stress that numerically solving Schrödinger equation for our model usually yields a stiff problem where the differential equation is unstable under standard numerical methods and we are able to recover expectation values for just small evolution times, Fig. 7c,d, while our method produces differential equation sets amenable to solution by standard numerical methods. These results may be of importance in Quantum technologies that usually involve complex open systems. There, the system of interest interacts with other systems or the environment, making it challenging to model their behavior accurately. Machine learning algorithms may be used to make predictions and control their behavior. However, the amount of experimental data to train them may be limited. In these circumstances, combining analytic results for closed systems under random perturbations and experimental data from systems weakly coupled to their environment may be useful to generate large and more diverse training data sets which could improve the accuracy of machine learning models.

Figure 5
figure 5

An example of (ae) random time-dependent parameter functions and (fj) its derivatives.

Figure 6
figure 6

Auxiliary time-dependent functions obtained numerically, (a) position displacement parameter \(\beta _{x}(t)\), (b) momentum displacement parameter \(\beta _{p}(t)\), (c) squeezing parameter \(\gamma (t)\), and (d) Ermakov parameter \(\rho (t)\).

Figure 7
figure 7

Time evolution of (a) expectation value for the position, \(\langle x(t) \rangle\) in blue, and momentum, \(\langle p(t) \rangle\) in red, we show standard deviations, \(\sigma _{x}(t)\) and \(\sigma _{p}(t)\), as shaded regions, and (b) Heisenberg uncertainty relation from a hybrid of analytic and numeric results. Time evolution of (c) expectation value for the position, \(\langle x(t) \rangle\) in blue, and momentum, \(\langle p(t) \rangle\) in red, we show standard deviations, \(\sigma _{x}(t)\) and \(\sigma _{p}(t)\), as error bars, and (d) Heisenberg uncertainty relation from numeric results in the laboratory frame. The initial state provided is the ground state of the standard harmonic oscillator for a QHO with random time-dependent parameter functions provided by Fig. 5.

Conclusion

We developed a procedure to diagonalize a general quadratic time-dependent QHO using a Lie algebraic approach provided by unitary transformations. In general, our approach yields a set of differential equations for the parameters in our unitary transformations in terms of the time-dependent parameters of our Hamiltonian model. Our approach allows for the analytic solution of some particular realizations of our quadratic QHO model and the numeric solution for well-behaved time-dependent functions providing positive definite effective masses and frequencies in each step of the process. In addition, our method provides in a straightforward manner the time evolution for the expectation values of observables and their variances.

We constructed the analytic closed-form solution of two iconic models. The periodically driven QHO without the rotating wave approximation and the Caldirola–Kanai QHO. Our procedure allows for finding analytic auxiliary functions for both models. They help us predict the expectation values for the position and momentum, as well as their variances, to good agreement with numerical solutions in any given parameter regime. In addition, we are able to show that there exists a class of Caldirola–Kanai QHO that takes the form of the Paul trap Hamiltonian under a suitable change of reference frame provided by a unitary transformation. We also show that a hybrid version of our approach, that is, our analytical results combined with numerical methods to determine the auxiliary functions, is able to provide expectation values for the variables of interest for a random realization of our general quadratic time-dependent QHO with well-behaved parameters that yields an Schrödinger equation that is unstable for standard numerical methods.

We hope our results help with the analysis of driven parametric systems that appear, for example, in circuit quantum electrodynamics. In these systems, the rotating wave approximation is a common source of predictive errors beyond the regime of near-resonance and small driving strength. Furthermore, the hybrid analytic–numeric version of our approach may be useful for generating training data sets for expert systems used, for example, to control the dynamics of experiments related to quantum technologies.