Classification method and device based on quantum SNN network, medium and equipment

By introducing quantum variation networks and quantum relaxation gates into spike neural networks, the challenges of traditional SNNs in terms of computing complexity and computing efficiency are solved, and more efficient neural pulse generation and propagation are achieved, improving the robustness and adaptability of the network.

CN120180225APending Publication Date: 2025-06-20BEIJING INST OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510297528.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

Traditional spike neural networks (SNNs) have challenges in operational complexity and computational efficiency, especially when processing timing signals and sparse data.

Method used

The classification method based on quantum SNN network is adopted to perform quantum evolution processing on the initial state of quantum through quantum variational networks, and the exponential attenuation process of membrane potential is used to simulate the exponential attenuation process of membrane potential to replace traditional matrix operations.

Benefits of technology

It significantly reduces the computational complexity, improves the computing efficiency and network feature extraction capabilities, enhances robustness, and adapts to the needs of multi-task scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180225A_ABST
    Figure CN120180225A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quantum computing, and discloses a classification method and device based on a quantum SNN network, a medium and equipment. The method comprises the following steps: acquiring a normalized vector of to-be-classified data; performing quantum state representation on the normalized vector by adopting a plurality of quantum bits to obtain a quantum initial state; parameterizing the quantum initial state through a network, and performing quantum evolution processing on the quantum initial state by adopting the network to obtain a quantum evolution processing result; the quantum SNN network comprises a plurality of quantum SNN neurons represented by quantum relaxation gates; the first quantum relaxation gate receives a quantum evolution processing result, and the last quantum relaxation gate outputs a quantum end state; and obtaining an output probability value according to the quantum end state of the SNN neuron, and obtaining a classification result of the to-be-classified data according to the output probability value. According to the invention, the calculation complexity can be reduced, and the calculation efficiency of the SNN neural network can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum computing technology, and in particular, to a classification method, device, medium, and equipment based on a quantum SNN network. Background Art

[0002] Traditional artificial neural networks (ANNs) have demonstrated powerful performance in many tasks. To process time-series signals and sparse data more efficiently, spiking neural networks (SNNs) have emerged. By simulating the spike emission mechanism of biological neurons, SNNs have efficient event-driven characteristics and low-power consumption advantages. The practical applications of SNNs face challenges in spike generation and exponential decay modeling, matrix operations and performance optimization, and insufficient robustness and receptive fields. Summary of the Invention

[0003] An object of the present invention is to provide a classification method, device, medium, and equipment based on a quantum SNN network, which is used to reduce the computational complexity and improve the computational efficiency of the SNN neural network.

[0004] To achieve the above object, the present invention provides the following technical solutions: According to one aspect of the present invention, a classification method based on a quantum SNN network is provided, including: Obtaining a normalized vector of the data to be classified; Representing the normalized vector in a quantum state using multiple qubits to obtain an initial quantum state; Parameterizing the initial quantum state through a quantum variational network, where matrix operations are included in the parameterization, and the matrix operations are implemented using quantum gates; Performing quantum evolution processing on the initial quantum state using a quantum variational network to obtain a quantum evolution processing result; The quantum SNN network includes several quantum SNN neurons represented by quantum relaxation gates; the quantum SNN neurons can simulate the exponential decay process of the membrane potential in the SNN; the several quantum relaxation gates are connected in sequence, the first quantum relaxation gate receives the quantum evolution processing result, and the last one outputs the final quantum state; Obtaining an output probability value according to the final quantum state of the SNN neuron, and obtaining a classification result of the data to be classified according to the output probability value.

[0005] The quantum relaxation gate uses a quantum T1 Relaxation gate. The quantum neuron network includes several quantum SNN neurons constructed by quantum T1 Relaxation gates; the quantum SNN neurons can simulate the exponential decay process of the membrane potential in the SNN; The several quantum T1 Relaxation gates are connected in sequence. The first T1 Relaxation gate receives the result of quantum evolution processing, and the last T1 Relaxation gate outputs the quantum final state. An output probability value is obtained based on the quantum final state of the SNN neuron, and a classification result of the data to be classified is obtained based on the output probability value.

[0006] According to an embodiment of the present invention, the quantum evolution processing of the quantum initial state by using the quantum variational network includes: Applying a combined U gate between every two adjacent qubits to form a quantum variational network; Performing multiple rounds of quantum evolution training processing on the quantum initial state based on the quantum variational network; The combined U gate includes a CNOT gate configured between two adjacent qubits, an RX rotation gate and an RZ rotation gate configured on the first qubit among two adjacent qubits, and an RY rotation gate configured on the second qubit among two adjacent qubits.

[0007] According to an embodiment of the present invention, representing the normalized vector by using multiple qubits in a quantum state includes: Initializing each qubit to a superposition state by using an H gate; performing phase encoding on the normalized vector by using an RX rotation gate to obtain a quantum initial state.

