Topological obstructions to quantum computation with unitary oracles

Algorithms with unitary oracles can be nested, which makes them extremely versatile. An example is the phase estimation algorithm used in many candidate algorithms for quantum speed-up. The search for new quantum algorithms benefits from understanding their limitations: Some tasks are impossible in quantum circuits, although their classical versions are easy, for example, cloning. An example with a unitary oracle $U$ is the if clause, the task to implement controlled $U$ (up to the phase on $U$). In classical computation the conditional statement is easy and essential. In quantum circuits the if clause was shown impossible from one query to $U$. Is it possible from polynomially many queries? Here we unify algorithms with a unitary oracle and develop a topological method to prove their limitations: No number of queries to $U$ and $U^\dagger$ lets quantum circuits implement the if clause, even if admitting approximations, postselection and relaxed causality. We also show limitations of process tomography, oracle neutralization, and $\sqrt[\dim U]{U}$, $U^T$, and $U^\dagger$ algorithms. Our results strengthen an advantage of linear optics, challenge the experiments on relaxed causality, and motivate new algorithms with many-outcome measurements.


I. INTRODUCTION
Quantum computation is believed to outperform classical computation.Many candidate algorithms for quantum speedup [1-6] use Kitaev's phase estimation algorithm [7].Phase estimation is so versatile because it is an oracle algorithm; it estimates the phase of any unitary oracle U .In oracle algorithms, the input is an oracle -an unknown subroutine, a black box whose inner workings are hidden.It is only possible to query an oracle; to set its input and receive its output.With no assumptions on the subroutines, versatility is the main advantage of oracle algorithms.They can be gradually composed into complicated computation in independent building blocks.
Another advantage of oracles is the provability of limitations of computation.Factoring has a low-complexity quantum algorithm due to Shor [1], while it is believed to have only high-complexity classical algorithms.Rigorously proving complexity lower bounds is hard.Unlike factoring, oracle problems do have some lower bound proof methods: the polynomial [8], hybrid [9] and adversary [10,11] methods.For example, the problem solved by Grover's quantum algorithm [12] is an oracle problem.It has a proven complexity lower bound in classical [12] as well as quantum [8,9] circuits.In Grover's quantum algorithm, the oracle is classical; it is a function on bit strings (representing classical computation).In phase estimation [7] the oracle is quantum; representing any quantum circuit, it is a unitary matrix.Additional versatile algorithms could be singled out by a new -possibly purely quantum -lower-bound method.
Usually, after an initial impossibility result, stronger no-go theorems and precise bounds follow by studying approximation, postselection, and complexity generalizations.The first two generalizations are often considered separately; approximate cloning [23,24] independently from postselection (probabilistic) cloning [25], and similarly for other tasks [16,[26][27][28][29][30] (see [31] for an exception).The third generalization allows repeated input.Re-preparing a state or re-running a procedure is often necessary, for example for obtaining statistics from experiments.Hopefully, polynomially many repetitions suffice.One such complexity generalization is N -to-M cloning [31][32][33][34][35]: if M = N + 1, N is the sample complexity of creating one clone.When the input is an oracle, we are interested in the algorithm's query complexity.
Here we develop a unified formalism for quantum computation with unitary oracles, which captures all of the above generalizations simultaneously.Thus, we are able to derive the strongest-yet no-go theorem for the if-clause task [36]; the task to implement controlled U given an oracle U , the quantum version of the conditional statement essential to classical computation.We show that an if clause of any query complexity is impossible, thus losing what could be a fundamental building block in quantum circuits.This, for example, limits the flexibility of phase estimation, which assumes the controlled U building blocks.Our method exploits features unique to unitary oracles; its novel topological approach adds to the few previously known lower-bound methods.To further demonstrate its applicability, we prove limitations of other previously studied unitary-oracle tasks: the neutralization, fractional power, inverse and transpose The interferometric if clause [36]: polarising beam splitters transmit or reflect the photon depending on its polarization degree of freedom |i⟩ c .U acts on other degrees of freedom.
tasks.The limitations hold for quantum circuits (even with postselection and relaxed causality), but not for linear optics.This motivates developing implementationdependent algorithms for oracle problems.

A. Problem statement
To state the problem precisely, we first discus some preceding works.In addition to phase estimation [7], several known algorithms use oracle access to U for implementing a function of U : the complex conjugate U [37], the transpose U T and inverse U † [38,39], and the fractional power U q for some q ∈ Q [40,41].The fractional power algorithms differ from the others in two ways: First, they require queries to U (or controlled U ) and to its inverse.Second, they succeed not for all, but only for most n-qubit unitary oracles U ∈ U (2 n ) -they are (exponential 1 ) average-case algorithms in the sense of heuristic schemes [42, Definition 11].Complexity theory mostly studies worst-case algorithms; algorithms succeeding even on the worst input.Worst-case algorithms satisfy input-independent guarantees, which is preferred for reliable computation.
In different computational models the same oracle problem might have a different query complexity -the minimal number of queries the model needs to solve the problem.In the quantum-circuit model the queries have predefined causal order, and in process matrices the causal order is relaxed [43,44].While quantum circuits need three queries, process matrices provide a two-query solution to the quantum switch [43], the task to superpose orders of two oracles.Thus, theoretically, process 1 The algorithms work for inputs U that satisfy a condition captured by the gap parameter g [40].As a function of g, the algorithms require O(1/g) queries to succeed on these "good" inputs.Haar measure over U (2 n ) induces the probability of a "bad" input δ = 1 − (1 − g) 2 n ≤ 2 n g, thus the algorithms fit within a requested δ with O(2 n /δ) queries.Since δ ≥ 1 − e −2 n g , the exponential query complexity is necessary.
matrices are more powerful.But are they physically relevant?The debate about the physicality of the processmatrix solution to the quantum switch is ongoing, for example whether it was implemented [45] or only simulated [46] by certain linear optics experiments [47][48][49].
A discrepancy between quantum circuits and linear optics is already exhibited by a simpler unitary-oracle problem -the if clause.Its classical version is fundamental for classical computation: Apply a subroutine if a control bit is 1 and do nothing otherwise.In the quantum version, the control bit is a qubit and the subroutine is a d-dimensional unitary U ∈ U (d), acting on n = ⌈log 2 d⌉ qubits.Following [36], we identify this with the linear operator for some real function ϕ.In the special case when ϕ is identically zero, the operator, c 0 (U ) = |0⟩⟨0| ⊗ I + |1⟩⟨1| ⊗ U , is controlled U .Access to c 0 (U ) is assumed in phase estimation [7].c 0 (U ) is implementable given a +1 eigenstate (Fig. 1a) or a classical description [50,51] of U .Such information is not available in our oracle setting, which entertains more flexibility.When U is an oracle, the freedom in ϕ(U ) is necessary: It grants the if clause an insensitivity to U 's global phase [36,52,53].Araújo, Feix, Costa, and Brukner [36] proved that implementing (1) for all U ∈ U (d) from only one query to U is impossible in quantum circuits, though it is possible in linear optics (Fig. 1b).To explain the discrepancy, the authors argued that the gate U in Fig. 1b is not completely unknown: its position is known, revealing that on the lower path-modes it acts as the identity.Any physical gate is restricted to a specific space (specific modes), so ref.[36] suggested adding the direct sum composition U ⊕ I to the quantum-circuit model.Dong, Nakayama, Soeda and Murao [54] found an algorithm for a related task, of implementing c d ϕ (U ) for all U ∈ U (d), where In their algorithm m = d, ϕ(U ) = det(U ) −1 , and U is queried d times.Alternatively, with d queries to the fractional power U ), the if clause.Thus, the algorithm of [54] relates two unitary-oracle problems: the if clause and the fractional power.
The fractional power dates back to the √ U question in Aaronson's 2006 list of "The ten most annoying questions in quantum computing" [55].For a given fraction, a given unitary has several possible fractional powers.Sheridan, Maslov and Mosca [40] chose a particular fractional power, and, by finding a contradiction, proved that a worst-case algorithm implementing it for an unknown U is impossible [40,Lemma 1].This oracle impossibility means that if a worst-case algorithm for some √ U exists, it depends on the details of the implementation of U .
Another important oracle task is to remove the effect of an unknown and undesired evolution -the neutralization task.Often the evolution, the repeated application of some unitary U , cannot be avoided.However, initializing the state and/or interlacing U with fixed gates can cancel out its effect.For example, spin echo [56] is a neutralization algorithm for restricted U s; for qubit rotations around the z axis.Spin echo neutralizes two queries to U .The neutralization algorithm of [54] works for general d-dimensional unitaries.It neutralizes d queries to U .
The tasks mentioned above are all tasks with unitary oracles.Some algorithms and no-go theorems have been found, but maybe a unified approach is possible, with more emphasis on query complexity in order to strengthen the no-gos and to understand the optimality of the known algorithms.We have seen that the linear-optics complexity of the if clause is constant, 1, and that its quantum-circuit complexity is strictly bigger.To bridge the gap, ref. [36] suggested modifying the quantum circuit formalism.But is the gap large enough -e.g.beyond poly(n)2 -to justify this?What is the quantum-circuit complexity of the if clause?It seems at most exponential, because U 's classical description suffices to build an if clause [51], and process tomography [61][62][63] yields the oracle's classical description from exp(n) queries.

B. Results overview
In this work we develop a unified formalism for computation with unitary oracles U .We phrase such tasks and worst-case algorithms as functions on unitaries.The algorithm functions have two important properties: continuity and homogeneity.We add to the few previously known lower-bound methods a different, topological method and derive results.
The first and the most surprising result shows that the quantum-circuit complexity of the if clause is infinite.We show that no matter how many times a postselection circuit queries U and U † , it cannot implement the if clause with a nonzero success probability for every U ∈ U (d)not even approximately!Surprisingly, process tomography suggested above fails for the if clause, and only works for a relaxed variant of the task.We prove this limitation of process tomography directly.Second, we give a different proof that implementing the fractional power U 1 d for all U ∈ U (d) is impossible, from any number of queries to U and U † .Our contradiction is independent of the particular dth root function.Third, we show that quantum circuits and process matrices fail to neutralize some specific numbers of queries.Last, we prove related limitations regarding the transpose and inverse tasks.
The above results limit versatile quantum computation, and impact our understanding of tomography, measurements, linear optics and causality.Using process tomography for the if clause has a caveat: Instead of a superoperator estimate of ρ → U ρ U † , the if clause requires a matrix estimate of U .We show the limitation of such matrix tomography.Defining a relaxed if clause circumvents the limitation, but the algorithm must use a measurement beyond the binary success/fail type.This splits measurements into two groups with different effects on the quantum-circuit query complexity.The quantumcircuit model itself is compared to other models: linear optics and process matrices.On the if clause the quantum-circuit model turns out to be infinitely less efficient than linear optics!One might put some hope into relaxing causality; maybe linear optics is better matched by process matrices.While arguably true for the quantum switch task, this is wrong for the more fundamental if-clause task: its process-matrix complexity is infinite, too.The advantage of linear optics stems from restricting the oracle.The models with fully general unitary oracles have a property central to our impossibility proofs: homogeneity.Linear optics restrict oracles to the form 1⊕U which breaks homogeneity.Differently from [36], we attribute the direct sum to the linearity of linear optics (see Section V).
The rest of the paper is organized as follows.Section II defines oracle computation using functions on ddimensional unitaries, U ∈ U (d). Section III proves the if-clause impossibility and the process tomography limitation by exploiting the continuity of algorithms and the topology of the space U (d) (Lemma 1).Section IV uses this topological approach to prove results regarding the neutralization, 1/dth power, transpose, and inverse.In Section V we emphasize that our method applies to the worst-case models with the exception of linear optics.We discuss the cause and the significance of this exception.Then we discuss relaxed causality and measurements.

II. ALGORITHM AS A FUNCTION OF THE ORACLE
An algorithm should solve a problem.Each problem mentioned in the Introduction asks to implement some operator t(U ) ∈ L(H), where L(H) is the set of linear operators from a finite-dimensional Hilbert space H to itself.We call the function t : U (d) → L(H) task function.The allowed types of queries to the oracle, for example U and U † queries, are also represented by functions on operators (query functions) in our example by id : U → U and inv : U → U † .Another example is the c 0 query function in phase estimation.A set of allowed query functions is a query alphabet Σ.A task function and a query alphabet together form a pair (t, Σ) called task.Examples are in Table I, which phrases the above mentioned preceding works in terms of tasks.
Next we represent algorithms by functions of U .In [8, for some fixed unitaries V i acting on a possibly larger Hilbert space than the oracle U .We generalize the above in two ways.First, we add the possibility to query U via query functions σ i : Regarding σ i as a single character, the string s = σ 1 σ 2 . . .σ N , called the query sequence, is fixed for the algorithm.Second, we allow for a projective measurement at the end {Π succ , Π fail }, followed by the postselection on success Π succ .
Definition 1 (Postselection oracle algorithm).A postselection oracle algorithm (A, Σ A ) is a function where σ i ∈ Σ A for all i ∈ [N ].The algorithm implements the total linear operator A(U ) (Fig. 2) whenever its projective measurement {Π succ , Π fail } yields success.The probability of success must be nonzero if the ancilla Hilbert space K is initialized to the all-zero state, i.e. for all U ∈ U (d) and for all |ξ⟩ ∈ H which is the usual postselection condition [65].
We will equivalently represent a postselection oracle algorithm by (A, Σ A ), where the calligraphic font denotes the corresponding function into superoperators, i.e. (5) where we already include the correct initialization of the ancilla, and its tracing-out at the end of the algorithm.Denote by S + (H) the completely positive superoperators L(H) → L(H) that are trace-nonvanishing, i.e. they map density states D(H) ⊂ L(H) to linear operators with strictly positive trace.Then the postselection condition (4) translates to the requirement that

A(U )(ρ) := tr
The following generalization of postselection oracle algorithms relaxes the causal order of the queries.
As opposed to quantum circuits, the wires in Fig. 3 do not fix the order of the queries.How the queries are connected is determined by W , which may correspond to a fixed causal order, but also to a superposition of orders [43], and beyond [44,66].
It remains to define what it means for an algorithm to achieve a task.Note that we consider only unitary t(U ).Definition 3 (exactly achieving a task).A postselection oracle algorithm (A, Σ A ) exactly achieves the task (t, Σ) if Σ A ⊆ Σ and if it implements t(U ) to the Hilbert space H, provided that the ancilla Hilbert space K was initialized to the all-zero state |0⟩, i.e. the operator equation A postselection oracle algorithm has fixed unitary gates Vi, a fixed projection Πsucc and special slots for queries σi(U ), while identity is applied to the remaining Hilbert space Ki.
W FIG. 3. A process-matrix algorithm is a contraction of queries with a fixed matrix W . W may or may not determine the queries' order.
The freedom in the unnormalized state |g(U )⟩ allows for any global phase and any postselection probability.By the postselection condition ( 4) |g(U )⟩ is never zero.
To define achieving a task for both postselection oracle algorithms and process-matrix algorithms, we use an equivalent equation in terms of (trace non-vanishing) superoperators A(U ) ∈ S + (H): One direction of the equivalence is immediate from (5), the other follows from Theorem 2.3 of [67].The theorem also relates the errors in the operator and superoperator languages.Here we continue with superoperators.
Definition 4 (ϵ-approximately achieving a task).Algorithm (A, Σ A ) ϵ-approximately achieves the task (t, Σ) if Σ A ⊆ Σ and if the renormalized output of the algorithm is always close to the task output, i.e. for all U ∈ U (d) sup The left-hand side of inequality ( 9) is postselection diamond distance [67].It simplifies to diamond distance if A(U ) is trace-preserving.Our use of the postselection condition and of diamond distance -a worst-case measure -means that ϵ-approximately achieving is worstcase: Even with the worst inputs ρ and U the algorithm Intuition for the n = 1 case of the Borsuk-Ulam theorem: At some moment the rising tide must hit points that are exactly opposite on the circle.
succeeds with nonzero probability and then satisfies the error bound.Thus, our formalism excludes the two algorithms in column four of Table I, and includes all the algorithms in column three, where "exact" means ϵ = 0, and "unitary" means Π succ = I.

III. IF-CLAUSE IMPOSSIBILITY VIA TOPOLOGY
Algorithms as functions of U (eqs. ( 5) and ( 6)) have useful properties.The postselection oracle algorithm, function (5), is continuous whenever the query functions are (see ( 3)).So is the process-matrix algorithm, function (6), because Choi isomorphism and its inverse are continuous.Moreover, both functions are 0-homogeneous according to the definition below.

Definition 5 (homogeneity). A function
for any x ∈ X and any scalar λ such that λx ∈ X.
For example, the scalars are restricted to the unit circle (one-sphere) λ ∈ S 1 if the domain of f is the space of unitaries U (d).The space SU (2) is homeomorphic to the three-sphere S 3 and the following prominent result in topology studies continuous functions on n-spheres S n : Borsuk-Ulam theorem [68].For any f : S n → R n continuous there exist antipodal points mapped to the same value, f (x) = f (−x).
While the Borsuk-Ulam theorem (Fig. 4) implies a special case (see Appendix A), for the fully general if-clause impossibility we prove a topological lemma that also exploits homogeneity.The if-clause (m = 1) impossibility is immediate.In addition to the following full proof of Theorem 1, the appendix contains two more proofs for only the exact, ϵ = 0, impossibility.The "operational" proof in Appendix B reaches a contradiction by using the supposed c m ϕ algorithm as a building block in a larger circuit.The proof in Appendix C for only the m = 1 case3 gives additional intuition: The special unitary group SU (d) is a dth cover of P U (d), the projective unitary group.This prevents the existence of a continuous map from a unitary superoperator to a matching operator, P U (d) → U (d), preventing an exact if-clause algorithm.The full proof below holds for approximations and relies on Lemma 1 proven next.
Proof of Theorem 1.For d|m direction we repeat |m|/d times the algorithm of [54] (Section IV A), which exactly achieves (c d ϕ , {id}) using d queries.We switch the id to inv queries if m < 0.
For the d ∤ m direction, assume an algorithm (A, {id, inv}) ϵ-approximately achieves (c m ϕ , {id, inv}) for some ϵ < 1/2.As mentioned, A is a continuous, 0homogeneous function of U ∈ U (d).Consider the input state ρ ∈ D(H), ρ = |+⟩⟨+| c ⊗|0⟩⟨0|, where the first register is the control qubit, and the second the target qudit.Using ρ define f : and that multiplication by |1⟩⟨0| c ⊗ U m and taking trace cannot increase trace norm, we get which is less than ϵ by the assumption.Thus and , where all the off-diagonal matrix elements are zero and the diagonal elements change: U (t) loops on all d of them simultaneously, U ′ (t) loops on all d of them in sequence, and U ′′ (t) loops only on the zeroth one.First, we show that U is homotopic to U ′ .We can write ), where exp is matrix exponentiation and diag v is the square matrix with the vector v on the diagonal and zeros elsewhere.For any vector in the ], the function outputs a unitary path starting and ending at the identity: the unitary path U (t), if the hypercube path is the straight line; the unitary path U ′ (t), if the hypercube path travels along the edges of the hypercube (Fig. 5).Since the two hypercube paths are homotopic, so are U and U ′ .
To show that U ′ and U ′′ are homotopic, note that U ′ ( j d ) = U ′′ ( j d ) for all j.Therefore, showing their homotopy on each of the d subintervals suffices.Indeed, there exists a continuous unitary path R j (s), s ∈ [0, 1] such that conjugating by R j (s) continuously deforms U ′ into U ′′ on the jth subinterval; at s = 0 U ′ stays unchanged, at s = 1 it becomes U ′′ -the role of the path R j (s) being analogous to the thick lines in Fig. 5.
† at s = 0 does nothing and at s = 1 swaps the 0th and the jth basis state.This fixes a homotopy between U ′ and U ′′ .Combining with the first homotopy, we conclude that U and U ′′ are homotopic.
Assuming a continuous m-homogeneous function f : , which corresponds to m loops on the circle S 1 starting and ending at f (I).U ′′ (t) is a periodic function with d periods inside [0, 1], and so is the function f (U ′′ (t)).Therefore, if f (U ′′ (t)) makes k ∈ Z loops on the interval [0, 1 d ], then it makes kd loops on S 1 on the entire [0, 1] interval.Since f is continuous, f (U (t)) must be homotopic to f (U ′′ (t)).But on the circle S 1 two paths can be homotopic if and only if they make the same number of loops (this is captured by the fundamental group of S 1 ).We must have m = kd, which proves Lemma 1.

