Quantum operations with indefinite time direction

The fundamental dynamics of quantum particles is neutral with respect to the arrow of time. And yet, our experiments are not: we observe quantum systems evolving from the past to the future, but not the other way round. A fundamental question is whether it is possible to conceive a broader set of operations that probe quantum processes in the backward direction, from the future to the past, or more generally, in a combination of the forward and backward directions. Here we introduce a mathematical framework for these operations, showing that some of them cannot be interpreted as random mixtures of operations that probe processes in a definite direction. As a concrete example, we construct an operation, called the quantum time flip, that probes an unknown dynamics in a quantum superposition of the forward and backward directions. This operation exhibits an information-theoretic advantage over all operations with definite direction. It can be realised probabilistically using quantum teleportation, and can be reproduced experimentally with photonic systems. More generally, we introduce a set of multipartite operations that include indefinite time direction as well as indefinite causal order, providing a framework for potential extensions of quantum theory.

The experience of time flowing in a definite direction, from the past to the future, is deeply rooted in our thinking. At the microscopic level, however, the laws of Nature seems to be indifferent to the distinction between past and future. Both in classical and quantum mechanics, the fundamental equations of motion are reversible, and changing the sign of the time coordinate (possibly together with the sign of some other parameters) still yields a valid dynamics. For example, the CPT theorem in quantum field theory [1,2] implies that an evolution backwards in time is indistinguishable from an evolution forward in time in which the charge and parity of all particles have been inverted. An asymmetry between past and future emerges in thermodynamics, where the second law postulates an increase of entropy in the forward time direction. But even the time-asymmetry of thermodynamics can be reduced to time-symmetric laws at the microscopic level [3], e.g. by postulating a low entropy initial state [4].
While the microscopic world is time-symmetric, the way in which we interact with it is not. As a matter of fact, we operate only in the forward time direction: in ordinary experiments, we initialise physicals system at a given moment, let them evolve forward in time, and perform measurements at a later moment. Still, this asymmetry in the structure of our experiments does not feature in the dynamical laws themselves. This fact suggests that, rather than being fundamental, time asymmetry may be specific to the way in which ordinary agents, such as ourselves, interact with other physical systems [5][6][7][8].
An intriguing possibility is that, at least in principle, some other type of agent could perform experiments in the opposite direction, by initialising the state of physical systems in the future, and by observing their evolution backward in time. This possibility is implicit in a variety of frameworks wherein pre-selected and postselected quantum states are treated on the same footing [9][10][11][12][13][14][15][16][17][18][19]. Building on these frameworks, one can even conceive agents with the ability to deterministically preselect certain systems and to deterministically post-select others, thus observing physical processes in an arbitrary combination of the forward and backward direction. Such agents may or may not exist in reality, but can serve as a useful fiction to shed light on the operational significance of the constraint of a fixed time direction, by contrasting the information-theoretic capabilities associated to alternative ways to operate in time.
Here we establish a mathematical framework for operations that use quantum devices in arbitrary combinations of the forward and backward direction. We first characterise the set of bidirectional quantum processes, that is, processes that could in principle be accessed in both directions. We then construct a set of operations that use bidirectional processes, and we show that some of these operations cannot be obtained as random mixtures of operations that probe the processes of interest in a definite direction. As a concrete example, we introduce an operation, called the quantum time flip, that uses processes in a coherent superposition of the forward and backward directions. The potential of the quantum time flip is illustrated by a game where a referee challenges a player to discover a hidden relation between two black boxes implementing two unknown unitary gates. As it turns out, a player with the ability to query the boxes in a coherent superposition of directions can identify the correct relation with no error, while every player who can only access the two boxes in a definite time direction will have an error probability of at least 11%, even if the player is able to combine the two boxes in an indefinite order [20][21][22].
Our work initiates the exploration of a new type of quantum operations that are not constrained to a sin- In the forward mode (top), an agent prepares an input system at time t1 and obtains an output system at time t2 ≥ t1.
In the backward mode (bottom), a hypothetical agent could prepare an input at time t2 and obtain an output at time t1. These two modes of using the device correspond to two different input-output transformations C and Θ(C), respectively. gle time direction, and provides a rigorous framework for analysing their information-theoretic power. It also allows for multipartite operations where both the time direction and the causal order are indefinite, and rises the open question whether these operations are physically accessible in new regimes, such as quantum gravity, or whether they are prevented by some yet-to-be-discovered mechanism.