[0008] According to an embodiment of the present invention, the combined U gate is a forward combined U gate, and applying the combined U gate between every two adjacent qubits includes: from to sequentially applying a forward combined U gate to adjacent qubits and The forward combined U gate includes a CNOT gate configured between the qubits and , an RX and an RZ rotation gate configured on the qubit , and an RY rotation gate configured on the qubit ; or, The combined U gate is a reverse combined U gate, and applying the combined U gate between every two adjacent qubits includes: from to sequentially applying a reverse combined U gate to adjacent qubits and The reverse combined U gate includes a CNOT gate configured between the qubits and , an RX and an RZ rotation gate configured on the qubit , and an RY rotation gate configured on the qubit RY rotation gate on it; The forward combined U gate, the expression is: ; Among them, represents the identity matrix. According to the expression, we can correspond the parameters of each part to the corresponding operations and qubits: corresponds to the RX rotation on the first qubit on it.

[0009] corresponds to the RY rotation on the second qubit on it.

[0010] corresponds to the RZ rotation on the first qubit on it.

[0011] Transfers the state of the control bit to the target bit , for introducing entanglement between qubits.

[0012] The reverse combined U gate, expressed as: ; Among them, represents the identity matrix. Similar to the forward combined U gate, the parameters of each rotation gate correspond to the rotation of a specific qubit, and the control bit and target bit of the CNOT gate are exchanged in reverse: corresponds to the RX rotation on the first qubit on it; corresponds to the RY rotation on the second qubit on it; corresponds to the RZ rotation on the first qubit on it.

[0013] According to an embodiment of the present invention, the quantum relaxation gate represents a neuron of a quantum neuron network, and the , represents the decay probability at the initial time t = 0, that is, the probability that the system is in the excited state at the initial time, T1 represents the relaxation time constant, and t represents the time elapsed since the initial time t = 0.

[0014] According to an embodiment of the present invention, the result of the quantum evolution process is , and the is a parameter matrix; The membrane potential exponential decay term of the quantum relaxation gate , denotes the relaxation time constant of the quantum relaxation gate.

[0015] The complete pulse signal at the current moment of the quantum relaxation gate representing a neuron in the quantum neuron network is expressed as: .

[0016] According to an embodiment of the present invention, the method further includes: Using the data to be classified in the training set to train the quantum relaxation gates of the quantum variational network and the quantum neuron network. The training process uses the quantum gradient descent method and the hybrid quantum-classical optimization algorithm to minimize the error function and gradually optimize the network parameters; the initial parameters of the network parameters are randomized parameters.

[0017] On the other hand, the present invention also provides a classification device based on a quantum SNN network, including: A preprocessing unit configured to obtain a normalized vector of the data to be classified; A quantum encoding unit configured to represent the normalized vector in a quantum state using multiple qubits to obtain an initial quantum state; An evolution unit configured to perform quantum evolution processing on the initial quantum state using a quantum variational network; A network unit configured to perform network classification processing on the result of the quantum evolution processing using a quantum neuron network constructed by quantum relaxation gates; An output unit that obtains an output probability value based on the final quantum state of the quantum neuron network and obtains a classification result of the data to be classified according to the output probability value.

[0018] On the other hand, the present invention also provides a computer storage medium, in which instructions are stored, and when the instructions are run, the classification method based on the quantum SNN network is implemented.

[0019] On the other hand, the present invention also provides a computing device, characterized in that it includes a processor and a communication interface coupled to the processor; the processor is used to run a computer program or instructions to implement the classification method based on the quantum SNN network.

[0020] A classification method, device, medium, and equipment based on a quantum spiking neural network (SNN) provided by the present invention combines quantum computing with spiking neural networks (SNNs) to improve the computational efficiency, robustness, and performance of spiking neural networks. By introducing a quantum relaxation gate (T1 Relaxation) and a quantum variational network, key aspects of the SNN are optimized from the perspective of quantum computing, enabling the efficient generation and propagation of neural spikes. Experimental results show that compared with the prior art, the beneficial effects of the present invention are as follows: 1. The classification method accurately simulates the exponential decay of the membrane potential through a quantum T1 Relaxation gate, significantly reducing the computational complexity; 2. The quantum variational network relied on by the classification method replaces matrix operations, improving the computational efficiency and the network's feature extraction ability; 3. The classification method and device rely on a hybrid quantum-classical computing architecture and a training process based on quantum gradient descent and hybrid quantum-classical optimization algorithms, expanding the receptive field, meeting the requirements of multi-task scenarios, and having stable performance. Specifically, the use of the quantum SNN neuron avoids the complex calculations of the exponential decay of traditional SNN neurons; 4. The classification method relying on the quantum SNN architecture not only performs well in efficiently processing time series signals and sparse data, but also significantly reduces the computational complexity, enhances the robustness of the network, and meets the requirements in multi-task scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 is a flowchart of a classification method based on a quantum SNN network according to an exemplary embodiment of the present invention; Figure 2 is a diagram of a classification device based on a quantum SNN network according to an exemplary embodiment of the present invention; Figure 3 is a schematic diagram of the structure of a quantum SNN network according to an exemplary embodiment of the present invention; Figure 4 is a schematic diagram of a V-shaped quantum variational circuit according to an exemplary embodiment of the present invention; Figure 5 is a schematic diagram of a forward combined U gate according to an exemplary embodiment of the present invention; Figure 6 is a schematic diagram of a reverse combined U gate according to an exemplary embodiment of the present invention; Figure 7 is a schematic diagram of a loss function of a classification method based on a quantum SNN network according to an exemplary embodiment of the present invention; Figure 8 It is a schematic diagram of the classification accuracy of the classification method based on the quantum SNN network according to an exemplary embodiment of the present invention. Detailed implementation manners

