I am trying to use the paper "A Realizable GAS-based Quantum Algorithm for Traveling Salesman Problem (2022)". However, it never explains how the index converter works, beyond it being a classical lookup table.
What I need help with is essentially the following: I have two n-qubit long registers $|r_i\rangle, |r_j\rangle$. I want to transform this state into $|r_i\rangle |P[r_i, r_j] \rangle $, where $P$ is the table I am trying to access. My first instinct is to just create a unitary matrix that maps each input to each output, but such a matrix would scale in memory like $(2n)^2$, which is not ideal. Is there a more efficient way of doing this?