I. RESULTS
Bidirectional devices and their characterisation. We start by identifying the largest set of quantum devices that are in principle compatible with two alternative modes of operation: either in the forward time direction, or in the backward time direction.
Consider a process that takes place between two times t 1 and t 2 ≥ t 1 , corresponding to two events, such as the entry of a system into a Stern-Gerlach apparatus, and its exit from the same apparatus. Ordinary agents can interact with the process in the forward time direction: they can deterministically pre-select state of an incoming system S 1 at time t 1 , and later they can measure an outgoing system S 2 at time t 2 . The overall input-output transformation from time t 1 to time t 2 is described by a quantum channel C, that is, a trace-preserving, completely positive (CPTP) map transforming density matrices of system S 1 into density matrices of system S 2 [23]. Now, imagine a hypothetical agent that operates in the opposite time direction, by deterministically postselecting the system at time t 2 and performing measurements at time t 1 , as illustrated in Figure 1. For such a backward-facing agent, the role of the input and output systems is exchanged, and the two systems at time t 1 and t 2 may even appear to be different from S 1 and S 2 , e.g. they may have opposite charge and opposite parity. In the following we denote the systems observed by the backward-facing agent as S * 1 and S * 2 , and we only assume that they have the same dimensions of S 1 and S 2 , respectively. If the overall input-output transformation observed by the backward-facing agent is still described by a valid quantum channel (CPTP map), we call the process bidirectional.
To determine whether a given process is bidirectional, one has to specify a map Θ, converting the channel C observed by the forward-facing agent into the corresponding channel Θ(C) observed by the backward-facing agent. We call the map Θ an input-output inversion. The set of bidirectional processes is then defined as the set of all quantum channels C with the property that also Θ(C) is a quantum channel. In the following, the set of bidirectional channels will be denoted by B(S 1 → S 2 ). We now characterise all the possible input-output inversions satisfying four natural requirements. Specifically, we require that the map Θ be not see any change. Requirement 3 is a weak form of symmetry: processes that appear distinct to a forwardfacing agent should appear distinct also to a backwardfacing agent. A stronger requirement would have been to require that applying Θ twice should bring every process back to itself. This condition is stronger than our Requirement 3, because it implies not only that Θ must be invertible, but also that Θ is its own inverse. Finally, Requirement 4 is that if a process has probability p to be C and probability 1 − p to be D for the forward-facing agent, then, for the backward-facing agent the process will have probability p to be Θ(C) and probability 1 − p to be Θ(D).
Our notion of input-output inversion is closely related with the notion of time-reversal in quantum mechanics [24,25] and in quantum thermodynamics [26]. It is worth stressing, however, that input-output inversion is more general than time-reversal, because it can include combinations of time-reversal with other symmetries, such as charge conjugation and parity inversion (see Appendix A for more discussion). Moreover, the input-output inversion can also describe situations that do not involve time-reversal, including, for example, the use of optical devices where the roles of the input and output modes can be exchanged, as discussed later in the paper.
In the following, we will focus on the scenario where the systems S 1 and S 2 have the same dimension. We will assume that all unitary dynamics are bidirectional, that is, that the set B(S 1 → S 2 ) contains all possible unitary channels. For unitary channels, Requirements 1-3 completely determine the action of the input-output inversion. Specifically, we show that the input-output inversion must either be unitarily equivalent to the adjoint θ(U ) := U † , or to the transpose θ(U ) := U T (Appendix A).
For general quantum channels, we show that the set of bidirectional processes coincides with the set of bistochastic channels [27,28], that is, channels C with a Kraus representation C(ρ) = i C i ρC † i satisfying both conditions i C † i C i = I S1 and i C i C † i = I S2 (see Methods). Also in this case we find that, up to unitary equivalence, there exist only two possible choices of input-output inversion: the adjoint C † , defined by C † (ρ) : For two-dimensional quantum systems the adjoint and transpose are unitarily equivalent, and therefore the input-output inversion is essentially unique. For higher dimensional systems, however, the adjoint and the transpose exhibit a fundamental difference: unlike the transpose, the adjoint does not generally produce quantum channels (CPTP maps) when applied locally to to the dynamics of bipartite quantum systems (see Methods). Technically, the difference is that the adjoint is not a completely positive map on quantum channels. In the terminology of Refs. [22,[29][30][31], the adjoint is not an admissible supermap on quantum channels.
Quantum operations with indefinite time direction. The standard operational framework of quantum theory describes sequences of operations performed in the forward time direction. We now define a more general type of operations, which use quantum devices in arbitrary combinations of the forward and backward direction. Our framework is based on the framework of quantum supermaps [22,[29][30][31], a mathematical framework describes candidate operations that could in principle be performed on a set of quantum devices. In general, a quantum supermap from an input set of quantum channels B to an output set of quantum channels B is a map that preserves convex combinations, and can act locally on the dynamics of composite systems, transforming any extension of a channel in B into an extension of a channel in B [22].
The possible operations on bidirectional devices correspond to quantum supermaps transforming bistochastic channels into ordinary channels (CPTP maps). Some of these supermaps use the devices in the forward direction: they are of the form S fwd (C) = B(C ⊗ I aux )A, where C is the bistochastic channel describing the device of interest, and A and B are two fixed channels, possibly involving an auxiliary system aux [29]. Other supermaps could be realised by using the device is the backward direction: they are of the form S bwd (C) = B (Θ(C) ⊗ I aux )A , where A and B are two fixed channels and Θ is (unitarily equivalent to) the transpose.
A complete characterization of the possible supermaps acting on bistochastic channels is provided in Appendix B. As we will see in the following, the set of these supermaps contains operations that are neither of the forward type nor of the backward type, nor of any random mixture of these two types. We call these transformations quantum operations with indefinite time direction. These operations are the analogue for the time direction of the operations with indefinite causal order [20][21][22], also known as causally inseparable operations [21,32,33].
In Appendix C, we extend our construction from operations on a single bistochastic channel to more general multipartite operations, described by quantum supermaps S that transform a list of bistochastic channels (C 1 , C 2 , . . . , C N ) into an ordinary channel S(C 1 , C 2 , . . . , C N ). This general type of supermaps can exhibit both indefinite time direction and indefinite causal order, and provide a broad framework for potential extensions of quantum theory.
The quantum time flip. We now introduce a concrete example of operation with indefinite time direction, called the quantum time flip. This operation is a analogue of the quantum SWITCH [20,22], previously introduced in the study of indefinite causal order. The quantum time flip takes in input a bidirectional device, and produces as output a controlled channel [10,[34][35][36][37], which acts as C if a control qubit is initialised in the state |0 , and as Θ(C) if the control qubit is initialised in the state |1 . For a fixed set of Kraus operators C = {C i }, we consider the controlled channel F C of the An unknown channel C is applied locally on a maximally entangled state, which then undergoes a controlled swap operation and is used as a resource for quantum teleportation. The probabilistic realisation of the quantum time flip is heralded by a specific value of the outcome m of the Bell measurement in the teleportation protocol.
where the map θ : C i → θ(C i ) is either unitarily equivalent to the adjoint or to the transpose. In passing, we observe that the channel F C is itself bistochastic, and therefore it also admits an input-output inversion. It is worth stressing that (i) F C is a valid quantum channel (CPTP map) if and only if the input channel C is bistochastic, and (ii) the definition of F C is independent of the Kraus representation if and only if the map θ is unitarily equivalent to the transpose (Appendix D). When these two conditions are satisfied, we show that the map F : C → F C satisfies all the requirements of a valid quantum supermap. We call this supermap the quantum time flip and we will write the controlled channel as F(C).
The quantum time flip is an example of an operation with indefinite time direction: it is impossible to decompose it as a random mixture F = p S fwd + (1 − p) S bwd where p is a probability, and S fwd (S bwd ) is a forward (backward) supermap. In Appendix E we show that, if such decomposition existed, then there would exist an ordinary quantum circuit that transforms a completely unknown unitary gate U into its transpose U T , a task that is known to be impossible [38,39]. We also show that the quantum time flip cannot be realised in a definite time direction even if one has access to two copies of the original channel C. Remarkably, this stronger no-go result holds even if the two copies of the channel C are combined in an indefinite order: as long as all copies of the channel are used in the same time direction, there is no way to reproduce the action of the quantum time flip.
Realisation of the quantum time flip through teleportation. We have seen that the quantum time flip cannot be perfectly realised by any quantum circuit with a definite time direction. This no-go result concerns perfect realisations, which reproduce the quantum time flip with unit probability and without error. On the other hand, the quantum time flip can be realised with nonunit probability in an ordinary quantum circuit, using quantum teleportation [40].
The setup is depicted in Figure 3. An unknown bistochastic channel C is applied on one side of a maximally entangled state, say the canonical Bell state |Φ = d i=1 |i ⊗ |i / √ d, and the output is used as a resource for quantum teleportation. The transpose is realized by swapping the two copies of the system: for example, when the channel C is unitary, the application of the channel to the Bell state |Φ yields another maximally entangled state |Φ U := (I ⊗ U )|Φ , where U is a unitary matrix, and swapping the two entangled systems produces the state |Φ U T , where the unitary U is replaced by its transpose U T . Coherent control of the choice between the forward channel C and the backward channel Θ(C) is realized by adding control to the swap. Finally, a Bell measurement is performed and the outcome corresponding to the projection on the state |Φ is post-selected. When this outcome occurs, the circuit reproduces the quantum time-flipped channel F(C), as shown in the following in the unitary case.
Let us denote by |φ S the initial state of the target system and by |ψ C = α |0 C + β |1 C the initial state of the control qubit. Then, the joint state of the target and control after the controlled swap is α |φ S ⊗ |Φ U ⊗ |0 + β |φ S ⊗ |Φ U T ⊗ |1 . When the Bell measurement is performed, the target system and the control are collapsed to one of the states α U U m |φ S ⊗ |0 C + β U T U m |φ S ⊗ |1 C , where m ∈ {1, . . . , d 2 } is the measurement outcome and {U m } d 2 m=1 are the unitaries associated to the Bell measurement. For the outcome corresponding to the state |Φ , one obtains the overall state transformation |φ S ⊗ |ψ C → α U |φ S ⊗ |0 C + β U T |φ S ⊗ |1 C , corresponding to the time-flipped channel F(C). More generally, each outcome of the Bell measurement gives rise to a conditional transformation that uses the gate U in an indefinite time direction. This fact is not in contradiction with the definite time direction of the overall setup in Figure 3: averaging over all outcomes of the Bell measurement yields an overall operation that uses the gate U in a well-defined direction (the forward one).
In the teleportation setup, the quantum time flip is realised probabilistically. However, in principle the quantum time flip could also be implemented deterministically and without error by some agent who is not constrained to operate in a well-defined time direction.
For example, Figure 3 shows that an agent with the ability to deterministically pre-select a Bell state, and to deterministically post-select the outcome of a Bell measurement would be able to deterministically achieve the quantum time flip. Note that not all circuits built from deterministic pre-selections and deterministic post-selections are compatible with quantum theory. In this respect, the framework of quantum operations with indefinite time direction provides a candidate criterion for determining which postselected circuits can be allowed and which ones should be forbidden.
An information-theoretic advantage of the quantum time flip. We now introduce a game where the quantum time flip offers an advantage over arbitrary setups with fixed time direction. The structure of the game is similar to that of another game, previously introduced by one of us to highlight the advantages of the quantum SWITCH [41]. However, the variant introduced here highlights fundamental diffference: in this variant of the game, no perfect win can be achieved by the quantum SWITCH, or by any of the processes with indefinite causal order considered so far in the literature.
The game involves a referee, who challenges a player to discover a property of two black boxes. The referee promises that the two black boxes implement two unitary gates U and V satisfying either the condition U V T = U T V , or the condition U V T = −U T V . The goal of the player is to discover which of these two alternatives holds.
A player with access to the quantum time flip can win the game with certainty. The winning strategy is to apply the quantum time flip to both gates, exchanging the roles of |0 and |1 in the control for gate V . In this strategy, one time flip generates the gate S U = U ⊗ |0 0| + U T ⊗ |1 1|, while the other generates the gate S V = V T ⊗ |0 0| + V ⊗ |1 1|. The strategy is to prepare the target and control systems in the product state |ψ ⊗ |+ , where |ψ is arbitrary, and |± := (|0 ± |1 )/ √ 2. Then, the target and control are sent first through the gate S V and then through the gate S U , obtaining the state If U and V satisfy the condition U V T = U T V , then the second term in the sum vanishes, and the control qubit ends up in the state |+ . Instead, if the gates satisfy the condition U V T = −U T V , then the first term vanishes, and the control qubit ends up in the state |− . Hence, the player can measure the control qubit in the basis {|+ , |− }, and figure out exactly which condition is satisfied. Overall, the transformation of the gate pair (U, V ) into the controlled-gate S U S V is an example of a bipartite supermap with indefinite time direction, of the type discussed in Appendix C. A player that implements this supermap can in principle win the game with certainty.
The situation is different for players who can only probe the two unknown gates in a definite time direction. In Appendix F we show that every such player will have a probability of at least 11% to lose the game. Remarkably, this limitation applies not only to strategies that use the two gates U and V in a fixed order, but also to all strategies where the relative order of U and V is indefinite.

FIG. 4.
Photonic realisation of the superposition of a process and its input-output inverse. Using a beamsplitter, a single photon is coherently routed along two paths, one (in blue) traversing an unknown waveplate from top to bottom, and the other (in red) traversing it from bottom to top. Along one path, the photon polarisation experiences a unitary gate U , while on the other path it experiences the transpose gate U T , up to a change of basis G that is undone by placing suitable polarisation rotations before and after the waveplate. The two paths are finally recombined in order to allow for an interferometric measurement on the control qubit (top image). By concatenating two setups with the above structure, one can implement the winning strategy in Eq. (2) (bottom image).
Photonic realisation of the suporposition of a process and its input-output inverse. A coherent superposition of a unitary process and its input-output inverse can be realised with polarisation qubits, using the interferometric setup illustrated in Figure 4. In this setup, the control qubit is the path of a single photon. A beamsplitter puts the photon in a coherent superposition of two paths, which lead to an unknown polarisation rotator from two opposite spatial directions, respectively. Along one path, the passage through the polarisation rotator induces an unknown unitary gate U . Along the other path, the passage through the polarisation rotator induces the unitary gate GU T G † , where G is a fixed unitary gate depending on the choice of basis used for representing polarisation states (in the standard representation of the Poincaré sphere, G is the Pauli matrix Z = |0 0| − |1 1|). By undoing the unitary gate G, one can then obtain a quantum process with coherent control over the gates U and U T , as described by Eq. (1).
Note that the above realisation is not in contradiction with our no-go result on the realisation of the quantum time flip in a quantum circuit with a fixed direction of time. The no-go result states that it is impossible to build the controlled unitary gate U ⊗ |0 0| + U T ⊗ |1 1| starting from an unknown and uncontrolled gate U as the initial resource. However, it does not rule out the existence of a device that directly implements the controlled gate U ⊗ |0 0| + U T ⊗ |1 1| in the first place. Such devices do exist in nature, as shown above, and the unitary U appearing in them can be either known or unknown. A similar situation arises in the implementation of other controlled gates, which cannot be constructed from their uncontrolled version [38,[42][43][44], but can be directly realised in various experimental setups [45,46].

II. DISCUSSION
In this work we defined a framework for quantum operations with indefinite time direction. This class of operations is broader than the set of operations considered so far in the literature, and in the multipartite case it includes all known operations with definite and indefinite causal order. Quantum operations with both indefinite time direction and indefinite causal order provide a framework for describing the interactions of an agent with the fundamentally time-symmetric dynamics of quantum theory, and for composing local processes into more complex structures. This higher order framework is expected to contribute to the study of quantum gravity scenarios, as envisaged by Hardy [13]. These applications, however, are beyond the scope of the present paper, and remain as a direction for future research.
The characterization of the bidirectional quantum channels provided in this paper reveals an interesting connection with thermodynamics. We showed that the the set of bidirectional quantum processes coincides with the set of bistochastic channels. On the other hand, bistochastic channels can also be characterised as the largest set of entropy non-decreasing processes: any entropy nondecreasing process must transform the maximally mixed state into itself, and therefore be bistochastic; vice-versa, every bistochastic channel is entropy non-decreasing [47]. Combining these two characterizations, we conclude that the processes admitting a time-reversal are exactly those that are compatible with the non-decrease of entropy both in the forward and in the backward time direction. This conclusion is remarkable, because no entropic consideration was included in the derivation of our results. A promising direction for future research is to further investigate the role of input-output inversion in the search of axiomatic principles for quantum thermodynamics [48,49].
Finally, another interesting direction is to explore generalisations of quantum thermodynamics to the scenario where agents are not constrained to operate in a def-inite time direction. A first step in this direction has been recently taken by Rubino, Manzano, and Brukner [50], who explored thermal machines using a coherent superpositions of forward and backward processes. Their notion of backward process is different from ours, in that it is defined in terms of the joint unitary evolution of the system and an environment, rather than the dynamics of the system alone. Due to the dependence on the environment, the superposition of forward and backward processes considered in [50] cannot be interpreted as the result of an operation performed solely on the original channel. An interesting direction of future research is to explore the thermodynamic power of the operations introduced in our work, combining them with the insights of Ref. [50] and with similar insights arising from the research on indefinite causal order [51][52][53].

III. METHODS
Characterisation of the input-output inversions. The foundation of our framework is the characterisation of the bidirectional quantum devices. The logic of our argument is the following: first, we observe that the input-output inversion must be linear in its argument (Appendix G). Hence, the input-output inversion of unitary gates uniquely determines the time-reversal of every channel in the linear space generated by the unitary channels. The linear span of the unitary channels is characterised by the following theorem from [28], for which we provide a new, constructive proof in Appendix H.

Theorem 1
The linear span of the set of unitary channels coincides with the linear span of the set of bistochastic channels.
Theorem 1 implies that the input-output inversion of bistochastic channels is uniquely determined by the input-output inversion of unitary channels. In particular, it implies that, up to changes of basis, there are only two possible choices of input-output inversion of bistochastic channels: either the adjoint, or the transpose.
Interestingly, the adjoint and the transpose exhibit a fundamental difference when applied to the local dynamics of a subsystem. Suppose that a composite system S ⊗ E undergoes a joint evolution with the property that the reduced evolution of system S is bistochastic. Then, one may want to apply the input-output inversion only on the S-part of the evolution, while leaving the E-part unchanged. In Appendix I we show that, when the dimension of system S is larger than two, the local application of the input-output inversion generates valid quantum evolutions if and only if the input-output inversion is described by the transpose. In contrast, if the input-output inversion is described by the adjoint, then there is no consistent way to define its local action on the dynamics of a subsystem.

Characterisation of the bidirectional channels.
We now show that the set of channels with an inputoutput inversion satisfying Requirements (1-4) coincides with the set of bistochastic channels. The key of the argument is the following result: Theorem 2 If a channel C admits an input-output inversion satisfying Requirements 1,2, and 4, then its input-output inversion Θ(C) is a bistochastic channel.
The proof is provided in Appendix J. Theorem 2, combined with Requirement 3 (the input-output inversion maps distinct channels into distinct channels), implies that only bistochastic channels can admit an inputoutput inverse. Indeed, if a non-bistochastic channel had an input-output inversion, then the time reversal should coincide with the input-output inversion of a bistochastic channel, in contradiction with Requirement 3.
In Appendix K we show that, even if Requirement 3 is dropped, defining a non-trivial input-output inversion satisfying requirements 1,2, and 4 is impossible for every system of dimension d > 2. For d = 2, instead, an input-output inversion satisfying conditions (1-3) can be defined on all channels, but it maps all channels into bistochastic channels, in agreement with Theorem 2.

DATA AVAILABILITY
The authors declare that the data supporting the findings of this study are available within the paper and in the supplementary information files.

AUTHOR CONTRIBUTIONS
Both authors contributed substantially to the research presented in this paper and to the preparation of the manuscript.

COMPETING INTERESTS
The authors declare no competing interests.

Appendix A: Input-output inversion of unitary dynamics and its relation with time-reversal
Here we characterise the action of the input-output inversion on the set of unitary evolutions. Using such characterisation, we will then discuss the relation between the notion of input-output inversion and the notion of timereversal in quantum mechanics [24,25] and in quantum thermodynamics [26].

Input-output inversion of unitary dynamics
Here we characterise the action of the possible inputoutput inversions on the set of unitary evolutions. For this part of the paper, we will only use Requirements 1 (order reversal), 2 (identity preservation), and 3 (distinctness preservation).
First, note that Requirements 1 and 2 together imply that the map Θ transforms unitary channels into unitary channels: Lemma 1 Every input-output inversion Θ, satisfying Requirements 1 and 2 in the main text must map unitary channels into unitary channels.
Proof. Recall that our standing assumption is that all unitary channels are bidirectional, that is, they are in the domain of the map Θ. Now, a channel C with input S 1 and output S 2 is unitary if and only if there exists another channel D, with input S 2 and output S 1 , such that D • C = I S1 and C•D = I S2 , where S 1 (S 2 ) is the input (output) of channel C, and I X is the identity channel on system X ∈ {S 1 , S 2 }. If C is a unitary channel, then, applying the map Θ on both sides of the two equalities, one obtains Θ(D • C) = Θ(I S1 ) and Θ(C•D) = Θ(I S2 ). Using Requirements 1 and 2, one then gets Θ(C) • Θ(D) = I S * 1 and Θ(D) • Θ(C) = I S * 2 , which imply that Θ(C) is a unitary channel. (In passing, we observe that the above proof applies to any map Θ that is defined on a set of channels B with the property that, for every unitary channel C in B, its inverse D is also in B.) Now, every unitary channel U can be written in the form U(ρ) = U ρU † , for some unitary matrix U in the special unitary group SU(d). Since the map Θ maps unitary channels into unitary channels, it induces a map θ from SU(d) to itself. For the map θ, Requirements 1-3 in the main text amount to the conditions We now show that the map θ must be unitarily equivalent to the adjoint or to the transpose.
for every pair of matrices U 1 and U 2 in SU(d).
The classification of the representations of SU(d) implies that, up to unitary equivalences, there exist only three representations in dimension d [54]: the trivial representation α(U ) = I, ∀U , the defining representation α(U ) = U, ∀U , and the conjugate representation Now, the definition of α implies the relation θ(U ) = α(U † ). Hence, there are only three possibilities, up to unitary equivalence: first possibility θ(U ) = I , ∀U is ruled out by Eq. (A3).

Relation with time-reversal of unitary dynamics
The classic notion of time-reversal in quantum mechanics dates back to Wigner [24]. In this formulation, timereversal corresponds to a symmetry of the state space. By Wigner's theorem, state space symmetries are described either by operators that are either unitary or antiunitary (see e.g. [55]). For the time-reversal symmetry, the canonical choice is to take a anti-unitary operator, motivated by physical considerations such as the preservation of the canonical commutation relations under the transformation X → X, P → −P [25], or the requirement that the energy be bounded from below both in the forward-time picture and in the backward-time picture [56,57]. In the following, we will first provide some remarks that are valid both for unitary and anti-unitary operators, and then we will specialise them to the canonical choice, namely the anti-unitary case.
Let A be an operator (either unitary or anti-unitary) that maps generic pure states |ψ into the corresponding time-reversed states |ψ rev = A|ψ . The time-reversal of states then induces a time-reversal of unitary evolutions. The latter is determined by the condition that, if a forward-time evolution U transforms the state |ψ into the state |ψ , then the corresponding backward-time evolution U rev must transform the state |ψ rev into the state |ψ rev , for every possible initial state |ψ . This condition amounts to the equation U rev AU |ψ = A|ψ , ∀|ψ , or equivalently, to the equation where A −1 is the inverse of A. This equation is known in quantum control and quantum thermodynamics, where it corresponds to the so-called microreversibility principle in the special case of autonomous (i.e. non-driven) systems with Hamiltonian invariant under time-reversal (cf. Eq. (40) of [26]).
Let us now focus on the canonical case where A is an anti-unitary operation. Eq. (A4) can be made explicit by recalling that every antiunitary operator A can be decomposed as V K, where V is a unitary operator, and K : |ψ → |ψ is the complex conjugation in a given basis [55]. Using the relations where U T denotes the transpose of U in the given basis.
Eq. (A5) shows that the transformation of unitary evolutions due to the canonical time-reversal is unitarily equivalent to the transpose. This transformation corresponds to one of the two possible forms of an inputoutput inversion allowed by our Lemma 2.
One can also consider non-canonical choices of timereversal, such as the one advocated by Albert [58] and Callender [59], who argued that, in certain systems, timereversal should leave quantum states unchanged. This choice corresponds to setting A equal to the identity operator, which, inserted into Eq. (A4), gives the timereversed dynamics U rev = U † . More generally, if one were to choose the operator A to be a generic unitary, one would get the time-reversed dynamics U rev = AU † A † . This choice corresponds to the second option in our Lemma 2.
Our characterisation of the input-output inversions is not specifically about time-reversal symmetry, but more generally about any symmetry that reverses the order of time evolutions, cf. Eqs. (A1)-(A3). As such, it also applies to other combination of the time-reversal symmetry with other order-reversing symmetries, such as the combinations of time-reversal (T), with parity inversion (P) and charge-conjugation (C). In other words, all the combinations CT, PT, and CPT are possible order-reversing symmetries. The two options allowed by Lemma 2 cover the possible cases that may arise in these scenarios. For example, Ref. [60] argued that the full CPT symmetry corresponds to a unitary transformation V at the state space level. In this case, the same argument used in the derivation of Eq. (A4) implies that the action of the CPT symmetry on the dynamics is given by the mapping U → V U † V † , in agreement with the second option in Lemma 2.

Relation with time-reversal in non-unitary case
So far we discussed the input-output inversion of unitary dynamics, and its relation with time-reversal and other order-reversing symmetries. In all these cases, the input-output inversion can be interpreted as an inversion of the system's trajectory in state space, corresponding to the intuitive idea of "playing a movie in reverse" [58,61]: if a system transitions from |ψ to |ψ in the forward time direction, then it transitions from |ψ to |ψ (up to unitary transformations and/or complex conjugations) in the backward time direction.
The extension to non-unitary processes, discussed in the main text, comes with a key difference. For nonunitary processes, the reversal of state space trajectories is generally impossible, unless one includes the environment into the picture. Nevertheless, the notion of input-output inversion introduced in the main text is still valid, and can be defined without specifying the details of the interaction with the environment. We now discuss the relation of our notion of input-output inversion with the notions of time-reversal of non-unitary evolution considered in the literature, in particular in the works of Crooks [62], Oreshkov and Cerf [18], Aurell, Zakrzewski, andŻyczkowski [63], and, more recently, in Ref. [64]).
In Crooks' formulation [62], time-reversals constructed from the adjoint using a non-linear procedure. Specifically, the time-reversal of a quantum channel C coincides with Petz' recovery map C Petz [65,66], defined as where ρ 0 is any quantum state such that C(ρ 0 ) = ρ 0 , and C † is the adjoint of channel C (see the main text for the explicit definition). This procedure can be applied to arbitrary channels, but in general it is non-linear, due to the dependence on the state ρ 0 . The non-linearity implies that the time-reversal of a mixture of channels is generally not equal to the mixture of their time-reversals, in violation of Requirement 4 in the main text. More importantly, this time-reversal is generally not order-reversing, and Requirement 1 in the main text is generally violated: for two generic channels C and D, it is often not the case that (C •D) rev = D rev •C rev . Requirements 1 and 4 are restored if one restricts the time-reversal to bistochastic channels, and chooses ρ 0 to be the maximally mixed state. In this case, the Petz recovery map coincides with the definition the adjoint map C † , and is in agreement with the classification provided in the main text.
An extension of the approach by Crooks was proposed in Ref. [64], following up on a suggestion by Andreas Winter. There, one defines a fixed reference state for every system, and defines the time-reversal only on the subset of channels C satisfying the condition C(ρ S1 ) = ρ S2 , where ρ S1 and ρ S2 are the fixed reference states of the systems S 1 and S 2 corresponding to the input and output of channel C, respectively. On this subset of channels, the time-reversal is defined as the Petz recovery map , or as the variant of the Petz recovery map where the adjoint C † is replaced by the transpose C T . This definition satisfies all the Requirements 1-4 in the main text. However, it does not assign a time-reversal to every unitary evolution, unless ρ 1 and ρ 2 are set to the maximally mixed state. Depending on the purpose, this may or may not be an issue. For example, it may be interesting to consider time reversals that are defined only on a subset of unitary evolutions, e.g. the evolutions that preserve the Hamiltonian of the system. More generally, extending the results of the present paper to the scenario where only a subgroup of the unitary group admits a time reversal is an interesting direction of future research.
Oreshkov and Cerf [18] considered symmetries in an extended framework for quantum theory where arbitrary postselection are allowed. Their main result is an extension of Wigner's theorem, where the allowed symmetries are described by invertible operators that are either linear or anti-linear. In their framework, the time-reversal is defined as an operation that transforms states into measurement operators, and vice-versa. This formulation does not explicitly specify how the time-reversal should be defined on quantum channels, but, since the timereversal operation on states is generally non-linear (due to the presence of postselection), it is natural to expect that any time-reversal of quantum channels based on it would also be non-linear, thereby violating our Requirement 4.
Finally, Aurell, Zakrzewski, andŻyczkowski [63] define the time-reversal of general quantum channels in terms of a special decomposition, whereby each channel is decomposed as C = V 1 C ess V † 2 , where V 1 and V 2 are unitary channels (generally depending on C), and C ess is a (generally non-unitary) quantum channel, called the "essential map". The time-reversal is then defined as the channel C rev = V 2 C ess V † 1 . This notion of time-reversal is an involution on the set of quantum channels, and for unitary channels it coincides with the adjoint. On the other hand, for general non-unitary channels it is not an order-reversing operation, nor a linear one: like Crook's time-reversal, this choice of time reversal generally violates Requirements 1 and 4 in the main text. Aurell, Zakrzewski, andŻyczkowski also consider other possible notions of time-reversals, defined as involutions on the set of quantum channels. For this broader definition, it is possible to show that the time-reversal of unitary dynamics cannot be extended to a time-reversal of arbitrary quantum operations [64], and it is conjectured that an extension to the set of all quantum channels is also impossible.
Appendix B: Characterisation of the operations on bidirectional quantum devices

Definition
A basic way to interact with a bidirectional quantum device is described by a particular type of quantum supermap [22] that transforms bistochastic channels into ordinary channels (CPTP maps).
Hereafter, we will denote by L(H, K) the set of linear operators on a generic Hilbert space H to another generic Hilbert space K, and we will use the shorthand notation L(H) := L (H, H). Also, we will denote by Map(S i , S o ) the set of linear maps from L(H Si ) to L(H So ), by Chan(S i , S o ) the set of all quantum channels with input system S i and output system S o , and by BiChan(S i , S o ) the subset of all bistochastic channels.
A quantum supermap on bistochastic channels is a linear map S : is the input (output) of the bistochastic channel on which S acts, and B i (B o ) is the input (output) of the channel produced by S. The map S is required to transform channels into channels even when acting locally on part of a composite process. Explicitly, this means that the map (S ⊗ I EiEo ) (M) must be a valid quantum channel when- is a channel that extends a bistochastic no-signalling channel, that is, a channel M is such that the reduced channel M σ , defined by belongs to NoSig(A i , A o ) for every density matrix σ ∈ L(E i ).

Choi representation
An equivalent way to represent quantum supermaps is to use the Choi representation [67].
where the second equality uses the double-ket notation [68,69] |A := m,n m|A|n |m ⊗ |n , for a generic operator A ∈ L(H Si , H So ). Now, a supermap S : is itself a linear map, and, as such, is in one-to-one correspondence with a linear operator S ∈ L(H Bo ⊗ H Bi ⊗ H Ao ⊗ H Ai ). The correspondence is specified by the relation In this representation, the requirement that S be applicable locally on part of a larger process is equivalent to the requirement that the operator S be positive [22,29]. The requirement that S transforms any bistochastic channel into a quantum channel is equivalent to the condition where N is an arbitrary Choi operators of a bistochastic channel in BiChan(A i , A o ). The normalisation conditions (B5) can be put in a more explicit form by decomposing the operator S into orthogonal operators, each of which is either proportional to the identity or traceless on some of the Hilbert spaces, in a similar way as it was done in [21] for the characterisation of the operations with definite time direction. Using this fact, in the following we provide a complete characterisation.

Characterisation of the supermaps from bistochastic channels to channels
Here we characterise the Choi operators of the supermaps transforming bistochastic channels into channels. First, note that the Choi operator (B6) As a consequence, the operator N can be decomposed as where T is operator such that Choosing an arbitrary T , instead, we obtain The combination of conditions (B9) and (B10) is equivalent to the original condition (B5). We will now cast condition (B10) in a more explicit form. Condition (B10) is equivalent to the requirement that S be orthogonal (with respect to the Hilbert-Schmidt product) to all operators of the form T AiAo ⊗ J Bi ⊗ I Bo , where J Bi is an arbitrary operator on H Bi and T AiAo is an arbitrary operator satisfying Eq. (B8). In other words, S must be of the form where M BiBo is an arbitrary operator on H Bi ⊗ H B o , and the remaining operators on the right hand side satisfy the relations The last step is to express the operators in the right hand side of Eq. (B11) in terms of the partial traces of S. Explicitly, we have while W AiAoBiBo is a generic operator satisfying the last three relations in Eq. (B12). Inserting the above relations into Eq. (B11), we obtain or equivalently, Here we provide the definition of the set of multipartite operations with indefinite time direction. The definition adopts the framework of [22], which defines general quantum supermaps from a subset of quantum channels to another. In our case, the input and output set are as follows: • Input set: the set of N -partite no-signalling bistochastic channels, defined as the set of N -partite quantum channels of the form where each c j is a real coefficient, each C i,j is a bistochastic channel. We denote the set of channels of this form as is the input (output) of channel A n,j , for every possible j.
• Output set: the set Chan(B i , B o ), consisting of ordinary channels from system B i to system B o .
A quantum supermap on no-signalling bistochastic channels is then defined as a linear map S : is the input (output) of the channel produced by S. The map S is required to transform channels into channels even when acting locally on part of a composite process. Explicitly, this means that the map (S ⊗ I EiEo ) (M) must be a valid quantum channel when- is a channel that extends a bistochastic no-signalling channel, that is, M is such that the reduced channel M σ , defined by belongs to BiNoSig(A 1i , A 1o | A 2i , A 2o | · · · |A N i , A N o ) for every density matrix σ ∈ L(E i ). Quantum supermaps on bistochastic no-signalling channels describe the most general way in which N bidirectional quantum processes can be combined together.
In general, this combination can be incompatible with a definite direction of time, and, at the same time, incompatible with a definite ordering of the N channels.
Here we provide three examples for N = 2. To specify a supermap S, we specify its action on the set of product channels A 1 ⊗ A 2 , which-by definition-are a spanning set of the set of bipartite bistochastic no-signalling channels. The first supermap, S 1 , is defined as where {A 1m } and {A 2,n } are Kraus operators of channels A 1 and A 2 , respectively. This supermap can be generated by applying two independent quantum time flips to channels A 1 and A 2 , respectively, and by exchanging the roles of the control states |0 and |1 in the second time flip. This supermap describes the winning strategy for the game defined in the main text. The supermap is incompatible with a definite time direction, but is compatible with a definite causal order between the two black boxes corresponding to channels A 1 and A 2 (channel A 1 , or its transpose A T 1 always acts after channel A 2 or its transpose A T 2 ). The second supermap, S 2 , is the quantum SWITCH [20,22], defined as Note that the quantum SWITCH here is defined only on the set of bistochastic no-signalling channels. Interestingly, however, this definition determines the action of the quantum SWITCH on arbitrary channels (and on arbitrary linear maps as well): the reason is that the set of bistochastic no-signalling channels includes the set of all products of unitary channels, and it is known that the quantum SWITCH is uniquely determined by its action on such channels [70]. Finally, note that the order of the channels A 1 and A 2 in the quantum SWITCH is indefinite, but each channel is used in the forward time direction. A third supermap, S 3 , is a combination of the quantum time flip and the quantum SWITCH, and is defined as follows: This supermap describes a coherent superposition of the process A 1 • A 2 and its time reversal Θ(A 1 • A 2 ) = A T 2 • A T 1 . Such supermap is incompatible with both a definite time direction and with a definite causal order.

Choi representation
An equivalent way to represent quantum supermaps on bistochastic no-signalling channels is to use the Choi representation, thus obtaining a generalisation of the notion of process matrix [21], originally defined for supermaps that combine processes in an indefinite order, while using each process in a definite time direction.
Since S is a linear map, it is in one-toone correspondence with a linear operator S ∈ The correspondence is specified by the relation In this representation, the requirement that S be applicable locally on part of a larger process is equivalent to the requirement that the operator S be positive [22,29]. The requirement that S transforms any bistochastic nosignalling channel into a quantum channel is equivalent to the condition where N is the Choi operator of an arbitrary bistochastic no-signalling channel in

Appendix D: The quantum time flip supermap
Here we show that that the quantum time flip is a welldefined transformation of bistochastic channels, that is, it is a valid quantum supermap [22,29,30].
First, we observe that the quantum time flip transformation is well defined: Proposition 1 The transformation F : C → F C defined in the main text is independent of the choice of Kraus operators C = {C i } used for channel C.
The proof uses the Choi isomorphism [67] and the double-ket notation in Eq. (B3). Using this notation, the Choi operator of a quantum channel C can be written as Proof of Proposition 1. The definition in the main text implies that the map F C has Choi operator with F i = C i ⊗ |0 0| + θ(C i ) ⊗ |1 1|. Explicitly, one has When θ(C i ) = C T i , we have with Combining Eqs. (D1), (D2), and (D4), we then obtain This equation implies that (the Choi operator of) F C depends only on (the Choi operator of) C, and not on the specific choice of Kraus operators for C used to define the Kraus operators F C .
Next we observe that the map F is completely positive, in the sense that the induced map F : Choi(C) → Choi(F C ) is completely positive. Complete positivity is immediate from Eq. (D6). Operationally, complete positivity means that the supermap F can be applied locally to one part of a larger quantum evolution [22,29,30].
Since the induced map F is completely positive, it also has a positive Choi operator. Specifically, the operator is with where A i (A o ) is the input (output) system of the process C on which the quantum time flip acts, and B it (B ot ) is the input (output) target system of the process F(C) produced by the quantum time flip. Finally, note that the quantum time flip maps bistochastic channels into bistochastic channels as one can check immediately from the Kraus representation Summarising, the quantum time flip F is a welldefined, completely positive supermap transforming bistochastic channels into bistochastic channels. Here we show that the quantum time flip cannot be decomposed as F = p S fwd + (1 − p) S bwd , where p ∈ [0, 1] is a probability and S fwd (S bwd ) is a supermap corresponding to a quantum circuit that uses the input channel in the forward (backward) direction.
The proof proceeds by contradiction. Let us consider the application of the quantum time flip to a unitary channel U. Since the output channel F(U) is unitary, and since unitary channels are extreme points of the convex sets of quantum channels, the condition F(U) = p S fwd (U) + (1 − p) S bwd (U) implies F(U) = S fwd (U) = S bwd (U). Now, the condition F(U) = S fwd (U) implies the equality where aux is an auxiliary quantum system, A and B are suitable quantum channels, and B 1 is the quantum channel defined by B 1 (ρ) := B(ρ ⊗ |1 1|). Equation (E1) should hold for all unitary channels U. But this is a contradiction, because it is known that no quantum circuit can implement the transformation U → U T [38,39].

Strenghtened proof with two copies of the input channel
We show that the time-flipped channel F(U) cannot be generated by an quantum process that uses two copies of a generic unitary channel U in a definite time direction. This impossibility result holds even for processes that combine the two copies of the channel U in an indefinite causal order. Our result highlights a difference between the quantum time flip and the quantum SWITCH, as the quantum SWITCH of two unitary gates can be reproduced by ordinary circuits if two copies of each unitary gate are provided [20,22].
Let us consider operations that transform a pair of input channels into a single output channel. These operations were defined in [22], which we briefly summarise in the following.
An operation on a pair of channels can be described by a quantum supermap S : (A, B) → S(A, B) that is linear in both arguments. Let us denote by A i (A o ) the input (output) system of channel A, and by B i (B o ) the input (output) system of channel B, and by C i (C o ) the input (output) system of channel S (A, B).
The normalisation condition for the supermap S is that the map S(A, B) should be a quantum channel for every A ∈ Chan(A i , A o ) and B ∈ Chan(B i , B o ). Linearity implies that the supermap S can be extended to a supermap S that is well-defined on every bipartite channel of the form N = j c j A j ⊗ B j , where each c j is a real coefficients, and each A j (B j ) is a channel in Chan(A i , A o ) (Chan(B i , B o )). The set of such channels N coincides with the set of no-signalling channels with respect to the bipartition A i A o vs B i B o . This set will be denoted by NoSig(A i , A o |B i , B o ). The relation between the bilinear supermap S and its extension S is given by the equality S(A ⊗ B) := S(A, B), valid for every pair of channels A and B. In the following, we will focus on the map S.
A general supermap with indefinite causal order is a linear map S : into ordinary channels in Chan(C i , C o ). Besides normalisation, the map S is required to be well-defined when acting locally on part of a larger process, that is, to satisfy the condition ( that extends a no-signalling channel, that is, any channel M such that the channel M σ : ρ → M σ (ρ) := Tr Do [M(ρ ⊗ σ)] is nosignalling for every state σ of system D i [22].
The set of all supermaps S from no-signalling channels in NoSig(A i , A o |B i , B o ) into ordinary channels in Chan(C i , C o ) can be used to describe all the ways in which two generic quantum channels A and B can be combined, either in a definite or in an indefinite order. In the special case where the channels A and B are bistochastic, the above supermaps correspond to operations that use both channels in the forward time direction. To emphasise this fact, we use the notation where A and B are arbitrary bistochastic channels. Operations that use channels A and B in the backward time direction can be defined similarly as where Θ is the input-output inversion, defined in terms of the transpose. We now show that the quantum time flip cannot be reproduced by a forward supermap S fwd , nor by a backward supermap S bwd , nor by a random mixture of these two types of maps.
Theorem 3 It is impossible to find supermaps S fwd and S bwd , and a probability p ∈ [0, 1] such that F(U) = p S fwd (U, U) + (1 − p) S bwd (U, U) for every unitary channel U.
The proof consists of three steps. First, note that, since F(U) is a unitary channel and unitary channels are extreme points of the convex set of quantum channels, the condition F(U) = p S fwd (U, U) + (1 − p) S bwd (U, U) implies F(U) = S fwd (U, U) = S bwd (U, U) for every unitary channel U. Hence, to prove the theorem it is enough to prove that the quantum time flip cannot be reproduced by a forward supermap.
Second, note that the condition F(U) = S fwd (U, U) implies that there exists a forward supermap implementing the transformation U ⊗ U → U T where U is an arbitrary unitary gate.
Third, we prove the following lemma: Lemma 3 No forward supermap can implement the transformation U ⊗ U → U T where U is an arbitrary unitary gate.
Proof. The similarity between the output channel S fwd (U, U) and the target gate U T can be measured by the average fidelity between their Choi operators, given by Explicitly, the average fidelity is given by In the following we will show that the fidelity F is strictly smaller than 1 for every forward supermap. Specifically, we will show that the fidelity is upper bounded by 5/6 for qubits, and by 6/d 2 for higherdimensional quantum systems. The derivation of the bounds is inspired by the semidefinite programming techniques developed in [38], although no knowledge of semidefinite programming is needed in the proof.
The first step in the derivation is to write down the supermap S fwd in the Choi representation. Choi operators of quantum supermaps are also known as process matrices [21].
The fidelity can be rewritten by introducing the Choi operator of the supermap S, hereafter denoted by S. The Choi operator S is a positive operator on the tensor product space H Ai ⊗ H Ao ⊗ H Bi ⊗ H Bo ⊗ H Ci ⊗ H Co , and the action of the supermap S fwd on a pair of channels A and B is given by where the subscripts label the Hilbert spaces of the input/output systems. Note that the operator Ω satisfies the commutation relation for every pair of unitary operators U and V . Now, recall that the Hilbert space C d ⊗ C d ⊗ C d can be decomposed into irreducible subspaces for the representation U ⊗ U ⊗ U as where R j is a representation space, where the representation U ⊗ U ⊗ U acts irreducibly, and M j is a multiplicity space, which is invariant under the action of the representation U ⊗ U ⊗ U . Here there are 3 possible irreducible representations, of which one has dimension d, and the other two have dimensions d(d ± − 1), respectively, where d ± = d(d ± 1)/2 is the dimension of the symmetric/antisymmetric subspace of C d ⊗ C d . The ddimensional representation, denoted by j 0 , has multiplicity m j0 = 2 ≡ dim(M j0 ), while all the other representations have multiplicity m j = 1 ≡ dim(M j ).
Using the decomposition (E9) and Schur's lemma, we obtain the expression For quantum systems of dimension d > 2, we now show that no quantum process with indefinite causal order can achieve fidelity higher than 6/d 2 . To prove this bound, we define the quantum state Note that we have and therefore Now, expand the state ρ AoBoCi as an affine combination where α k , β k , and γ k are density matrices of systems A o , B o , and C i , respectively, and (c k ) K k=1 are real coefficients summing up to 1. Define the quantum channels A k and B k with Choi operators Choi A k = I Ai ⊗ α k and Choi B k = I Bi ⊗ β k , and note that one has is the Choi operator of the channel D k := S(A k , B k ), as per Eq. (E6). Since the channel D k is trace-preserving, its Choi operator satisfies the condition Combining Eqs. (E13), (E15), and (E17), we finally obtain Hence, no process with locally definite time arrow can achieve fidelity larger than 6/d 2 .
Direct inspection shows that the states ρ +,AoBoCi and ρ −,AoBoCi have the same marginals on systems A o C i and The channel N has Choi operator and direct inspection shows that one has the matrix inequality Eq. (E7) then yields the bound We now show that the factor inside the trace is equal to 1. To this purpose, we observe that the channel N satisfies the conditions meaning that the marginals of the output state on systems B o C i and A o C i are independent of the input state ρ. In particular, these condidions imply that the channel N is no-signalling with respect to the tripartition where C * is a fictitious onedimensional system, serving as input for the C-part of the tripartition. Thanks to the no-signalling property, the channel N can be decomposed as an affine combination of product channels, namely , and C k ∈ Chan(C * , C i ) are quantum channels, and (r k ) K k=1 are real coefficients summing up to 1. Note that, since the system C * is trivial, the "channel" C k ∈ Chan(C * , C i ) is just a quantum state of system C i . Such state will be denoted by γ k in the following.
The decomposition (E27) implies that the Choi operator of the channel N can be decomposed as Hence, we have where the second equality follows from Eq. (E6), by defining A k and B k , respectively. Then, the third inequality follows from the fact that the map S(A k , B k ) is a quantum channel, and therefore is trace-preserving. Finally, inserting Eq. (E29) into Eq. (E25) we obtain the bound F ≤ 5/6. Appendix F: Bound on the error probability for strategies with definite time direction

Numerical bound for arbitrary strategies
Here we consider the game defined in the main text: a player is given access to two black boxes, implementing two unknown gates U and V , respectively. The problem is to determine whether a given pair of gates (U, V ) belongs to the set or to the set where U and V are generic elements of U(d), the set of d × d unitary matrices. In the following we will show that every player who uses the two black boxes in a definite time direction will make errors with probability of at least 11.2%. This bound on the probability of error holds for every strategy in which the two gates are accessed in the same time direction (either both in the forward direction, or both in the backward direction), even if the relative order of the two black boxes is indefinite.
Measurement strategies with indefinite causal order were defined in Ref. [35], where they were called indefinite testers (see also the recent work [71]). Mathematically, an indefinite tester is a linear map from the set of no-signalling channels to the set of probability distributions over a given set of outcomes X. Since we are interested in measurements on a pair of qubit channels A : ρ → U ρU † and B : ρ → V ρV † , here we will focus on the case of bipartite no-signalling channels in the set In the Choi representation, the tester is described by a set of positive operators (T x ) x∈X where each operator T x acts on the Hilbert space H Ai ⊗ H Ao ⊗ H Bi ⊗ H Bo . When the test is performed on a pair of channels (A, B), the probability of the outcome x is given by the generalised Born rule The normalisation of the tester is expressed by the condition Equivalently, this means that the positive operator T := x∈X satisfies the condition This condition shows that the operator T is a process matrix, in the sense of Ref. [21]. In the notation of our paper, the above conditions is equivalent to the linear constraints We now give a numerical bound of the minimum probability of error in distinguishing between two generic elements of the sets S + and S − defined in Eqs. (F1) and (F2), respectively. For this purpose, we consider an indefinite tester with binary outcome set X = {+, −} and tester operators are denoted as (T + , T − ).
To obtain our bound, we consider two subsets of S + and S − , denoted by S 0 and S 1 , respectively, and we show that these two subsets not be distinguished perfectly by any indefinite tester. The subsets are defined as follows: The worst-case probability in distinguishing between the sets S 0 or S 1 is Hence, the minimum worst-case error probability is given by the following program: Numerical calculation by MATLAB CVX [72,73] and QETLAB [74] then yields the optimal value 0.112149.

Appendix G: Linearity of input-output inversion
Here we show that every input-output inversion defined on a convex subset B of quantum channels can be extended to a linear supermap on the (complex) linear space spanned by B.
Proposition 2 Every input-output inversion Θ, defined on a convex subset B ⊆ Chan(H) and satisfying Requirement 4 in the main text, can be uniquely extended to a linear supermap Γ on the vector space Span(B) spanned by the quantum channels in B. In other words, there exists a linear supermap Γ : Span(B) → Span(B) such that Γ(C) = Θ(C) for every channel C ∈ B.
The proof is somewhat lengthy, and can be skipped at a first reading.
Proof. Let M be a generic element of Span(B), written as for some complex numbers {c j } ⊂ C and some quantum channels {C j } ⊂ B. Note that, if the input-output inversion Θ can be extended to a linear supermap Γ on Span(B), then such extension is necessarily unique: indeed, the action of the supermap Γ is uniquely fixed by the linearity condition which defines Γ on every element of Span(B). We now show that the above definition is independent of the way in which M is represented as a linear combination. That is, if M = k c k C k for some other set of complex numbers {c k } ⊂ C, and for some other set of quantum channels {C k } ⊂ B, then one has To prove Equation (G3), we start from the special case where the numbers {c j } and {c k } are probabilities, so that (G1) is a convex combination. In this case, the map M is a quantum channel and Condition 3 in the main text implies j c j Θ(C j ) = Θ(M) = k c k Θ(C k ). Hence, the definition (G2) is well-defined on convex combinations.
Consider now the case where the numbers {c j } and {c k } are non-negative, so that (G1) is a conic combination. In this case, the trace-preserving property of the channels {C j } and {C k } implies Define the probabilities p j := c j /λ and p k := c k /λ, and note that they satisfy the condition j p j C j = M/λ = k p k C k . Hence, one has where the third and fifth equalities follow from the condition j p j C j = k p k C k and from the fact that Θ is well-defined on convex combinations. Summarizing, Equation (G5) shows that the definition (G2) is wellposed on conic combinations.
We now show that Θ is well-defined on real-valued combinations. When the coefficients {c j } and {c k } are real, they can be partitioned into positive (negative) subsets, denoted by {c j } j∈S+ ({c j } j∈S− ) and {c k } k∈S + ({c k } k∈S − ), respectively. Define the maps M ± := j∈S± |c j | C j and M ± := k∈S ± |c k | C k . By construction, we have M + − M − = M + − M − , and equivalently, M + +M − = M + +M − . Since Θ is well-defined on conic combinations, we have and therefore, . Hence, we conclude that the definition (G2) is well-posed on linear combinations with real coefficients.
Finally, consider linear combinations with arbitrary complex coefficients. In this case, the map M in Equation (G1) can be decomposed as M = A + iB, with where Re(z) and Im(z) denote the real and imaginary part of a generic complex number z ∈ C, respectively.
Since the definition (G2) is well-posed on linear combinations with real coefficients, we have the equalities which, summed up, yield the desired equality j c j Θ(C j ) = k c k Θ(C k ). Hence, the definition (G2) is well-posed on arbitrary linear combinations.

Appendix H: Proof of Theorem 1 in the main text
Here we provide a constructive proof of the fact that the unitary channels are a spanning set for the linear space spanned by bistochastic channels [28]. Our proof provides an explicit way to decompose a given bistochastic channel into a linear (in fact, affine) combination of unitary channels.
where we used the double ket notation in Eq. (B3). In particular, the unitary channels U(·) = U · U † correspond to vectors of the form |Vec(U) = |U |U . We now show that the span of the vectors of the form |U |U coincides with the span of the vectors of the form |Vec(B) , where B is a generic bistochastic channel. To this purpose, we use the fact that the linear span of a set of vectors {|v i } is equal to the support of their frame operator and every vector |v in the linear span can be expanded as where F −1 denotes the inverse of F on its support, also known as the Moore-Penrose pseudo-inverse (see e.g. [75]).
For the vectors |U |U /d, the frame operator can be defined as where dU is the normalized Haar measure on SU(d).
The integral can be computed with the methods of representation theory, which give rise to the following Lemma 4 The frame operator (H5) is given by where E and E ⊥ are the projectors E := |I I|/d and E ⊥ := I ⊗ I − E, and the subscripts 13 and 24 specify the Hilbert spaces on which the operators act.
Proof. Note that the vectors |U |U can be expressed as (U 1 ⊗I 2 ⊗U 3 ⊗I 4 )(|I 12 |I 34 ). The product U ⊗U defines a representation of SU(d) that can be decomposed into two irreducible representations: one is the trivial representation, acting on the one-dimensional subspace spanned by the vector |I , and the other is its orthogonal complement, acting on the (d 2 − 1)-dimensional subspace orthogonal to |I . Hence, Schur's lemmas imply the relation Inserting this relation into the definition of F , one obtains Equation (H6).
Let BiChan(H) be the set of bistochastic channels mapping density matrices on H into density matrices on H. We have the following:

Proposition 3 Every bistochastic channel is a linear combination of unitary channels.
Proof. Let B ∈ BiChan(H) be a generic bistochastic channel, and let B(·) = i B i · B † i be a Kraus representation for B. Then, the vector representation of B is |Vec(B) := i |B i |B i . We will now show that the vector |Vec(B) is contained in the linear span of the vectors |U |U , which coincides the the support of the frame operator F in Equation (H5). Using Lemma (4), the projector on the support of F can be expressed as where E and E ⊥ are as in Lemma 4.
Note that one has the relation P = I 13 ⊗ I 24 + 2E 13 ⊗ E 24 − E 13 ⊗ I 24 − I 13 ⊗ E 24 . Using this relation, one obtains P |Vec(B) = |Vec(B) Since the channel B is bistochastic, it satisfies the conditions Hence, one obtains P |Vec(B) = |Vec(B) , meaning that the vector |Vec(B) is contained in the support of the frame operator F . Equivalently, this means that the bistochastic channel B is contained in the linear span of the unitary channels.
Note that Equation (H4), combined with the vector representation (H1), also provides an explicit way to decompose every bistochastic channel as a linear combination of unitary channels. Explicitly, one has or equivalently, Since every unitary channel is trivially bistochastic, Proposition 3 implies Theorem 2 in the main text.

Appendix I: Local action of the input-output inversion
Let Θ S be the input-output inversion for evolutions of system S, defined on the set BiChan(H S ) of bistochastic channels. As shown in Supplementary Note 3, Θ S can be extended to a linear supermap acting on the linear span of the set of bistochastic channels. In the following, we will denote the linear span by SpanBiChan(H S ), and we will call its the maps SpanBiChan(H S ) bistochastic maps.
Here we ask whether it is possible to define the local action of the input-output inversion Θ S on joint evolutions of a composite system S ⊗ E. Let us first specify the properties that the local action is required to satisfy. Let C be a quantum channel on system S ⊗ E, with the property that the reduced evolution of system S is well-defined, meaning that one has where Tr E is the partial trace over the Hilbert space of system E, and C S is a channel on system S. If the channel C S is bistochastic, one may want to apply the inputoutput inversion locally on the S-part of the joint evolution C, without changing the E-part. Mathematically, this means extending the map Θ S to a linear supermap Γ S acting on the whole space of linear maps Map(H S ), instead of just the space of bistochastic channels: Now, a crucial requirement for the local action Γ S is that the extended supermap Γ S ⊗ I E should transform quantum operations (completely positive trace nonincreasing maps) into quantum operations [22,29]. This requirement implies in particular that Γ S ⊗ I E should be complete positivity preserving (CP-preserving), that is, it should transform completely positive maps into completely positive maps.
In the main text, we showed that, up to unitary equivalences, the input-output inversion supermap Θ S is either the transpose or the adjoint. These two For a completely positive map C : ρ → C(ρ) = i C i ρC † i , the transpose and adjoint are given by C T : For the transpose supermap Γ trans S : M → M T , a proof of CP-preservation comes from the Choi representation. In this representation, the map Γ S is represented by a map Γ S , uniquely defined by the relation The map Γ S is CP-preserving if and only if the map Γ S is completely positive [29].
Proof. For an arbitrary completely positive map CP-preservation of the transpose supermap is then immediate: Proof. The proof has the same structure of the proof of Proposition 4. For an arbitrary completely positive map C(·) = i C i · C † i , one has Proof. The Choi map Γ adj S is unitarily equivalent to the transpose, which is known to be positive but not completely positive. Since Γ adj S is not completely positive, Γ adj S is not CP-preserving.
We have shown that the adjoint supermap is not CPpreserving. We conclude with a strengthening of this result, showing that, in dimension d S > 2, no CPpreserving supermap can act as the adjoint supermap on the set of bistochastic channels. In other words, every extension of the adjoint supermap from the set of bistochastic maps to the set of all maps will necessarily be non-CP-preserving. In dimension d S = 2, instead, the adjoint and the transpose are unitarily equivalent on bistochastic channels, and therefore the adjoint has a positive extension to the set of all maps. with where |Φ + := |I / √ 2 is the canonical maximally entangled state.
Then, one has Hence, we obtained the relation and, in turn, the relation valid for every unitary channel U. Since the unitary channels span the space of bistochastic maps (Theorem 2 in the main text), the above relation implies In summary, we proved that Γ adj S is an extension of Θ adj S , and is CP-preserving (because Γ adj S has a Kraus representation). Note that Γ adj S does not act as the adjoint outside the space of bistochastic maps.
Let consider now the d S > 2 case. We now prove by contradiction that the map Θ adj S admits no CP-preserving extension Θ adj S . To get the contradiction, we suppose that the CP-preserving extension exist, and we let Γ S be the corresponding completely positive map. Since Γ S is completely positive, it has a Kraus representation for some suitable set of operators {G j }.
The condition that Γ S extends Θ S can be expressed as 1. The space of bistochastic channels We start by providing a few properties of the subset of bistochastic channels. The set BiChan(H) ⊂ Chan(H) can be equivalently be defined as the set of linear maps B that are completely positive and satisfy the conditions B(I) = I and B T (I) = I, where B T is the transpose of the map B, defined in Eq. (I3).
The following proposition provides a characterization of the linear space spanned by the bistochastic channels. We now show that A and B are linear combinations of bistochastic channels. The maps A and B are Hermitianpreserving, meaning that they map Hermitian operators into Hermitian operators. Consider a generic Hermitianpreserving map G = 0 satisfying the conditions G(I) = G T (I) = g I for some real number g ∈ R. In the following we will show that G is a linear combination of bistochastic channels.
Let G be the Choi operator of the map G. In the Choi representation, the condition that the map G be Hermitian-preserving is equivalent to the condition that the operator G be Hermitian. Hence, G has real eigenvalues and can be decomposed into a positive part and a negative part, namely Now, define the operators Note that the operators G ± are positive by construction. Moreover, they satisfy the condition G + − G − = G. Indeed, one has where the second equality follows from Eqs. (J1), (J2), (J3), (J4), and (J5). Finally, note that G ± are proportional to the Choi operators of two bistochastic channels: indeed, one has and In conclusion, we have shown that the Choi operator of the map G can be decomposed as G = G + − G − , where G ± are proportional to the Choi operators of two bistochastic channels. Hence, G is a linear combination of bistochastic channels.

Input-output inversion of constant channels
Here we show that Requirements 1-4 in the main text imply that the input-output inversion of every constant channel is the completely depolarizing channel. This result implies in particular that the input-output inversion cannot be a one-to-one map on the set of all quantum channels.
Proposition 10 Let Θ be an arbitrary input-output inversion satisfying Requirements 1-4 in the main text, and let K ρ0 ∈ B be an arbitrary constant channel, defined by the condition K ρ0 (ρ) = ρ 0 ∀ρ ∈ L(H) where ρ 0 ∈ L(H) is a fixed (but otherwise arbitrary) density matrix. Then, one has Θ(K ρ0 ) = K I/d for every ρ 0 .
The proof uses Lemma 1 and the following Lemma 5 Let Θ be a input-output inversion satisfying Requirements 1-4 in the main text. Every input-output inversion Θ leaves the completely depolarizing channel invariant.
Proof. The completely depolarizing channel C I/d can be expressed as a random mixture of d 2 unitary channels: for every set of unitary operators {U i } D 2 i=1 satisfying the Hilbert-Schmidt orthogonality condition Tr[U † i U j ] = d δ i,j , one has C I/d = i U i /d 2 .
Requirement 4 (preservation of random mixtures) implies that the input-output inversion of C I/d can be expressed as Θ(C I/d ) = i Θ(U i )/d 2 .
Then, discussion after the proof of Lemma 1 shows that the input-output inversion of each unitary channel U i can be expressed as Θ(U i )(·) = θ(U i )(·)θ(U i ) † , where θ is an input-output inversion on the special unitary group.
Under Requirements 1-3, we know that the inputoutput inversion on the special unitary group is either the adjoint or the transpose (Lemma 2), we conclude that one has either Θ(U i )(·) = U † i (·)U i or Θ(U i )(·) = U T i (·)U i . In either case, the set {θ(U i )} satisfies the orthogonality condition Tr[θ(U i ) † U j ] = d δ i,j . Hence, we obtain the equality Θ(C I/d ) = i Θ(U i )/d 2 = C I/d .

Proof of Proposition 10.
For every constant channel C ρ0 one has the relation C ρ0 = C ρ0 C I/d . Hence, the input-output inversion satisfies the condition Θ(C ρ0 ) = Θ(C I/d )Θ(C ρ0 ) = C I/d Θ(C ρ0 ) = C I/d , the second equality following from Lemma 5 An immediate consequence of Proposition 10 is that the set of bidirectional quantum channels can only contain one constant channel, namely the completely depolarising channel. In other words, the set of bidirectional quantum channels contains only one way to re-set the system to a fixed state.

The input-output inversion of a generic quantum channel is a bistochastic quantum channel
Here we prove Theorem 2 in the main text: if a quantum channel admits an input-output inversion, then its input-output inversion is a bistochastic channel.

Proposition 11
Let Θ be a input-output inversion satisfying Requirements 1-4 in the main text, and let C ∈ B be a generic bidirectional channel, decomposed as in Equation (J17). Then, one has Θ(C) = Θ(Π(C)).
Since Θ maps all constant channels into the completely depolarizing channel (Proposition 10), the last two terms coincide, and one has Θ(C) = Θ(Π(C)).
In summary, we have shown that the input-output inversion of a given quantum channel depends only on its projection on the space of bistochastic channels. In particular, this implies Theorem 2 in the main text: Proof of Theorem 2 in the main text. By Proposition 11, one has Θ(C) = Θ(Π(C)). Since the unitary channels are a spanning set for the space of bistochastic maps, one has Π(C) = i c i U i , for suitable coefficients {c i } and suitable unitary channels {U i }. By linearity of the input-output inversion, we have Θ(C) = i c i Θ(U i ). Since Θ maps unitary channels into unitary channels, the channel Θ(C) is a linear combination of unitary channels. But we know that any such channel is bistochastic (Theorem 1 of the main text).

Appendix K: Relaxing the notion of input-output inversion
Here we explore a relaxed notion of input-output inversion, which is not required to be injective. We ask whether, under such relaxation, it is possible to define a non-trivial input-output inversion for every quantum channel. As it turns out, the answer is negative in dimension d > 2, and affirmative for d = 2.

Positivity of the input-output inversion supermap
Let Θ : Chan(H) → Chan(H) be a supermap defined on all channels and satisfying Requirements 1 (order reversal), 2 (identity presevation), and 4 (compatibility with random mixtures) in the main text. A trivial choice for the map Θ is to transform every channel C into the identity channel I. The question is whether any other nontrivial choice exists.
Here we show that, for every non-trivial Θ, the restriction of Θ to the space of bistochastic maps must map completely positive maps into completely positive maps: Proof. By Lemma 1 of this Supplemental Material, Requirements 1 and 2 imply that the supermap Θ maps unitary channels into unitary channels, and therefore induces a map θ on the special unitary group. Since the supermap Θ is non-trivial, the map θ cannot be θ(U ) = I, ∀U . Hence, the proof of Lemma 2 shows that the action of Θ on unitary channels is unitarily equivalent either to the transpose, or to the adjoint. Now, Requirement 4 implies that the action of the supermap Θ is uniquely defined on the set of bistochastic channels (which is the linear span of the set of unitary channels, cf. by Theorem 1 in the main text). Hence, the input-output inversion of bistochastic channel must be unitarily equivalent to the transpose or to the adjoint. The action of these maps in the  By Proposition 11, the action of any non-trivial supermap Θ satisfying Requirements 1,2 and 4 on a generic channel C satisfies the condition Θ(C) = Θ(Π(C)) , where Π is the projection on the set of bistochastic maps. We now observe that the supermap Π is generally not positive, in the sense that it may not map completely positive maps into completely positive maps.
Proposition 13 For d > 2, there exist channels C ∈ Chan(H) such that the map Π(C) is not positive.
Corollary 3 For d > 2, it is impossible to find a nontrivial supermap Θ defined on the set of all quantum channels and satisfying Requirements 1,2, and 4.
Proof. Equation (K1) implies that the input-output inversion Θ(C) of a channel C is completely positive if and only if the map Θ(Π(C)) is completely positive. In turn, Proposition 12 implies that the map Θ(Π(C)) is completely positive if and only if the map Π(C) is completely positive. For d > 2, Proposition 13 shows that there exist channels for which the map Π(C) is not positive. Hence, the supermap Θ cannot be defined on these channels.
Building on the above result, one can define an inputoutput inversion Θ on the set of all qubit channels by first projecting on the subspace of bistochastic channels, and then applying one of the input-output inversions of bistochastic channels defined earlier in the paper.