[0022] For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. For example, the first threshold and the second threshold are only used to distinguish different thresholds, and do not limit their sequence. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first", "second", etc. do not necessarily mean different.

[0023] It should be noted that in the present invention, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.

[0024] In the present invention, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. The following at least one (item) or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b or c can represent: a, b, c, the combination of a and b, the combination of a and c, the combination of b and c, or the combination of a, b and c, where a, b, c can be single or multiple.

[0025] Next, the embodiments of the present invention will be described in detail with reference to the drawings.

[0026] The present invention innovatively combines quantum computing with spiking neural networks (SNNs), and starting from aspects such as quantum state encoding, exponential decay modeling, and matrix operation optimization, proposes a classification method, device, medium, and equipment based on a quantum SNN network, providing a new technical solution for the future development of neural networks. Based on the quantum relaxation gate and the quantum pulse neural network QSNN of the network, the quantum relaxation gate (T1 Relaxation gate) is used to simulate the exponential decay process of the neuron membrane potential, replacing classical computing in a quantum way to achieve more efficient generation and propagation of nerve impulses; a quantum variational network is introduced into the SNN neural network to replace the traditional matrix multiplication operation; the quantum rotation gate is used to achieve the non-linear transformation of features, significantly reducing the operation complexity and improving the computing efficiency of the network; innovatively combining the core technology of quantum computing with the pulse characteristics of spiking neural networks forms a new type of quantum SNN model, which is superior to the prior art in terms of computing performance and task adaptability.

[0027] As Figure 1 shown, a flowchart of a classification method based on a quantum SNN network is given, and the method includes the following steps: Step S1: Obtain the normalized vector of the data to be classified; Step S2: Represent the normalized vector in a quantum state using multiple qubits to obtain the initial quantum state; Step S3: Parameterize the initial quantum state through a quantum variational network, where the parameterization includes matrix operations, and the matrix operations are implemented using quantum gates; Step S4: Perform quantum evolution processing on the initial quantum state using a quantum variational network to obtain the result of quantum evolution processing; Step S5: The quantum SNN network includes several quantum SNN neurons represented by quantum relaxation gates; the quantum SNN neurons can simulate the exponential decay process of the membrane potential in the SNN; the several quantum relaxation gates are connected in sequence, the first quantum relaxation gate receives the result of quantum evolution processing, and the last one outputs the final quantum state; Step S6: Obtain the output probability value according to the final quantum state of the SNN neuron, and obtain the classification result of the data to be classified according to the output probability value.

[0028] The method further includes: training the quantum variational network and the quantum relaxation gates of the quantum SNN network using the data to be classified in the training set, and using the quantum gradient descent method and the hybrid quantum-classical optimization algorithm during the training process to minimize the error function and gradually optimize the network parameters; the initial parameters of the network parameters are randomized parameters.

[0029] As Figure 2 shown, a schematic diagram of a classification device based on a quantum SNN network is given, including: A preprocessing unit, configured to obtain a normalized vector of data to be classified; A quantum encoding unit, configured to represent the normalized vector in a quantum state using multiple qubits to obtain an initial quantum state; An evolution unit, configured to perform quantum evolution processing on the initial quantum state using a quantum variational network; A network unit, configured to perform network classification processing on the result of quantum evolution processing using a quantum SNN neural network constructed by a quantum relaxation gate; An output unit, obtaining an output probability value according to the final quantum state of the quantum SNN neural network, and obtaining a classification result of the data to be classified according to the output probability value.

[0030] As Figure 3 shown, a schematic diagram of a quantum SNN network is given. The quantum SNN network includes: a quantum input layer, a quantum variational network, and a quantum neuron network. The quantum input layer is used to perform quantum encoding on data, and the quantum variational network is used to perform pulse signal encoding and parameterization on the input feature vector. The quantum variational network is the core for model training of the quantum SNN network. For the input matrix X and the parameter matrix W of a traditional SNN neural network, in the quantum SNN network, the behavior obtained by using the quantum variational network for processing is similar to matrix multiplication: ; In the quantum SNN network, first, the quantum input layer encodes each feature of the data feature vector using phase encoding, and embeds the rotation angle into the qubit through a rotation gate.

