-
In order to improve the training efficiency of the support vector machine, a quantum circuit training scheme based on the inner product of the quantum state for the support vector machine is proposed in this work. Firstly, on the basis of the full analysis of the computational complexity of the classical support vector machine, the kernel function which is the main factor affecting the computational complexity of the algorithm is primarily analyzed. Based on quantum mechanics and quantum computing theory, the training sample elements in the kernel function are quantized to generate the corresponding quantum states. Secondly, according to the quantum states of the training sample elements, the types and quantities of the required quantum logic gates are derived and calculated, and the quantum circuit that can generate the corresponding quantum states of the training sample elements through the evolution of the quantum initial ground states and the quantum logic gates is designed. Then, in the light of the relationship between the inner product of the quantum state and the quantum logic gate SWAP, the quantum circuit is designed to complete the exchange operation of the corresponding quantum state amplitude. The inner product of the quantum state is realized by exchanging and evolving the amplitude of the quantum state in the quantum circuit. Finally, by measuring the quantum state of the controlling qubit, the inner product solution of the kernel function is obtained, and the acceleration effect of training support vector machine is realized. The verification results show that the scheme enables the support vector machine not only to complete the correct classification, but also to operate the quantum part of the scheme on the real quantum computer . Compared with the classical algorithm, the scheme reduces the time complexity of the algorithm for the polynomial degree, greatly shortens the training time of the model, and improves the efficiency of the algorithm. The scheme has certain feasibility, effectiveness and innovation, and expands the training idea of the support vector machine.
-
Keywords:
- quantum circuit/
- inner product/
- quantum state/
- support vector machine
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] -
SN Data group Result of 0 Result of 1 Classical calculation Error rate/% Inner product value 1 (2.942485, 4.977398, 3.176513)(7.551510, 1.580030, 0.067732) 29.679279 29.679279 30.299795 2.05 2 (0.341367, 3.894998, 3.929515)(7.139979, 2.329896, 1.981083) 19.255815 19.255815 19.296989 0.21 3 (6.080573, 0.418886, 1.33507)(9.205805, 0.586480, 0.958476) 57.284265 57.284265 57.501870 0.38 4 (0.870296, 3.609952, 3.851484)(3.536555, 3.964960, 4.16744) 33.501898 33.501898 33.441993 0.18 5 (0.926310, 4.564359, 5.114204)(8.102154, 0.603875, 0.617218) 13.805552 13.805552 13.417987 2.89 算法1. 基于量子态内积的量子线路训练方案 输入: 训练样本集数据. 输出: 支持向量机相关参数. 初始化训练样本数据M和数据特征数量N, 初始化目标函数和约束条件, 初始化量子线路运行环境$ {Q}_{r} $和量子比特数量$n\leftarrow \lceil{ {\rm{log} } }_{2}N\rceil$.1: 使用SMO算法求解拉格朗日乘子向量
$ \left({\alpha }_{1}, {\alpha }_{2}, \cdots , $$ {\alpha }_{M}\right) $;//2.1节2:while不满足停止条件时do3: for$ i, j=1:M $do4: 通过启发式策略选择一对 $ {\alpha }_{i} $ and $ {\alpha }_{j} $;//2.1节5: 初始化量子态;6: 生成量子态制备对应的量子线路;// (23)式7: 生成量子态内积对应的量子线路;// (25)式8: 通过量子线路计算对应训练样本之间的内积;//
(19), (26) and (27) 式9: 计算 $ {\alpha }_{i}^{{\rm{n}}{\rm{e}}{\rm{w}}} $;// (10)式10: 计算 $ {\alpha }_{j}^{{\rm{n}}{\rm{e}}{\rm{w}}} $;// (11)式11: 计算 $ {b}_{i}^{{\rm{n}}{\rm{e}}{\rm{w}}} $;// (12)式12: 计算 $ {b}_{j}^{{\rm{n}}{\rm{e}}{\rm{w}}} $;// (13)式13: 更新$ {\alpha }_{i}, {\alpha }_{j}, b $的值;14: end for15:end while16: 输出$ \alpha $与b -
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40]
Catalog
Metrics
- Abstract views:3317
- PDF Downloads:65
- Cited By:0