That in quantum mechanics in order to execute a time reversal operation one has to perform complex conjugation of the wave function, implies that the time reversal operator \(\hat{{\mathscr{T}}}\) is a product of a complex conjugation operator \(\hat{{\mathscr{K}}}\) and a unitary rotation \({\hat{U}}_{R}\), i.e. \(\hat{{\mathscr{T}}}={\hat{U}}_{R}\,\hat{{\mathscr{K}}}\), where for any \({\rm{\Psi }}\), \(\hat{{\mathscr{K}}}{\rm{\Psi }}={{\rm{\Psi }}}^{\ast }\). This operation not only reflects velocities like in the classical physics, but also reverses phases of the wave function components. A general universal operation that can reverse any arbitrary wave function, does not exist in nature. Yet, some special \({\rm{\Psi }}\)-dependent operation such that \({\hat{U}}_{{\rm{\Psi }}}{\rm{\Psi }}={{\rm{\Psi }}}^{\ast }\) can exist and below we explicitly construct such an operation for a system of qubits. To that end, one has to design a supersystem that is external with respect to the system of interest and which is capable to implement the purposeful manipulating on the given system. In nature, in the simplest case of a single particle, the role of such a supersystem can be taken up, for example, by the fluctuating electromagnetic field. To gain an insight into how this works, let us consider a wave packet corresponding to the particle with the square energy dispersion, \(\varepsilon ={p}^{2}/2m\), where p is the particle momentum and m is the particle mass, propagating in space, see Fig. 1. The electromagnetic field is assumed to be predominantly weak except for rare fluctuations. Thus, the spreading of the wave packet is coherent. At large times \(\tau \) the wave packet spreads as

$${\rm{\Psi }}(x,\tau )\simeq \frac{f(xm/\hslash \tau )}{\sqrt{2\pi \hslash \tau /m}}\,\exp \,(i\frac{m{x}^{2}}{2\hslash \tau }),$$ (1)

where f(q) is a Fourier image of the initial spatial wave function. The phase of \({\rm{\Psi }}\) changes as a result of the action of the fast fluctuation of an external potential, i.e. with the potential that changes on the times much shorter than the characteristic time of the phase change. To set the fluctuation that complex conjugates \({\rm{\Psi }}\), let us divide the coordinate space into a large number of the elemental cells δx n where a wavefunction’s phase \(\phi (x,\tau )\) changes slowly and look for a fast electromagnetic potential fluctuation \(V(x,t)\) which is smooth on the cell’s scale and reverts the phase of the wavefunction: \(\int \,dt\,eV({x}_{n},t)/\hslash =-\,2\phi ({x}_{n},\tau )\). If during the \(\tau \) the wave packet (1) has spread from the size L 0 to the size \({L}_{\tau }=\hslash \tau /m{L}_{0}\), it would require \(N\sim {\epsilon }^{-1/2}({L}_{\tau }/{L}_{0})\) elementary cells to approximately revert the quantum state \({\rm{\Psi }}(x,\tau )\to {\tilde{{\rm{\Psi }}}}^{\ast }(x,\tau )\) with the probability \(1-\epsilon \): \(|\langle {\tilde{{\rm{\Psi }}}}^{\ast }(x,\tau )|{{\rm{\Psi }}}^{\ast }(x,\tau )\rangle {|}^{2}=1-\epsilon \), see Supplementary Information (SI). Then the probability of the spontaneous reversal, i.e. the probability of the appearance of the required electromagnetic potential fluctuation, estimates as 2−N. Now we determine the typical time scale \(\tau \) on which the spontaneous time reversal of a wave-packet can still occur within the universe lifetime \({t}_{U}\sim 4.3\times {10}^{17}\) sec. The latter is obtained from the estimate \({2}^{-N}\simeq \tau /{t}_{U}\), where the number of cells \(N\sim {\epsilon }^{-1/2}\,(\langle E\rangle \tau /\hslash )\) is expressed through the average particle energy \(\langle E\rangle ={\hslash }^{2}/m{L}_{0}^{2}\). As a typical average energy of the wave-packet we take the energy corresponding to the current universe temperature 2.72 K, and arrive at \(\tau \simeq 6\times {10}^{-11}\) sec. One thus sees that even in the discussed simplest possible example of a single quantum particle the time reversal is already a daunting task where even with the GHz rate of attempts, the required fluctuation is not observable within the universe lifetime. The above arguments reveal that, in quantum mechanics, time irreversibility emerges already on the level of a single evolving particle.