[0031] The quantum variational network uses a parameter matrix W with randomized parameters to perform evolution processing on the input matrix X after quantum encoding. During the training process of the neural network model, the network parameters of the quantum variational network can be evolved and trained using the input matrix X and the parameter matrix W to obtain the parameters on each quantum circuit. In the quantum variational network, the CNOT gate between two adjacent qubits is used to entangle the qubit states, and the obtained behavior is similar to matrix multiplication.

[0032] The quantum neuron network is used to simulate a traditional SNN neural network, and uses a quantum relaxation gate (T1 Relaxation) to simulate neurons. In the quantum implementation, the T1 Relaxation process can be naturally realized through the relaxation mechanism of the quantum system. This mechanism gradually decays the excited state to the ground state, conforming to the following exponential decay model: ; where The probability of being in the excited state is consistent with the exponential decay process in traditional SNN networks.

[0033] Since traditional SNN networks require the pulse signal to decay with delay and superimpose different signals with delays when constructing neural pulse signals, the quantum relaxation gate (T1 Relaxation) simulating exponential decay enables this process to be efficiently implemented in a quantum way. The pulse signal delay decay of the quantum relaxation gate (T1 Relaxation) can be expressed as: ;

[0034] represents the input pulse signal at the previous moment. This is the input signal of the T1 Relaxation gate and is used to calculate the decay value at the current moment; ; is the relaxation time constant of the Relaxation gate, which is used to control the rate of exponential decay; represents the time step or time interval, that is, the time difference from t−Δt to t. It determines the time span of the decay calculation.

[0035] The quantum neuron network can be a multi-layer network. For example, a multi-layer network composed of multiple columns of quantum relaxation gates can be used. Multiple quantum relaxation gates in each column can work in parallel, and each quantum relaxation gate processes an independent qubit or pulse signal. The outputs of these quantum relaxation gates can be combined as the input of the next layer. Multiple quantum relaxation gates can be serially connected on the quantum circuit of the same qubit. The output of the previous quantum relaxation gate is directly used as the input of the next quantum relaxation gate. The quantum relaxation gates of the previous layer pass the pulse signal to the quantum relaxation gates of the next layer.

[0036] At the current moment t, for each quantum relaxation gate in the quantum neuron network, its pulse signal is constructed by linearly adding the input pulse at the current moment t and the weights of the quantum variational network to form the complete pulse signal of the quantum relaxation gate at the current moment : ; The quantum variational network and the quantum neural network can be trained using training set data. During the training phase, the parameters of the quantum gates in the network can be trained. When the expected effect is achieved, the obtained parameter matrix can be used as the classification parameter matrix W of the quantum SNN network. The training process can use the quantum gradient descent method and the hybrid quantum-classical optimization algorithm to minimize the error function and gradually optimize the network parameters. After the training is completed, the trained quantum SNN network can be used to classify the data to be classified, and the data classification result can be obtained.

[0037] In the quantum variational network, the combination of quantum logic gates that repeatedly appears in the quantum variational circuit is defined as a combined U gate, which serves as the basic building block of the quantum variational circuit. As Figure 4 shown, a schematic diagram of a V-shaped quantum variational circuit is given.

[0038] In Figure 4 the quantum variational circuit shown, n = 8 qubits are configured. For each qubit, a Hadamard gate (H) is first applied to put the qubit in a superposition state, and then a rotation gate RX is applied for inputting the initial quantum state. Subsequently, a quantum logic gate module, called the combined U gate, is applied between every two adjacent qubits. The combined U gate includes multiple quantum gates, specifically including a CNOT gate configured between two adjacent qubits, an RX rotation gate and an RZ rotation gate configured on the first qubit of two adjacent qubits, and an RY rotation gate configured on the second qubit of two adjacent qubits.

[0039] The combined U gate is divided into a forward combined U gate and a reverse combined U gate. During the construction of the quantum variational circuit, the forward combined U gate is applied first. As Figure 4 shown, from to the forward combined U gate is sequentially applied to adjacent qubits and . The forward combined U gate includes a CNOT gate configured between qubits and , an RX and an RZ rotation gate configured on qubit , and an RY rotation gate configured on qubit .

[0040] As Figure 5 shown, a schematic diagram of the forward combined U gate applied between adjacent qubits and is given.

[0041] Controlled-NOT gate (CNOT): , which is used to generate quantum entanglement between adjacent qubits and .

[0042] The RY rotation gate configured on the qubit is used to perform a rotation in the Y-axis direction on so as to adjust its quantum state and achieve the manipulation of the amplitude of the qubit.

