Experimental demonstration of input-output indefiniteness in a single quantum device

Quantum theory allows information to flow through a single device in a coherent superposition of two opposite directions, resulting into situations where the input-output direction is indefinite. Here we introduce a theoretical method to witness input-output indefiniteness in a single quantum device, and we experimentally demonstrate it by constructing a photonic setup that exhibits input-output indefiniteness with a statistical significance exceeding 69 standard deviations. Our results provide a way to characterize input-output indefiniteness as a resource for quantum information and photonic quantum technologies and enable table-top simulations of hypothetical scenarios exhibiting quantum indefiniteness in the direction of time.

Introduction.-Acornerstone of quantum theory is the CPT theorem [1,2], stating that the fundamental dynamics of quantum fields is invariant under inversion of time direction, charge, and parity.The theorem implies that, at the fundamental level, the roles of past and future are symmetric: while we normally treat systems at earlier times as the inputs and systems at later times as the outputs, the dynamical laws of quantum mechanics are indifferent to the direction of time.The time symmetry of the fundamental quantum dynamics was later extended to scenarios involving measurements by Aharonov and collaborators [3][4][5].With the advent of quantum information, the role of time symmetry in quantum theory has attracted renewed attention, due to its connection with the structure of quantum protocols [6], multitime quantum states [7][8][9], simulation of closed timelike curves [10][11][12], inversion of unknown quantum evolutions [13][14][15], quantum retrodiction [16,17], and the origin of irreversibility [18,19].Time-symmetric frameworks for quantum theory [20,21] and more general physical theories [22,23] have been developed and analyzed.
Recently, Refs.[24,25] extended the notion of timereversal to a broader notion of input-output inversion, which applies whenever the roles of the input and output ports of a quantum device can be exchanged.This includes, for example, the case of linear optical devices, which can be traversed in two opposite spatial directions.Notably, all kinds of input-output inversions turned out to share the same mathematical structure.As a consequence, hypothetical scenarios involving the reversal of the time direction between two spacetime events can be simulated by real-world setups that reverse the direction of a path between two points in space.Building on the notion of input-output inversion, Ref. [24] then introduced a new type of operations that utilize quantum devices in a coherent superposition of two alter-native input-output directions, giving rise to a feature called input-output indefiniteness.This feature has been found to offer advantages in information-theoretic [24,25] and thermodynamical tasks [26,27].Input-output indefiniteness is also related to the notion of indefinite order [28][29][30][31], whose applications to quantum information have been extensively investigated in the past decade, both theoretically [31][32][33][34][35][36][37][38] and experimentally [39][40][41][42][43][44][45][46][47].An important difference is that, while indefinite order requires multiple devices (or multiple uses of the same device), input-output indefiniteness can already arise at the single-device level, enabling quantum protocols that could not be achieved with indefinite order (see Appendices [48] for examples in the tasks of gate transformation, estimation, and testing).
Here we develop a general method for witnessing inputoutput indefiniteness in the laboratory, and we use it to experimentally demonstrate a photonic setup that probes a single quantum device in a coherent superposition of two alternative directions.By optimizing the choice of witness, we demonstrate incompatibility of our setup with a definite input-output direction by more than 69 statistical deviations.Notably, our setup applies not only to reversible quantum devices, such as polarization rotators, but also to a class of irreversible devices including postselected polarization measurements.In addition to single-device indefiniteness, we experimentally demonstrate the combination of two devices in a quantum superposition of two opposite input-output directions, building a setup that achieves 99.6% winning probability in a quantum game where every strategy using both devices in the same direction fails with at least 11% probability.Our techniques enable a rigorous characterization of input-output indefiniteness as a resource for quantum information and photonic quantum technologies, and, at the same time, could be used to simulate exotic physical Input-output indefiniteness in a bidirectional quantum device.A bidirectional device with ports A and B can be traversed in two opposite directions: from A to B (a) or from B to A (b).When these two configurations take place in a quantum superposition (c), the direction of the information flow between A and B becomes indefinite.To generate the superposition, we introduce a control qubit that coherently controls the direction, with basis states |0⟩ and |1⟩ corresponding to directions A → B and B → A, respectively.Our setup (d) sets the control qubit in the state |+⟩c = (|0⟩ + |1⟩)/ √ 2 and witnesses input-output indefiniteness by performing local measurements on the target and control system, with the target initialized in a quantum state ρt.models where the arrow of time is subject to quantum indefiniteness.
Witnesses of input-output indefiniteness.-Formany processes in nature, the role of the input and output ports can be exchanged.An example is the transmission of a single photon through an optical crystal, schematically illustrated in Fig. 1.Quantum devices with exchangeable input-output ports, called bidirectional, can be used in two alternative ways, conventionally referred to as the "forward mode" (with the inputs entering at port A and the outputs exiting from port B) and "backward mode" (with the inputs entering at port B and the outputs exiting from port A).In the special case where ports A and B are associated with two moments of time t A < t B , the forward mode corresponds to the standard use of the device in the forward time direction, while the backward mode corresponds to a hypothetical use of the device in the reverse time direction [24].
Ref. [24] showed that a device is bidirectional if and only if the corresponding transformation of density matrices is a bistochastic quantum channel [49,50], that is, a linear map C of the form C(ρ) = i C i ρC † i , where ρ is the input density matrix, and (C i ) are square matrices satisfying the conditions i C † i C i = i C i C † i = I, I being the identity matrix.If a bistochastic channel C describes the state change in the forward mode, then the state change in the backward mode is described by a (generally different) bistochastic channel Θ(C) given by Θ(C) : ρ → i θ(C i ) ρ θ(C i ) † , where the square matrix θ(C i ) is either unitarily equivalent to C T i , the transpose of C i , or unitarily equivalent to C † i , the adjoint of C i [24].The map Θ is called an input-output inversion.Physically, it can represent a time reversal (if the two ports of the device correspond to two moments of time), an inversion of spatial directions (as in the example of the optical crystal), or any other symmetry transformation obeying a set of general axioms specified in [24].In the following, we will focus on the case where the input-output inversion is (unitarily equivalent to) the transpose.This case includes in particular the canonical time-reversal in quantum mechanics [51,52] and quantum thermodynamics [53] (see [48] for more details.) In principle, quantum mechanics allows for setups that coherently control the input-output direction, such as the setup shown in Fig. 1(d).We now develop a method for witnessing input-output indefiniteness in the laboratory.A witness for a given quantum resource, such as entanglement [54], indefinite causal order [55], and causal connection [56], is an observable quantity that distinguishes between resourceful and non-resourceful setups [57].In our case, the non-resourceful setups are those that use the device in a well-defined direction.Setups that use it in the forward (backward) mode are described by a suitable set of positive operators, denoted by S fwd (S bwd ).The explicit characterization of these operators is provided in the Appendices [48].For the following discussion, it will suffice to know that they act on the tensor product Hilbert space H AI ⊗H AO ⊗H BI ⊗H BO , where H AI (H AO ) is the Hilbert space of the input (output) system of the device, while H BI (H BO ) is the Hilbert space of the input (output) system of the overall process obtained by inserting the device into the setup.
A setup that uses the device in a random mixture of the forward and backward modes corresponds to an operator of the form with S fwd ∈ S fwd , S bwd ∈ S bwd , and p ∈ [0, 1].We will denote by S definite the set of all operators of the form (1). The setups outside S definite are incompatible with the use of the given device in a definite input-output direction: in these setups, the device is not used in the forward mode, nor in the backward mode, nor in any random mixture thereof.For an operator S outside S definite , we define a witness of input-output indefiniteness to be a self-adjoint operator W such that and The condition (3) is characterized in the following Theorem, which provides a systematic way to construct witnesses of input-output indefiniteness.FIG. 2. Experimental setup.A 2.5 mW continuous wave violet laser at 404 nm pumps a type-II cut ppKTP crystal, effectively working as a heralded single photon source when the idler photons trigger an SPD.The single photon's polarization serves as the target qubit and is initialized with a fiber polarizer controller, an HWP, and a QWP.Spatial modes of the photon serve as the control qubit, and BS1 is used to coherently control the input-output direction.Measure-and-reprepare operations on the polarization are implemented by two HWPs, two QWPs, and a PBS (dotted rectangle), while measurements on spatial modes are implemented by two LCs and BS2.A trombone-arm delay line and a piezoelectric transducer are used to set the path length and the relative phases of the interferometer.HWP, half-wave plate; QWP, quarter-wave plate; PBS, polarizing beam splitter; BS, beam splitter; RM, reflection mirror; LC, liquid crystal variable retarder; FC, fiber coupler; SPD, single photon detector; DL, trombone-arm delay line.
The proof is provided in the Appendices [48], where we also show that the expectation value of any witness can be decomposed into a linear combination of outcome probabilities arising from settings in which a device is inserted in the setup and the resulting process is probed on multiple input states.
Experimental demonstration of input-output indefiniteness of a single quantum device.-Ourexperimental setup, illustrated in Fig. 2, is inspired by a theoretical primitive known as the quantum time flip (QTF) [24].The QTF takes in input an arbitrary bidirectional device and adds quantum control to the direction in which the device is used.When applied to a bidirectional device that acts as channel C in the forward direction, the QTF generates a new quantum channel F(C), acting jointly on the target system and on a control qubit.Explicitly, the Kraus operators of the new quantum channel F(C), denoted by {F i }, are related to the Kraus operators of the original channel C, denoted by {C i }, as where {|0⟩, |1⟩} are two orthogonal states of the control qubit.When the control qubit is initialized in a coherent superposition of |0⟩ and |1⟩, the new channel F(C) imple-ments a superposition of channel C and its input-output inversion C T , in the sense of Refs.[58][59][60][61][62][63][64][65].
In our experiment, schematically illustrated in Fig. 1(d), a heralded single photon is generated through spontaneous parametric down-conversion [48].The polarization qubit, serving as the target system in the QTF, is initialized in an arbitrary fixed state, using a fiber polarizer controller, a half-wave plate (HWP) and a quarter-wave plate (QWP).The photon is sent to a 50/50 beamsplitter (BS1) to prepare the spatial qubit in the superposition state |+⟩ = (|0⟩ + |1⟩)/ √ 2, where |0⟩ and |1⟩ correspond to the two alternative paths shown green and carmine in Fig. 2. The input device for the QTF is a bistochastic measure-and-reprepare operation [21], implemented by an assemblage of two HWPs, two QWPs, and a polarizing beam splitter (PBS), shown inside the dotted rectangle in Fig. 2. The input-output inversion is realized by routing the photon through the same assemblage along a backward path sandwiched between two fixed Pauli gates Z = |0⟩⟨0| − |1⟩⟨1|.A coherent superposition of the forward and backward measure-and-reprepare operations is created by using the spatial qubit as a control qubit.Finally, two paths are coherently recombined on BS2, followed by a measurement on the polarization qubit.
To certify input-output indefiniteness, we derived the witness W opt with maximum robustness to noise (see Appendices [48].)This witness can be estimated by probing the setup on a set of bistochastic measure-andreprepare processes that measure the polarization qubit in the eigenbasis of a Pauli gate and reprepare the output √ 2, respectively.For example, '03' labels the outcome that projects the control qubit onto |0⟩ and the target qubit onto (|0⟩ + i|1⟩)/ √ 2. The bars show the theoretical predictions, while the blue diamonds show the experimental data.We omit the experimental data for outcomes that are irrelevant to the evaluation of the optimal witness.All the data in this figure refer to the setting where the device inside our setup implements a measure-andreprepare process.Specifically, they refer to the event where the target is measured on the X-eigenstate |+⟩ and re-prepared in the Z-eigenstate |0⟩.The experimental data for the remaining settings are shown in the Appendices [48].
in a state in the eigenbasis of another Pauli gate.The overall evolution induced by the setup is probed by initializing the path qubit in the maximally coherent state |+⟩ and the polarization qubit in one of the states |0⟩, |1⟩, |+⟩ and 1 √ 2 (|0⟩ + i|1⟩).Finally, the target qubit and control qubit are measured in the eigenbases of the three Pauli gates.The measured probabilities, shown in Fig. 3, are used to calculate the experimental value of the witness Tr[W opt S QTF ], which we find to be −(0.345±0.005),corresponding to a violation of the condition of definite input-output direction by more than 69 standard deviations.
To implement the optimal witness W opt , we performed local operations on 5 qubits, using a total of 794 settings [48].The complexity of the experiment is less than that of a full process tomography, which would require at least 1023 settings.To further reduce the complexity, we designed a simplified witness where the target qubit is initialized in a fixed state |0⟩ and is eventually discarded.This witness involves only 3 qubits and 48 settings, which we show to be the optimal values [48].In the experiment, we find the value −(0.140 ± 0.004), which certifies incompatibility with a definite input-output direction by more than 35 standard deviations.
Experimental demonstration of advantage in a quantum game.-Input-outputindefiniteness offers an advantage in a quantum game where a referee challenges a player to find out a hidden relation between two unknown quantum gates [24].In this game, the referee provides the player with two devices implementing unitary gates U and V , respectively, promising that the two gates satisfy either the relation U V T = U T V or the relation U V T = −U T V .The player's task is to determine which of these two alternatives holds.Ref. [24] showed that a player that uses the two gates in the QTF can win the game with certainty, while every strategy that uses the two devices in the same input-output direction will fail at least 11% of the times.
In our experiment, discussed in the Appendices [48], we observe an average success probability of 99.60 ± 0.18% over a set of 21 gate pairs.The worst-case error probability is approximately 0.68 ± 0.19%, which is 16 times smaller than 11%, the lower bound on the error probability for all possible strategies with definite-input-output direction.We also show that the advantage of inputoutput indefiniteness persists even if the player has coherent control on each of the gates U and V : every strategy using the controlled gates ctrl−U = I⊗|0⟩⟨0|+U⊗|1⟩⟨1| and ctrl − V = I ⊗ |0⟩⟨0| + V ⊗ |1⟩⟨1| in the same inputoutput direction will necessarily have an error probability of at least 5.6%.Overall, this game can be regarded as a bipartite witness of global input-output indefiniteness.In the Appendices [48], we provide a general theory of such witnesses.
Conclusions.-In this paper we introduced the notion of witness of input-output indefiniteness and used it to experimentally demonstrate input-output indefiniteness in a single photonic device.Our results provide a way to rigorously characterize input-output indefiniteness in the laboratory, and represent a counterpart to recent experiments on indefinite order of quantum gates [39][40][41][42][43][44][45][46][47].Overall, input-output indefiniteness provides a new resource for quantum information protocols, and could potentially lead to advantages in photonic quantum technologies.Our setup and its generalizations could also be used to simulate exotic physics in which the arrow of time is a quantum variable.These hypothetical phenomena fit into a broad framework developed by Hardy [28], who suggested that a full-fledged theory of quantum gravity would require spacetime structures to be subject to quan-tum indefiniteness.While an explicit physical model for scenarios with indefinite time direction has yet to be proposed, the availability of a mathematical framework for their study and an experimental platform for their simulation represent valuable tools for understanding their operational implications.protocols that can be achieved using indefinite inputoutput direction but cannot be achieved using indefinite order.
Indefinite order refers to scenarios where two or more quantum devices are connected with one another in a way that is not compatible with any probabilistic mixture of well-defined orders [30].The simplest example of this situation is the quantum SWITCH [29,31], an operation S that takes in input two quantum devices A and B, acting on the same target system, and produces in output a new quantum device S(A, B) that adds quantum control to the order in which A and B are applied.Mathematically, the new device S(A, B) is a bipartite quantum channel, acting on the target system and on a control qubit that determines the relative order of A and B. The Kraus operators of channel S(A, B), denoted by {S ij } are given by where {A i } and {B j } are the Kraus operators of channels A and B, respectively, and {|0⟩, |1⟩} are orthogonal states of the control qubit.When the control qubit is initialized in the state |0⟩ (|1⟩), the target qubit undergoes processes A and B in the definite order AB (BA).When the control qubit is in a coherent quantum superposition of |0⟩ and |1⟩, instead, the order of A and B becomes indefinite.A number of information-theoretic applications of the quantum switch has been discussed over the past years [31][32][33][34][35][36][37][38], and series of experiments inspired by the quantum switch has been performed on photonic systems [39][40][41][42][43][44][45][46][47] (see also Refs.[66][67][68] for a theoretical discussion on the interpretation of the experiments.)Another famous example of indefinite order is a process introduced by Oreshkov, Costa, and Brukner [30].More generally, the quantum switch, the Oreshkov-Costa-Brukner process, and other operations with indefinite causal order are represented by quantum supermaps [31,69], that is, higher-order maps acting on quantum channels.This type of supermaps take in input two (or more) quantum channels and produce a new quantum channel as output.
For indefinite order, the input channels can be arbitrary completely positive, trace-preserving maps.Physically, this condition guarantees that the corresponding supermaps could in principle be implemented on arbitrary quantum devices.In stark contrast, operations with indefinite input-output direction can only be applied to bidirectional devices, mathematically described by bistochastic channels.In other words, operations with indefinite input-output direction are defined on a strictly smaller domain.The restriction of the domain leads to a broader set of conceivable supermaps, which can sometime lead to stronger advantages in quantum information tasks.In the following, we will present three such advantages: 1. Unitary black box inversion/transposition.In this task, one is given a black box implementing an un-known quantum dynamics, represented by a unitary gate U acting on a d-dimensional quantum system.The goal is to produce a new black box implementing the inverse of the original dynamics, corresponding to the unitary U † , or the transpose of the original dynamics, corresponding to the gate U T .
For qubits, the inverse and the transpose are unitarily equivalent, due to the relation U † = Y U T Y , valid for every matrix U ∈ SU(2).For higher dimensional systems, we will focus our attention on the transpose.If the gate U is an arbitrary unitary matrix, the transformation U → U T cannot be perfectly achieved by inserting the gate U in a quantum circuit: every implementation of this transformation must necessarily be probabilistic, or approximate [13,70,71].Furthermore, Ref. [24] showed that the transpose U T cannot be perfectly generated from two copies of the original gate U , even if the two copies are used in an indefinite order.
The above no-go theorems do not apply if the experimenter is able to use the black box in two opposite input-output directions, that is, if the black box can be treated by the experimenter as a bidirectional quantum device, acting as U in one direction, and acting as V U T V † in the opposite direction, where V is a fixed unitary.In this case, the experimenter has only to use the device in the appropriate direction and to undo the unitary V .
In summary, the transformation U → U T provides an example of a quantum task that cannot be perfect achieved by operations with indefinite order (using two queries of the unitary gate U ), but can be perfectly achieved by operations with indefinite input-output direction.
2. Gate estimation.In this task an experimenter is given access to a black box implementing an unitary gate of the form U θ = e −iθH , where the generator H has eigenvalues {0, 1, . . ., d−1} and satisfies the condition H T = −H, while the shift parameter θ is in the range [0, 2π).The goal is to estimate the θ with minimum error, that is, to produce an estimate θ that minimizes the root mean square er- , where p( θ|θ) is the conditional probability of obtaining estimate θ when the true value is θ.
Suppose that the N copies of the gate U θ are available to the experimenter.When the N gates are used in parallel, they act as a single N -partite gate, and the total generator has spectrum {0, . . ., N (d− 1)}.If is then known that the minimum RMSE scales as ∆θ ≈ π/[ √ 2 N d] at the leading order in N d, both in the worst case over θ and on average over uniformly distributed θ [72][73][74][75].This value of the RMSE is optimal even if the N gates are used in a sequence [76], or, more generally, in an indefinite order (by a simple generalization of the argument in [76]).
In contrast, the QTF can transform each gate U θ into the gate W θ = U θ ⊗ |0⟩⟨0| + U T θ ⊗ |1⟩⟨1|, whose generator K := H⊗Z has spectrum {−d+1, . . ., d− 1}.By applying the QTF to the initial N gates, the experimenter can obtain N copies of the gate W θ , which can then be used to estimate θ with RMSE π/[2 √ 2N d] at the leading order in N d.In other words, indefinite input-output direction can reduce the RMSE by a factor 2, equivalent to doubling the number of available uses of the unknown gate U θ .
3. Testing properties of quantum gates.Another advantage of input-output indefiniteness arises in the game described in the main text, originally introduced in Ref. [24].In this game, a referee prepares a pair of black boxes implementing unitary gates U and V , respectively, and guarantees that either the relation A player can query each black box one time, and then has to determine which of the two alternative relations holds.
Ref. [24] showed every strategy that uses the two devices in the same input-output direction will necessarily have a nonzero probability of error.This conclusion applies even if the two black boxes are used in an indefinite order: if the input-output direction is fixed and equal for both boxes, then the error is non-zero.The nature of this advantage will be discussed in detail in Section G, where we classify different types of witnesses of input-output indefiniteness for pairs of bistochastic channels.
Appendix B: Relation with the notion of time reversal in quantum theory and quantum thermodynamics Here we briefly summarize the relation between the notion of input-output inversion and the notion of timereversal in quantum mechanics [51,52] and in quantum thermodynamics [53].
Ref. [24] showed that the input-output inversion of a unitary channel, corresponding to a unitary matrix U , is another unitary channel, corresponding to another unitary matrix θ(U ).The map θ : U → θ(U ) is either unitarily equivalent to the transpose (θ(U ) = V U T V † ∀U , where V is a fixed unitary matrix) or unitarily equivalent to the adjoint (θ(U ) = V U T V † ∀U , where V is a fixed unitary matrix).
An example of input-output inversion where θ(U ) is unitarily equivalent to the transpose arises from the classic notion of time reversal in quantum mechanics [51].In this formulation, time-reversal corresponds to a symmetry of the state space.By Wigner's theorem, state space symmetries are described by operators that are either unitary or anti-unitary (see e.g.[77]).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 [52], or the requirement that the energy be bounded from below both in the forward-time picture and in the backward-time picture [78,79].
The choice of a time reversal symmetry at the state level induces a notion of time reversal of unitary dynamics.Suppose that the time reversal symmetry is described by an operator A (either unitary or anti-unitary).Then, if a forward-time unitary dynamics U transforms the state |ψ⟩ into the state |ψ ′ ⟩ = U |ψ⟩, then the corresponding backward-time dynamics should transform the state A|ψ ′ ⟩ into the state A|ψ⟩, for every possible initial state |ψ⟩.This condition implies that the backward-time dynamics is also unitary, and the corresponding unitary operator U rev satisfies the condition 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 [53]).
In the canonical case where A is an anti-unitary operation, one can write A = V K, where V is a unitary operator, and K : |ψ⟩ → |ψ⟩ is the complex conjugation in a given basis [77].Using this decomposition, we can write the time-reversed unitary as U rev = V U T V † , where U T denotes the transpose of U in the given basis.
One can also consider non-canonical choices of timereversal, such as the one advocated by Albert [80] and Callender [81], who argued that, in certain systems, timereversal should leave quantum states unchanged.This choice yields U rev = U † .More generally, if one chooses the operator A to be a generic unitary V , the timereversed dynamics has the form It is important to stress that input-output inversion is a more general notion than time reversal (T).For example, it applies to arbitrary combinations of the timereversal symmetry with other symmetries, such as parity inversion (P) and charge-conjugation (C).In other words, all the combinations CT, PT, and CPT are possible input-output inversions.Regarding the full CPT symmetry, Ref. [82] argued that it corresponds to a unitary transformation V at the state space level.In this case, the analogue of Eq. (B1) yields implies that the CPT symmetry transforms a unitary dynamics U into another unitary dynamics of the form V U † V † .
In the non-unitary case, notions of time-reversal have been proposed in the literature.An early formulation is due to Crooks [83], who defined the time-reversal of a quantum channel C as the Petz' recovery map C Petz [84], explicitly given by C Petz (ρ) := ρ where ρ 0 is any quantum state such that C(ρ 0 ) = ρ 0 , and C † is the adjoint of channel C. If one restricts the timereversal to bistochastic channels and one picks the state ρ 0 to be maximally mixed, then Crooks' definition coincides with input-output inversion discussed in the main text, in the special case where the input-output inversion is unitarily equivalent to the adjoint.
An extension of Crook's approach was recently proposed by Chiribella, Aurell, and Życzkowski [85].In this extension, one defines a fixed reference state for every system, and defines the time-reversal 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 C Petz (ρ S1 , or as the variant of the Petz recovery map where the adjoint C † is replaced by the transpose S1 , where ρ denotes the complex conjugate of the matrix ρ in the given basis).When the reference states are set to be maximally mixed, this notion of time reversal mathematically coincides with the notion of input output inversion discussed in the main text.

