Graph maximum partitioning method and system based on quantum approximate optimization algorithm

By constructing the graph and generating the QAOA circuit, combining the neural network and linear difference algorithm to optimize the initial parameters, the problem of inefficient parameter initialization in the Max-Cut problem is solved, and a higher approximation ratio and maximum graph segmentation accuracy is achieved.

CN117273155BActive Publication Date: 2025-05-06ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311252233.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-05-06
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

QAOA faces the main challenge of parameter initialization when solving the Max-Cut problem, resulting in inefficient optimization.

Method used

By constructing a graph, the intersection of the road network is used as nodes, and the connection relationship between the intersections is represented by edge probability to generate a p-layer QAOA circuit. Use neural networks to predict initial variational parameters and combine linear difference algorithms to optimize circuit parameters to improve performance.

Benefits of technology

It realizes better initial variational parameter initialization than traditional optimizers, improves the approximate ratio of QAOA in solving the Max-Cut problem, and improves the accuracy of the maximum segmentation of the graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117273155B_ABST
    Figure CN117273155B_ABST
Patent Text Reader

Abstract

The invention discloses a maximum graph partitioning method and system based on a quantum approximate optimization algorithm. The method comprises the following steps: taking each intersection of a road network as a node, and using edge probability to represent the connectivity relationship between intersections to construct a graph; generating a p-layer QAOA circuit according to the graph; when S is p=1, using a first neural network to predict the initial variational parameters of the first layer of the QAOA circuit; when p=2, using a second neural network to predict the initial variational parameters of the first and second layers of the QAOA circuit based on the initial variational parameters of the first layer; when p≥3, using the initial variational parameters of the first and second layers of the circuit, and using a linear difference algorithm from the third layer, adding the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer, as the initial variational parameters of the current layer; running the QAOA circuit based on the initial variational parameters of each layer of the circuit, and obtaining an approximate solution for the road network partitioning; the invention obtains a good approximation ratio in processing the maximum partitioning problem of the road network graph.
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 graph maximum partitioning method and system based on a quantum approximate optimization algorithm. Background Art

[0002] With the advent of noisy intermediate-scale quantum (NISQ) devices, short-term quantum devices have a small number of noisy qubits that can only support the execution of shallow-depth circuits. Variational Quantum Algorithms (VQA) aim to exploit the capabilities and limitations of these devices to solve interesting problems such as combinatorial optimization, quantum chemistry, and quantum machine learning. These variational algorithms have great potential for application due to their flexible architecture, adaptive properties to adapt to the thresholds of quantum devices, and partial robustness to system noise. Quantum Approximate Optimization Algorithm (QAOA), a type of VQA with the prospect of quantum acceleration on near-term devices, is dedicated to finding approximate solutions to combinatorial optimization problems and has been extensively described in theory and experimentally implemented on state-of-the-art NISQ hardware. Although QAOA has gained popularity as a quantum hardware benchmark, its optimization still faces a major challenge in the NISQ era - parameter initialization. In QAOA, the state is prepared by a p-layer circuit specified by 2p variational parameters, and QAOA has nontrivial provable performance guarantees even at the smallest circuit depth (p=1). It is therefore an attractive algorithm to explore quantum speedups on near-term quantum machines.

[0003] The Max-Cut problem is one of the typical combinatorial optimization problems. It has become the canonical problem of the benchmark QAOA. This problem attempts to cut the nodes of a graph into two sets so that there are as many edges as possible between the nodes from the two sets. The Max-Cut problem is ubiquitous in various fields, such as road traffic, social networking, and finance. In traffic networks, the maximum cut problem can be used to optimize the layout of road networks. In social network analysis, the maximum cut problem can be used to identify the divisions between different groups in social networks and reveal the community structure with obvious separations in social networks. In the financial field, the maximum cut problem is used for discrete portfolio optimization.

