Practical computational advantage from the quantum switch on a generalized family of promise problems

The quantum switch is a quantum computational primitive that provides computational advantage by applying operations in a superposition of orders. In particular, it can reduce the number of gate queries required for solving promise problems where the goal is to discriminate be-tween a set of properties of a given set of unitary gates. In this work, we use Complex Hadamard matrices to introduce more general promise problems, which reduce to the known Fourier and Hadamard promise problems as limiting cases. Our generalization loosens the restrictions on the size of the matrices, number of gates and dimension of the quantum systems, providing more parameters to explore. In addition, it leads to the conclusion that a continuous variable system is necessary to implement the most general promise problem.


Introduction
Classical events follow well defined causal relations. However, in quantum mechanics one can conceive of a superposition of causal structures, just as quantum systems can be in a superposition of states [1]. This idea motivated the development of the process matrices formalism [2], which allows for the description of quantum processes exhibiting an indefinite causal order, i.e., showing correlations incompatible with any definite causal structure.
The quantum switch [3][4][5][6][7][8][9][10] is a physically realisable instance of indefinite causal order, which consists in the application of two quantum channels A and B on a target qubit in two different orders, either BA or AB, coherently controlled by a second qubit (see Fig. 1). It has become an interesting resource with applications in quantum computing [11][12][13][14][15], quantum communication complexity [16][17][18], communication through noisy channels [19][20][21][22][23][24][25][26][27][28], quantum thermodynam- Figure 1: The simplest quantum switch applies two gates in two different orders, which is coherently controlled by a control qubit. In photonic realizations, the order of the operations can be controlled by the path degree of freedom of photons, which we illustrate by colour wires. When the control is in a superposition of states, the order of the gates becomes indefinite.
The quantum switch provides computational advantage by reducing the number of queries of unknown quantum channels in a family of tasks, of which the simplest known case is to decide whether a pair of unitary gates commute or anticommute [11,12]. This can be achieved using the quantum switch with a single use of each gate, whilst a fixed-order circuit demands one extra query to one of them. This task has been generalised to the so-called Fourier Promise Problem (FPP). There, a quantum switch of N unitary gates (N -switch) deterministically discriminates between a set of N ! properties that a set of gates is promised to satisfy upon permutation [13]. The N -switch coherently applies the N ! different orders of the gates such that the permutation property can be determined with a single use of each unitary. On the contrary, the best known fixedorder circuit simulating the quantum switch requires a total of O(N 2 ) gate queries [34]. An alternative solution to the FPP using a fixed-order circuit has a query complexity of O(N log N ), with the cost of using extra ancillary systems [35].
The quantum switch has been experimentally implemented to solve the FPP for N = 2 qubit gates [12,5]. However, implementation for N > 2 is technically difficult due to the unfavorable scaling of the dimension of the target system, which must have dimension at least N ! [13]. While photons do indeed have accessible degrees of freedom with large dimension, such as orbital angular momentum [36] and other types of spatial modes [37,38], producing the required transformations even for the smallest dimensional case of 3! is challenging. One possible path towards more practical realizations of promise problems was provided in Ref. [14], where the Hadamard Promise Problem (HPP) was introduced, with an explicit solution experimentally demonstrated using a quantum switch that applied four sequences of four gates to a qubit target system. A more general definition of HPPs using N gates was recently introduced in Ref. [15], with the same distinctive feature of requiring just a qubit as the target system. Both the FPP and HPP can be cast as the task of determining which column of a matrix describes the permutation properties of a set of unitaries, relating the promise satisfied by the set of unitaries to the entries of a Fourier or Hadamard matrix.
In this paper, we introduce a generalized set of promise problems, which in addition to providing much more freedom in regards to the dimension of the target system, uncouples the order of the matrix and the number of quantum gates, offering more parameters to explore. To achieve this, we turn to the more general Complex Hadamard (CH) matrices to define the Complex Hadamard Promise Problem (CHPP), providing a large family of promise problems. The CHPP reduces to the FPP or HPP as limiting cases. In regard to discrete variable target systems, our approach removes the unfavorable factorial scaling of the FPP, and we find that CHPPs exist for every finite dimension with some additional constraints on the entries of the CH matrix. In addition, the entire family of CHPPs can be defined for continuous variable (CV) target systems. Moreover, some CHPPs are exclusively defined for CV systems, which could possibly lead to new applications. For a comparison with related works on these features, see Table I. Looking towards implementation, we show how the quantum switch solves the CHPP and offers computational advantage compared to the best known fixed-order circuits for both discrete and continuous variable target systems. This result renders new flexibility to the design of experiments using the quantum switch to solve promise problems and opens the possibility of using CV platforms to this end.
The structure of the article is as follows. Section 2 introduces Complex Hadamard matrices and some relevant properties. The CHPP is defined in Section 3 and shown to be well defined for every dimension, with some restrictions on the CH matrices. Section 4 shows the solution of the CHPP using the quantum switch and Section 5 assesses the computational advantage of the quantum switch against the best known fixedorder solutions. A discussion on possible experimental implementations is found in Section 6, Araújo,