[0043] The RX rotation gate configured on the qubit is used to perform a rotation in the X-axis direction on to adjust the amplitude and phase of its quantum state.

[0044] The RZ rotation gate configured on the qubit is used to perform a rotation in the Z-axis direction on to adjust the phase difference of its quantum state.

[0045] The forward combined U gate provides a basis for the training and parameter optimization of the quantum variational circuit by introducing entanglement (through the CNOT gate) between adjacent qubits and applying parameterizable single-qubit rotation gates (RX, RY, RZ).

[0046] After applying the forward combined U gate, the reverse combined U gate is applied. As Figure 4 shown, from to the reverse combined U gate is sequentially applied to adjacent qubits and . The reverse combined U gate includes a CNOT gate configured between qubits and , RX and RZ rotation gates configured on qubit , and a RY rotation gate configured on qubit . Among them, .

[0047] As Figure 6 shown, a schematic diagram of the reverse combined U gate applied between adjacent qubits and is given.

[0048] Controlled-NOT gate (CNOT): , which is used to generate quantum entanglement between adjacent qubits and .

[0049] The RY rotation gate configured on the qubit is used to perform a rotation in the Y-axis direction on so as to adjust its quantum state and achieve the manipulation of the amplitude of the qubit.

[0050] The RX rotation gate configured on the qubit is used to perform a rotation in the X-axis direction on and adjust the amplitude and phase of its quantum state.

[0051] The RZ rotation gate configured on the qubit is used to perform a rotation in the Z-axis direction on and adjust the phase difference of its quantum state.

[0052] The inverse composite U gate introduces entanglement (through the CNOT gate) between adjacent qubits and applies parameterizable single-qubit rotation gates (RX, RY, RZ) to the qubits to construct a parameterizable quantum circuit. By reversely connecting the quantum circuit, the expressive power of the quantum variational circuit is further improved, providing a basis for training and parameter optimization.

[0053] By comparing Figure 5 the forward composite U gate shown in Figure 6 with the inverse composite U gate shown in

[0054] it can be seen that the difference between the two lies in the different directions of the CNOT gate. Figure 4 Referring to the V-shaped quantum variational circuit shown in it is also possible to first apply the inverse composite U gate and then apply the forward composite U gate to construct an inverted V-shaped quantum variational circuit, including the following steps: During the construction of the quantum variational circuit, first apply the inverse composite U gate. From to successively apply the inverse composite U gate to adjacent qubits and The inverse composite U gate includes a CNOT gate configured between qubits and RX and RZ rotation gates configured on qubit and a RY rotation gate configured on qubit .

[0055] After applying the inverse composite U gate, then apply the forward composite U gate. From to successively apply the forward composite U gate to adjacent qubits and The forward composite U gate includes a CNOT gate configured between qubits and RX and RZ rotation gates configured on qubit and a RY rotation gate configured on qubit RY rotation gates on it. Thus, an inverted V-shaped quantum variational circuit is constructed.

[0056] After constructing the quantum variational circuit, the quantum variational circuit can be trained as a network to obtain the quantum variational circuit parameters.

[0057] Embodiment 1: Construct a forward composite U gate.

[0058] For adjacent qubits and , define the forward composite U gate . As Figure 5 shown, the forward composite U gate includes the following parts: Controlled-NOT gate (CNOT gate): ; RX and RZ rotation gates configured on qubit : ; RY rotation gate configured on qubit : .

[0059] Therefore, the overall operation of the forward composite U gate is expressed as: ; where represents the identity matrix, indicating no operation on the corresponding qubit.

[0060] The matrix representation of the RZ rotation gate is: .

[0061] Therefore, the matrix representation A of RZ0(θ3) ⊗ I1 is: ; The matrix representation of the RX rotation gate is: ; Therefore, the matrix representation B of RX0(θ1) ⊗ I1 is: ; The matrix representation of the RY rotation gate is: ; Therefore, the matrix representation C of I0 ⊗ RY1(θ2) is: ; The matrix representation D of the controlled-NOT gate CNOT0,1 is: ; Finally, the transformation matrix of the composite U gate can be calculated step by step: First, calculate E = B * A: Since A is a diagonal matrix, directly multiply the diagonal elements of A by the corresponding columns of B.

[0062] Then, calculate F = C * E: For the specific structure of C, the matrix is partitioned to simplify the calculation.

[0063] Finally, calculate U = D * F: The matrix representation D of the controlled-NOT gate has the effect of swapping certain rows of F. Therefore, the transformation matrix U of the combined U gate can be obtained by rearranging the rows of F. Combining the above calculations, the transformation matrix U is: ; Where: , represents the embedded RX rotation parameter, represents the embedded RY rotation parameter, represents the embedded RZ rotation parameter.

[0064] Example 2: Construct the reverse U gate.

[0065] For adjacent qubits and , define the reverse combined U gate . As Figure 6 shown, the reverse combined U gate includes the following parts: Controlled-NOT gate (CNOT gate): ; RX and RZ rotation gates configured on qubit : ; RY rotation gate configured on qubit : .

