QSWAP Algorithms
System-Only QSWAP Algorithms
The QSWAPAlgorithm
and QSWAPMSAlgorithm
implement the swapping algorithm presented in this
paper to simulate the (second order) trotterized time evolution
of a system of qubits on a device with linear connectivity. They only differ in the way they
implement multi-qubit gates: the QSWAPAlgorithm
uses the CNOTAlgorithm,
while QSWAPMSAlgorithm
uses the VARIABLEMSXXAlgorithm.
In order to implement two-qubit gates between qubits that are not nearest neighbors, the algorithm uses a SWAP network to shuffle the order of the logical qubits, so that each pair of logical qubits is encoded in a pair of nearest neighboring physical qubits at least once during the swapping procedure.
The SWAP network alternates even and odd layers of SWAP gates
\[ U_{SWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \]
where the even layers apply the SWAPs to the even indices, and the odd layers to the odd indices. Indicating by a dash the (logical) qubits being swapped, we have
Even layer: \[ 0 - 1 \ \ 2 - 3 \ \ 4 - 5 \ \] Odd layer: \[ 0 \ \ 1 - 2 \ \ 3 - 4 \ \ 5 \ \]
This swapping procedure shuffles the pairs that are found next to each other at every layer. After \( 2N \) layers of this external swap network, the logical qubits recover their original ordering. During the swapping, all logical qubits are found next to each other at least once, and the relevant interactions can be implemented.
System-Bath QSWAP Algorithms
Similar to the system-only algorithms, the SystemBathQSWAPAlgorithm
and the
SystemBathQSWAPMSAlgorithm
implement the swapping procedure described above for a spin system
coupled to a non-interacting spin bath, and they only differ in the multi-qubit gates implementation.
The connectivity graph between the qubits consists of three parallel linear chains, with the corresponding qubits from each chain coupled with each other. The central chain represents the system qubits, while the two external chains the bath qubits. Since the bath is non-interacting, only the system qubits are swapped.