Taddei
Renner, Parameter Chiribella [11] Costa, et al. [14] Brukner [15] This work Brukner [  Since the entries of a complex Hadamard matrix are unimodular, they can be written as The phases φ jk ∈ [0, 2π) are the entries of a matrix φ known as a log-Hadamard matrix. For example, if M is dephased, then all the entries of the first row and first column of the corresponding log-Hadamard matrix are equal to zero.
A special subset of complex Hadamard matrices is the set of Butson-type complex Hadamard matrices, or Butson-Hadamard (BH) matrices for short [40]. They satisfy the additional condition that all their entries are roots of unity. We say 1 where we have dropped the normalizing constant. Another known family of BH matrices is the set of real Hadamard matrices, with entries equal to ±1, hence corresponding exactly to the set BH(p, 2).
It is important to notice that not every CH matrix is BH. As an example, let us consider the case of CH matrices of size 4. Every matrix in CH (4) is equivalent 2 to a matrix in the family with a ∈ [0, π). Conversely, every matrix in this family is a CH. Notice that F To get a CH matrix which is not BH, it is enough to write a = 2πν and fix ν as an irrational number.

.1 The Problem
In this section we introduce the Complex Hadamard Promise Problem (CHPP). Our definitions follow those laid out in Ref. [13].
Let M be a CH(p) matrix in its dephased form and consider a set of N unknown unitary gates U 0 , ..., U N −1 . We define the product ..U 0 and denote different permutations of the same gates by Π 1 , ..., Π p−1 . The Complex Hadamard Promise states that the set of unitaries satisfies the following property for one of the columns of M : The problem is to find the column k.
Notice that the size p of the matrix defines the number of permutations that will be considered. This sets a lower bound for the number of unitaries N , which must be such that:

Existence of unitaries satisfying the promise: Finite dimensional target
The definition of the CHPP does not garantee the existence of a set of unitaries satisfying the promise under some permutations for a given CH matrix. Here, we prove that those unitaries do exist, but some restrictions appear on the CH matrices if we choose unitary gates acting on finite dimensional systems.
Let us consider a D-dimensional target system. In that case, gates are D × D unitary matrices. We can follow a similar approach as in Ref. [13] to find that M D jk = 1, due to detΠ j = M D jk detΠ 0 and detΠ j = detΠ 0 , for any j and k. Consequently, M must be a BH matrix. More specifically, a CHPP can be implemented in finite dimensional systems only if the CH matrix specifying the promise is Butson-type with complexity d = D/m for some positive integer m. Moreover, if a CHPP can be formulated for a d-dimensional target, it can also be formulated for any system with dimension that is a multiple of d. This follows from the definition of BH matrices, which implies that BH(p, d) ⊆ BH(p, md). For the canonical case of a qubit target, the CHPP must be specified by a real Hadamard matrix, i.e., the CHPP gets restricted to the HPP already introduced in Refs. [14,15], which may also be implemented in any even dimensional target system.
It is useful to set some nomenclature at this point. We will refer to particular classes of CH-PPs, such as Butson-Hadamard Promise Problems (BHPPs), Fourier Promise Problems (FPPs) and Hadamard Promise Problems (HPPs), when the CH matrices specifying them are Butsontype, Fourier and Hadamard, respectively. Notice that the original definition of the FPP [13] uses all possible permutations of N unitaries, hence the dimension of the target must be a multiple of d = N !. Since we are loosening the number of permutations required for the promise, our definition allows the FPP to be formulated with Fourier matrices whose size, and therefore the dimension of the target system, does not need to be as large as the factorial of the number of unitaries, allowing for more realistic experimental scenarios. Similarly, Ref. [15] introduced a method to construct HPPs from simpler HPPs. It leads to specific relations between p and N depending on the fundamental HPP considered. Their explicit construction is based on Chiribella's task [11] and leads to p = 2 N −1 , which is included in Table I. It can be proven that Taddei et al.'s task [14] is also fundamental in this sense, providing a different scaling for p in terms of N . With our approach instead, we shall be able to build solutions for every HPP, be it fundamental or not. Now, let us show that any BHPP is well defined on a target with compatible dimension, i.e. we can always find sets of unitary gates fulfilling the promise when the dimension of the target is multiple of the complexity of the BH matrix. The construction is as follows: Let us consider the generalized Pauli X and Z gates, defined as: where ⊕ denotes sum modulo d and ω d = exp(2πi/d) is the primitive d-th root of unity. These unitary operators satisfy X d = Z d = I d and the commutation relation which can be extended using mathematical induction to Now, let us define the following p unitaries: where q j are integers, and consider the following p permutations, where U 0 is shifted one position to the left each time: Using the commutation relation (9) it is easy to show that 13) of M , we just need to choose q j = q jk − q (j−1)k for j = 1, ..., p − 1 to obtain a set of p unitaries satisfying the promise, as we wanted to show.