[0004] For combinatorial optimization problems such as Max-Cut, the QAOA algorithm can achieve good results. Effective initialization and optimization strategies can greatly speed up the search for optimal solutions to problems, which is crucial for promoting the QAOA circuit to converge to the optimal expected value, and can improve the accuracy of the maximum cut problem prediction. Traditional QAOA uses gradient or non-gradient optimizers for iterative optimization to generate initial variational parameters, then bind the variational parameters to the corresponding quantum gates on the quantum circuit, and finally run the QAOA quantum circuit to measure the expected value. However, it usually takes many iterations for traditional optimizers to generate a good initial parameter before the optimized initial parameter can generate a good expected value when running on the quantum circuit.

[0005] In the related art, the patent application document with publication number CN115018080A proposes to use the quantum state obtained from each evolution as the state input of reinforcement learning, and then learn to optimize the parameters of QAOA through deep reinforcement learning, thereby solving the Max-Cut problem. The patent application document with publication number CN113935489A proposes a variational quantum model TFQ-VQA based on quantum neural network and its two-stage optimization method. In the first stage, a layer-by-layer iterative grid search method is used for the VQA instance with quantum circuit depth p=1, and the output is fed back to the classical optimizer BFGS global optimization algorithm to obtain the optimal control parameter value. In the second stage, the pre-trained TFQ-VQA model, the optimal control parameter value generated in the first stage and the target depth pt of the quantum circuit are used to predict the initial value of the control parameter of the VQA instance with depth pt. ​​The local optimizer optimizes the control variables according to the initial value of the control parameter to find the optimal parameters for the variational quantum algorithm circuit. Summary of the invention

[0006] The technical problem to be solved by the present invention is how to enable QAOA to achieve a good approximation ratio in solving the Max-Cut problem.

[0007] The present invention solves the above technical problems by the following technical means:

[0008] The present invention proposes a graph maximum partitioning method based on a quantum approximate optimization algorithm, the method comprising:

[0009] S1. Treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections. picture;

[0010] S2. According to the Figure, generating p-layer QAOA circuit;

[0011] S3, when p=1, using the first neural network to predict the initial variational parameters of the first layer of the QAOA circuit;

[0012] S4, when p=2, executing step S3 to calculate the initial variational parameters of the first layer of the circuit, and based on the initial variational parameters of the first layer, using a second neural network to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit;

[0013] S5. When p≥3, execute steps S3-S4 to calculate the initial variational parameters of the first and second layers of the circuit, and use a linear difference algorithm starting from the third layer to add the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer as the initial variational parameters of the current layer;

[0014] S6. Run the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

[0015] Further, according to the Figure , generates a p-layer QAOA circuit, including:

[0016] According to the The number of nodes in the graph is N, generating an N-qubit quantum circuit;

[0017] According to the The edge probability of the graph generates the circuit structure of the N-qubit quantum circuit.

[0018] Furthermore, the initial variational parameters are the rotation angle parameters γ of the RZ revolving gate and the RX revolving gate in the QAOA circuit. l and β l , where l = 1, 2, ..., p, and p is the number of circuit layers.

[0019] Furthermore, the first neural network adopts a gated recurrent network GRU, and the using the first neural network to predict the initial variational parameters of the first layer of the QAOA circuit includes:

[0020] The initial random parameter is concatenated with the cost corresponding to the parameter to obtain concatenated data, where the cost is the cutting value corresponding to the specified initial parameter, that is, the number of edges cut by the dividing line when the intersection is divided into two categories;

[0021] The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs;

[0022] The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

[0023] Furthermore, the second neural network adopts a convolutional neural network CNN, and the initial variational parameters of the first layer and the second layer of the QAOA circuit are predicted by the second neural network based on the initial variational parameters of the first layer, including:

[0024] Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions;

[0025] The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions;

[0026] The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

[0027] In addition, the present invention proposes a graph maximum segmentation device based on a quantum approximate optimization algorithm, the device comprising:

[0028] The graph construction module is used to treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections to construct picture;

[0029] A quantum circuit encoding module is used according to the Figure, generating p-layer QAOA circuit;

[0030] A first parameter optimization module, for predicting initial variational parameters of the first layer of the QAOA circuit using a first neural network when p=1;