Appendix C: Characterization of the witnesses
In this section, we provide the characterization of the witnesses of input-output indefiniteness, which is done with the Choi representation [86] More generally, a setup that uses the device in a random mixture of the forward and backward mode corresponds to an operator of the form S = p S fwd + (1 − p) S bwd , which, as we have mentioned in the main text, is incompatible with the use of the given device in an indefinite input-output direction.The scenarios involving indefinite input-output direction can be described by quantum supermaps [24].Every quantum supermap S : M → S(M) induces a linear map S on the Choi operators via the relation S(Choi(M)) = Choi(S(M)).Hence, we can define the Choi operator of the supermap S as the Choi operator of the induced map S. In turn, the Choi operator of a supermap acting on a single bidirectional device as in Fig. 1 of the main text can be described by a positive operator S, acting on the tensor product Hilbert space H AI ⊗ H AO ⊗ H BI ⊗ H BO , where H AI (H AO ) is the Hilbert space of the input (output) system of the initial channel C, while H BI (H BO ) is the Hilbert space of the input (output) system of the final channel S(C).Since the original device C transforms a given quantum system into itself, the Hilbert spaces H AI and H AO have the same dimension, hereafter denoted by d A .
In the following, the set of all witnesses of input-output indefiniteness will be denoted by W in/out , which will also be characterized in the Choi representation.With this notation, we are ready to provide our characterization of the set W in/out .