Existence of unitaries satisfying the promise: Continuous variable target
As mentioned in Section 2, there are Complex Hadamard matrices which are not Butson-type. Consequently, they do not define valid CHPPs on finite dimensional target systems. Interestingly, the restriction imposed by the determinant in the finite dimensional case is dropped in the continuous variable (CV) regime. Moreover, as we next prove, unitary gates satisfying the promise do exist for every CH matrix in its dephased form and for each of its columns, thus the CHPP is always well defined for CV target systems.
The construction of unitaries is analogous to that in previous section. Now let us consider the displacement operators where α, β, γ are real numbers, whilex andp are position and momentum operators satisfying [x,p] = iI. Using the Baker-Campbell-Hausdorff formula we have Setting the gates and considering the same p permutations of (11), it can be shown that Given M dephased and an arbitrary column of M , we can choose α = 0, β j = (φ jk −φ (j−1)k )/α and γ j arbitrary for j = 1, ..., p − 1 to have a set of unitaries satisfying the promise.
Notice that if {U j } is a set of unitaries satisfying a specific promise and V is any unitary gate, then the set {V U j V † } fulfills the same promise.

Existence of unitaries satisfying the promise: Minimal sets
From the definition of the problem, we already know that the number of unitaries N required to satisfy a promise specified by a CH(p) matrix is such that p ≤ N !. We will say that a set of unitaries satisfying the promise is minimal if the number of unitaries is the minimum N such that p ≤ N !. In this section we discuss the following question: is it possible to define a minimal set of unitaries satisfying a given promise? Some examples are already known. Indeed, Ref. [13] shows minimal sets of unitaries for some FPPs; since they consider only matrices of order N !, their construction of unitaries is trivially minimal. Also, in [15] a specific HPP is considered for any N , with a construction of unitaries that is minimal for N = 2, 3 and 4, but not for larger N . Meanwhile, our construction above is minimal only for matrices of size p = 2 and 3.
We also investigated the case of a CHPP specified by a CH(4) matrix. In particular, we considered an arbitrary member of the parameterised family defined in Eq. (3). Since this family includes matrices which are not Butson-type, we required unitary gates acting on a CV system. This promise consists on four permutations; therefore, a minimal set of unitaries must have three gates: U 0 , U 1 and U 2 . We chose Π 0 = U 2 U 1 U 0 , Solving for α j and β j , we found solutions for each column and any a ∈ [0, π). Some solutions are the following: • For column k = 0: α j = 0 and β j arbitrary for every j.
Thus, for every CHPP of size 4, minimal sets of unitaries satisfying the promise do exist.
We conjecture that minimal sets of unitaries satisfying a CHPP exist for every size p. However, they may require joint systems as target, just like the construction in Ref. [13]. That is, for some p, keeping the number of unitaries low would demand an increase in the dimension of the target.

