# Mathematical proof of the quantum kernel method

I’ve always wondered why the quantum kernel method
\kappa (x,x')=|\langle \phi(x) |\phi(x') \rangle {{|}^{2}}
must be a square. After reading references

V. Havlíček, A. D. Córcoles et al., “Supervised learning with quantum-enhanced feature spaces,” Nature, vol. 567, no. 7747, pp. 209-212, 2019.

and

M. Schuld, and N. Killoran, “Quantum machine learning in feature Hilbert spaces,” Physical Review Letters, vol. 122, no. 4, pp. 040504, 2019.,

it was not straightforward to discover the derivation of this formula. Furthermore, is \kappa (x,x')=|\langle \phi(x) |\phi(x') \rangle {{|}^{2}} a semi-positive definite matrix?

Hello @RX1 ! Thanks for the question

It is not the only expression for kernel function. In particular that one is used a lot because it comes very naturally. A kernel function is a similarity function, that is: it will take high values if they are similar and small values if they are not (This similarity function can be understood in some way as the inverse of distance)

Well, the distance induced by the norm is 1 - |\langle\phi(x)|\phi(x')\rangle|^2 , so something that behaves the other way around could be just changing the sign |\langle\phi(x)|\phi(x')\rangle|^2 (we eliminate one because it does not provide any information).

I hope this helps

1 Like