Proof of Theorem 1 of the main text
Since all witnesses have non-negative expectation values on the setups with definite input-output direction, W in/out is the dual cone of S definite .In turn, S definite is the convex hull of the (Choi operators of) supermaps with forward input-output direction and of those with backward input-output direction.The Choi operators of supermaps with forward input-output direction generate a closed convex cone of operators on H AI ⊗ H AO ⊗ H BI ⊗ H BO .Specifically, the closed convex cone is equal to P ∩ L f , where P is the cone of positive operators, L f is the subspace defined by the intersection of two subspaces.
Notice that the projections onto the two subspaces in Eq. (C1) commute.It follows that L f can be expressed, with the notation of Theorem 1 in the main text, as below, Similarly, the Choi operators of supermaps with backward input-output direction generate the closed convex cone P ∩ L b , with L b given by It follows that the conic hull of S definite is equal to The dual cone of S definite can be deduced using the duality properties of closed convex cones: where ⊥ denotes orthogonal complement and + denotes Minkowski addition.Now we can conclude from Eq. (C8) that a Hermitian operator W on H AI ⊗ H AO ⊗ H BI ⊗ H BO is a witness of input-output indefiniteness if and only if for some According to the characterization of L f and L b in Eq. ( C3) and (C5), respectively, W 0 satisfies the condition (C10) and W 1 satisfies the condition (C11) ■