Solution using the quantum switch
The quantum switch S is a device that applies a set of unknown gates on a target quantum system in different orders that are determined by a control quantum system. For each basis state |j of the control, a corresponding permutation Π j of the gates is applied on the target, which is prepared in some arbitrary initial state |ψ . Mathematically, If the control is in a superposition of states, then the gates are applied in a superposition of orders (see Fig. 2).
In the literature, it is common to find the expression "N -switch" for a quantum switch of N gates. As we mentioned above, we do not necessarily require all possible permutations, so it makes sense to refer to an (N, p)-switch, i.e., a quantum switch of N gates applied in p different orders. Of course, since there are different combinations of p permutations of N elements, the expression "(N, p)-switch" properly denotes a class of quantum switches. Therefore, the N -switch considering all the N ! permutations, as originally introduced in Ref. [13], is the only quantum switch in the class of (N, N !)-switches. Rigorously speaking, the HPP implemented in Ref. [14] is solved using a (4, 4)-switch and the scaling method proposed in Ref. [15] uses (N, 2 N −1 )-  switches that can be described as nested (2, 2)switches. Note that the exploration of different combinations of permutations of channels was also highlighted in Refs. [21,27,28].
The quantum switch plays a key role in the quantum approach to solving the CHPP, which is a straightforward extension of the protocol for solving the FPP in Ref. [13]. It is as follows: First, consider a CHPP specified by a matrix M ∈ CH(p) and a set of p permutations {Π j } of N unitaries. Suppose the unitaries satisfy the promise for the k-th column of M . Now initialize a control system of dimension p in the state |0 , and a target system of dimension compatible with the problem in an arbitrary state |ψ . The unitary gate M/ √ p is applied on the control system. Since M must be in its dephased form, the joint state becomes (20) Then, applying the corresponding quantum switch we get where we used Eq. (19). Using now the definition of the promise (4) and recognizing the matrix multiplication, we have Applying the inverse M † / √ p on the control, the number k of the column becomes encoded on the control system: (23) Finally, a projective measurement on the control system gives us the solution of the problem deterministically.
The solution of the CHPP using the quantum switch only requires a single use of each gate. Indeed, this can be shown by coupling one highdimensional ancilla state |f as "counter" to each gate [13], whose state evolves from |f to |f + 1 each time the corresponding gate is used, with f ∈ N . More specifically, if the counters are initialized in state |0 , then the state of each counter becomes |1 after applying the quantum switch, since the unitaries are coherently controlled. The solution using the quantum switch is the most efficient solution known to the CHPP, as we discuss in next section.

Solution using fixed-order circuits
The CHPP can also be solved using fixed-order circuits. However, as we discuss next, the solution |j |c 0 Figure 3: Here we show a fixed-order simulation of a (3, 4)-switch. The arrangement of the U i gates in the circuit is the shortest one containing the permutations 012, 021, 120 and 201. This circuit has a two-qubit control register, one target and two ancillary systems. The state |j of the control defines which permutation will be applied to the target system |ψ . The target is routed with the aid of controlled-swap gates which interchange the target and one of the ancillas |a i .
using the quantum switch requires a fewer number of gate queries than the best known fixedorder alternatives, which is referred to as query complexity advantage.

