What is Quantum embedding and its techniques?

If you’re using quantum machine learning to look at classical data and solve machine learning problems, then you need to see how to represent this classical data as a quantum state. When you use a quantum device to solve some machine learning problem, it deals with the quantum state, so this data has to be somehow mapped to a quantum state.

quantum embedding

Embedding techniques

There are many ways to do embedding, but we will only be discussing the following:

  • Basis embedding
  • Amplitude embedding
  • Angle embedding

Basis embedding

For basis embedding, the data must be in the form of a binary string. The concept of basis embedding is based on the use of a computational basis. A scalar value is approximated to its binary form before being transformed into a quantum state. For example, y=010 represents a 3-qubit quantum state, you can see this in the diagram.

basis embedding

Amplitude embedding

There are real input values in amplitude embedding. For example, data point y has four dimensions (for instance, y1=1.2, y2=2.7, y3=1.1, y4=0.5y_1=1.2,~y_2 = 2.7,~y_3=1.1 ,~y_4=0.5). We require two qubits for these four features in y. Normalize this input and then directly encode it into the amplitude of our quantum states.

Take a look below for the general formula:

ψ(y)=j=1nyjj\psi(y)\rangle = \sum^n_{j=1}y_j |j\rangle

yjy_j is the jth element of y. We have to square-normalize each element. For example, 110.19\frac{1}{\sqrt{10.19}}(1.2,2.7,1.1,0.5) and j|j\rangle is the computational basis state.

The final form is:

1.210.1900+2.710.1901+1.110.1910+0.510.1911\frac{1.2}{\sqrt{10.19}}|00\rangle + \frac{2.7}{\sqrt{10.19}}|01\rangle + \frac{1.1}{\sqrt{10.19}}|10\rangle + \frac{0.5}{\sqrt{10.19}}|11\rangle

Angle embedding

Suppose we have a y data point with two features: y1=1.4= 1.4 and y2 =0.7= 0.7. These features will become the angle of your rotation in angle embedding. Each of the features use the two qubits separately.

y1 can be encoded on the first qubit as:

cos(1.42)0sin(1.42)1\cos\left(\frac{1.4}{2}\right)|0\rangle - \sin\left(\frac{1.4}{2}\right)|1\rangle

y2 can be encoded on the second qubit as:

cos(0.72)0sin(0.72)1\cos\left(\frac{0.7}{2}\right)|0\rangle - \sin\left(\frac{0.7}{2}\right)|1\rangle

The rotations can be performed on either xx, yy, or zz axis of the Bloch sphere.


Copyright ©2024 Educative, Inc. All rights reserved