Measures of input-output indefiniteness
Witnesses can be used not only to detect resources, but also to define quantitative resource measures.This is done by assessing the robustness of a given resource to the addition of noise, as it was done, e.g. for the robustness of entanglement [89], robustness of indefinite causal order [55], and robustness of causal connection [56].
Setups that use bidirectional channels are mathematically described by quantum supermaps that transform bistochastic channels into (generally non-bistochastic) channels [24].The Choi operator of every such supermap, denoted by S, satisfies the conditions Tr AOAIBO [S]/d A = I BI and In the following, the set of all Choi operators satisfying the above constraints will be denoted by S.
We define the robustness of a setup S ∈ S with respect to a witness W as which is equal to the amount of noise the setup S can tolerate until its input-output indefiniteness stops to be detected by the witness W .The definition implies that the input-output indefiniteness of the setup S can be detected by the witness W only if the quantity r(S | W ) is larger than zero.Optimizing the quantity r(S | W ) over the witness W , we obtain the robustness of input-output indefiniteness of the setup S r(S) := max Both Eq. (C13) and Eq.(C14) can be phrased as semidefinite programming (SDP) problems and can be computed efficiently (see Section D).In particular, the quantity r(S) is given by the following SDP: where S * definite and S * are the dual cones of S definite and S, respectively.The last constraint of Eq. (C15) can be interpreted as a normalization condition, noticing that, for every setup T , the value Tr(W T ) should not exceed than 1.
The form of Eq. (C15) implies that the robustness is a convex in its argument, is faithful measure of inputoutput indefiniteness (r(S) is equal to zero if and only if S is compatible with a well-defined input-output direction), and cannot be increased by composing the setup S with local bistochatic channels.The evaluation of the robustness of input-output indefiniteness can be cast into an SDP problem that can be solved efficiently, similarly to the SDP problem for the causal robustness in Ref. [55].Explicitly, the SDP for the robustness of input-output indefiniteness is minimize Tr(T ) where coni(S) denotes the conic hull of the set S, consisting of the Choi operators of all deterministic supermaps on bistochastic channels.The above expression follows from the definition of robustness in Eq. (C13).
The dual of the above SDP is maximize − y Tr(W S) In the next subsection, we show that the primal-dual pair (D1) and (D2) satisfies the condition for strong duality, meaning that the solutions of the primal and dual problems coincide.Hence, the robustness r(S | W ) can be computed through the dual problem (D2).Furthermore, the maximum robustness over all possible witnesses, denoted by r(S) := max S r(S | W ), can also be computed by an SDP, which follows from Eq. (D2)) by absorbing the variable y into the variable W , thus obtaining maximize − Tr(W S) The problem (D3) is exactly the SDP problem in Eq. (C15).Its dual problem is minimize Tr(T )

