EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS Vol. 16, No. 3, 2023, 1695-1704 ISSN 1307-5543 – ejpam.com Published by New York Business Global A note on quantum gates SWAP and iSWAP in higher dimensions Arash Pourkia College of Engineering and Technology, American University of the Middle East, Kuwait Abstract. We present explicit descriptions for the swap gate and the iswap gate in any arbitrary dimension d ≥ 2, in terms of permutation matrices. Moreover, we unify these gates by introducing a more general gate xSWAP which includes SWAP and iSWAP for x = 1 and x = i (i.e. √ −1), respectively. The higher dimensional xSWAP e.g., the swap and iswap gates for d > 2 serve as quantum logic gates that operate on two d-level qudits. For d = 2, it is well known that iSWAP unlike SWAP is universal for quantum computing. We will prove this fact for xSWAP in any dimension d, when x ̸= ±1. Our explicit representation of xSWAP by a permutation matrix facilitates the proof, greatly. 2020 Mathematics Subject Classifications: 81P68, 81P40 Key Words and Phrases: Qudits, Quantum logic gates, Universal gates, Entangling gates 1. Introduction Applications of d-level qudits for d ≥ 3 have been found to have many advantages over the conventional qubits (d = 2) in quantum computing and quantum information. [7–9, 11–13, 17]. As in the case of d = 2, to make it possible to work with any d-level qudits one needs to have quantum logic gates that could operate on them. The familiar swap gate (SWAP) and iswap gate (iSWAP) are among most important quantum gates in quantum computing (for d = 2). Their generalization from different point of views, and their physical implementation are active topics of research [2, 4– 6, 10, 14–16]. Our aim in this work is to explicitly extend the well known swap and iswap gates from dimension d = 2 to any dimension d ≥ 2, from the point of view of their representations in terms of permutation matrices. To do this we first unify these gates by introducing a more general gate xSWAP which includes SWAP and iSWAP for x = 1 and x = i ( √ −1), respectively. These higher dimensional gates are quantum logic gates for d-level qudit DOI: https://doi.org/10.29020/nybg.ejpam.v16i3.4824 Email address: arash.pourkia@aum.edu.kw (A. Pourkia) https://www.ejpam.com 1695 © 2023 EJPAM All rights reserved. A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1696 systems. Our explicit representation in terms of permutation matrix will play a crucial role in helping us to prove that for x ̸= ±1, xSWAP is a universal quantum gate, analogous to the well known fact about iSWAP for d = 2. To do this we will use the universality criterion in [3] and the non-entangling criteria in [1]. This paper is organized as follows. In Section 2, we recall some preliminary notions and notations. In Section 3 in Definition 1, we give an explicit description for the higher dimensional xSWAP (hence SWAP and iSWAP) in terms of permutation matrices. In Section 4 in Theorem 1, we prove that the quantum gate xSWAP is universal for x ̸= ±1. We will finish this paper with concluding remarks in Section 5. 2. Preliminaries and Notations Let us recall that in quantum computing quantum logic gates can be represented by unitary matrices on a Hilbert space H with dimension d. The qubit is a basic unit of quantum information in dimension d = 2. The qudit is a generalization of the qubit to a larger Hilbert space of dimension d ≥ 2. In dimension d = 2, i.e. for qubit systems, two very important examples of quantum logic gates are the swap gate (SWAP) denoted here by S and the iswap gate (iSWAP) denoted here by iS. They are defined as follows. S : H ⊗ H → H ⊗ H (1) S(u⊗ v) = v ⊗ u iS : H ⊗ H → H ⊗ H (2) S(u⊗ v) = i(v ⊗ u), when v ̸= u and, S(u⊗ u) = u⊗ u for all u and v in H . For our purpose in this paper it is enough to consider H = Cd, as this is enough for quantum computing. Throughout this paper we will use the standard basis for Cd alongside the ket from Bra–ket notation common in quantum computing literature ( { |0⟩, |1⟩, |2⟩, · · · , |d− 1⟩ } ). A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1697 By |ab⟩ we mean |a⟩ ⊗ |b⟩, where ⊗ stands for the tensor product. Therefore, for ex- ample in dimension d = 2, for C2 ⊗C2, we use the computational basis for 2-qubit states,{ |00⟩, |01⟩, |10⟩, |11⟩ } . Or in dimension d = 3, for C3 ⊗ C3, we use the computational basis for 2-qudit states, { |00⟩, |01⟩, |02⟩, |10⟩, |11⟩, |12⟩, |20⟩, |21⟩, |22⟩ } . Let us also recall the following. A quantum logic gate must be unitary by definition. A quantum logic gate is entangling if it can produce entangled states by acting on unentan- gled ones. A 2-qudit gate G (i.e. a gate that operates on two d-level qudits) is universal if the set containing G and all 1-qudit gates is enough to generate all qudit gates. It is well known that, a quantum logic gate operating on two d-level qudits is universal for quantum computing [6], if and only if it is entangling [3]. 3. SWAP and iSWAP in higher dimensions and general xSWAP For d = 2 the SWAP and iSWAP defined by (1) and (2) are represented by the following permutation matrices S4 and iS4 (or S and iS for short if there is no confusion about the dimensions) S4 =  1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1  , iS4 =  1 0 0 0 0 0 i 0 0 i 0 0 0 0 0 1  (3) Before we move to the higher dimensions let us first unify these gates by introducing a more general gate xSWAP (denoted here by xS4 or xS for short) as follows: xS4 =  1 0 0 0 0 0 x 0 0 x 0 0 0 0 0 1  (4) where x = eiφ and φ belongs to the real numbers. This choice of x guarantees the unitarity of xS. Clearly, x = 1 and x = i correspond to S and iS, respectively. The representations in (3), and (4) are basically the results of the following fact. From (1) and (2), for x = 1 and x = i, xS must satisfy xS(|00⟩) = |00⟩ xS(|01⟩) = x|10⟩ xS(|10⟩) = x|01⟩ xS(|11⟩) = |11⟩ A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1698 Now going one step higher in dimension, for d = 3, using the same definitions (1) and (2), the unified xswap gate xS9 : C3 ⊗ C3 → C3 ⊗ C3 (or xS for short) must satisfy xS(|00⟩) = |00⟩ xS(|01⟩) = x|10⟩ xS(|02⟩) = x|20⟩ xS(|10⟩) = x|01⟩ xS(|11⟩) = |11⟩ xS(|12⟩) = x|21⟩ xS(|20⟩) = x|02⟩ xS(|21⟩) = x|12⟩ xS(|22⟩) = |22⟩ The above relations easily imply that for x = eiφ where φ is a real number xS9 =  1 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 1  This is xSWAP in dimension d = 3. For x = 1 and x = i, it provides the gates SWAP and iSWAP in dimension d = 3 (S9 and iS9), respectively. A similar argument for d = 4 yields xSWAP (denoted below by xS16), as follows: A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1699 xS16 =  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1  Here x = 1 and x = i correspond to SWAP and iSWAP in dimension d = 4, respec- tively. At this point it is not hard to see that the matrix xSd2 (or xS for short) defined below is the xSWAP gate for any dimension d. Definition 1 (xSWAP). For any d ≥ 2 and for any x = eiφ in which φ belongs to the real numbers, we define the xSWAP (denoted by xS below) by the following relations: xSi,j = x, for i = (t− 1)d+ s and j = (s− 1)d+ t, (5) where 1 ≤ t ≤ d, 1 ≤ s ≤ d and t ̸= s xSi,j = 1, for i = (t− 1)d+ s and j = (s− 1)d+ t, where t = s = 1, 2, · · · , d and, xSi,j = 0 elsewhere. 4. xSWAP is a universal quantum logic gate when x ̸= ±1 A quantum gate must be unitary by definition. A 2-qudit gate (i.e. a gate operating on two d-level qudits) is universal if and only if it is entangling [3]. It is very easy to see A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1700 that, in any dimension d and for any unit complex number x = eiφ, xSWAP is unitary. However, the entangling property of xSWAP is not obvious for dimensions d > 2 (for d = 2 and x = i this fact is well known and easy to prove). In this section we will prove that xSWAP is a universal quantum gate when x ̸= ±1. We use the non-entangling criteria in [1]. To show that any operator R : H ⊗H → H ⊗H is entangling, it is enough to prove neither R nor RS can be factored as X ⊗ Y , where X and Y are arbitrary operators on H , i.e., X, Y : H → H . First, we illustrate this for for d = 3 i.e. for xS9 and (xS9)(S9). Let xS9 = X ⊗ Y , where X and Y are any two 3 by 3 matrices. This means xS9 =  1 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 1  =  x11 x12 x13 x21 x22 x23 x31 x32 x33 ⊗  y11 y12 y13 y21 y22 y23 y31 y32 y33  =  x11y11 · · · · · · · · · · · · · · · · · · · x11y33 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · x33y11 · · · · · · · · · · · · · · · · · · · x33y33  Then, comparing only the boxed diagonal entries in the big matrices above we must have (x11y11)(x33y33) = (x11y33)(x33y11), which implies the contradictory result 1 = 0. Thus, xS9 can never be factored as X ⊗ Y . Similarly, for the equality (xS9)(S9) = X ⊗ Y to happen, we need to have: A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1701 (xS9)(S9) =  1 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 1  =  x11 x12 x13 x21 x22 x23 x31 x32 x33 ⊗  y11 y12 y13 y21 y22 y23 y31 y32 y33  =  x11y11 · · · · · · · · · · · · · · · · · · · x11y33 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · x33y11 · · · · · · · · · · · · · · · · · · · x33y33  Again, comparing only the boxed diagonal entries in the big matrices above we must have (x11y11)(x33y33) = (x11y33)(x33y11), which implies 1 = x2. Therefore, for x ̸= ±1, (xS9)(S9) can not be factored as X ⊗ Y . The general result and its proof is presented in the following theorem. Theorem 1. For any d ≥ 2 and for any x = eiφ in which φ is a real number, the xSWAP from Definition 1 is unitary and it is entangling when x ̸= ±1. Hence, for x ̸= ±1, xSWAP is a universal quantum gate for d-level qudit systems. Proof. The unitarity of xSWAP is obvious because of the choice x = eiφ. As for the entangling property, we need to show that for x ̸= ±1 none of xS and (xS)(S) can factor as X ⊗ Y , where X and Y are d by d matrices [1]. For both cases, we assume the opposite, i.e., we assume xS = X ⊗ Y or (xS)(S) = X ⊗ Y . Then, using Definition 1, we compare the following equality, (x11y11)(xddydd) = (x11ydd)(xddy11) (6) A. Pourkia / Eur. J. Pure Appl. Math, 16 (3) (2023), 1695-1704 1702 which involves certain diagonal entries from the tensor product matrix X ⊗ Y with the same equality involving the same entries from the matrix S or (xS)(S)). The above mentioned comparison for the case of xS = X ⊗ Y implies 1 = 0, which is impossible regardless of the value of x. Also for the case of (xS)(S) = X ⊗ Y it implies x2 = 1. This finishes the proof. Remark 1. To directly prove a 2-qudit gate G is universal one needs to show that the set containing G and all 1-qudit gates is enough to produce other qudit gates. Showing this directly is not always easy even in dimension d = 2. This is why we have instead used the powerful Brylinskis’ criterion [3] and the the non-entangling criteria from [1]. 5. Concluding remarks In the recent decades, there has been an ever increasing interest in applications of d-level qudits, for d ≥ 3, in quantum computing and quantum information. This is due to their advantages over the conventional qubits (i.e., d = 2). These advantages include larger storing and processing space for information, smaller number of qudits required to span the state space, better noise-resistant, simplifying quantum logic, and more. More- over, there has been very interesting developments regarding the physical implementation of qudit-based quantum computing systems [7–9, 11–13, 17]. Naturally, to make it possible to work with d-level qudits one needs to have quantum logic gates that could operate on them. In the present paper we have generalized the swap gate and the iswap gate to any dimension d ≥ 2, in terms of permutation matrices. We have unified these gates by introducing a more general gate xSWAP for x = eiφ where φ is a real number. Moreover, we have shown that xSWAP is universal for quantum computing when x ̸= ±1. These higher dimensional gates can serve as quantum logic gates acting on two d-level qudits. Let us conclude by mentioning some future research directions related to the present work. It would be interesting to generalize the xSWAP further by using different variables x1, x2, x3, etc., instead of only one variable x. Using the definition to prove the universality is usually not very easy even in dimension d = 2 (refer to Remark 1). However, it would be still interesting and useful to find such a direct proof based on the definition. These research directions will be pursued in a sequel to this paper. Acknowledgement The author would like to thank referees for their invaluable feedback which helped to greatly increase the quality and the presentation of this work. I would also like to thank Dr. Sinan Kapçak for introducing me to the computer algebra system SageMath which was useful in testing the validity of some formulas before finding the general proof for REFERENCES 1703 them. Last but not least, I would like to thank Mrs. Elena Ryzhova for helping with the proofreading of this paper and for fruitful conversations. References [1] Gorjan Alagic, Michael Jarret, and Stephen P. Jordan. Yang-Baxter operators need quantum entanglement to distinguish knots. Journal of Physics A: Mathematical and Theoretical, 49(7), 2016. [2] Monika Bartkowiak and Adam Miranowicz. Linear-optical implementations of the iSWAP and controlled NOT gates based on conventional detectors. J. Opt. Soc. Am. B, 27:2369–2377, 2010. [3] JL Brylinski and R Brylinski. Universal quantum gates. Mathematics of Quantum Computation. Chapman and Hall/CRC, first edition, 2002. [4] Garcia-Escartin J. C. and Chamorro-Posada P. A SWAP gate for qudits. Quantum Inf Process, 12:3625–3631, 2013. [5] Peng Xu. et al . Realization of the iSWAP-like gate among the superconducting qutrits. Chinese Phys. B, 32(020306), 2023. [6] Adriano Barenco et al. Elementary gates for quantum computation. Phys. Rev. A, 52, 1995. [7] Kaszlikowski D. et al. Quantum cryptography based on qutrit Bell inequalities. Phys. Rev. A, 67:656, 2003. [8] Kues M. et al. On-chip generation of high-dimensional entangled quantum states and their coherent control. Nature, 546:622–626, 2017. [9] Lanyon B. P. et al. Simplifying quantum logic using higher-dimensional Hilbert spaces. Nat. Phys., 5:134–140, 2008. [10] Marco Fiorentino et al. Single-photon two-qubit SWAP gate for entanglement ma- nipulation. Phys. Rev. A, 72, 2005. [11] Neeley M. et al. Emulation of a quantum spin with a superconducting phase qudit. Science, 325:722–725, 2009. [12] Shlyakhov A. R. et al. Quantum metrology with a transmon qutrit. Phys. Rev. A, 97(2), 2018. [13] Soltamov V.A. et al. Excitation and coherent control of spin qudit modes in silicon carbide at room temperature. Nature Communications, 10, 2019. [14] Yan Guo-an, Qiao Hao-xue, and Lu Hua. Quantum iSWAP gate in optical cavities with a cyclic three-level system. Quantum Inf Process, 17(71), 2018. REFERENCES 1704 [15] Nielsen M. and Chuang I. Quantum Computation and Quantum Information. Cam- bridge University Press, 10th anniversary edition, 2010. [16] Colin M. Wilmott and Peter R. Wild. On a generalized quantum SWAP gate. Inter- national Journal of Quantum Information, 10(3), 2012. [17] Wang Y, Hu Z, Sanders B.C., and Kais S. Qudits and high-dimensional quantum computing. Front. Phys., 8, 2020.