Fig. 3: Swap circuit.
From: An elegant scheme of self-testing for multipartite Bell inequalities

This graphic represents the partial SWAP gate isometry used to self-test maximally entangled N partite GHZ state \(\left\vert GH{Z}_{N}\right\rangle =\frac{1}{\sqrt{2}}({\left\vert 0\right\rangle }^{\otimes N}+{e}^{\iota \phi (N)}{\left\vert 1\right\rangle }^{\otimes N})\). After the application of the circuit, the \(\left\vert GH{Z}_{N}\right\rangle\) state is extracted from the actual experimental state \(\left\vert {\tilde{\psi }}_{N}\right\rangle\) to the ancillary qubits. Here, H denotes a Hadamard gate, and X1, Y1, X2, Y2, …XN, YN are the operators which act analogously to σx, σy on the actual state \(\left\vert {\tilde{\psi }}_{N}\right\rangle\). As the circuit only depends on the self-testing measurements, this circuit works for the N partite self-testing statements obtained in this work, namely, the self-testing statements for MABK inequalities (Theorem 6), complimentary MABK inequalities (Corollary 6.1), Uffink’s quadratic inequalities (Theorem 7) and Uffink’s complex-valued Bell expressions (Corollary 7.1). As the self-testing measurements for all of these cases are the same, i.e., A(j) = σx and \({A}^{{\prime} {(j)}}={\sigma }_{y}\), the circuit SWAPs the actual state \(\left\vert {\bar{\psi }}_{N}\right\rangle\) (which attains the respective preconditions of these self-testing statements) with the state \({\left\vert 0\right\rangle }^{\otimes N}\) of the registers, such that the final state of the registers corresponds to their respective self-testing maximally entangled N partite GHZ state.