Member-only story
Simplified Quantum Machine Learning (QML) Classification
I have been working with the SWAP Test quite a bit (check out my Basis-Specific SWAP Test if you haven’t already), and so I was excited to read the paper, Carsten Blank et al, Quantum classifier with tailored quantum kernel, npj Quantum Information (2020). DOI: 10.1038/s41534-020-0272-6. However, the paper uses very unclear language (I wouldn’t have understood the paper at all if I hadn’t already known how neural networks and the SWAP Test work) and the circuit requires several seemingly-unnecessary qubits (the paper is connected to another paper that seems to use those qubits, but this paper doesn’t need them). I hope that this article and my version of the circuit, in contrast, are much simpler to understand.
What is the SWAP Test?
The SWAP Test compares quantum states. You measure 0 with a probability of 1 when the states are identical and you measure 0 with a probability of .5 when the states are maximally different. I have read that the SWAP Test works with entangled states, as well, but I haven’t personally played around with that yet.
Looking at the circuit diagram above, the “out” qubits are the control qubits for Fredkin gates, also known as controlled-SWAP gates. The Fredkin gates are sandwiched between Hadamard gates. Finalized with z-basis measurements, these gate combinations each…