[0031] A second parameter optimization module is used to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit using a second neural network based on the initial variational parameters of the first layer of the circuit calculated by the first parameter optimization module when p=2;

[0032] The third parameter optimization module is used for adding the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer when p≥3 based on the calculation results of the first parameter optimization module and the second parameter optimization module and using the linear difference algorithm starting from the third layer as the initial variational parameters of the current layer;

[0033] The circuit operation module is used to operate the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

[0034] Furthermore, the first parameter optimization module is specifically used to:

[0035] Concatenate the initial random parameter with the cost corresponding to the parameter to obtain concatenated data;

[0036] The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs;

[0037] The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

[0038] Furthermore, the second parameter optimization module is specifically used to:

[0039] Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions;

[0040] The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions;

[0041] The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

[0042] The advantages of the present invention are:

[0043] (1) The present invention constructs a network of intersections as nodes and uses edge probabilities to represent the connectivity between intersections. Figure, please The goal of maximum graph partitioning is to cut the nodes of a graph into two sets so that there are as many edges as possible between the nodes from these two sets. By encoding the objective function corresponding to graph partitioning into the quantum circuit, the maximum graph partitioning problem is converted into an approximate solution for road network planning by measuring the optimal parameter set of the QAOA circuit. A neural network is combined with a linear difference algorithm to form a classical preprocessing network for optimizing and predicting the initial parameters of the QAOA circuit. By optimizing the parameters in the preprocessing network, the initial variational parameters with better optimization effect than the classical optimizer can be finally obtained. At the same time, the circuit parameters at a higher depth are predicted, so that the performance of the quantum circuit is optimized, thereby enabling QAOA to achieve a good approximation ratio in solving the Max-Cut problem.

[0044] (2) The gated recurrent unit (GRU) predicts the parameters of the QAOA circuit with a depth of 1. GRU is a type of recurrent neural network that can effectively alleviate the problems of gradient vanishing and gradient exploding in the traditional iterative process. It has a simpler structure and converges faster. It can finally converge to a good initial parameter with very few steps, thus optimizing the circuit performance. It is also a good starting point for predicting the initial variational parameters of deeper quantum circuits.

[0045] (3) The convolutional neural network (CNN) is used to predict the QAOA circuit parameters with a depth of 2. CNN has the function of extracting features. Since the pixels in the image have similar properties to the QAOA parameters, the pixels are continuous values ​​within an interval, which is the same as the QAOA parameters. At the same time, there is a certain correlation between the optimal QAOA parameters and between adjacent pixels. Therefore, CNN can effectively extract parameter features and make predictions.

[0046] (3) For quantum circuit parameters of higher depth, the use of linear interpolation algorithm can iterate faster, and the optimal value of the parameters of the next layer can be predicted by the difference between the parameters of the first two layers, thereby expanding to higher depths.

[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flowchart of a graph maximum partitioning method based on a quantum approximate optimization algorithm proposed in one embodiment of the present invention;

[0049] Figure 2 is a graph corresponding to 8 nodes and edge probability 0.5 in one embodiment of the present invention;

[0050] Figure 3 is a schematic diagram of a QAOA circuit corresponding to 8 qubits in one embodiment of the present invention;

[0051] Figure 4 is a flow chart of QAOA initial parameter preprocessing in one embodiment of the present invention;

[0052] Figure 5 It is a comparison diagram of GRU and Adam loss iterations in one embodiment of the present invention;

[0053] Figure 6 This is a comparison diagram of the approximation ratio achieved by GRU and Adam optimization parameters in one embodiment of the present invention;

[0054] Figure 7 is the corresponding approximation ratio of the QAOA circuit parameters for preprocessing depths 1 to 12 in one embodiment of the present invention;

[0055] Figure 8 It is a structural schematic diagram of a graph maximum partitioning system based on a quantum approximate optimization algorithm proposed in one embodiment of the present invention;

[0056] Fig. 9 It is a schematic diagram of the structure of a CNN network proposed in one embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] like Figure 1 , Figure 4 As shown, the first embodiment of the present invention discloses a graph maximum partitioning method based on a quantum approximate optimization algorithm, the method comprising the following steps:

[0059] S1. Treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections. picture;

[0060] S2. According to the Figure, generating p-layer QAOA circuit;

[0061] S3, when p=1, using the first neural network to predict the initial variational parameters of the first layer of the QAOA circuit;

[0062] S4, when p=2, executing step S3 to calculate the initial variational parameters of the first layer of the circuit, and based on the initial variational parameters of the first layer, using a second neural network to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit;

[0063] S5. When p≥3, execute steps S3-S4 to calculate the initial variational parameters of the first and second layers of the circuit, and use a linear difference algorithm starting from the third layer to add the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer as the initial variational parameters of the current layer;

[0064] For circuits with higher depth, this embodiment uses a linear difference algorithm starting from the third layer. Based on the optimized second layer parameters, the difference between the parameters of the first two layers is added as the initial variational parameters of the next layer, and iterates to higher depths in turn to speed up the iteration speed.

[0065] S6. Run the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

[0066] In this embodiment, the intersections of the road network are taken as nodes, and the edge probability is used to represent the connectivity relationship between the intersections. Figure, please The goal of maximum graph partitioning is to cut the nodes of a graph into two sets so that there are as many edges as possible between the nodes from these two sets. By encoding the objective function corresponding to graph partitioning into the quantum circuit, the maximum graph partitioning problem is converted into an approximate solution for road network planning by measuring the optimal parameter set of the QAOA circuit. A neural network is combined with a linear difference algorithm to form a classical preprocessing network for optimizing and predicting the initial parameters of the QAOA circuit. By optimizing the parameters in the preprocessing network, the initial variational parameters with better optimization effect than the classical optimizer can be finally obtained. At the same time, the circuit parameters at a higher depth are predicted, so that the performance of the quantum circuit is optimized, thereby enabling QAOA to achieve a good approximation ratio in solving the Max-Cut problem.

[0067] In one embodiment, in a traffic network, each intersection is represented as a node, and the connectivity between intersections is expressed by edge probabilities to construct Figure Figure 2 As shown, it means that there are 8 intersections, and the connection probability between each intersection is 0.5; if in a social network, Figure 2 This means that there are 8 communities, and the probability of each community being connected is 0.5, which is consistent with the above The 8-bit quantum circuit corresponding to the figure is as follows Figure 3 shown.

[0068] In one embodiment, the step S2: according to the Figure , generating a p-layer QAOA circuit, specifically including the following steps:

[0069] According to the The number of nodes in the graph is N, generating an N-qubit quantum circuit;

[0070] According to the The edge probability of the graph generates the circuit structure of the N-qubit quantum circuit.

[0071] Specifically, The 4-bit quantum circuit corresponding to the figure is as follows Figure 4As shown, the initial variational parameters are the rotation angle parameters γ of the RZ revolving gate and the RX revolving gate in the QAOA circuit. l and β l , where l = 1, 2, ..., p, and p is the number of circuit layers.

[0072] By taking the road network partition as the maximum cut of a (weighted or unweighted) graph, that is, given a graph G = (V, E), where V is the vertex set and E is the edge set, the goal is to cut the nodes of a graph into two sets so that there are as many edges between the nodes from these two sets as possible. Then find the optimal solution z of Max-Cut * To maximize the objective function C(Z):

[0073]

[0074] Where E is the edge set of a given graph, w ij is the weight of edge (i, j), indicating the relationship between two intersections, z i Indicates +1, z j Represents -1, which means dividing the intersection into two categories, +1 and -1, and the division result is found by maximizing the objective function.

[0075] When using QAOA to solve the objective function, the Pauli-Z operator is used to construct the Hamiltonian H describing the maximum cut problem of the graph C :

[0076]

[0077] In the formula, Indicates that z i Quantized into a Pauli operator, Indicates that z j Quantized into a Pauli operator.

[0078] In the original algorithm for solving the maximum cut problem, a QAOA circuit of depth p is in the initial state The above consists of p layers of alternating operators:

[0079]

