4
$\begingroup$

As the title states.

I am a Machine Learning Engineer with a background in physics & engineering (post-secondary degrees). I am reading the Tensorflow Quantum paper. They say the following within the paper:

One key observation that has led to the application of quantum computers to machine learning is their ability to perform fast linear algebra on a state space that grows exponentially with the number of qubits. These quantum accelerated linear-algebra based techniques for machine learning can be considered the first generation of quantum machine learning (QML) algorithms tackling a wide range of applications in both supervised and unsupervised learning, including principal component analysis, support vector machines, kmeans clustering, and recommendation systems. These algorithms often admit exponentially faster solutions compared to their classical counterparts on certain types of quantum data. This has led to a significant surge of interest in the subject. However, to apply these algorithms to classical data, the data must first be embedded into quantum states, a process whose scalability is under debate.

What is meant by this sentence However, to apply these algorithms to classical data, the data must first be embedded into quantum states?

Are there resources that explain this procedure? Any documentation or links to additional readings would be greatly appreciated as well.

Thanks in advance!

Note: I did look at this previous question for reference. It helped. But if anyone can provide more clarity from a more foundational first principles view (ELI5 almost), I would be appreciative

$\endgroup$
  • $\begingroup$ the TL;DR is that if you want to do quantum computation, you need to operate on quantum states. If you want to do use a quantum computer to process classical data, you thus need to have your classical data somehow encoded into a quantum state. How exactly you do this depends, but in general it's as simple as pretending that, say, an input 00 correspond to this quantum state, 01 to this other one, etc., and then perform your operations on the quantum states $\endgroup$ – glS Mar 31 at 10:41
5
$\begingroup$

First it is instructive to ask oneself: "how does classical data get into my computer?" In a classical computer, your data is always stored in bits. Because calculations in base 2 are not very straightforward for most people there are abstractions like int types for integers and float types for rational numbers with the associated math operations readily abstracted for the user -- which means that you can easily add, multiply, divide and so on.

Now, on a quantum computer you run into a fundamental problem: Qubits are really expensive. When I say really expensive, this does not only mean that building a quantum computer costs a fortune, but also that in current applications you only have a handful of them (Google's quantum advantage experiment used a device with 53 qubits) -- which means that you have to economize your use of them. In machine learning applications you usually use single precision floating point numbers, which use 32 bits. This means a single "quantum float" would also need 32 qubits, which means that state of the art quantum computers can't even be used to add two floating point numbers together due to the lack of qubits.

But you can still do useful stuff with qubits, and this is because they have additional degrees of freedom! One particular thing is that you can encode an angle (which is a real parameter) bijectively into a single qubit by putting it into the relative phase $$ | \theta \rangle = \frac{1}{\sqrt{2}}(|0\rangle + \mathrm{e}^{i\theta} |1\rangle) $$

And this is the heart of embedding data into quantum states. You simply can't do the same thing you would be doing on a classical computer due to a lack of sufficient qubit numbers and therefore you have to get creative and use the degrees of freedom of qubits to get your data into the quantum computer. To learn more about very basic embeddings, you should have a look at this paper. One particular example I want to highlight is the so-called "amplitude embedding" where you map the entries of a vector $\boldsymbol{x}$ into the different amplitudes of a quantum state $$ | \boldsymbol{x} \rangle \propto \sum_i x_i | i \rangle $$ There is no equals sign because the state needs to be normalized, but for the understanding this is not important. The special thing about this particular embedding is that it embeds a vector with $d$ elements into $\log_2 d$ qubits which is a nice feature in our world where qubits are expensive!

| improve this answer | |
$\endgroup$
0
$\begingroup$

For 32 bit you only need 5 qubits not 32 qubits. $2^n=N$, where $n$ stands for number of qubits, and $N$ stands for number of bits.

| improve this answer | |
$\endgroup$
  • $\begingroup$ For 32bit you only need 5 qubits not 32 qubits. 2^n=N which n stands for number of qubits and N stands for number of bits. Did you mean for 32 states you need 5 qubits? $\endgroup$ – Martin Vesely Oct 16 at 10:33

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.