2
$\begingroup$

In the paper, Quantum linear systems algorithms: a primer, available here page 23, the authors discuss encoding a vector in $\mathbb{R^n}$ into qRAM.

For $x \in \mathbb{R}^n$, let $|x \rangle := ||x||_2^{-1}\sum_{i=1}^{n}x_i |i\rangle$ be a quantum state on $\lceil logn \rceil$ qubits. We would like to have an operation $f$ that takes some finite precision representation of $x$, denoted $\tilde{x}$, and outputs the state $|x \rangle$ along with $||x||_2$.

So, $f:\tilde{x} \mapsto |\: \widetilde{||x||_2} \rangle |x \rangle$, where $\widetilde{||x||_2}$ is a computational basis state encoding of the value of $||x||_2$. The author/s state, $\widetilde{||x||_2}$ can be easily loaded into a computational register using CNOT gates. I'm not sure how this is achieved.

Take $n=3$, and a non-unit vector, say $(1,1,1)$. How can the norm of this vector be loaded into a register using CNOT gates?

$\endgroup$
2
$\begingroup$

The issue is not about loading the norm of the vector - this can be taken into account automatically. Let me give an example. This is not a complete explanation of how the state preparation procedure works, but illustrates the point.

Let's say that you want to make a state $\sum_ix_i|i\rangle$, up to normalisation, and let's assume you have a bound $x_i\leq\delta$ for some $\delta$ and all $i$ (you might argue this is as problematic to know as the normalisation, but that's another debate, and you can at least make some reasonable estimates often).

So, now imagine a matrix $$ A=\left(\sum_i|x_i\rangle\right)\langle 0|. $$ You can embed this in a Hermitian matrix $H$, using a structure like $$ H=\left(\begin{array}{cc} 0 & A \\ A^T & 0 \end{array}\right), $$ and you can implement an evolution $$ e^{-i\delta t X\otimes H}|0\rangle|0\rangle $$ for some $\delta t$ such that $\delta t\delta\ll 1$ ($X$ is the standard Pauli matrix, applied to some ancilla qubit), after which you measure the top qubit. If the answer is $|1\rangle$, with high probability you've produced the state you want in the second register, and it is correctly normalised by virtue of the renormalisation that happens upon collapse of the wavefunction. If the answer is $|0\rangle$, you can just try again, and keep going until you're successful. If you did actually want to compute the norm, you could simply estimate the probability of getting the $|1\rangle$ answer in the above procedure, but for what you're talking about, you don't need to.

$\endgroup$
  • 1
    $\begingroup$ Expand the answer about $\delta t$. Like making it too small like $0$ would just give you failure all the time. Only gave small inequality, not large enough. $\endgroup$ – AHusain Jul 22 at 19:03
  • $\begingroup$ @AHusain I did say this wasn't actually the way you'd do it! I think you can actually let $\delta t$ be any size because the output is something like $\cos(N\delta t)|0\rangle|0\rangle-i\sin(N\delta t)|1\rangle|\text{target}\rangle$, where $N$ is the norm of the state $\sum_ix_i|i\rangle$ $\endgroup$ – DaftWullie Jul 23 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.