# Understanding the association rule between classical to quantum data $|x\rangle=\frac{1}{|\vec x|_2}\sum_{i=1}^d x_i|i\rangle$

I've been reading the paper on Quantum Hopfield Networks by Rebentrost et al. and I'm not sure to quite understand the association rule they mention on page 2.

Here's what they say :

Consider any $$d$$-dimensional vector $$\vec{x} = [x_1,x_2,...,x_d]^T$$. We associate it to the pure state $$|x\rangle$$ of a $$d$$-level quantum system according to $$\vec{x} \rightarrow |\vec{x}|_2 \phantom{a}|x\rangle$$ where $$|\vec{x}|_2$$ is the $$l_2$$-notm of $$\vec{x}$$ and $$|x\rangle$$ is given by $$|x\rangle = \frac{1}{|\vec{x}|_2} \sum_{i=1}^d{x_i|i\rangle}$$

Usually, when I don't understand a rule like this one, I try an example I try to build my understanding from it.

So let $$\vec{x} = [1,0,1]^T$$. We have that $$|\vec{x}_2| = \sqrt{2}$$ and therefore $$|x\rangle = \frac{1}{\sqrt{2}} \big( 1*|1\rangle + 0*|2\rangle + 1*|3\rangle \big)$$ which doesn't make a lot of sense to me (in fact, usually when it comes to Quantum Computing, anything that deviates from the computational basis is confusing for me). From the way I see it, this is a quantum superposition. What I don't understand however, what kind of basis is this ?

Another way of phrasing this would be : How do I chose my initial vector such that the resulting vector from this association rule is in the computational basis?

It may be easier to understand how this works in terms of the computational basis if you choose $$d$$ to be some power of $$2$$. So let $$d=2^n$$ and then we will use $$n = \log_2 d$$ qubits to represent the quantum system. Then the indices $$i=0,\dots, d-1$$ (starting from $$i=0$$ for convenience) can be represented in their binary form $$i := i_{n} i_{n-1} \dots i_1$$using $$n$$ bits, and we assign this binary form a value: $$i = \sum_{k=1}^n i_k 2^{k-1}$$
and you can replace every basis state $$|i\rangle$$ in the encoding rule with its binary representation $$|i_{n} i_{n-1} \dots i_1\rangle$$ to represent the encoded state in terms of the computational basis of qubits.
Here's an example with $$n=2$$, and let $$\vec{x} = [a, b, c, d]^T$$ be the vector. We use the encoding rule to write \begin{align} |x\rangle &= \frac{1}{|\vec{x}|_2} \sum_{i=0}^{d-1}{x_i|i\rangle} \\&=\frac{1}{|\vec{x}|_2} \left(a|0\rangle + b|1\rangle + c|2\rangle + d|3\rangle\right) \\&=\frac{1}{|\vec{x}|_2} \left(a |00\rangle + b|01\rangle + c|10\rangle + d|11\rangle\right) \end{align} where in the last line I just replaced each $$i$$ with its binary representation $$i_2 i_1$$. This would still work if we had access to $$n>2$$ qubits and in general $$n \geq \lceil \log_2 d \rceil$$ qubits are sufficient for representing a $$d$$-dimensional quantum system. There are some minor adjustments needed if $$d$$ is not a power of $$2$$ but these are mostly procedural.
• Its just a matter of representation - the information contained in the state isn't changing at all. Its the same way I could write either $3+5 = 8$ (decimal) or $0011 + 0101 = 1000$ (binary) as these statements both say the same thing in their respective bases. Commented Aug 20, 2021 at 4:04