Skip to main content
. 2022 Feb 3;12:1851. doi: 10.1038/s41598-022-05971-9

Figure 3.

Figure 3

Quantum Circuit to compute u|v2. The model circuits encode train and test data into quantum states u=Uq1q2q3 and v=Vq4q5q6. The Hadamard gate on the ancilla qubit (q0) generates a superposition of the quantum state including the train and test datasets. The application of the single-controlled swap gates with the ancilla qubit as the control results in an entangled state of Eq. (10). Another Hadamard gate on the ancilla qubit interferences uv and vu. The ancilla qubit on the 0 state is measured in the Z basis. Therefore, the value of u|v2 can be obtained from Eq. (12).