[0066] Therefore, the overall operation of the reverse combined U gate is expressed as: ; Where, represents the identity matrix, indicating no operation on the corresponding qubit.

[0067] The reverse combined U gate has a similar structure to the forward combined U gate , the difference being that the direction of the controlled-NOT gate is opposite. Thus, the reverse combined U gate can be constructed with reference to Example 1.

[0068] Example 3: Construction of the V-shaped circuit.

[0069] Applying a combined U gate between every two adjacent qubits includes: From To Successively applying a forward combined U gate to adjacent qubits And The forward combined U gate Includes a CNOT gate configured between qubits And An RX and RZ rotation gate configured on qubit And an RY rotation gate configured on qubit ; From To Successively applying a reverse combined U gate to adjacent qubits And The reverse combined U gate Includes a CNOT gate configured between qubits And An RX and RZ rotation gate configured on qubit And an RY rotation gate configured on qubit , where . Finally, a V-shaped circuit is formed.

[0070] Example 4: Construction of an inverted V-shaped circuit.

[0071] The applying of a combined U gate between every two adjacent qubits includes: From To Successively applying a reverse combined U gate to adjacent qubits And The reverse combined U gate Includes a CNOT gate configured between qubits And An RX and RZ rotation gate configured on qubit And an RY rotation gate configured on qubit ; From To Successively applying a forward combined U gate to adjacent qubits And The forward combined U gate Includes a CNOT gate configured between qubits And An RX and RZ rotation gate configured on qubit And an RY rotation gate configured on qubit RY rotating door on it, where . Finally, an inverted V-shaped line is formed.

[0072] Embodiment 5: Data processing of the V-shaped line.

[0073] After constructing the quantum variational circuit, the quantum variational circuit can be used as a network for training to obtain the quantum variational circuit parameters. The specific training process includes the following steps: Step S51: Convert classical training data into quantum-encoded training data; Convert classical data into the initial quantum state through the RX gate. The classical data can then be processed in the quantum circuit.

[0074] Step S52: Initialize the quantum circuit parameters; Initialize the adjustable parameters (such as rotation angles) in the quantum circuit. Initialize the parameters by adding small random perturbations to zero.

[0075] Step S53: Input the quantum-encoded training data into the quantum variational circuit for training to obtain the quantum variational circuit parameters; The following sub-steps are included during the training process: Step S5301 Forward propagation: Input the quantum-encoded training data into the quantum variational circuit, and through a series of parameterized quantum gate operations, obtain the output quantum state.

[0076] Step S5302 Measure and calculate the expectation value: Measure the output quantum state and calculate the relevant physical quantity or expectation value to evaluate the performance of the circuit.

[0077] Step S5303 Calculate the loss function: Calculate the loss function based on the expectation value and the target value : ; where is the quantum circuit with parameters, is the measured Hamiltonian, is the initial quantum state.

[0078] Step S5304 Gradient calculation: Use the Parameter-Shift method to calculate the gradient of the loss function with respect to the circuit parameters.

[0079] For each parameter , the gradient can be expressed as: ; Step S5305 Parameter update: Update the circuit parameters according to the gradient and the selected optimization algorithm .

[0080] Update the parameters using the calculated gradient according to the selected optimization algorithm: ; where is the learning rate.

[0081] Step S5306 Iterative training: Repeat the above steps S5301 to S5305 until the loss function converges or reaches the predetermined number of training epochs.

[0082] The circuit of the quantum variational circuit adopts a symmetric structure (forward and backward CNOT chains), forming a V-shaped or inverted V-shaped topology, which improves the coupling of the network. This symmetry helps to maintain balanced gradients in different parts of the circuit; between the entangled CNOT gates, a variety of single-qubit rotation gates (RX, RY, RZ) are applied. These rotation gates increase the expressive power of the quantum variational circuit, increase the number of parameters, and at the same time control the growth of entanglement.

[0083] Example 6: Using a quantum SNN network for handwritten image classification Step 601: Extract handwritten image features.

[0084] Randomly select 60,000 images from the handwritten image database, each handwritten image is 28×28 pixels; from each handwritten image, form a vector by the pixel points in each row, and form the handwritten image features of this image by all vectors; divide the 60,000 handwritten image features into a training set and a test set, with sizes of 50,000 and 10,000 respectively.

[0085] Step 602: Construct a quantum neural network.

[0086] Use a quantum relaxation gate (T1 Relaxation) to simulate neurons, Step 603: Use a quantum variational network to encode and parameterize the pulse signal.

[0087] The quantum variational network VQC is the core component for training the quantum SNN network. Given an input matrix X and a parameter matrix W, the obtained behavior is similar to matrix multiplication: ; Each feature of the vector is embedded into the qubit by encoding them as rotation angles.