[0080] in, is the initial superposition state, that is, the initial state In the effect of N quantum bits passing through the Hadamard gate, β l , γ l is the variational parameter of the corresponding number of quantum gates in the QAOA circuit, is the mixed Hamiltonian, is the Pauli x operator, H C is the problem Hamiltonian, the operator You can use U M (β l )=R X (β l ) acts on all qubits simultaneously to achieve M (β l ) means that β l Packaged in the form of a U gate, R X (β l ) is the quantum gate in the corresponding quantum circuit, and the parameter β l is the rotation angle of the quantum gate, and the operator The formula is:

[0081]

[0082] Among them, γ l is the quantum gate rotation angle parameter, I is the identity matrix, Z i , Z j is the Pauli z operator, the operator Can be equivalent to That is, it can be realized by two CNOT entanglement gates and one RZ rotation gate. C (β l ) means encapsulating the quantum gate process into a U-gate form, CNOT ij Indicates the application of CNOT gate to edge (i, j), R Z (2γ l ) j Indicates that an R is applied between edge j Z Door.

[0083] When applied to solving the Max-Cut problem, QAOA approximates the ground state through mimicry:

[0084]

[0085] Where U M (β p ), U C (γ p ), U M (β1), U C (γ1) indicates that the packaged U gate is applied to the initial state of the quantum circuit.

[0086] The corresponding objective cost function is given by the expected value F of the problem Hamiltonian p Decide:

[0087] F p (γ,β)=<φ p (γ,β)|H C |φ p(γ,β)>

[0088] In the formula, F p (γ,β) represents combining this final state with the target Hamiltonian and calculating the expected value, i.e., the cost, φ p (γ, β) represents the final state of the circuit after the evolution of the above p-layer quantum circuit.

[0089] In order to find |z * >That is, the optimal situation corresponding to the road network division, by updating γ and β to maximize the objective function, find the optimal parameter γ * , β * , and then get the optimal solution.

[0090] In one embodiment, in step S3, the first neural network uses a gated recurrent network GRU, and the use of the first neural network to predict the initial variational parameters of the QAOA circuit with a depth of 1 includes:

[0091] Concatenate the initial random parameter with the cost corresponding to the parameter to obtain concatenated data;

[0092] The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs;

[0093] The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

[0094] It should be noted that the cost represents the number of edges cut by using QAOA to accurately divide the traffic intersection (the number of edges that the dividing line passes through when dividing the intersection); the initial random parameter corresponds to the rotation parameter of the quantum gate of the quantum circuit. Optimizing this parameter can improve the accuracy of the division.

[0095] Specifically, the GRU in this embodiment has two inputs, which are the initial hidden state and the data concatenated with the initial random parameters and the cost corresponding to the parameters. The GRU iterates the corresponding loss function through the expected value obtained by running the parameters, and finally returns the new cost, new parameters and new hidden state as output. Specifically, the GRU performs calculations for five time steps. The more steps, the more optimized the iterations will be, and the corresponding iteration time will be extended. The expected value calculated at each time step is used as the parameter corresponding to the maximum expected value as the initial variational parameter (p = 1).

[0096] When processing sequence data, the hidden state of the GRU is updated at each time step. But at the first time step of the sequence, an initial hidden state needs to be specified for the GRU. The most common practice is to initialize the initial hidden state with an all-zero vector, which can provide a reasonable starting point. At each time step, the GRU calculates a new hidden state based on the current input and the hidden state of the previous time step. By using a gating mechanism, the GRU can selectively retain or forget previous information and combine it with the current input. This allows the GRU to better capture long-term dependencies in the sequence.

[0097] This embodiment uses GRU to predict the first layer parameters of QAOA. GRU is a type of recurrent neural network, which can effectively alleviate the problems of gradient disappearance and gradient explosion in the traditional iterative process. At the same time, it has a simpler structure and faster convergence speed.

[0098] In one embodiment, in step S4, the second neural network adopts a convolutional neural network CNN, and the initial variational parameters of the first layer and the second layer of the QAOA circuit are predicted using the second neural network based on the initial variational parameters of the first layer, including:

[0099] Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions;

[0100] The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions;

[0101] The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