Proof of strong duality and efficient solvability
Here we prove that the SDP problems derived in the previous subsection can be solved efficiently and satisfy the condition for strong duality.To obtain this result, we will use some general facts about conic optimization problems, a large category of optimization problems that include SDP as a special case.
Mathematically, a conic optimization problem is defined as follows: A relation between the optimal solutions of the primal and dual problems was provided in Theorem 4.2.1 of Ref. [90]: Theorem 2 Let (P), (D) be a primal-dual pair of conic problems as defined above, and let the pair be such that 1.The set of primal solutions K ∩ (L + b) intersects int K; 2. The set of dual solutions K * ∩ (L ⊥ + c) intersects int K * ; 3. ⟨c, x⟩ is lower bounded for all x ∈ K ∩ (L + b).
Then both the primal and the dual problems are solvable with polynomial-time interior-point methods, and the optimal solutions x * and y * satisfy the relation ⟨c, b⟩ = ⟨c, x * ⟩ + ⟨y * , b⟩. (D5) We now apply the above results to the primal-dual SDP pairs (D1, D2) and (D4, D3).Let L s be the linear space spanned by the operators of general supermaps on bistochastic channels, which is characterized by Eq. (C12), for a system X of dimension d X .Recall the subspaces L f and L b defined in Section (C) which are the linear span of the operators of forward and backward setups, respectively.Since every operator of supermap we consider is in L s , it suffices to optimize witnesses within L s .Let us start by translating these SDPs into the language of Definition 1.To this purpose, we define the following data of a conic optimization problem: For the pair (D1, D2), we define For the pair (D4, D3), we define To show that the set of primal solutions of the conic optimization problem intersects the interior of the convex cone K 1 (K 2 ), we prove the following lemma which shows that the sum of the identity operator and an arbitrary operator with a constrained norm from L s is contained in the convex cone of S definite : Proof.This proof is similar to the proof of Lemma 7 of [55].Let S be such an operator.I +S can be decomposed into S f + S b where We can check that S f ∈ L f and S b ∈ L b .Notice that [AO] S and S − [AO] S are orthogonal.By Pythagoras' theorem, it holds that  Due to the relation It follows that the two pairs of SDP problems (D1, D2) and (D4, D3) satisfy the three conditions of Theorem 2 and thus can be solved efficiently.