Simulation of the quantum switch
A first way to solve the CHPP using a fixed-order circuit is by simulating the quantum switch in the circuit model [34,41]. The best simulation known requires as many gates as elements are in the shortest common supersequence (SCS) 3 of the permutations involved [34]. The circuit consists of a target and a p-dimensional control system. The gates are applied in the order specified by the SCS and for each extra use of a unitary gate an ancillary system with the same dimension of the target is added [14]. Controlled-swap gates route the target in such a way that it undergoes the required permutation of the gates. Furthermore, the ancillas are used in such a way that they end up being disentangled from the rest of the system. See Fig. 3 for a (3, 4)-switch fixedorder simulation example.
In order to assess the query advantage of the quantum switch against its fixed-order simulation, we have to find the length of the corresponding SCS, which will be equal to the total number s is a sequence such that every si can be recovered by deleting some elements from s . A SCS is a supersequence of minimal length and may not be unique. For example, s = 0120210 is a SCS for the set of sequences {012, 021, 102, 120, 201, 210}. of queries. However, the problem of finding a SCS has been proved to be NP-complete [42] and some approximate algorithms have been reported in the literature (for further details see Ref. [43]). In the case of the SCS containing all the N ! permutations of N elements, its length grows with O(N 2 ) [34] and an upper bound is set by the length of the Koutas-Hu supersequence [44]. In this work, we deal with a broader scenario considering p ≤ N ! permutations, hence the SCS may be shorter. To find it, we proceed by numerical exhaustive search, i.e., we list and sort by length all the sequences shorter than the Koutas-Hu supersequence and for each one we decide if it contains or not the desired set of permutations; the search halts when the first supersequence is found and its length is recorded. In this fashion, we explored the cases N = 3 and N = 4 with varying p, confirming that the total number of queries depends on both N and p, and also on the specific set of permutations. For example, simulating a (3, 4)-switch demands 5 or 6 gate uses, which depends on the set of chosen permutations, with an average of 5.4 queries (see Fig. 4). For the case of the (3, 3!)-switch, 7 calls to the gates are required. Similarly, simulating a (4, 4)-switch requires a number of gate uses in a range from 6 to 9, with an average of 7.43, while simulating all the permutations of 4 gates demands 12 queries.
In Refs. [13,15], each promise problem is specified by the number of gates N . Here, we have seen that the same CHPP can be defined for different values of N . As a consequence, the total number of queries may not be the best parameter to assess the computational advantage of the quantum switch over solutions based on fixed-order circuits solving the same task. We find it useful to introduce the average number of queries per gate (qpg) as a parameter for query complexity advantage. The quantum switch has a constant value of qpg switch = 1 for every CHPP, while its simulation via the shortest common supersequence grows with qpg = O(N ). The simulations of the (3, 4)-and (4, 4)-switches described in the previous paragraph have averages qpg (3,4) = 1.8 and qpg (4,4) = 1.86, respectively, and if we consider all the permutations of 3 and 4 gates, the corresponding simulations of the quantum switch will be qpg (3,3!) = 2.33 and qpg (4,4!) = 3. A thorough description for the case N = 4 is shown in Fig.  5. It can be seen that the quantum switch offers advantage for every p ≥ 2 with the greatest difference for p = N !.

Other approaches
We could ask whether different approaches using fixed-order circuits could solve any arbitrary CHPP as well. In particular, tomographic recon-  struction of the gates is discussed in Ref. [14], with cubically worse performance in N than with the quantum switch; similarly, direct reconstruction of the permutations is still quadratically worse than the quantum switch. Alternatively, the authors of Ref. [35] proposed a causal circuit which solves the original FPP with O(N log N ) queries to the gates (qpg = O(log N )), and in Ref. [15] they extended it to solve the HPP. That is the best fixed-order circuit known to solve these particular tasks for large N and it is conjectured that no causal algorithm can solve them more efficiently.
It is an open question whether this approach can be extended to the general CHPP.
There is one additional scenario that deserves special attention, since it could solve the CHPP also with qpg = 1. It is known from the ddimensional dense coding protocol that we can send a 2-dit message using 1 qudit system when a maximally entangled high-dimensional channel has been previously shared. This information is encoded by applying a generalized Pauli gate on the system and retrieved at the end in a Bellstate measurement [45]. Retrieving the message is equivalent to discriminating which Pauli gate was applied. Consequently, to solve a CHPP where the unitary gates are known to be a certain set of Pauli gates, we could identify each unitary by using it to perform a dense coding protocol and then calculate their permutations; it would solve the CHPP with a single query to each gate, the same as the quantum switch. Notwithstanding, this approach consumes N pairs of maximally entangled qudits (one for each unitary) and requires prior information about the gates. Also, the Bellstate measurement must be performed with respect to the correct basis. Instead, the quantum switch based solution does not consume entanglement nor need prior information about the gates.