[0102] Specifically, all parts of the convolutional neural network architecture are composed of convolutional layers such as Fig. 9 In the first part, two convolutional layers are used to extract features from the input QAOA parameters. A 2×2 kernel is set in each layer. The first layer expands the input to 16 dimensions, and the second layer expands the dimension from 16 to 64. In the second part, a 3×2 convolutional kernel is used to reduce the dimension from 64 to 1 dimension as the output of the convolutional network, where the stride of all convolutional layers is 1.

[0103] In addition, this embodiment applies the rectified linear unit (ReLU) activation function to the network for nonlinear mapping. Since the convolutional neural network has the function of extracting features, the change of QAOA parameters is similar to the change of pixels in CNN to solve image problems. The optimal parameters of the circuit with a depth of 1 generated by GRU are used as the input of CNN, and the two-layer parameters corresponding to the QAOA circuit with a predicted depth of 2 are used as output.

[0104] In one embodiment, in step S5, a linear difference algorithm is used starting from the third layer, and the difference between the parameters of the first two layers is added to the initial variational parameters of the previous layer of the current layer as the initial variational parameters of the current layer, specifically:

[0105] Starting from the third layer, the linear interpolation algorithm is used. That is, based on the optimized second layer parameters, the difference between the parameters of the first two layers is added as the initial variational parameters of the third layer. For the fourth layer, based on the initial variational parameters of the third layer, the difference between the parameters of the second and third layers is added as the initial variational parameters of the fourth layer, and the algorithm is iterated to higher depths.

[0106] Specifically, starting from the third layer of the QAOA circuit, since the parameters transform linearly with the increase of p, the linear difference algorithm is used to calculate the parameter difference between the first and second layers of the circuit with a depth of 2 to predict the initial parameters of the circuit with a higher depth, and so on, which can speed up the iteration speed.

[0107] Furthermore, this embodiment combines GRU with CNN and a linear difference algorithm, and performs joint optimization to achieve parameter prediction on circuits with higher depths, and achieves good performance. The QAOA circuit is run based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for road network partitioning. By optimizing the initial variational parameters of the circuit, a good approximation ratio is obtained, which improves the accuracy of graph segmentation, which is beneficial to improving traffic fluidity and reducing congestion.

[0108] Furthermore, the GRU and CNN used in this embodiment for initial variational parameter optimization need to be trained in advance, and the specific process is as follows:

[0109] On the randomly generated 73 graphs with 8 nodes and edge probability of 0.5, the first layer variational parameters are randomly initialized, and the quantum circuit is called to calculate the expected values ​​corresponding to all graphs, which are stored in the list as costs. Then, GRU is used to perform iterative optimization for five time steps, and the angle value obtained by optimizing each time step is saved. For comparison, the classic Adam optimizer is also used to perform 5 iterative optimizations to obtain the optimized initial parameters. The loss comparison of the GRU and Adam optimization iterative process is shown in the figure below. Figure 5 As shown, GRU converges faster than Adam.

[0110] During the test of the optimized initial parameters, the generalization performance was tested on a new graph with 8 nodes and edge probability of 0.5. The parameters obtained by each iteration of the GRU and Adam optimizers during the training process were bound to the corresponding quantum gates of the corresponding 8-node QAOA quantum circuit, and then the quantum circuit was run to measure the expected value. The expected value was divided by the expected value corresponding to the optimal solution as the benchmark for measuring performance - the Approximation Ratio. It was found that the performance of the parameters optimized by GRU at each time step was better than that of the Adam optimizer. The performance comparison chart of the two preprocessing methods is shown in the figure below. Figure 6 shown.

[0111] The best initial parameters predicted by GRU are used as the starting point to input into CNN, and the new optimized two-layer parameters are predicted. Then, starting from the third layer, since the parameters are linearly transformed with the increase of p, the linear difference algorithm is used to add the difference between the parameters of the first two layers on the basis of the optimized second-layer parameters as the initial variational parameters of the next layer, and iterate to higher depths in turn: the present invention can predict the parameters of QAOA circuits with depths from 1 to 12, and the corresponding approximations are as follows: Figure 7 As shown, its approximation ratio increases with increasing depth.