A. Process tomography for the if clause?
Theorem 1 seems to contradict process tomography.After we allow approximations and arbitrarily many queries, process tomography seems to offer a solution to the if clause.exp(n) queries suffice to estimate any oracle's superoperator with exponentially small error [69].To build the if clause, our process tomography should output a matrix estimate X ∈ U (d), instead of the superoperator estimate ρ → XρX † , because controlled-X, † , (11) contains cross-terms.Thus, in this section we study process tomography (of a unitary oracle) that outputs a matrix estimate X.
If such tomography is possible, its matrix output X approximately describes the oracle U ∈ U (d) only up to the global phase, because distinguishing the global phase is unphysical.Thus, to quantify the error, we compare κ(X) to κ(U ), where the function κ : U (d) → U (d) fixes one canonical form for all unitaries equal up to the global phase.Formally, κ(e iα U ) = κ(U ) for all α ∈ [0, 2π) (κ is 0-homogeneous) and κ(U ) = e iϕ(U ) U for some real function ϕ.An example is a function that makes the first nonzero matrix element of its input real positive.
While any practical process tomography procedure includes classical postprocessing of measurement outcomes, in principle it is convertible to a fully quantum algorithm with one measurement at the end that yields the full estimate -in our case a full matrix X: all its matrix elements written down to some N -dependent precision.Being a measurement outcome, this matrix estimate X is a random variable that takes values in the discrete space Ω N ⊂ U (d).
Definition 6 (Process tomography yielding a unitary matrix).Process tomography of a unitary oracle is an algorithm making N queries to U ∈ U (d) and then measuring, obtaining the outcome where lim N →∞ ϵ N = 0 and lim N →∞ δ N = 0.
The operator norm ||•|| op distinguishes Definition 6 from existing process tomography algorithms that ensure a vanishing distance of superoperators [69].Can we relate the two distances?Vanishing operator norm implies vanishing diamond distance of the corresponding superoperators [70,Lemma 12.6 ) for any unit vector |v⟩ [67, Theorem 1.3].However, Definition 6 requires the U -term to be independent of X.This makes all the difference.Theorem 2. Process tomography of Definition 6 is impossible.
Proof.The triangle inequality gives where σ N,U := X∈Ω N p N,U (X) ||κ(U ) − κ(X)|| op is a sum which can be split to two sums -over "good" and "bad" X-values -and then by Definition 6 upper bounded by ϵ N + 2δ N .The middle term of ( 13) is the total variational distance of two probability distributions.
Equivalently, it is the trace distance of two classical density states ρ N,U = diag(p N,U ) and ρ N,V = diag(p N,V ), the outputs of the process tomography algorithm making N queries to U or V respectively.By the sub-additivity of diamond distance, the trace distance of the outputs is Thus κ is continuous.But if κ is continuous (it is 0-homogeneous by definition), then defining f (U ) := ⟨0| κ(U )U † |0⟩ = e iϕ(U ) gives us f : U (d) → S 1 continuous and −1-homogeneous, contradicting Lemma 1.
Building on top of known process tomography algorithms cannot produce matrix estimates in the sense of Definition 6 and the proof reveals the reason: The arbitrary closeness of the matrices κ(X), κ(U ) cannot be guaranteed because any κ must be discontinuous (see also Lemma 2 in Appendix C).Consider the κ example that makes the first nonzero matrix element real positive.This κ is discontinuous.At the discontinuity is, for example, the Pauli-X operator U = κ(U ) = σ x , because its first matrix element is zero, ⟨0|σ x |0⟩ = 0. We can choose an estimate X with small but negative ⟨0|X|0⟩, so that κ(X) ≈ −σ x .This maximizes the operator norm difference ||κ(X) − σ x || op ≈ 2. Thus, near the discontinuity, || op is large -the discontinuity in κ amplifies the error arbitrarily.
We suggest modifying Definition 6 to use multiple κ j , each continuous on some subset of U (d) and applied only if the sampled X lies deep inside this subset.For example, the following functions, indexed by j ∈ {0, 1 . . ., d − 1}, split U (d) to d such (overlapping) subsets: Having sampled X choose κ r , where r = r(X) = min{j : The chosen function is continuous around the sampled X, circumventing the impossibility.Thus given some set {κ r } r and a rule r = r(X) we define Definition 7 (Process tomography yielding a unitary matrix -revised).Process tomography of a unitary oracle is an algorithm making N queries to U ∈ U (d) and then measuring, obtaining the outcome X ∈ Ω N ⊂ U (d) with probability p N,U (X).The output distribution p N,U is such that for all U ∈ U (d) where lim N →∞ ϵ N = 0, lim N →∞ δ N = 0 and r = r(X).Appendix E argues that any standard process tomography [69] combined with (15) satisfies this definition.The dependence of κ r on the sampled X yields randomness beyond the estimation error: There are oracles U for which the sampling yields either an approximation of κ 0 (U ) or an approximation of κ 1 (U ), both with a nonnegligible probability.(Consider the Fourier transform oracle ⟨j|U |k⟩ = e i 2π d jk / √ d and κ r , r(X) of example (15).)Having obtained a classical estimate of κ r (U ), we build a circuit close to |0⟩⟨0|⊗I +|1⟩⟨1|⊗κ r (U ) = c ϕr (U ), but the value r changes the circuit's operator (and the superoperator) beyond the estimation error.The index r is known and random; calculated from the measurement outcome obtained along implementing c ϕr (U ), instead of the if clause, process tomography yields the random if clause (see Appendix F).A many-outcome measurement is necessary for randomness.Thus, on the random if clause, quantum circuits using a many-outcome measurement are more powerful than those using a binary success/fail measurement (Table II).
We can make the tomography-based strategy fully quantum, deferring the r measurement to an additional ancilla register.Before the measurement, this implements a superoperator close to corresponding to the entangled if clause (see Appendix F).
After the deferring, a d-outcome measurement suffices to achieve the random if clause, because r in c ϕr (U ) = |0⟩⟨0| ⊗ I + |1⟩⟨1| ⊗ e iϕr(U ) U takes d values.This measurement is less complex than the full process tomography 4 .Since the |Ω N |-outcome tomography measurement turns out to be unnecessary, one may ask whether the d-outcome measurement is optimal or can be simplified further.Even more pressing is the question of the query complexity of the random if clause.The brute-force tomography approach is likely far from optimal.

IV. APPLICATIONS TO OTHER TASKS
Here we use our method to study other tasks, namely the neutralization, fractional power, transpose, and inverse task.For each task we first review some preceding work.
A. Review of the c d ϕ algorithm via the neutralization In this section we review the unitary algorithm of Dong, Nakayama, Soeda, and Murao [54] that exactly implements c d ϕ (U ).Suppose we try to implement c m ϕ (U ) taking the following approach: (I) use the controlledswap gates as in Figure 1a; if the control is |1⟩ the oracle U is queried in sequence m times, if the control is |0⟩ the m queries are 'moved' to an ancilla register.(II) If the control is |0⟩ apply to the ancilla a subroutine that makes the 'moved' queries have no effect other than a multiplication by a scalar.In the words of ref. [54], the subroutine of step II neutralizes the 'moved' queries.Fitting the neutralization into our framework we define: Definition 8 (ϵ-approximately neutralizing a query sequence).Given a query sequence s, a postselection oracle algorithm A ∅ : U (d) → L(H) ϵ-approximately neutralizes s, if its query sequence is s and still it leaves an all-zero input (almost) untouched: Definition 8 uses the algorithm's operator instead of the superoperator in order to forbid the (partial) trace; applying the oracles to an ancilla that is later traced out is not considered a neutralization.
Observing that the totally antisymmetric state is an eigenstate of U ⊗d , ref. [54] presented an algorithm exactly neutralizing (ϵ = 0) the sequence s = (id) d of parallel queries.This postselection oracle algorithm, A ∥d ∅ (U ), is unitary.Ref. [54] used A ∥d ∅ (U ) to build the algorithm of Fig. 6a, the (unitary) postselection oracle algorithm that exactly achieves (c d ϕ , {id}): Construction 1 (due to [54]).For the correctly chosen fixed unitary V , the unitary algorithm of Fig. 6a makes d queries to U and implements the operator Proof.First note that we can write the determinant as where is the totally antisymmetric state.For a proof of eq. ( 19) see Appendix G.Note that we have indexed the basis vectors starting with i = 1.Switching to the usual labeling that starts with zero, observe that |χ d ⟩ is normalized and therefore there exists a unitary V ∈ L(K) Observe that the algorithm of Fig. 6a implements

B. Neutralizable query sequences
Complementary to the neutralizing algorithm A ∥d ∅ (U ) above, here we prove the impossibility of neutralizing the remaining numbers of parallel, as well as sequential id queries.At first glance, it seems that one could always add a query and then make it have no effect in the algorithm.This is less obvious when tracing out subsystems is disallowed, as in the neutralization (Definition 8).Indeed, for most query numbers, the neutralization is impossible.Conceptually, this no-neutralization of oracle queries is analogous to the no-deleting of states [14].
Since taking X → ⟨0| X |0⟩ can only contract trace norm, inequality (17) implies that the circle and is continuous m-homogeneous.Then by Lemma 1, m is a multiple of d.
Theorem 3 does not distinguish between parallel and sequential queries -it applies to both.More generally, all of the above applies also to process-matrix algorithms (a model already without the parallel/sequential distinction).

C. Fractional power impossibility
Here we are interested in the 1/dth power task (U → U 1 d , {id, inv}).It is listed in Table I.For this task, Sheridan, Maslov and Mosca [40] found an average-case algorithm -an algorithm that works for most, but not all U ∈ U (d).Given any fraction q ∈ Q, the algorithm makes id, inv queries (after the adjustment in Appendix A of [40] that removes the controlled-U queries) and implements an operator that for most U ∈ U (d) is close to U q ⊗U −q ⊗I K2 .This can be arbitrarily close at the cost of increasing the dimension of the ancilla Hilbert space K 2 .In [40] U → U q corresponds to a specific fractional-power function.Many exist, because each unitary has many possible roots.For example, for any j, k ∈ {0, 1, . . .m−1} a possible mth root of Here we show that, unlike in the average case, in the worst case we cannot implement U 1 d to within an arbitrarily small error ϵ.For the specific 1/dth power function chosen in [40], the impossibility was already proven in [40, Lemma 1].However, the following corollary of Theorem 1 holds for any 1/dth power function.
Corollary 1.Let t : U (d) → U (d) be any function such that t(U ) d = U .No postselection oracle algorithm or process-matrix algorithm can ϵ-approximately achieve the 1/dth power task (t, {id, inv}) for ϵ < 1/2d, no matter how many queries it makes.
The impossibility of errors smaller than 1/ exp(n) for n-qubit unitaries is discouraging, because the "inverse exponential scaling" here is qualitatively different from how errors scale in useful algorithms.In a useful algorithm the error ϵ scales inverse exponentially or even inverse polynomially with respect to the complexity of the algorithm.In other words, the complexity scales as log 2 (1/ϵ) or poly(1/ϵ) [41,[71][72][73].Here, instead, we found ϵ-values for which arbitrarily complex algorithms fail.
Another way to understand the strength of the result is to consider only two-dimensional unitary oracles, which intuitively should be the simplest to work with.According to the result, the square root of a two dimensional unitary is impossible to implement within ϵ < 1/4 by quantum circuits of any complexity.
The intuition for a complexity-independent lower bound on ϵ is simple: we are trying to approximate a discontinuous function t by some continuous algorithm.
Proof.Suppose (A, {id, inv}) ϵ-approximately achieves the 1/dth power task (t, {id, inv}).Use A(U ) instead of each query to U in the (c d ϕ , {id, inv}) algorithm of ref. [54] as in Fig. 6.The resulting algorithm in the exact which corresponds to the if clause.For A with error ϵ, the composed algorithm in Fig. 6b has error dϵ, because it uses the A(U ) subroutine d times and because postselection diamond distance satisfies weak subadditivity (Theorem 2.1 in [67]).By Theorem 1 we must have dϵ ≥ 1/2 implying that ϵ ≥ 1/2d.

D. Review of the complex conjugation algorithm
Complex conjugation is used as a subroutine in the inverse algorithm discussed in the subsequent sections.Here we review the complex conjugation algorithm of 7.After postselecting the first two registers on outcome ψ + , this algorithm of [38,39] implements U † .Its subroutine in the dashed box, the unitary algorithm of [37], implements the complex conjugate U from d − 1 parallel queries to U .
Construction 2 (due to [37]).For a correctly chosen fixed unitary V conj , the unitary algorithm in the dashed box in Fig. 7 implements A conj (U ) such that while making d − 1 queries to U .
Proof.Cramer's rule for matrix inversion reads U −1 = det(U ) −1 C(U ) T , where C(U ) is the cofactor matrix of U .We define it presently, but first note that from Cramer's rule C(U ) = det(U )U .It remains to show that the algorithm implements C(U ) to its first register corresponding to a d-dimesional Hilbert space H. Cofactor matrix of U is the matrix of minors of U , C(U ) i,j = (−1) i+j det(U ̸ i,̸ j ) or: where the labeling of the computational basis vectors starts with i = 1, and where det(U ̸ i,̸ j ) is the (i, j)th minor, defined as the determinant of the matrix U with the ith row and jth column deleted.Formally, we write E : H → H ⊗d−1 is an isometry, because the vectors {|v j ⟩} j∈ [d] in H ⊗d−1 are orthonormal.We switch back to the basis-labeling that starts with zero.Since {|v j ⟩} j∈{0,1,...d−1} are orthonormal, there exists a (nonunique) unitary 7 on input |ξ⟩ ⊗ |0⟩ ⊗d−2 outputs the all-zero state on the ancilla with probability In other words, projecting the ancilla output onto the all-zero state has no effect, i.e.A conj (U )(I ⊗ |0⟩⟨0| ⊗d−2 ) equals which by eq. ( 23) equals to C(U ) ⊗ |0⟩⟨0| ⊗d−2 .

E. Review of the simplest transpose and inverse algorithms
We listed the transpose and inverse task in Table I.Quintino, Dong, Shimbo, Soeda and Murao [38,39] presented a family of algorithms for each task.Here we review only the simplest algorithm of each family; the one with the fewest queries and the lowest probability of success.
Construction 3 (due to [38,39]).Figure 7 with the dashed box replaced by U is a single-query algorithm implementing U T with the probability of success 1/d 2 .

Prepending to Construction 3 a unitary that prepares the input |ψ
i=0 |ii⟩ (the generalized Bell state) gives a postselection oracle algorithm exactly achieving the task (U → U T , {id}).
Proof.Note that if the dashed box is replaced by the identity operator I, Fig. 7 corresponds to the generalized teleportation, which succeeds with probability 1 d 2 .In other words (⟨ψ which can be verified by writing M in terms of its matrix elements.Thus, the algorithm of Fig. 7 with the dashed box replaced by U implements Composing the transpose algorithm with the unitary algorithm for the complex conjugate [37] gives a postselection oracle algorithm exactly achieving the task (U → U † , {id}).
Construction 4 (due to [38,39]).The algorithm of Fig. 7 makes d − 1 queries to U and implements U † with the probability of success 1/d 2 .
Both algorithms above have a useful feature: their effect on the ancillae can easily be uncomputed.Let V prep be a unitary that prepares |ψ + ⟩ from the all-zero state.
⊗2 into the algorithm of Figure 7 for both occurrences of |ψ + ⟩ gives algorithms with ancillae initialized to zeros and with Π succ = |0⟩⟨0| ⊗2 .Adding after the dashed box a gate that swaps the first and the last register results in transpose and inverse algorithms A T and A † such that We call such algorithms clean (Definition 9).Note the complex-conjugation algorithm, eq. ( 20), is also clean.
Cleanness can be achieved whenever the ancilla output is independent of the oracle U , by adding the appropriate fixed unitary gate as we did here.

F. Query complexity of the clean transpose and inverse
We reviewed the simplest transpose and inverse algorithms.References [38,39] also presented other algorithms, with higher probabilities of success, that require more queries.Are they all clean?We answer this negatively in a much more general way: In this section we show that clean transpose and inversion algorithms with certain numbers of queries are impossible.First we define clean algorithms: Apart from achieving their task (inequality (9)), they satisfy an additional condition regarding their effect on their ancillae -if the ancilla input is the all-zero state, so should be the ancilla output.In the definition we merge the task and the ancilla conditions into one inequality.

Definition 9. [Clean postselection oracle algorithm] A postselection oracle algorithm
where the wide tilde denotes the extension X := I H ′ ⊗X.
In other words, the ancilla output is independent of the unknown oracle.Clean algorithms enable ancillae recycling and preserve coherences if used inside an interferometer (Fig. 1b).The following impossibility of certain clean algorithms is a corollary of Theorem 3.
Proof of 1.Such an algorithm (A, {id}) satisfies Proof of 2. Suppose some clean N -query algorithm ϵapproximately achieves the transpose task.Replace each query to U by A conj (U ) of eq. ( 20), i.e. by the clean, unitary, (d − 1)-query algorithm of [37] that exactly implements U .The new algorithm makes N (d − 1) queries to U , ϵ-approximately implements U † , and is clean.Then by the preceding proof d divides N (d − 1) + 1, so N ≡ 1 (mod d).
References [38,39] found for every k ∈ N a k-query transpose algorithm and a k(d − 1)-query inverse algorithm.The success probability of these grows with k.We have shown that their algorithms can be clean only if k ≡ 1 (mod d).

V. DISCUSSION AND OPEN PROBLEMS
In this work we introduce a unified framework for algorithms with unitary oracles U ∈ U (d), and develop a topological method to prove their limitations.The method yields new limitations for algorithms implementing the if clause c ϕ (U ), neutralization, 1/dth power U 1 d , transpose U T and inverse U † .Our method adds to the very few previously known proof methods for limiting query complexity.
Similarly to the preceding methods [8][9][10][11], our method is worst-case: It expects algorithms to work on every input.The distinction is important.While a quantum circuit implementing U 1 d for most U ∈ U (d) exists [40], one working for all U ∈ U (d) is impossible.Similarly, the worst-case if clause is impossible (Theorem 1), and the (exponential) average-case if clause is implemented by Fig. 6b after substituting the U In this quantum switch implementation [74], the photon passes through the interferometer twice.In the first pass, A acts on one photon if the polarization is |1⟩ c and on vacuum otherwise.In the second pass, A acts on one photon if the polarization is |0⟩ c and on vacuum otherwise.A can act nontrivially on vacuum.(b) Analogously to Figure 1, the equivalent circuit captures this possibility.
[40] for A(U ).Whether a more efficient average-case algorithm exists remains open.Between the finite averagecase and the infinite worst-case complexity, other complexity notions fit -and could be explored.One notion is that of Levin's average-case complexity [75], equivalent to the notion of errorless heuristic scheme [42] -the scheme gives a warning (e.g. the ⊥ symbol) if its output breaks the requested specifications (in our case, if the implemented operator exceeds the requested diamond distance from the task operator).Errorless heuristic schemes remain a possibility for the if clause and the fractional power.Another notion is that of smoothed complexity [76], which considers the worst input, but after perturbing it slightly.Though previously defined for errorless heuristic schemes [76,77], smoothed complexity can also be defined for heuristic schemes with errors (as ref. [78] did specifically for the perceptron algorithm).Such smoothed analysis could resolve the transition between the two problems' average-case and worst-case complexities.Focusing here on worst-case query complexity, we leave all the above questions open.
The query complexity bounds proven here reveal surprising differences between oracle computational models.First, we show how quantum circuits differ from linear optics.By Theorem 1, the if clause is an oracle problem on which quantum circuits perform much worse than linear optics.The query complexities of the if clause in these models are not polynomially, and not even exponentially equivalent.While the linear-optics complexity of the if clause was known to equal one, its quantumcircuit and process-matrix complexities are worked out here to be infinite!Linear optics avoid our impossibility because the direct sum U ⊕ I lacks homogeneity, a property required by our method.According to ref. [36], the direct sum appears due to the gate's localization to the upper path-modes in Fig. 1b.However, instead of a direct sum, a second-quantization view yields a tensor product of modes.We suggest a conceptually different reason for the direct sum: the linearity of linear optics.Figure 1b implicitly assumes that U is a linear (passive) gate: the vacuum |Ω⟩ is its +1 eigenstate.If this hidden assumption is made explicit, the oracle is not completely unknown and should be represented by U ′ = 1 ⊕ U as in Fig. 1a.Thus, while restricting to linear optics yields a weaker computational model, in the presence of oracles (Appendix H), it also imposes additional knowledge about the oracles.Surprisingly, overall this gives a remarkable advantage on the if clause.
The demonstrated advantage of linear optics motivates studying restricted computational models -especially if the restriction makes the model more implementable in the near term.For example, besides linear optics, we could restrict optics to Gaussian optics or to various levels of non-Gaussianity [79] -applying the same restriction to the oracle.This could capture varying amounts of device-independence in experiments, adversarial power in cryptography, or distrust in communication protocols.Restricting the computational model -and with it the oracle -may change the query complexity of problems other than the if clause.Studying these changes under restrictions that are relevant in near-term computation is an interesting future direction.
Process matrices compare equally unfavorably to linear optics on the if clause.While the linear restriction improves efficiency, relaxed causality does not.This affects the debate of whether the linear optics experiments [47][48][49] implement the process-matrix solution to the quantum switch: Any claimed linear-optics efficiency could stem from the implicit restriction on the oracles, and not from relaxed causality.To discount the restriction effect, we suggest to check the query complexity in the experiments by imagining that the oracles are fully general and act nontrivially on vacuum.For example, for the specific linear-optics quantum switch in Figure 8a, this leads to an equivalent circuit in Figure 8b whose query complexity does not match the process-matrix quantum switch.This approach to query complexity has a specific, causalityrelated purpose.It might not work for other purposes.Indeed, in computational models that allow changing or superposing particle numbers, calculating complexity is an interesting and difficult open problem.
The last query complexity gap is between measurements.Understanding why process tomography fails at the if clause (it fails at the (1/d)th power for a similar reason) lead us to define modified tasks which are achievable: The entangled and random if clause.If simpler implementations exist, the entangled if clause could serve as a subroutine in larger algorithms.The random if clause reveals the complexity gap between measurements: its query complexity is infinite in the one-success-outcome model, but finite (at most exponential) in a model with exp(n) success outcomes (Table II).Are there algorithms requiring fewer queries and fewer outcomes?An optimal algorithm will exactly quantify the advantage of many outcomes -finding one remains an open question.
This is well defined because A maps into S + (C 2d ) so the superoperator A(U ) never vanishes the trace of its input.Observe that by its definition f is a continuous odd function.Substituting the inequality (A1) into (A2), we get that |f (U ) − 1 2 e −iϕ(U ) | < 1 2 so f never maps to zero.We can define f (U ) = f (U )/ f (U )f (U ), which is also continuous and odd, but maps into the circle S 1 .Now, since d is even we can define the following continuous function g : S 3 → U (d) such that given a vector x = (x 1 , x 2 , x 3 , x 4 ) T on the 3-sphere , where the dots denote that the elements are repeated across the diagonal and the antidiagonal, and there are zeroes everywhere else.Note that g is odd, g(−x) = −g(x).By the Borsuk-Ulam theorem, since f • g : , where the last equality holds because f • g is odd.So for this x we have f • g(x) = 0.But this contradicts the fact that f maps into S 1 .
is continuous, m-homogeneous and by eq. ( 4) well-defined on all U ∈ U (d). Observe that f (U ) = e −iϕ(U ) .Lemma 1 applies to f , so d divides m.
The above can be extended to approximations, as long as the two sides of (B1) are close enough to guarantee f (U ) ̸ = 0.

Appendix C: Exact if-clause impossibility via covering spaces
This proof uses the fact that P U (d) is a dth cover of SU (d) 5 .The covering space approach gives useful intuition, but, we did not find a way to extend it to the approximate case (ϵ > 0) -we discuss the difficulty at the end of this section.
Proof of Theorem 1 (m = 1, ϵ = 0).Assume towards contradiction the existence of an algorithm (A, Σ A ) that ϵapproximately achieves (c ϕ , {id, inv}) for ϵ = 0. Observe from eqs. ( 5) and ( 6) that we can define a function on unitary superoperators A S (U) := A(U ), where the unitary superoperator U is defined as U(ρ) := U ρU † .Since the query alphabet Σ A ⊆ {id, inv} only contains continuous functions, A S (U) is continuous.Next define and observe that s is continuous and that applying eq. ( 8) we get s(U) = e iϕ(U ) U , which produces a contradiction with the lemma below.
We will show that there is no continuous function s (called section) that maps a unitary superoperator to some matching unitary.First we will characterize the space Im(π).Defining the equivalence relation U ∼ e iα U for all α ∈ [0, 2π), we will show that Im(π) is homeomorphic to the quotient space U (d)/ ∼ = U (d)/Z(U (d)) =: P U (d) called the projective unitary space.In particular, π maps into the same element precisely those unitaries that differ by the global phase.To see this, consider the continuous map π and the quotient map p : U and observe that whenever p(U ) = p(U ′ ) we have that π(U ) = π(U ′ ).By the universal property of quotient spaces in topology there exists a continuous map h : We can prove this via Lemma 1 (see 6 ).But our aim here is to prove Lemma 3 directly, using the fact that SU where the second equality follows from the first commuting diagram, the third equality from the second commuting diagram and the fourth equality from the fact that r is a retraction.Similarly take any 6 Proof.p is continuous and 0-homogeneous, i.e. p(e iα U ) = p(U ) for all α real.Suppose that s as in Lemma 3 exists, then the opposite composition s • p must be continuous and 0-homogeneous (as p loses the information about α).Also (s • p)(U ) differs from U only by the global phase (because p The function f is continuous and (−1)-homogeneous so its existence contradicts Lemma 1. □ det •γ : [0, 1] → S 1 is the loop t → e 2πidt , which winds d times around the circle, it is homotopic to the composition of ν with itself d times (as both loops are equal up to reparametrization of time).Thus, ) is a dth power in π 1 S 1 , 1 and det * is a group isomorphism, we deduce that [γ] is also a dth power (to see this, apply the inverse of det * to both sides of eq. ( D1)).
To complete the proof of Lemma 1 we give here the formal version of the arguments in the main text.
Proof of Lemma 1.Without the loss of generality we may assume that f (I) = 1, since otherwise we may replace f with its rotation U → f (I) −1 f (U ).Let γ : [0, 1] → U (d) be the loop γ (t) = e 2πit I.By Lemma 4, the homotopy class [γ] is a dth power in π 1 (U (d) , I), and so must map to a dth power under any group homomorphism.In particular, h Since the fundamental group of the circle π 1 S 1 , 1 is (infinite) cyclic and generated by the homotopy class of the loop ν (t) = e 2πit , we can write [γ ′ ] = [ν] k for some k ∈ Z, and so we have kd .On the other hand, the m-homogeneity of f allows us to derive an explicit formula for f • γ: The loop t → e 2πimt , which winds m times around the circle, is homotopic to the composition of ν with itself m times (as both loops are equal up to reparametrization of time) and so [f Since the order of [ν] in π 1 S 1 , 1 is infinite, the two powers must be equal and m = kd.which ensures that |⟨r|X|0⟩| ≥ 1/ √ d and because of our supposition also that ⟨r|U |0⟩ ̸ = 0, so we can safely divide by each.We will show that the left-hand side of (E3) is close to ||κ r (X) − κ r (U )|| op , by using the following upper bound: where the last inequality upper bounded: the first term using | |a| − |b| | ≤ |a − b| a, b ∈ C, the second term using the same applied to eq. (E4) with α U,X ⟨r|X|0⟩ taken out of the norm, the third term using eq.(E4) with ⟨r|U |0⟩ taken out.Applying (E2) to the first term of (E7) and simplifying the rest, we get We obtain The last inequality upper bounds the first term by (E3) and the second term by (E8).Provided that condition (E1) holds, we set the parameters of Definition 7 in the following way.Let δ N = δ ♢N .Let N 0 be some number such that ϵ ♢N ≤ 1/d for all N ≥ N 0 .We set The r = r(X) rule guarantees that for N ≥ N 0 ϵ N upper bounds (E9).At the same time lim N →∞ ϵ N = 0 and lim N →∞ δ N = 0 hold, satisfying Definition 7.

Appendix F: Random if clause and entangled if clause
Here we show how algorithms of Definition 7 yield the random if clause and the entangled if clause.For a rigorous treatment we first need several definitions.Definition 10 (k-task).A k-task is a pair (t, Σ), where 1. t is a vector (t 0 , t 1 , . . .t k−1 ) of task functions t i : U (d) → L(H t ) 2. The query alphabet Σ is a set of query functions.
For example, the k-if clause is ((c ϕ0 , c ϕ1 , . . ., c ϕ k−1 ), {id, inv}) for any {ϕ i } i .Another example is the k-qth power for some fraction q ∈ Q, where each t i is a specific qth power function on U ∈ U (d) (recall that many such functions exist).
A random task or an entangled task is a k-task for any k ≥ 2. The qualifiers "random" and "entangled" will invoke different notions of algorithms "achieving" the k-task.We defined postselection oracle algorithm (Definition 1), which includes only a binary success/fail measurement.Here we need a generalization: where the wide tilde denotes the H ′ extension by the identity superoperator or operator, and for r ≥ k we set t r = t k−1 .
If either k = 1 or m = 1, then (F5) simplifies to (9).Consequently, the if clause (k = 1) is impossible also in the m > 1 model, and the random if clause is impossible in the original m = 1 model.This justifies the remaining impossibilities in Table II.
Extending the algorithmic model is not necessary for the entangled if clause.Binary success/fail measurement suffices if the r value can remain in an additional, entangled register.where {|r⟩} r∈[k] is the computational basis of C k , and the wide tilde denotes the H ′ extension by the identity superoperator or operator.
where || • || tr is the trace norm, and I ∈ L(H ′ ) and I ∈ S + (H ′ ) are the identity operator and superoperator.

Lemma 1 .
Let m ∈ Z.If a continuous m-homogeneous function f : U (d) → S 1 exists, then d divides m.For example the determinant, emerging in the c d ϕ algorithm reviewed in Section IV A, is a d-homogeneous function: det(λU ) = λ d det(U ).By Lemma 1 this homogeneity degree and its multiples are the only ones possible for continuous functions U (d) → S 1 .Consequently, in our main result c m ϕ obeys a dichotomy that depends on whether d divides m (d|m): Theorem 1.Let d be the oracle dimension, let m ∈ Z and ϵ ∈ [0, 1/2).• If d|m a postselection oracle algorithm exists ϵapproximately achieving (c m ϕ , {id, inv}) for some ϕ.It makes |m| queries.• If d ∤ m no such postselection oracle algorithm or process-matrix algorithm exists, for any number of queries.

Theorem 3 .
Let d ∈ N be the dimension of the oracle U , let s = (id) m and ϵ ∈ [0, 1).If there exists a postselection oracle algorithm ϵ-approximately neutralizing s, then d|m.Proof.Suppose (A ∅ , {id}) is a postselection oracle algorithm ϵ-approximately neutralizing s.By eq.(3), A ∅ : U (d) → L(H) is continuous and m-homogeneous and so is

FIG. 6 .
FIG. 6.(a) The unitary algorithm due to [54] makes d queries to U and implements c d ϕ (U ) to its first two registers.(b) The queries to U are replaced by subroutines A(U ) that possibly act on additional ancillae.A(U ) is assumed to approximately apply t(U ) = U 1 d to its non-ancilla Hilbert space.
holds for all U ∈ U (d), all ρ ∈ D(C 2d ) and for some real function ϕ.Let ρ + = |+⟩⟨+| ⊗ |0⟩⟨0| ∈ C 2 ⊗ C d , and define f : U (d) → C by FIG. 9. Circuit B : U (d) → L(H ⊗ K) running A as a subroutine.The control qubit and the target qudit of H are shown explicitly.X is a Pauli-X gate.
and let U ∈ [U ] be some unitary from the equivalence class.Choose coordinates k, l ∈ [d] such that the matrix element u lk of U is nonzero.Observing that j U (|j⟩⟨k|) |l⟩⟨j| = u lk U and similarly for some U ′ ∈ [U ′ ], we get u lk U = u ′ lk U ′ ̸ = 0 and since both U and U ′ are unitary we have U = e iα U ′ for some α ∈ [0, 2π).Therefore [U ] = [U ′ ] and h is also injective.A bijective continuous function from a compact space to a Hausdorff space is a homeomorphism, so Im(π) and P U (d) are homeomorphic.We can restate Lemma 2: Lemma 3. Let p : U (d) → P U (d) be the quotient map.There is no continuous map s : P U (d) → U (d) such that p • s = id.
(d) is a finite cover of P SU (d) := SU (d)/Z(SU (d)) = SU (d)/ ∼.Proof.First we show that P U (d) and P SU (d) are homeomorphic.Let ı : SU (d) → U (d) be the embedding of the special unitaries into the unitaries and sp and p the quotient maps as depicted SU (d) Observing that whenever sp(U ) = sp(U ′ ) we must have that U = λU ′ (with λ d = 1) and therefore (p • ı)(U ) = (p•ı)(U ′ ), we get by the universal property of quotient spaces in topology that there exists a continuous g : P SU (d) → P U (d) that makes the diagram commute.Next define the function r : U (d) → SU (d), r(U ) = U/ det(U ).This is a continuous function such that r • ı = id SU (d) (a retraction).Whenever p(U ) = p(U ′ ) we have that U = e iα U ′ for some α ∈ [0, 2π) and therefore (sp • r)(U ) = (sp • r)(U ′ ).By the universal property of quotient spaces in topology there exists a continuous g ′ : P U (d) → P SU (d) that makes the diagram commute.The following argument shows that g and g ′ are the inverse of each other: Take any x ∈ P SU (d) and some preimage of it x ∈ SU (d), sp(x) = x.Observe that

TABLE II .
If-clause achievability by algorithms that use a different type of measurement