Discussion
The introduction of the more general CHPP opens the possibility for experimental realizations of the computational advantage of the quantum switch in higher dimensions, both in terms of the number of permutations and the dimension of the target system. In addition, the more general description via CH matrices should allow these problems to be more readily adapted to different experimental platforms that do not necessarily implement a Fourier or Hadamard transformation directly.
All experimental implementations of the quantum switch have been realized in photonic sys-tems, and most of them have exploited the polarization degree of freedom as either the control or target system [12,5,6,18,24,14]. For higher-dimensional target systems, implementations of the BHPP with the quantum switch requires two photonic degrees of freedom (DOF) with dimension greater than two. Due to the fact that arbitrary d × d unitary operations can be constructed from 2 × 2 beam splitters and phase shifters [46], the path DOF is a natural candidate for the control system. Moreover, multiport beam splitters can be used to implement Hadamard and/or Fourier transformations directly [47,48]. For the target system, a number of transverse DOFs could be used. For example, Heisenberg-Weyl operators can be implemented on the orbital angular momentum of photons using spiral wave plates and other linear devices [49]. Ddimensional states and unitaries can also be implemented using gratings and near-field diffraction via the Talbot effect [50], an approach which could also apply to matter waves [51]. Regarding the implementation of the most general CHPP, a CV target system is required. Particularly, simple photonic realizations could exploit the continuous transverse position/momentum of photons, where the appropriate Heisenberg-Weyl operators can be implemented using lenses and phase devices [52].
Our results might also inspire exploration of promise problems and the quantum switch using non-photonic systems. As noted in Ref. [32], there are a number of systems with continuous degrees of freedom that could be candidates for the quantum switch, including trapped ions or cavity QED systems.
Generalization of the Fourier and Hadamard promise problem to the CHPP also inspires further study from a fundamental point of view. Causal non-separability of the quantum switch has been experimentally confirmed for the case of two gates acting on a qubit target [5,6,9], but a similar proof with gates acting on either higherdimensional or CV systems is still lacking. Furthermore, as far as we are aware, nor has experimental demonstration of causal non-separability of the (N, p)-switch been reported.

Conclusions
We have introduced the Complex Hadamard Promise Problem, a family of computational tasks that includes the previously defined Fourier Promise Problem [13] and Hadamard Promise Problem [14] as limiting cases, and shown how it can be solved using the quantum switch. This generalization allows for the definition of promise problems that can be solved in a wider array of physical control and target systems, including continuous variable target systems. Moreover, it uncouples the size p of the Complex Hadamard matrix and the number of quantum gates N , requiring only that p ≤ N !.
Restricting to the case of finite dimensional target systems, we have shown that these generalized promise problems are restricted to the sub-class of Butson-Hadamard Promise Problems. In that case, the dimension of the target must be compatible with the complexity of the Butson-Hadamard matrix defining the problem. In particular, all Complex Hadamard Promise Problems reduces to the Hadamard Promise Problem when the target system is a qubit. A comparison with related work is summarized in Table I. Also, we have proved that using a more general class of (N, p)-switches to solve the Complex Hadamard Promise Problem provides computational advantages against known fixed-order algorithms in both discrete and continuous variable target systems. To best highlight this advantage, we have introduced the "query per gate" parameter. The lowest value of this parameter is reached by the quantum switch, which has a fixed qpg switch = 1, suggesting that the quantum switch could be considered a benchmark for query complexity.
Our work opens the possibility for experimental implementations of promise problems in new platforms, such as CV photonic systems, trapped ions or cavity QED. Finally, we highlight the necessity of further study on the (N, p)-switch as an indefinite causal order instance and its possible application to other computational tasks.