# Hilbert space vs RKHS

I believe in quantum machine learning, it is interesting to talk about RKHS(reproducing kernel Hilbert space) and Hilbert space where a quantum state lives in. How do we think of these two spaces? Are they effectively the same thing in the context of quantum ML?

I think when talking about quantum machine learning, the notion of the RKHS and the Hilbert space where quantum states live are related but are two distinct spaces.

The RKHS is the space of the kernel functions $$k(x^k,x)$$ i.e. a space of symmetric and positive semi-definite functions. There is nothing particularly related to quantum computing about this. I would recommend this great lecture to learn more about the RKHS.

Now we get to the Hilbert space where the quantum states live. We can represent a kernel function $$k(x^k,x)$$ (living in the RKHS) by density matrices as (details in this paper):

$$k(x^k,x) = tr[\rho(x^k)\rho(x)]$$

where $$\rho(x)$$ are density matrices aka quantum states (whose form depends on $$x$$) that live in their own Hilbert space. And using the formula above, you can use these states to compute some $$k(x^k,x)$$ which lives in the (separate) RKHS.

But even though the quantum states and kernel functions live in well-defined separate Hilbert spaces, they are related: $$\rho(x)$$ lives in the space of the quantum states, and $$k(x^k,x)$$ lives in the space of the (linear combinations) of the trace of the product of different $$\rho(x)$$.

So the next question is: how can we understand this relation better? I.e. what kinds of interesting kernels (that live in the RKHS) can you efficiently create with quantum states (that live in their own Hilbert space)? This is currently an active area of research :) Hope this helps!

• thank you so much for the informative sharing! What got me ponder upon this question is this youtube.com/watch?v=OKbcJCUx6xA, in which it hand-wavily suggested that the quantum svm can perform classification in Hilbert space, which led me think the two are the same thing.
– Sam
Sep 26 at 15:49
• A kernel can be replaced by the inner product of two vectors i.e. $k(x_i,x_j)=\langle \phi(x_j),\phi(x_j)\rangle$ (I used $\langle , \rangle$ to indicate that this is valid for any general abstract vectors). So if I replace abstract vectors by density matrices $\phi(x_j) \rightarrow \rho(x_j)$, then I get that the kernel can be replaced by the trace of the product of two density matrices i.e. $tr\left[\rho(x_j)\rho(x_i)\right]$, where the individual density matrices live in a Hilbert space, and the kernel is evaluated by combining them in that specific way. Does that make sense? Sep 29 at 10:16
• And just to add a bit of rigor (but it doesn't really add to why the RKHS is different to the quantum state Hilbert space, so feel free to ignor this comment :)), the kernel objects are actually functions $k_{x_i}: \mathcal{X} \rightarrow \mathbb{R}$ where we define $k_{x_i}(\cdot) = k(x_i, \cdot)$. These objects are the ones that live in the RKHS. To dive deeper into these more abstract notions, I would definitely recommend checking out Ulrike's lecture on it if you have the time :) youtube.com/watch?v=EoM_DF3VAO8. I'm always happy to chat (and learn!) about kernels too :) Sep 29 at 10:28
• Hi, I think your latest comment pointed out the distinction, because the objects in RKHS are functions whereas the objection on Hilbert space are states (be it pure or mix). Am I understanding it correctly?
– Sam
Oct 1 at 5:35
• Yup that's right! Objects in the Reproducing Kernel Hilbert Space are (linear combinations) of kernel functions, whereas the states live in a Hilbert Space where the objects are (linear combinations) of states. And the additional point is that there is not a bijective mapping between the the two spaces. Any mathematicians out there please free to comment if something I said was not rigorously precise :) Oct 1 at 9:22