Figure 1 Time reversal procedure for a Gaussian wave-packet \({\rm{\Psi }}(x,0)\propto \exp (\,-\,{x}^{2}/2{\sigma }^{2})\), \(\sigma =1(a.u.)\). The wave-packet spreads \({\rm{\Psi }}(x,0)\to {\rm{\Psi }}(x,\tau )\) according to a quadratic Hamiltonian \({\hat{p}}^{2}/2m\) during the time interval \(\tau =3m{\sigma }^{2}/\hslash \). At the moment \(\tau \) the system is exposed to the fast step-wise electromagnetic potential fluctuation v(x) (second panel). The fluctuation approximately (with the precision corresponding to the density of partitioning points) conjugates the phase of the wave-function: \(\phi (x,{\tau }^{-0})\to \tilde{\phi }(x,{\tau }^{+0})=\phi (x,{\tau }^{-0})+ev(x,\tau )\delta \tau /\hslash \) (third panel). The prepared time-reversed state \(\tilde{{\rm{\Psi }}}(x,\tau )\) then freely evolves during the same time interval \(\tau \) and arrives to the squeezed state \(\tilde{{\rm{\Psi }}}(x,2\tau )\) (fourth panel). The resulting state \(\tilde{{\rm{\Psi }}}(x,2\tau )\) has 86% overlap with the initial state \({\rm{\Psi }}(x,0)\) shown as an empty envelope curve in the fourth panel. Full size image

Now we consider a more complex example and demonstrate that a separable state

$${\rm{\Psi }}({x}_{1},{x}_{2})=|{\psi }_{1}({x}_{1}){\psi }_{2}({x}_{2})|\,\exp \,[i({\phi }_{1}({x}_{1})+{\phi }_{2}({x}_{2}))]$$ (2)

of two particles can not be reverted by classical field fluctuations in the case where particle’s wave functions overlap. Let all particles have the same electric charge q and interact with a classical electric potential v(x, t). The potential fluctuations produce phase shifts \(\int \,dtqv(x,t)/\hslash \). Accordingly the proper fluctuations capable to reverse the quantum state should satisfy the condition \({\phi }_{1}({x}_{1})+{\phi }_{2}({x}_{2})\) + \(\int \,dt[qv({x}_{1},t)+qv({x}_{2},t)]/\hslash \) = \(-\,{\phi }_{1}({x}_{1})-{\phi }_{2}({x}_{2})\). For \({x}_{1}={x}_{2}\) it implies \(\int \,dtqv(x,t)/\hslash =-\,{\phi }_{1}(x)-{\phi }_{2}(x)\), and therefore at \({x}_{1}

e {x}_{2}\) one has to satisfy the condition \({\phi }_{2}({x}_{2})+{\phi }_{1}({x}_{1})={\phi }_{2}({x}_{1})+{\phi }_{1}({x}_{2})\) which, in general, does not hold.

Quantum entanglement introduces the next level of complexity for the time-reversal procedure. Consider a two-particle state \({\rm{\Psi }}({x}_{1},{x}_{2})=|{\rm{\Psi }}({x}_{1},{x}_{2})|{e}^{i\phi ({x}_{1},{x}_{2})}\) with the non-separable phase function \(\phi ({x}_{1},{x}_{2})={a}_{1}({x}_{1}){b}_{1}({x}_{2})+\)\({a}_{2}({x}_{1}){b}_{2}({x}_{2})\). In this situation even for the non-overlapping particles with \({\rm{\Psi }}({x}_{1},{x}_{2})=0\) for \({x}_{1}={x}_{2}\) the two-particle state can not be reversed by an interaction with classical fields. Let one access the particles by different fields which induce separate phase shifts \({\rm{\Psi }}({x}_{1},{x}_{2})\to {\rm{\Psi }}({x}_{1},{x}_{2}){e}^{i({\varphi }_{1}({x}_{1})+{\varphi }_{2}({x}_{2}))}\). The induced phase shifts should satisfy the relation: \({\varphi }_{1}({x}_{1})+{\varphi }_{2}({x}_{2})=-\,2\phi ({x}_{1},{x}_{2})\), therefore for any three points \({x}_{1}

e {x}_{2}

e {x}_{3}\) the following conditions should hold

