I am trying to implement the quantum k-means algorithm proposed in https://arxiv.org/pdf/1909.04226.pdf.
In the equation (8) of the manuscript we need to implement a state $|\psi\rangle = \frac{1}{\sqrt{2}}\left[|0\rangle \otimes |X_i\rangle + |1\rangle \otimes |X_j\rangle\right]$ like the one shown in the title, where $X_i$, $X_j$ are normalised vectors.
One solution proposed in the paper for implementing the $|\psi\rangle$ state is to use Hadamard and CSWAP gates. Assuming that $X_i$ and $X_j$ can be prepared with one qubit each, if one apply a Hadamard gate to the first qubit and afterwards a CSWAP gate, we would have the state $|\gamma\rangle = \frac{1}{\sqrt{2}}\left[|0\rangle \otimes |X_i\rangle \otimes |X_j\rangle + |1\rangle \otimes |X_j\rangle \otimes |X_i\rangle \right]$. So I need to somehow "get rid" of the leftmost qubit. Here are some of the things I have tried/thought about until now:
- As the $|\gamma\rangle$ state is not separable, we can't use the partial trace or just reset the leftmost qubit.
- We can apply a SWAP gate between the leftmost qubit and a new qubit q3, because then equation (9) of the manuscript wouldn't hold.
Any ideas on how to encode the $|\psi\rangle$ state with or without using the mentioned procedure ?