Appendix E: Details on the source and measurement
All the experiments reported in this paper used a heralded single photon source based on a spontaneous parametric down-conversion (SPDC) process on a type-II cut ppKTP crystal.The crystal was pumped by focusing a 2.5 mW diode laser centered at 404 nm on it using a convex lens (focal length is 12.5 cm).Setting the polarization of the pump laser to be horizontal, we generated pairs of correlated photons centered at 808 nm in a polarization state |H⟩|V ⟩, which were then separated by a PBS.The pump laser was blocked with long pass and narrow band pass filters.After this, the photon pairs were coupled into single-mode fibers and detected with single photon detectors (photon counting module from PerkinElmer).The idler photon was used as a herald and the signal photon was sent to our experiment.When setting the coincidence window to be 1 ns, the observed coincidence rate of the photon source was about 20000 pairs per second, the counting rate of each detector was about 60000, and thus the coincidence efficiency was 0.33.The coincidence rate was attenuated to 1850 pairs per second after the signal photon passed through the whole apparatus.
An important factor in our experiments is to guarantee a high interference visibility in the Mach-Zehnder interferometer, which in the case of the game is directly related to the success probability.The coherence length of our photon source was over 1000 µm.The length difference between the two interference paths was ensured to be within the coherence length by using a trombone-arm delay line composed of a translation stage with a precision of 10 µm.The phase between the two interference paths was stabilized by using a piezoelectric transducer (not shown in Fig. 2 of the main text).The interference visibility was measured to be 0.9921 ± 0.0035 in our experiment (see the end of Section H for more details).
It is also worth mentioning that our setup guarantees a high single-photon purity, which can be estimated from the expression 1 − g (2) (0), where g (2) (0) is the heralded idler-idler self-correlation.In the end of Section H, we briefly discuss how g (2) (0) can be estimated from our experimental data (including coincidence rates between de-
To witness single-device input-output indefiniteness, we projected the control qubit (encoded in the spatial modes of the single photon) onto four states |0⟩, |1⟩, |+⟩, and | + i⟩ := (|0⟩ + i|1⟩)/ √ 2. This is done by using two liquid crystal variable retarder (LC1 and LC2 in Fig. 2 of the main text) and a beam splitter (BS2).We use BS2 to choose which spatial mode is measured.When BS2 is removed, measurements onto |0⟩ and |1⟩ can be achieved on Port 0 and Port 1 respectively.To achieve measurements onto |+⟩ and | + i⟩, on the other hand, we use BS2 to recombine the two spatial modes and add a relative phase of 0 or π between these two spatial modes.The relative phase is achieved by using the two LCs.Specifically, we align the optical axes of LC1 and LC2 with the horizontal and vertical directions respectively and apply voltages on the two LCs to introduce a phase on the horizontally and vertically polarized photons.When the phases added on the horizontally and vertically polarized photons are the same, we can realize adding a phase on the control qubit while not influencing the target qubit.
The above setup can be used to estimate any witness of input-output indefiniteness.This is done by expanding the witness on a set of state preparation and measurement settings as described in Sec.IV.For each setting, we collected the data for 15 seconds and the outcome probabilities were then estimated.The probabilities used in the calculation of the optimal witness W opt are shown in Figs.(4)(5)(6)(7).These probabilities correspond to different settings, where different measure-and-reprepare devices are inserted in our setup, and different events are registered.For a measure-and-reprepare device that measures on the basis {|a 0 ⟩, |a 1 ⟩} and reprepares in the basis {|b 0 ⟩, |b 1 ⟩}, we label the possible events by the operators Similarly, the probabilities used in the experimental evaluation of the simplified witness W ′ are shown in Fig. (8).
Appendix F: Witnesses for the QTF Here we use the SDP Eq. (C15) to calculate the optimal witness of input-output indefiniteness for the quantum time flip supermap F, with the control qubit initialized in the state |+⟩ = (|0⟩ + |1⟩)/ √ 2. Consider the case where the target system is a qubit.The input (output) qubit of a bistochastic channel C will be denoted by A I (A O ), while the input (output) qubits of F(C) will be denoted by where B it (B ot ) is the input (output) target qubit and B ic (B oc ) is the input (output) control qubit.The Choi operator of QTF is given by [24] Choi with It follows that the Choi operator including the state preparation of the control qubit in the state |+⟩ is with Solving the SDP (C15) for S = S QTF,|+⟩⟨+| , we then obtain the robustness r(S QTF,|+⟩⟨+| ) ≈ 0.4007 and a matrix representation of the optimal witness W opt .To measure the witness W opt in the experiment, we decompose it into a collection of linearly independent operations, including state preparations for B it , measurements on A I , state repreparations of A O , and measurements on B ot and B oc .To be bidirectional, the measure-and-reprepare operations are required to be bistochastic instruments [21], i.e. the operators {M j } of such an instrument satisfy the condition that j M j is a bistochastic channel.
In the case of QTF, we realized bistochastic instruments by measuring the system A I in some orthonormal basis {|v 0 ⟩, |v 1 ⟩}, and then repreparing states from another orthonormal basis {|w 0 ⟩, |w 1 ⟩}, with the state repreparation depending on the measurement outcome.Explicitly, the decomposition is W opt = a,b,c,d,e α a,b,c,d,e W abcde , where α a,b,c,d,e are real coefficients (obtained from the solution of the SDP), and the vectors |a⟩, |b⟩, |c⟩, |d⟩ and |e⟩ are chosen from the set The number of terms that contribute to the decomposition of W opt is 794.
The robustness is then given by the expression  c, d, e).In the experiment, we estimated the probabilities p(a, b, c, d, e), and inserted the estimates into the expression of the robustness, obtaining the experimental value 0.345 ± 0.005.We also consider witnesses of input-output indefiniteness that require fewer measurement settings.To this purpose, we restrict the optimization of the robustness to a subset of witnesses the can be estimated by measuring only A I , A O , B oc , fixing the state of B it to |0⟩ and tracing out B ot .These witnesses can be computed by adding the following constraint to Eq. (C15): where W reduce is a Hermitian matrix on The maximal robustness under this constraint is given by r ′ (S QTF,|+⟩⟨+| ) ≈ 0.1716.The witness that achieves maximal robustness, denoted by W ′ , can be decomposed as We show that 3 is the minimum number of qubits to be measured for witnesses of input-output indefiniteness of QTF.Thus the complexity of witnesses of QTF can not be further reduced.
Lemma 2 Supermaps transforming bistochastic channels to unit probability has no indefiniteness of inputoutput direction.
Proof.Let S be the Choi operator of a supermap transforming every bistochastic channel (from system A I to system A O ) to unit probability.Then S is a postive operator on Consider the spectral decomposition Tr AO S QTF ⊗ I AO corresponds to a forward supermap consisting of the channel C and a discarding operation on system A O .It follows that the expectation Tr(W S QTF ) must be non-negative.Similarly, if there is there is no variation on system A I , the expectation of witnesses must be non-negative.Thus, variations on both system A I and system A O is necessary for certification of input-output indefiniteness of QTF.
In the case that variations occur only on systems A I and A O , according to Lemma 2, the reduced operator of any supermap corresponds to a supermap transforming bistochastic channels to unit probability and thus has no indefiniteness of input-output direction.Hence variations restricted to systems A I and A O are not sufficient.Now we show that a variation on one of the control systems of QTF is necessary.If the control qubit B ic of QTF is initialized in a fixed state σ (or the target B it and control system B ic are initialized in a joint state ρ), and the control qubit B oc is traced out in the end, then QTF becomes a random mixture of a forward supermap and backward supermap.To see this, we compute the Choi operator of the supermap after fixing the corresponding deterministic operations on systems B ic (B it B ic ) and system B oc : where ) and In conclusion, any witness of QTF has to include variations on both system A I and system A O , as well as one of the control systems: B ic and B oc .■ Appendix G: Bipartite witnesses of input-output indefiniteness Here we introduce the notion of bipartite witness of input-output indefiniteness, distinguishing between two levels of strength of this notion and showing that the quantum game discussed in the main text is an example of the weaker kind, while the single-device witnesses introduced earlier in our paper provide examples of the stronger kind.

Strong vs weak witnesses
Consider a setup that uses a pair of bidirectional devices (mathematically represented by their forward processes A and B, respectively) to generate a new device (mathematically represented by a quantum channel; C).The setup can be represented by a Choi operator, acting on the Hilbert spaces of systems A I , A O (input and output of device A), B I , B O (input and output of device B), and C I , C O (input and output of device C).Mathematically, the setup is a bilinear supermap, sending pairs of bistochastic channels (A, B) into (generally non-bistochastic) channels C.These supermaps can be naturally extended to supermaps transforming no-signaling bipartite bistochastic channels, of the form N = i x i A i ⊗ B i where A i and B i are bistochastic and x i are real coefficients, into channels C. The set of Choi operators of these supermaps has been characterized in Ref. [24].Now, consider the subset of bipartite supermaps that use both devices A and B in the forward direction, meaning that the action of these supermaps is well-defined even if A and B are ordinary (non-bistochastic) channels.These supermaps coincide with the supermaps defined in Refs.[30,31], where the input-output direction is fixed and the relative order of the devices A and B can be indefinite.The Choi operators of these supermaps satisfy the constraints [30] S ≥ 0 , We denote the set of Choi operators satisfying these constraints as S fw,fw definite , meaning that they are Choi operators of supermaps that use both devices A and B in the forward direction.
Similarly, we define the set S bw,bw definite of (Choi operators of) supermaps that use both devices in the backward direction.Mathematically, the set S bw,bw is characterized by the constraints which can be obtained from the constraints (G1) by exchanging the roles of the input and output systems.The sets S fw,fw definite and S bw,bw definite are compatible with a global input-output direction, defined jointly for both devices A and B. These sets are especially important in scenarios where the input-output direction coincides with the arrow of time.In this case, the set S fw,fw definite represents the largest set of operations accessible to an agent that operates in the forward time direction, while the set S bw,bw definite represents the largest set of operations accessible to a hypothetical agent that operates in the backward time direction.
In general, however, one can also consider setups that use device A in the forward direction and device B in the backward direction, or vice-versa.The corresponding sets of Choi operators, denoted by S fw,bw definite and S bw,fw definite , are characterized by the constraints and respectively.Now, consider the setups that use both devices in a definite input-output direction, with the same input-output direction for both devices.The corresponding set of Choi operators, denoted by S same definite , consists of all Choi operators of the form where p ∈ [0, 1] is a probability, and the operators S fwd,fwd , S bwd,bwd belong to the sets S fwd,fwd definite , S bwd,bwd definite , respectively.
Likewise, we can consider the setups that use the two devices in a definite input-output direction, but with opposite directions for the two devices.The corresponding set of Choi operators, denoted by S same definite , consists of all Choi operators of the form where p ∈ [0, 1] is a probability, and the operators S fwd,bwd , S bwd,fwd belong to the sets S fwd,bwd definite , S bwd,fwd definite , respectively.
Finally, we can consider the setups that use both devices in a definite input-output direction, without any restriction on how the input-output direction of the first device is related to the input-output direction of the second device.The Choi operators of these setups are of the form where p ∈ [0, 1] is a probability, and the operators S same , S opposite belong to the sets S same definite , S opposite definite , respectively.The set of Choi operators of the form (G7) will be denoted by S definite .
We are now ready to define three different notions of witnesses of bipartite input-output indefiniteness.The above definitions imply that an operator W is a strong witness if and only if W is both a weak witness and a conjugate weak witness.