[0088] Next, apply the parameter matrix W, and a single-parameter single-qubit rotation acts on each quantum circuit. These parameters Train together with other parameters of the model. Then, connect CNOT gates to entangle the qubit states. Thus, the obtained behavior is similar to matrix multiplication.

[0089] Step 604: Pulse signal construction. The input at the current moment enters the network for parameterization, and the linear addition of the final input pulse and the weights of the quantum neuron network constitutes the complete pulse signal at the current moment.

[0090] Step 605: Node representation and training. Use the quantum gradient descent method and the hybrid quantum-classical optimization algorithm in the training process to minimize the error function and gradually optimize the network parameters.

[0091] Step 606: Group the training set picture vectors according to the quantum SNN neural network.

[0092] Construct a quantum SNN network with 8 qubits, organize the single picture vector output by the input layer into a 10*56 input vector, and input this vector into the quantum SNN network.

[0093] Step 607: Perform 50 iterations of training on the handwritten picture features in the training set, and finally obtain a trained quantum SNN neural network.

[0094] Adopt the operation steps of the above embodiment, and use the Pytorch and Pennylane function libraries for joint training during training to classify the MNIST handwritten picture set, which is one of the most complex handwritten picture sets currently. This picture set has 10 classification labels and a total of 60,000 handwritten pictures, all of which are used in the simulation experiment of the present invention. Figure 7 It can be seen that the effective Loss value of the training decreases, and the Loss value of the classical neural network with the same number of parameters is lower and the accuracy is higher. Figure 8 It can be seen from the curve in that the classification accuracy of the optimal neural network continuously improves, and the classification accuracy can reach 0.96 after 50 optimizations. This is because the quantum pulse neural network (QSNN) based on the quantum relaxation gate and the network proposed in the present invention enables each quantum pulse neural network based on the quantum relaxation gate and the network to combine the characteristics of the quantum relaxation gate and exert great fitting potential. The simulation results show that the quantum pulse neural network QSNN based on the quantum relaxation gate and the network has better classification performance for the handwritten digit data set and higher resolution for different handwritten digits under the same number of parameters.

[0095] In addition, according to an exemplary embodiment of the present invention, a computer-readable storage medium storing a computer program may also be provided. The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to execute the classification method based on a quantum SNN network according to an exemplary embodiment of the present invention. The computer-readable recording medium is any data storage device that can store data readable by a computer system. Examples of the computer-readable recording medium include: read-only memory, random access memory, compact disc read-only memory, magnetic tape, floppy disk, optical data storage device, and carrier waves (such as data transmission via the Internet through wired or wireless transmission paths).

[0096] In addition, according to an exemplary embodiment of the present invention, a computing device may also be provided. The computing device includes a processor and a memory. The memory is used to store a computer program. The computer program is executed by the processor such that the processor executes the computer program of the classification method based on a quantum SNN network according to an exemplary embodiment of the present invention.

[0097] Although the present invention has been described in connection with various embodiments, however, in the process of implementing the claimed invention, those skilled in the art can understand and achieve other variations of the disclosed embodiments by viewing the drawings, the disclosure content, and the like. In the specification, the term "comprising" does not exclude other components or steps, and "a" or "one" does not exclude a plurality. A single processor or other unit can implement several functions listed in the specification. Certain measures are described in different embodiments, but this does not mean that these measures cannot be combined to produce good results.

[0098] Although the present invention has been described in connection with specific features and their embodiments, obviously, various modifications and combinations can be made without departing from the spirit and scope of the present invention. Accordingly, the present specification and the drawings are only exemplary descriptions of the present invention and are considered to have covered any and all modifications, variations, combinations, or equivalents within the scope of the present invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the present invention and its equivalent technologies, the present invention also intends to include these changes and modifications.

Claims

1. A classification method based on quantum SNN network, characterized in that: The following steps are involved: Get the normalized vector of the data to be classified; The normalized vector is represented by a quantum state using a plurality of quantum bits to obtain a quantum initial state; Parameterizing the quantum initial state through a quantum variational network, wherein the parameterization includes matrix operations, and the matrix operations are implemented using quantum gates; Using a quantum variational network to perform quantum evolution processing on the quantum initial state to obtain a quantum evolution processing result; The quantum SNN network includes quantum SNN neurons represented by a plurality of quantum relaxation gates; the quantum SNN neurons can simulate the exponential decay process of the membrane potential in the SNN; the plurality of quantum relaxation gates are connected in sequence, the first quantum relaxation gate receives the result of the quantum evolution processing, and the last one outputs the quantum final state; An output probability value is obtained according to the quantum final state of the SNN neuron, and a classification result of the data to be classified is obtained according to the output probability value.

