Superposition in classification

Hi, most of the classification approaches are what classical computers can also do. eg. classification of hymenoptera. If I mix two images, how can I identify them at the same time using PennyLane (trying to emulate superposition)? In classical DL, you would have to probably separate them. A better example would be sound (eg. during discussion, two speakers can speak at the same time but with classical DL, preprocessing is done to separate the speakers but how can we identify the two at the same time using qml). I was thinking about creating problems classical approached could not solve easily.
Summary: How to classify 2 different items at the same time?

Hey @therafael.

Classification in superposition is an interesting topic, and still very much open!

To prepare a superposition of data, you could simply entangle the circuit embedding x_1 with an ancilla qubit in state |0\rangle, while entangling the circuit embedding x_2 with the ancilla in |1\rangle to get |\psi_{\rm ent}\rangle = \frac{1}{\sqrt{2}}| \phi(x_1) \rangle | 0 \rangle + \frac{1}{\sqrt{2}}| \phi(x_1) \rangle | 1 \rangle . For more inputs you’d just need more ancillas.

Or you could do a superposition without an ancilla, which is particularly elegant in basis embedding. For example, the two binary data points 010 and 111 can be represented in superposition as \frac{1}{\sqrt{2}}| 010 \rangle + \frac{1}{\sqrt{2}}|111 \rangle .

Controlling an embedding automatically is a feature that we are working on, but for now you would have to code up the circuit by hand (i.e., just replace every gate in the embedding by a controlled version). You’ll see though that the controls introduce quite an overhead that quickly becomes too costly for near-term devices and simulations…

1 Like

Thanks @Maria_Schuld, will update if I find anything interesting or have more questions.