The game as a weak witness
We now show that the game described in the main text is a weak witness, but not a strong one.
First, let us cast the game in the form of a witness.The possible strategies are described by bipartite supermaps which have two slots (corresponding to systems A I A O and B I B O ) and one qubit output C O (compared to the general framework in the previous subsection, here we are taking the input system C I to be trivial).The strategy is carried out by placing the two gates U and V in the slots and then measuring the output qubit C O in Fourier basis {|±⟩} which gives the outcome that (U, V ) belongs to or In the general case, suppose that µ(U, V ) is a probability measure on G + ∪ G − .We define the operators M + and M − to be (G12) Then the probability of winning is Ref. [24] provided examples of probability distributions dµ(U, V ) with the property that the probability of winning is strictly smaller than 1 for every strategy that uses both gates in the forward direction, or both gates in the backward direction.For all those probability distributions, the operator is a weak witness.
The witness W game is not a strong witness, because there exist quantum strategies that achieve a unit probability of success while using each of the gates U and V in definite (opposite) input-output directions.
For example, a perfect winning strategy uses the gate U in the forward direction and the gate V in the backward direction, corresponding to the gate V T .The strategy is to insert the gates U and V T into the quantum SWITCH supermap [31], which turns them into the controlled unitary gate Now, if the control qubit of the quantum SWITCH is initialized in the state |+⟩ = (|0⟩+|1⟩)/ √ 2 and the target system is maximally entangled with an auxiliary system R, the gate S(U, V T ) produces the output state where we used the double-ket notation We now show that a projective measurement on the above states can determine with certainty whether the gates (U, V ) belong to the G + or to the G − .Suppose that (U, V ) belongs to G + .In this case, we obtain the relations and where H ± are the symmetric and anti-symmetric subspaces of H ⊗ H. Instead, if (U, V ) belongs to G − , we have and Hence, it is possible to determine whether the pair (U, V ) belongs to G + or to the set G − by performing the binary projective measurement with projectors and The (Choi operator of the) above winning strategy belongs to the set S opposite definite .

Strong bipartite witnesses from single-device witnesses
Single-device witnesses can be easily converted into strong bipartite witnesses.Intuitively, the idea is that if we can rule out a definite input-output direction for the use of an individual device, then we can also rule out a definite input-output direction for the combined use of two or more devices.
More formally, suppose that W ∈ L(H AI ⊗H AO ⊗H CI ⊗ H CO) is a single-device witness for setups that transform an input bistochastic channel A (with input A I and output A O ) into a channel C (with input C I and output C O ), and that B is the Choi operator of a bistochastic channel with input B I and output B O .Then, the operator W ⊗ B is a strong witness for bipartite setups taking in input two bidirectional devices (with input-output pairs (A I , A O ) and (B I , B O ), respectively) and producing in output a device (with input-output pair (C I , C O )).This particular witness corresponds to plugging a fixed bidirectional device into one slot of the bipartite setup, and testing the input-output indefiniteness in the remaining slot.
Similarly, one can construct strong witnesses of the form A ⊗ W ′ , where A is the Choi operator of a bistochastic channel with input A I and output A O , and W ′ ∈ L(H BI ⊗ H BO ⊗ H CI ⊗ H CO) is a single-device witness for setups that transform an input bistochastic channel B (with input B I and output B O ) into a channel C (with input C I and output C O ).
By taking linear combinations of witnesses of the above form, one can easily construct examples of strong bipartite witnesses that take negative values only if both devices are used in an indefinite input-output direction.It Unitary gate QWP1 HWP QWP2 This value implies that in our game the success probability per photon is P photon right = P succ n click /n photon ≈ P right [p 1 + p 2 /2] ≈ P right [1 − p 2 /2] ≈ 0.9960.Note that the success probability per photon is equal, within the experimental error bars, to the success probability per click P succ = 0.9960 ± 0.0018, as a result of the high single-photon purity in our experiment.Here we show that the advantage demonstrated in our experiment holds even if our setup is compared with arbitrary setups that use the control-unitary gates ctrl − U = I ⊗ |0⟩⟨0| + U ⊗ |1⟩⟨1| and ctrl − V = I ⊗ |0⟩⟨0| + V ⊗ |1⟩⟨1| instead of the original gates U and V .As long as these controlled gates are used in a fixed input-output direction (either the forward direction for both gates or the backward direction for both gates), the error probability in the game cannot go below 5.6%.Notably, this result holds even if the relative order between the gates ctrl − U and ctrl − V is indefinite.
To derive this result, we adapt the method developed in Ref. [24] to find the minimal worst-case error over all strategies using the gates U and V in a fixed inputoutput direction, equal for both gates.Here we replace the 2-by-2 matrices U and V with their controlled versions ctrl − U and ctrl − V , mathematically equivalent to the block diagonal matrices U = I 0 0 U and V = I 0 0 V , respectively.With this substitution, the minimum probability of error over all possible strategies with definite input-output direction can be cast in the FIG.1.Input-output indefiniteness in a bidirectional quantum device.A bidirectional device with ports A and B can be traversed in two opposite directions: from A to B (a) or from B to A (b).When these two configurations take place in a quantum superposition (c), the direction of the information flow between A and B becomes indefinite.To generate the superposition, we introduce a control qubit that coherently controls the direction, with basis states |0⟩ and |1⟩ corresponding to directions A → B and B → A, respectively.Our setup (d) sets the control qubit in the state |+⟩c = (|0⟩ + |1⟩)/ √ 2 and witnesses input-output indefiniteness by performing local measurements on the target and control system, with the target initialized in a quantum state ρt.

