5
$\begingroup$

I have an algorithm that uses QRAM, after accessing the given QRAM that store M d-dimensional classical vectors, the state of the index register and the data register become entangled. But for now I don't have the QRAM black box, I just initialize the state of both systems by providing an array value to the registers at once using initialize function that exists in the qiskit module. My question is I have assigned the value 0 for non-visible basis. Is that ok?

$\endgroup$
2
$\begingroup$

If you are talking about the qRAM for encoding real numbers in amplitudes of a quantum system yes. Basically, you assume without loss of generalities that your problem/vector is of size a power of 2. But if your problem is not exactly of this type, we just pad with 0s. When you apply a quantum algorithm, you just need to be sure you are doing the computation you want.

$\endgroup$
  • $\begingroup$ Yes, sir thank you very much !!! that is what i want, encoding real number vectors to the amplitude. But as the dimension of the vector increased the result will be not expected. The algorithm that i want is to estimate the Euclidean distance between a single and a set of point (by taking the average). $\endgroup$ – Aman Sep 29 '18 at 14:43
  • 1
    $\begingroup$ The swap Test adapted for distance ? $\endgroup$ – cnada Sep 29 '18 at 22:50
  • $\begingroup$ Yes sir, when the number of points in the set and or the number of dimension is increased i loose a lot. What shall i do ?? I am in big trouble!! $\endgroup$ – Aman Sep 30 '18 at 11:06
  • 1
    $\begingroup$ Thank you every one!! I found it. Since the algorithm uses swap gate I was wrong on selecting the qubits that exchanged. $\endgroup$ – Aman Oct 10 '18 at 19:59
  • 1
    $\begingroup$ @Aman You mean that if we have our vectors requiring 3 qubits, the first on (q1,q2,q3) and the second (q4,q5,q6), you mean that we should swap (q1,q6), (q2,q5) and (q3,q4) instead of (q1,q4), (q2,q5), (q3,q6)? $\endgroup$ – cnada Oct 10 '18 at 22:15

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.