# Is the square-root-of-SWAP for a pair of 4-dimensional qudits isomorphic to two square-root-of-SWAPS for two pairs of qubits?

This may be a very naïve question indicative of a lot of confusion, but I am trying to understand more about Hamiltonian simulation. I'm starting to intuit that the $$n^{th}$$-root-of-SWAP acting on a single pair of qubits somehow corresponds to what's meant by Hamiltonian simulation of a SWAP gate (much as a Lie algebra is to a Lie group). But what about the $$n^{th}$$-root-of-SWAP qutrits or qudits, with $$d=4?$$

For example consider a pair of SWAP gates acting on four qubits; the first SWAP gate swaps the first two qubits, and the second SWAP gate swaps the second two qubits. That is, consider a two-qubit gate such as $$\mathsf{SWAP}\otimes\mathsf{SWAP}$$.

The $$16\times 16$$ matrix $$\mathsf{SWAP}\otimes\mathsf{SWAP}$$ of such a gate may be as below:

$$\mathsf{SWAP}\otimes\mathsf{SWAP}=\begin{pmatrix} 1 & & & & & & & & & & & & & & & &\\ & & 1 & & & & & & & & & & & & & &\\ & 1 & & & & & & & & & & & & & & &\\ & & & 1 & & & & & & & & & & & & &\\ & & & & & & & & 1 & & & & & & & &\\ & & & & & & & & & & 1 & & & & & &\\ & & & & & & & & & 1 & & & & & & &\\ & & & & & & & & & & & 1 & & & & &\\ & & & & 1 & & & & & & & & & & & &\\ & & & & & & 1 & & & & & & & & & &\\ & & & & & 1 & & & & & & & & & & &\\ & & & & & & & 1 & & & & & & & & &\\ & & & & & & & & & & & & 1 & & & &\\ & & & & & & & & & & & & & & 1 & &\\ & & & & & & & & & & & & & 1 & & &\\ & & & & & & & & & & & & & & & 1 &\\ \end{pmatrix}.$$

Notice that $$\mathsf{SWAP}\otimes\mathsf{SWAP}$$ is unitary (by virtue of it being a permutation matrix) and also hermitian (by virtue of it being symmetric around the diagonal). This I believe is isomorphic to a SWAP gate acting to swap a pair of qudits ($$d=4$$).

I'd like to see if I can somehow do a local Hamiltonian simulation to simulate such a gate, which may be part of a larger simulation. For example, I'd like to act locally on one of the pairs of qubits, and also act locally on the other of the pair of qubits; but I'm not sure if I'm missing something. The matrix $$\mathsf{SWAP}\otimes\mathsf{SWAP}$$ does not seem to be composed of a sum of two separate hermitian matrices.

Nonetheless, it might make sense to simulate such a matrix with repeated applications of an "$$n^{th}$$-root-of-SWAP" on the first pair of qubits and an "$$n^{th}$$-root-of-SWAP" on the second pair of qubits?

Is $$\sqrt {\mathsf{SWAP}}$$ acting on a pair of 4-dimensional qudits isomorphic to $$\sqrt {\mathsf{SWAP}}\otimes\sqrt{\mathsf{SWAP}}$$ acting on two pairs of qubits?

• Why do you want swap $\otimes$ swap to be a sum of two Hermitian matrices? If each swap gate is local then they are best described as a tensor product of local operations, just as you have done. Sep 10, 2021 at 19:11
• I'd like to take square roots or the nth roots. For example is the square-root of SWAP for 4-d qudits equal to (the square root of SWAP)$\otimes$(the square root of SWAP) for two 2-d qubits? Can I still do that locally? Sep 10, 2021 at 20:04
• If I understand correctly, are you asking whether $\sqrt{S\otimes S}=\sqrt{S}\otimes\sqrt{S}$? If so, the answer is yes, in the sense that both square to the same thing! Sep 10, 2021 at 20:10

Swapping 4-level qudits is equivalent to swapping pairs of qubits. Because you can encode a 4-level qudit into a pair of qubits. Similarly, swapping 8-level qudits will be equivalent to swapping triplets of qubits. The swap gate is convenient enough that this should hold regardless of how you map the 4-level qudit into the qubits (e.g. whether you map qudit |2> to big endian qubits |10> or little endian qubits |01>).

That being said, in general it is not the case that $$\sqrt{U \otimes U}$$ is defined to be $$\sqrt{U} \otimes \sqrt{U}$$ even though $$(\sqrt{U} \otimes \sqrt{U})^2 = U \otimes U$$, so you can't go from "swapping qubit pairs is the same as individual qubit swaps" to "the square root of swapping qubit pairs is the same as individual square roots of swapping qubits".

Let the principle square root of $$U$$ be what you get by computing its eigendecomposition, halving the angles of the eigenvalues in polar coordinates, then putting the matrix back together. Under this definition $$\sqrt{SWAP \otimes SWAP}$$ looks like this:

Whereas $$\sqrt{SWAP} \otimes \sqrt{SWAP}$$ looks like this:

You can see they're not the same. In particular, the former entangles qubits that the latter does not.

• @MarkS It depends how you define it. Some square roots of the 4-level qudit swap gate decompose into a tensor product of square roots of qubit swap gate, and some don't. For example, the "natural" square root of the 4-level qudit swap gate, the one you get from doing phased phase estimation, treated as a qubit pair swap, creates entanglement between the separate qubit pairs. Sep 10, 2021 at 20:52
• Thanks - what is the "natural" root of the 4-level qudit swap gate that creates entanglement between the separate qubit pairs? I think that's where I'm getting confused; on the one hand two square root of swaps can be tensored together as you and @QuantumMechanic indicate, but on the other hand there "should" be entanglement between respective elements of the pairs. Sep 10, 2021 at 20:59
• @MarkS E.g. consider that sqrt(X tensor X) is used in ion traps as an entangling gate, whereas sqrt(X) tensor sqrt(X) is not an entangling operation even though sqrt(X) tensor sqrt(X) does square to X tensor X. It's because you have to be careful about what you mean by "square root"; there are multiple square roots to choose from. Sep 10, 2021 at 21:04
• @MarkS Look at the middle state display in the following link. It shows the matrix: https://algassert.com/quirk#circuit={%22cols%22:[[1,%22H%22,%22H%22,%22H%22,%22H%22],[%22H%22,%22inputA4%22,1,1,1,%22+=A4%22],[%22%E2%80%A2%22,1,%22Swap%22,1,%22Swap%22],[%22%E2%80%A2%22,%22Swap%22,1,%22Swap%22],[%22H%22],[%22Z^%C2%BD%22],[%22H%22],[%22%E2%80%A2%22,%22Swap%22,1,%22Swap%22],[%22%E2%80%A2%22,1,%22Swap%22,1,%22Swap%22],[%22H%22],[1,%22Amps8%22],[],[],[],[],[],[],[],[1,1,1,1,%22Swap%22,1,%22Swap%22],[1,1,1,%22Swap%22,1,%22Swap%22],[1,%22Amps4%22]]} Sep 10, 2021 at 21:06
• @MarkS that's right Sep 23, 2021 at 15:22