FIG. 3 .
FIG.3.Experimental data for the optimal witness.The figure shows the outcome probabilities of different measurements on the control and target qubits, with the control initialized in the state |+⟩ and the target in one of the states |0⟩ (red), |1⟩ (cyan), |+⟩ (yellow), and (|0⟩ + i|1⟩)/ √ 2 (green).The measurement outcomes are labeled by numbers 0, 1, 2, 3, corresponding to projections on the states |0⟩, |1⟩, |+⟩, (|0⟩ + i|1⟩)/ √ 2, respectively.For example, '03' labels the outcome that projects the control qubit onto |0⟩ and the target qubit onto (|0⟩ + i|1⟩)/ √ 2. The bars show the theoretical predictions, while the blue diamonds show the experimental data.We omit the experimental data for outcomes that are irrelevant to the evaluation of the optimal witness.All the data in this figure refer to the setting where the device inside our setup implements a measure-andreprepare process.Specifically, they refer to the event where the target is measured on the X-eigenstate |+⟩ and re-prepared in the Z-eigenstate |0⟩.The experimental data for the remaining settings are shown in the Appendices[48].
. The Choi representation associates linear maps M : L(H in ) → L(H out ) to bipartite operators Choi(M) := (I in ⊗ M)(|I⟩⟩⟨⟨I| in,in ), where L(H) denotes the linear operators on a Hilbert space H, and |I⟩⟩ in,in = m |m⟩|m⟩ is the (unnormalized) maximally entangled quantum state on H ⊗2 in .The Choi representation is related to the Jamio lkowski representation [87] Jam(M) := m,n |m⟩⟨n| ⊗ M(|n⟩⟨m|) by a partial transposition on the first Hilbert space.In the Choi representation, a setup that uses the original device in the forward mode corresponds to a positive operator S fwd satisfying the conditions Tr BO [S fwd ] = I AO ⊗ Tr AOBO [S fwd ]/d A and Tr AOAIBO [S fwd ]/d A = I BI [88].Similarly, a setup that uses the original device in the backward mode corresponds to a positive operator S bwd satisfying the conditions Tr BO [S bwd ] = I AI ⊗ Tr AIBO [S bwd ]/d A and Tr AOAIBO [S bwd ]/d A = I BI .
Appendix D: Efficient computation of the robustness of input-output indefiniteness via SDP 1. Derivation of the SDP problems

Definition 1
Let E be a finite-dimensional vector space, K a closed convex pointed cone in E with a nonempty interior, and L a linear subspace of E. Let also b ∈ E and c ∈ E. The data E, K, L, b, and c define a pair of conic problems (P ) : minimize ⟨c, x⟩ subject to x ∈ K ∩ (L + b), (D) : minimize ⟨y, b⟩ subject to y ∈ K * ∩ (L ⊥ + c), where K * ⊆ E is the cone dual to K, L ⊥ ⊆ E is the orthogonal complement to L, L + b ⊆ E and L ⊥ + c ⊆ E are affine subspaces.(P) and (D) are called, respectively, the primal and dual problems associated with the above data.

FIG. 4 .Lemma 1
FIG. 4. Experimental data for the optimal witness (settings |0⟩⟨0|, |1⟩⟨0|, |+⟩⟨0|, and | + i⟩⟨0|).The figure shows the outcome probabilities of different measurements on the control and target qubits, with the control initialized in the state |+⟩ and the target in one of the states |0⟩ (red), |1⟩ (cyan), |+⟩ (yellow), and | + i⟩ (green).The measurement outcomes are labeled by numbers 0, 1, 2, 3, corresponding to projections on the states |0⟩, |1⟩, |+⟩, | + i⟩, respectively.The bars show the theoretical predictions, while the blue diamonds show the experimental data.We omit the experimental data for measurement outcomes that are irrelevant to the estimation of the optimal witness.The data in the figure have been taken in different settings, corresponding to different events of measure-and-prepare processes.Specifically, Subfigures a, b, c, and d refer to the events where the target qubit is measured on the state |0⟩ and re-prepared in the state |0⟩ (a), |1⟩ (b), |+⟩ (c), and | + i⟩ (d).
D13) where ∥ • ∥ is the standard operator norm (i.e. the maximal singular value).Therefore, both S f and S b are positive.So, S f ∈ P ∩ L f and S b ∈ P ∩ L b .It follows that I + S belongs to coni(S definite ).■ Now we check that the three conditions of Theorem 2 are satisfied by the two pairs of SDP problems (D1, D2) and (D4, D3).Let S be the Choi operator of a setup.1.Since ∥S∥ 2 ≤ ∥S∥ 1 = Tr(S) = d BI d A and S ∈ L s , Lemma 1 implies that S + λI ∈ coni(S definite ) , ∀λ ≥ 2d BI d A .(D14) So by choosing λ 0 > 2d BI d A , we have (λ 0 I, λ 0 I) ∈ L and b + (λ 0 I, λ 0

[Theorem 3
AI] S = I AI ⊗ i µ j |v j ⟩⟨v j | .(F10) Note that [AI] S and [AO] S are simultaneously diagonalizable.Let [AIAO] S = m I AI ⊗ I AO .Positivity of S implies that, for any i, j, the sum of eigenvalues satisfies λ i + µ j ≥ m and thus the minimum satisfies λ min + µ min ≥ m.Now we can decompose S into the sum of two positive operators: S = S f + S b where S f = [AO] S − λ min I AI ⊗ I AO (F11) and S b = [AI] S − (m − λ min )I AI ⊗ I AO .(F12) It holds that S f = [AO] S f and S b = [AI] S b .Therefore the supermap S is a random mixture of a forward and backward supermaps (corresponding to the operators S f and S b , respectively).■ Any witness of QTF has to include variations on both system A I and system A O , as well as one of the control systems: B ic and B oc .Proof.If there is no variation on the composite system of A I and A O , i.e. a fixed bistochastic channel C 0 is applied on system A I and A O , then the reduced process on the remaining systems is a simple channel from B it B ic to B ot B oc , which is irrelevant to the input-output direction of A I and A O .If there is no variation on system A O in a witness W , i.e.W = Tr AO W ⊗ I A O d A O .Then the expectation of W on S QTF satisfies Tr(W S QTF ) = Tr W 1 d AO Tr AO S QTF ⊗ I AO .(F13) The reduced operator 1 d A O Tr AO S QTF turns out to be the the Choi operator of a channel C from B it B ic to A I B ot B oc since 1 d A O Tr AIAOBotBoc S QTF = I Bit ⊗ I Bic .Hence the operator 1 d A O

Definition 2 Definition 3 Definition 4
An operator W acting on the composite system A I A O B I B O C I C O is a weak witness of bipartite input-output indefiniteness if Tr[W S] ≥ 0 for every S ∈ S same definite and Tr[W S] < 0 for some S ∈ S.An operator W acting on the composite system A I A O B I B O C I C O is a conjugate weak witness of bipartite input-output indefiniteness if Tr[W S] ≥ 0 for every S ∈ S opposite definite and Tr[W S] < 0 for some S ∈ S.An operator W acting on the composite system A I A O B I B O C I C O is a strong witness of bipartite input-output indefiniteness if Tr[W S] ≥ 0 for every S ∈ S definite and Tr[W S] < 0 for some S ∈ S.

5 •FIG. 11 .
FIG. 11.Experimental data for the quantum game.The figure shows the experimentally estimated probabilities of the outcomes + (red bars) and − (cyan bars) of the Pauli-X measurement used to distinguish two alternative properties of an unknown gate pair (U, V ).The measurement data refers to 21 different gate pairs, corresponding to different combinations of single-qubit gates in the set {I, X, Y, Z, U1, U2, U3, V1, V2, V3}.Gate pairs in the set S+ (S−) satisfy the condition UV T = U T V (U V T = −U T V ).The experimental data show that the outcome + (−) has high probability to occur for gate pairs in the S+ (S−), offering a near unit winning probability in the game.
Appendix I: A strengthened advantage in the quantum game