2. The classification method based on quantum SNN network according to claim 1 is characterized in that: The quantum variational network is used to perform quantum evolution processing on the quantum initial state, comprising: A combined U gate is applied between every two adjacent qubits to form a quantum variational network; Based on the quantum variational network, multiple rounds of quantum evolution training are performed on the quantum initial state; The combined U gate includes a CNOT gate configured between two adjacent quantum bits, an RX rotation gate and an RZ rotation gate configured on the first quantum bit of the two adjacent quantum bits, and an RY rotation gate configured on the second quantum bit of the two adjacent quantum bits.

3. The classification method based on quantum SNN network according to claim 1 is characterized in that: The normalized vector is represented by a quantum state using a plurality of quantum bits to obtain a quantum initial state, including: Use H gate to initialize each qubit to superposition state; The RX rotating gate is used to phase encode the normalized vector to obtain the quantum initial state.

4. The classification method based on quantum SNN network according to claim 2 is characterized in that: The combined U gate is a forward combined U gate, and the combined U gate is applied between every two adjacent quantum bits, including: arrive For adjacent quantum bits and Apply a forward combination U gate, the forward combination U gate includes configuring a quantum bit and CNOT gates between them, configured on the quantum bit The RX and RZ revolving gates on the qubit RY revolving door on; or, The combined U gate is a reverse combined U gate, and applying the combined U gate between every two adjacent quantum bits includes: arrive For adjacent quantum bits and Applying a reverse combination U gate, the reverse combination U gate includes configuring a quantum bit and CNOT gates between them, configured on the quantum bit The RX and RZ revolving gates on the qubit RY revolving door on; The forward combination U gate is expressed as: ; in, Represents the identity matrix. According to the expression, the parameters of each part correspond to the corresponding operations and quantum bits: Corresponding to the first qubit RX rotation parameters on ; Corresponding to the second qubit RY rotation parameters on ; Corresponding to the first qubit RZ rotation parameters on ; The control bit The state is passed to the target bit , used to introduce entanglement between quantum bits; The reverse combination U gate is expressed as: ; in, Represents the identity matrix. Similar to the forward combination U-gate, the parameters of each rotation gate correspond to the rotation of a specific quantum bit. The control bit and target bit of the CNOT gate are reversely exchanged: Corresponding to the first qubit RX rotation parameters on ; Corresponding to the second qubit RY rotation parameters on ; Corresponding to the first qubit RZ rotation parameters on ; It is the reverse CNOT operation, that is, the control bit is , the target bit is .

5. The classification method based on quantum SNN network according to claim 1 is characterized in that: The decay probability of the quantum relaxation gate is expressed as: ; in, It means that the quantum system The initial probability of being in the excited state at any time, is the relaxation time constant, is a time variable, indicating that from the initial moment start.

6. The classification method based on quantum SNN network according to claim 1 is characterized in that: The quantum evolution processing result is represented by a circuit VQC, that is, ; in, Represents the input vector matrix, which contains the input feature information at the current moment. is a parameter matrix containing quantum parameters for neuron connection weights; in quantum neuron networks, the decay process of membrane potential is described by the following exponential decay model: ; in, Indicates the previous moment ( ) of the membrane potential signal, From the current moment The forward time step, is the relaxation time constant of the quantum relaxation gate, which controls the decay rate; The complete pulse signal at the current moment It is expressed as: ; That is, the pulse signal of the quantum neuron is the linear superposition of the membrane potential decay simulated by the quantum relaxation gate and the processing result of the quantum variational circuit.

7. The classification method based on quantum SNN network according to claim 1 is characterized in that: The method further comprises: The quantum relaxation gates of the quantum variational network and the quantum neural network are trained using the data to be classified in the training set. The training process uses the quantum gradient descent method and the hybrid quantum classical optimization algorithm to minimize the error function and gradually optimize the network parameters. The initial parameters of the network parameters are randomized parameters.

8. A classification device based on a quantum SNN network, characterized in that: include: A preprocessing unit, configured to obtain a normalized vector of the data to be classified; A quantum encoding unit is configured to use a plurality of quantum bits to represent the normalized vector in a quantum state to obtain a quantum initial state; An evolution unit, configured to perform quantum evolution processing on the quantum initial state using a quantum variational network; A network unit is configured to perform network classification processing on the quantum evolution processing result by using a quantum neural network constructed by a quantum relaxation gate; The output unit obtains an output probability value according to the quantum final state of the quantum neural network, and obtains the classification result of the data to be classified according to the output probability value.

9. A computer storage medium, characterized in that The computer storage medium stores instructions, and when the instructions are executed, the classification method based on the quantum SNN network described in any one of claims 1 to 7 is implemented.

10. A computing device, characterized in that It includes a processor and a communication interface coupled to the processor; the processor is used to run a computer program or instruction to implement the classification method based on the quantum SNN network as described in any one of claims 1 to 7.

Citation Information

Cited By

  • SDN (Software Defined Network) traffic forwarding optimal path generation method and system, medium and equipment

    CN122268803A