[0112] The preprocessing process of the QAOA initial parameters proposed in the present invention is divided into three steps. The output between networks is used as the input of another network for joint iterative optimization. Finally, a linear algorithm is used to accelerate the iteration speed by utilizing the law of parameter change. The optimized parameter value is used as the QAOA initial parameter to run the circuit, thereby optimizing the circuit performance and obtaining a good approximation ratio in processing the maximum segmentation problem of the graph.

[0113] Furthermore, the present invention uses the approximation ratio as a metric to compare the performance of different optimization methods in solving the Maxcut problem. A It is expressed as the number of cuts obtained by the QAOA algorithm, C * represents the optimal value of Max-Cut, then the approximation ratio can be expressed as

[0114] like Figure 8 As shown, the second embodiment of the present invention discloses a graph maximum partitioning device based on a quantum approximate optimization algorithm, the device comprising:

[0115] The graph construction module is used to treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections to construct picture;

[0116] A quantum circuit encoding module is used according to the Figure, generating p-layer QAOA circuit;

[0117] A first parameter optimization module, for predicting initial variational parameters of the first layer of the QAOA circuit using a first neural network when p=1;

[0118] A second parameter optimization module is used to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit using a second neural network based on the initial variational parameters of the first layer of the circuit calculated by the first parameter optimization module when p=2;

[0119] The third parameter optimization module is used for adding the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer when p≥3 based on the calculation results of the first parameter optimization module and the second parameter optimization module and using the linear difference algorithm starting from the third layer as the initial variational parameters of the current layer;

[0120] The circuit operation module is used to operate the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

[0121] In one embodiment, the graph construction module is specifically used to:

[0122] According to the The number of nodes in the graph is N, generating an N-qubit quantum circuit;

[0123] According to the Edge probability of the graph, generating the circuit structure of the N-qubit quantum circuit

[0124] In one embodiment, the initial variational parameters are the rotation angle parameters γ of the RZ revolving gate and the RX revolving gate in the QAOA circuit. l and β l , where l = 1, 2, ..., p, and p is the number of circuit layers.

[0125] In one embodiment, the first parameter optimization module is specifically used to:

[0126] Concatenate the initial random parameter with the cost corresponding to the parameter to obtain concatenated data;

[0127] The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs;

[0128] The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

[0129] In one embodiment, the second parameter optimization module is specifically used to:

[0130] Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions;

[0131] The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions;

[0132] The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

[0133] It should be noted that other embodiments of the device for maximum graph segmentation based on the quantum approximate optimization algorithm of the present invention or implementation methods thereof can refer to the above-mentioned method embodiments, which will not be repeated here.

[0134] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0135] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0136] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A graph maximum partitioning method based on quantum approximate optimization algorithm, characterized in that: The method comprises: S1. Treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections. -Rényi diagram; S2. According to the -Rényi diagram, generating p-layer QAOA circuit; S3, when p=1, using the first neural network to predict the initial variational parameters of the first layer of the QAOA circuit; S4, when p=2, executing step S3 to calculate the initial variational parameters of the first layer of the circuit, and based on the initial variational parameters of the first layer, using a second neural network to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit; S5. When p≥3, execute steps S3-S4 to calculate the initial variational parameters of the first and second layers of the circuit, and use a linear difference algorithm starting from the third layer to add the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer as the initial variational parameters of the current layer; S6. Run the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

2. The graph maximum partitioning method based on quantum approximate optimization algorithm according to claim 1, characterized in that: According to the -Rényi diagram, generating p-layer QAOA circuits, including: According to the -Number of nodes in the Rényi graph, N qubit quantum circuits are generated; According to the -Edge probabilities of the Rényi graph, generating the circuit structure of an N-qubit quantum circuit.

3. The graph maximum partitioning method based on quantum approximate optimization algorithm according to claim 1 is characterized in that: The initial variational parameters are the rotation angle parameters γ of the RZ revolving gate and the RX revolving gate in the QAOA circuit. l and β l , where l = 1, 2, ..., p, and p is the number of circuit layers.