$${\varphi }_{1}({x}_{1})+{\varphi }_{2}({x}_{2})=-\,2({a}_{1}({x}_{1}){b}_{1}({x}_{2})+{a}_{2}({x}_{1}){b}_{2}({x}_{2})),$$ (3)

$${\varphi }_{1}({x}_{1})+{\varphi }_{2}({x}_{3})=-\,2({a}_{1}({x}_{1}){b}_{1}({x}_{3})+{a}_{2}({x}_{1}){b}_{2}({x}_{3})).$$ (4)

Subtracting these relations one gets \({\varphi }_{2}({x}_{2})-{\varphi }_{2}({x}_{3})\) = \(-\,2{a}_{1}({x}_{1})\,({b}_{1}({x}_{2})-{b}_{1}({x}_{3}))\) − \(2{a}_{2}({x}_{1})\,({b}_{2}({x}_{2})-{b}_{2}({x}_{3}))\) where the left hand side does not depend on x 1 and therefore one has to assume a 1 and a 2 to be constant. This, however, contradicts the non-separability assumption for \(\phi ({x}_{1},{x}_{2})\).

An entangled two-particle state with a non-separable phase function can naturally emerge as a result of scattering of two localized wave-packets31. However, as we have seen, the generation of the time-reversed state, where a particle gets disentangled in the course of its forward time evolution, requires specific two-particle operations which, in general, cannot be reduced to a simple two-particle scattering.

The above consideration enables us to formulate important conjectures about the origin of the arrow of time: (i) For the time reversal one needs a supersystem manipulating the system in question. In the most of the cases, such a supersystem cannot spontaneously emerge in nature. (ii) Even if such a supersystem would emerge for some specific situation, the corresponding spontaneous time reversal typically requires times exceeding the universe lifetime.

A matter-of-course supersystem of that kind is implemented by the so-called universal quantum computer. It is capable to efficiently simulate unitary dynamics of any physical system endowed with local interactions32. A system’s state is encoded into the quantum state of the computer’s qubit register and its evolution is governed by the quantum program, a sequence of the universal quantum gates applied to the qubit register. There exists a panoply of ways by which a quantum state of a system can be encoded into the states of the quantum computer. Indeed, choosing a proper dimension of the quantum computer register one can swap its state \(|{\psi }_{0}{\rangle }_{{\rm{reg}}}\) with the system’s quantum state, \(|{\rm{\Psi }}{\rangle }_{{\rm{sys}}}\), by the unitary operation \({\hat{U}}_{{\rm{SWAP}}}|{\psi }_{0}{\rangle }_{{\rm{reg}}}\otimes |{\rm{\Psi }}{\rangle }_{{\rm{sys}}}=|\psi {\rangle }_{{\rm{reg}}}\otimes |{{\rm{\Psi }}}_{0}{\rangle }_{{\rm{sys}}}\), where the mapping \(|{\rm{\Psi }}{\rangle }_{{\rm{sys}}}\to |\psi {\rangle }_{{\rm{reg}}}\) completes the encoding task. Such an encoding procedure is universal i.e. it does not require the knowledge of the system state \(|{\rm{\Psi }}{\rangle }_{{\rm{sys}}}\). However, non-physical encodings might be suggested which can not be accomplished by unitary transformation. One of the ways to do that was proposed in33 where the real and the imaginary components of the system’s wave function were separately mapped onto the different Hilbert subspaces of the auxiliary system, i.e. quantum computer. Within this representation of the initial quantum system, the complex conjugation can be formulated as a universal unitary rotation of the wave function of the auxiliary system. However, the mapping itself is not a universal unitary operation as follows from the superposition principle arguments. This means that the approach of33 merely lifts the problem of the non-unitarity of the quantum conjugation hiding it in the non-unitarity of the mapping procedure. At variance, in what follows we address the time reversal of the original physical system without nonphysical mapping it on some completely different system unrelated to the original one. We start with formulating general principles of constructing time-reversal algorithms on quantum computers and, in the next section, present a practical implementation of a few-qubit algorithm that enabled experimental time reversal procedure on the public IBM quantum computer.