3

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?

Mark Spinelli
  • 11,947
  • 2
  • 19
  • 65
  • 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. – Quantum Mechanic Sep 10 '21 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? – Mark Spinelli Sep 10 '21 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! – Quantum Mechanic Sep 10 '21 at 20:10

1 Answers1

3

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:

enter image description here

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

enter image description here

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

Craig Gidney
  • 36,389
  • 1
  • 29
  • 95
  • @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. – Craig Gidney Sep 10 '21 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. – Mark Spinelli Sep 10 '21 at 20:59
  • 1
    @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. – Craig Gidney Sep 10 '21 at 21:04
  • 1
    @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]]} – Craig Gidney Sep 10 '21 at 21:06
  • @MarkS I edited the comment. – Craig Gidney Sep 10 '21 at 21:08
  • @MarkS The circuit is using phase estimation on the SWAP tensor SWAP operation to get a qubit representing whether we're in the +1 or -1 eigenspace, then phasing that qubit by 90 degrees, then undoing the phase estimation. This applies a square root of the operation (as long as its eigenvalues are only +1 or -1; otherwise you need more involved phase estimation). This is a standard technique; I just applied it to the specific gate you were interested in. – Craig Gidney Sep 10 '21 at 21:17
  • I see! I think. Awesome! I understand the circuit I think. The evals are $\pm$1 because SWAP$^2=\mathbb I$. The $S$ gate in the middle takes the square-roots. After the last $H$ the ancilla reverts back to $\vert 0\rangle$. Wow, that's cool! – Mark Spinelli Sep 10 '21 at 21:35
  • Sorry to bother again - the simplicity of your circuit suggests to me that this a very standard to use QPE for nth-root finding. But two quick follow-ups to test my understanding - (1) if I wanted the $4^{th}$ root instead of the square root, I'd use the $T$ gate instead of the $S$ gate? and (2) if instead of SWAPs I have another circuit $A$ such that $A^4=\mathbb I$ then I'd use two ancillas instead of just the one (as the e'vals are $(\pm i, \pm 1)$? – Mark Spinelli Sep 23 '21 at 15:11
  • 1
    @MarkS that's right – Craig Gidney Sep 23 '21 at 15:22