4. The graph maximum partitioning method based on quantum approximate optimization algorithm according to claim 1, characterized in that: The first neural network adopts a gated recurrent network GRU, and the use of the first neural network to predict the initial variational parameters of the first layer of the QAOA circuit includes: Concatenate the initial random parameter with the cost corresponding to the parameter to obtain concatenated data; The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs; The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

5. The graph maximum partitioning method based on quantum approximate optimization algorithm according to claim 1, characterized in that: The second neural network adopts a convolutional neural network CNN, and the initial variational parameters of the first layer and the second layer of the QAOA circuit are predicted by the second neural network based on the initial variational parameters of the first layer, including: Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions; The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions; The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

6. A graph maximum partitioning device based on quantum approximate optimization algorithm, characterized in that: The device comprises: The graph construction module is used to treat each intersection of the road network as a node and use edge probability to represent the connectivity between intersections to construct -Rényi diagram; A quantum circuit encoding module is used according to the -Rényi diagram, generating p-layer QAOA circuit; A first parameter optimization module, for predicting initial variational parameters of the first layer of the QAOA circuit using a first neural network when p=1; A second parameter optimization module is used to predict the initial variational parameters of the first layer and the second layer of the QAOA circuit using a second neural network based on the initial variational parameters of the first layer of the circuit calculated by the first parameter optimization module when p=2; The third parameter optimization module is used for adding the difference between the parameters of the first two layers to the initial variational parameters of the previous layer of the current layer when p≥3 based on the calculation results of the first parameter optimization module and the second parameter optimization module and using the linear difference algorithm starting from the third layer as the initial variational parameters of the current layer; The circuit operation module is used to operate the QAOA circuit based on the initial variational parameters of each layer of the circuit to obtain an approximate solution for the road network partitioning.

7. The graph maximum partitioning device based on quantum approximate optimization algorithm according to claim 6, characterized in that: The graph construction module is specifically used for: According to the -Number of nodes in the Rényi graph, N qubit quantum circuits are generated; According to the -Edge probabilities of the Rényi graph, generating the circuit structure of an N-qubit quantum circuit.

8. The graph maximum partitioning device based on quantum approximate optimization algorithm according to claim 6, characterized in that: The initial variational parameters are the rotation angle parameters γ of the RZ revolving gate and the RX revolving gate in the QAOA circuit. l and β l , where l = 1, 2, ..., p, and p is the number of circuit layers.

9. The graph maximum partitioning device based on quantum approximate optimization algorithm according to claim 6, characterized in that: The first parameter optimization module is specifically used for: Concatenate the initial random parameter with the cost corresponding to the parameter to obtain concatenated data; The initial hidden state h0 and the concatenated data are used as inputs of the GRU, the expected value obtained by running the initial random parameters is iterated through the loss function, and the new cost, the new initial random parameters and the new hidden state are returned to the input of the GRU as outputs; The set time step is executed, and the expected value corresponding to each time step is calculated, and the parameter corresponding to the maximum expected value is used as the initial variational parameter of the first layer of the QAOA circuit.

10. The graph maximum partitioning device based on quantum approximate optimization algorithm according to claim 6, characterized in that: The second parameter optimization module is specifically used for: Using the initial variational parameters of the first layer of the QAOA circuit as input to a convolutional layer 1, wherein the convolutional layer 1 is used to expand the input data to 16 dimensions; The output of the convolutional layer 1 is connected to the convolutional layer 2, and the convolutional layer 2 is used to expand the input of the convolutional layer 2 to 64 dimensions; The output of the convolutional layer 2 is connected to the convolutional layer 3, and the convolutional layer 3 is used to reduce the dimension of the input of the convolutional layer 3 to 1 dimension and then output the initial variational parameters of the first layer and the second layer of the QAOA circuit.

Citation Information

Patent Citations

  • Variable component submodel TFQ-VQA based on quantum neural network and two-stage optimization method thereof

    CN113935489A

  • Graph maximum segmentation problem solving method based on QAOA parameter optimization

    CN115018080A