Efficient XOR Oracle construction method and system under multi-constraint condition
Through the method of recursive tree structure and quantum circuit mapping device, through the recursive tree construction device and quantum circuit mapping device, the technology is applied to solve the specific application field of constructing Oracle in the existing technology, specifically to solve the flexibility and efficiency problems of constructing XOR Oracle in the existing technology, and realizes the deep optimization and performance solution under the same bit resources.
Patent Information
- Application Number
- CN202510792527.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-23
AI Technical Summary
When constructing XOR Oracle, existing technologies have problems such as limited optimization of the number of quantum bits and circuit depth, poor flexibility, and heavy user decision-making burden.
A recursive tree structure is used to model the quantum circuit of XOR Oracle. Through the recursive tree construction device and quantum circuit mapping device, the optimal quantum circuit solution is automatically optimized and generated according to the number of quantum bits and constraints given by the user, realizing the flexibility of depth-space conversion.
With the same bit resources, the depth performance and ease of use of XOR Oracle are significantly improved, and the number of auxiliary quantum bits or circuit depth can be selected as needed to achieve the optimal effect.
Smart Images

Figure CN120687436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and in particular to a method and system for constructing an efficient XOR Oracle under multiple constraints. Background Art
[0002] Quantum computing has proven to have enormous potential across multiple application areas. Its application is inseparable from the development of algorithms. Currently, various types of quantum algorithms have been developed, including one based on an oracle. An oracle can be simply understood as a black box that maps inputs to outputs. Quantum algorithm designers do not need to consider the implementation of the oracle when designing the algorithm, but rather treat it as a single, integrated module capable of performing a specific function. However, to actually run a quantum algorithm on a quantum computer, the oracle must be constructed using quantum circuits. The additional qubits used to construct the oracle and the depth of the quantum circuit consumed also have a profound impact on the algorithm's performance, making the construction of the oracle a critical issue. One commonly used type of oracle is the XOR oracle.
[0003] The paper "Optimizing the Quantum Circuit for Solving Boolean Equations Based on Grover Search Algorithm" proposes using qubit reuse to construct the oracle component of the Grover algorithm, enabling the computation of more equations using fewer auxiliary qubits. However, this method lacks flexibility due to its lack of depth-space conversion. Furthermore, its optimization capabilities for both the number of qubits and the depth of the quantum circuit are limited.
[0004] The paper "Resource Efficient Boolean Function Solver on Quantum Computer" proposes a quantum circuit construction method based on the Grover algorithm to solve Boolean equations and has depth-space trade-off characteristics. However, it mainly achieves trade-offs by providing multiple discrete preset schemes for users to choose from, which may lead to non-optimal solutions and user decision-making burdens.
[0005] The patents "A method and device for solving nonlinear equations based on quantum circuits", "A method and device for solving nonlinear ordinary differential equations based on quantum circuits", "A method and device for solving quadratic nonlinear equations based on quantum circuits", and "A method and device for solving linear equations based on quantum computing" all propose solution processes for solving equations based on quantum circuits. They all directly use Oracle components without discussing the specific implementation of Oracle. Moreover, their methods are targeted at specific equations and are not universal. Summary of the Invention
[0006] In order to further optimize the number of quantum bits and circuit depth consumed in constructing XOR Oracle, the present invention proposes an efficient XOR Oracle construction method and system for multiple constraints, which has the flexibility of depth-space conversion. Users can choose to use more auxiliary quantum bits to achieve less circuit depth, or use more circuit depth to save the number of auxiliary quantum bits; the present invention proposes a resource-driven adaptive construction mechanism, which uses the number of quantum bits given by the user as the input constraint, and automatically optimizes and generates a solution with better quantum circuit depth performance under the resource conditions. Compared with the non-optimal solution and user decision-making burden that may result from the selection of the preset solution, the present invention can ensure better depth performance under the same bit resources and significantly improve the ease of use of the solution; and the XOROracle constructed by the present invention can be used to solve all types of equations involved in the above patent.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] On the one hand, the present invention provides an efficient XOR Oracle construction method for multiple constraints, comprising:
[0009] Step 1: Obtain n quantum bits with an initial state of |0>, denoted as SQ, m auxiliary quantum bits with an initial state of |0>, denoted as AQ, k constraints, and k constraints f. i (x) = 0, i = 1, 2, 3, ..., k;
[0010] Step 2: Perform the Hadamard gate evolution operation on SQ, so that the quantum state evolves into a uniform superposition state. At this time, n SQs represent a size of 2 n Search space;
[0011] Step 3: Using the number of auxiliary qubits m and the number of constraints k as inputs to the recursive tree construction device to obtain a recursive tree structure;
[0012] Step 4: Input the recursive tree structure into the quantum circuit mapping device to obtain the mapped quantum circuit structure, completing the quantum circuit construction of the XOR Oracle.
[0013] Furthermore, the recursive tree construction device constructs the recursive tree structure in the following manner:
[0014] Step 3.1: Set up an empty queue data structure Q, an empty tree structure tree, and several tree node data structures node. Each node is marked with a value, called the node size, which indicates the number of AQs owned by a module in the quantum circuit corresponding to the node.
[0015] Step 3.2: Take a node, denoted as node0, and insert it into the tree as the root node. The size of the root node is the total number m of AQ, and insert node0 into the tail of queue Q;
[0016] Step 3.3: Calculate the number of leaf nodes in the tree. If the number of leaf nodes is equal to the number of constraints k, output the current recursive tree structure and the construction algorithm ends. If the two are not equal, go to step 3.4.
[0017] Step 3.4: If the queue Q is empty, an error message is displayed: too many constraints. Otherwise, read the node at the head of the queue Q, denoted as node', and the size of node' is denoted as m'.
[0018] Step 3.5: If m' is not greater than 2, pop the node from the queue Q and go back to step 3.4; otherwise, continue to step 3.6;
[0019] Step 3.6: If the number of child nodes of node' is equal to m'-1, pop this node from the queue Q and go back to step 3.4. Otherwise, continue to step 3.7.
[0020] Step 3.7: Index all child nodes of node' from the tree and compare them to get the maximum size of the child nodes, which is recorded as max_m; if node' has no child nodes, max_m is m'-1;
[0021] Step 3.8: Take a new node data structure node, denoted as node', set the size of node' to max_m-1, insert node' into tree as a child node of node', and insert it into the tail of queue Q, and go to step 3.3.
[0022] Furthermore, the quantum circuit mapping device obtains the mapped quantum circuit structure based on the recursive tree structure in the following manner:
[0023] Starting from the root node, traverse each node of the recursive tree structure and map quantum circuits to each node in turn. The mapping rules are as follows:
[0024] If the node is a leaf node, the leaf node size is m', and the AQ with index number m' is used to store the result of the constraint calculation to encode a constraint;
[0025] If the node is not a leaf node, all its child nodes are encoded first, and then the MCT gate is used to perform the merging operation of the constraints, and then the inverse operation of the quantum circuits of all child nodes is performed to restore the state of AQ.
[0026] Another aspect of the present invention provides an efficient XOR Oracle construction system for multiple constraints, comprising:
[0027] The information acquisition unit is used to obtain n quantum bits with an initial state of |0>, which is denoted as SQ, m auxiliary quantum bits with an initial state of |0>, which is denoted as AQ, and k constraints. i (x) = 0, i = 1, 2, 3, ..., k;
[0028] The gate evolution unit is used to perform the Hadamard gate evolution operation on SQ, so that the quantum state therein evolves into a uniform superposition state. At this time, n SQs represent a size of 2 n Search space;
[0029] A recursive tree construction unit, configured to take the number m of auxiliary quantum bits and the number k of constraint conditions as inputs of a recursive tree construction device to obtain a recursive tree structure;
[0030] The quantum circuit mapping unit is used to input the recursive tree structure into the quantum circuit mapping device, obtain the mapped quantum circuit structure, and complete the quantum circuit construction of the XOR Oracle.
[0031] Furthermore, the recursive tree construction device constructs the recursive tree structure in the following manner:
[0032] Step 3.1: Set up an empty queue data structure Q, an empty tree structure tree, and several tree node data structures node. Each node is marked with a value, called the node size, which indicates the number of AQs owned by a module in the quantum circuit corresponding to the node.
[0033] Step 3.2: Take a node, denoted as node0, and insert it into the tree as the root node. The size of the root node is the total number m of AQ, and insert node0 into the tail of queue Q;
[0034] Step 3.3: Calculate the number of leaf nodes in the tree. If the number of leaf nodes is equal to the number of constraints k, output the current recursive tree structure and the construction algorithm ends. If the two are not equal, go to step 3.4.
[0035] Step 3.4: If the queue Q is empty, an error message is displayed: too many constraints. Otherwise, read the node at the head of the queue Q, denoted as node', and the size of node' is denoted as m'.
[0036] Step 3.5: If m' is not greater than 2, pop the node from the queue Q and go back to step 3.4; otherwise, continue to step 3.6;
[0037] Step 3.6: If the number of child nodes of node' is equal to m'-1, pop this node from the queue Q and go back to step 3.4. Otherwise, continue to step 3.7.
[0038] Step 3.7: Index all child nodes of node' from the tree and compare them to get the maximum size of the child nodes, which is recorded as max_m; if node' has no child nodes, max_m is m'-1;
[0039] Step 3.8: Take a new node data structure node, denoted as node', set the size of node' to max_m-1, insert node' into tree as a child node of node', and insert it into the tail of queue Q, and go to step 3.3.
[0040] Furthermore, the quantum circuit mapping device obtains the mapped quantum circuit structure based on the recursive tree structure in the following manner:
[0041] Starting from the root node, traverse each node of the recursive tree structure and map quantum circuits to each node in turn. The mapping rules are as follows:
[0042] If the node is a leaf node, the leaf node size is m', and the AQ with index number m' is used to store the result of the constraint calculation to encode a constraint;
[0043] If the node is not a leaf node, all its child nodes are encoded first, and then the MCT gate is used to perform the merging operation of the constraints, and then the inverse operation of the quantum circuits of all child nodes is performed to restore the state of AQ.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The present invention proposes an efficient XOR Oracle construction method and system for multiple constraints, which uses a recursive tree structure to model the quantum circuit structure of XOR Oracle and converts the quantum circuit construction process of XOR Oracle into a corresponding recursive tree construction process. Each node in the recursive tree represents a module of a quantum circuit, and the size of the recursive tree represents the number of auxiliary quantum bits owned by the module. The present invention can automatically provide the optimal Oracle quantum circuit implementation solution based on the user's existing number of auxiliary quantum bits and the number of constraints that need to be encoded. The present invention has the flexibility of depth-space conversion. The user can choose to use more auxiliary quantum bits to achieve less circuit depth, or use more circuit depth to save the number of auxiliary quantum bits. In either case, the present invention can ensure that the circuit depth achieves the most ideal effect when using the same number of auxiliary quantum bits as other construction schemes. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Schematic diagram of the XOR Oracle quantum circuit provided by an embodiment of the present invention;
[0047] Figure 2 A flowchart of a method for constructing an efficient XOR Oracle under multiple constraints provided by an embodiment of the present invention;
[0048] Figure 3 A flow chart of a recursive tree construction algorithm in a recursive tree construction device provided by an embodiment of the present invention;
[0049] Figure 4 Flowchart of the execution of the quantum circuit mapping device provided in an embodiment of the present invention;
[0050] Figure 5 A schematic diagram of the quantum circuit of the Grover algorithm provided in an embodiment of the present invention;
[0051] Figure 6 Schematic diagram of the Phase Oracle quantum circuit provided by an embodiment of the present invention;
[0052] Figure 7 One of the Oracle conversion diagrams provided in an embodiment of the present invention;
[0053] Figure 8 A schematic diagram of a recursive tree structure provided by an embodiment of the present invention;
[0054] Figure 9 A schematic diagram of a recursive tree structure mapping provided by an embodiment of the present invention;
[0055] Figure 10 The second Oracle conversion diagram provided by the embodiment of the present invention;
[0056] Figure 11 The overall flow chart of using the Grover algorithm to solve a 7-variable Boolean equation system when the number of auxiliary qubits provided in an embodiment of the present invention is 4;
[0057] Figure 12 A schematic diagram of the architecture of an efficient XOR Oracle construction system under multiple constraints provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0059] This paper proposes an efficient XOR Oracle construction method for multiple constraints. The problem is described as follows:
[0060] Given a multi-constraint condition, assume that it is abstracted into a mathematical function f1(x)=0,f2(x)=0,…,f k (x) = 0, and it is required to construct the quantum circuit of XOR Oracle under this multi-constraint condition.
[0061] The function of XOR Oracle is O|x>|0>=|x>|f(x)>, and the corresponding quantum circuit diagram is as follows Figure 1 shown.
[0062] where f(x) is the value that satisfies all f i Elements where (x)=0(i=1,2,3,…,k)=0.
[0063] like Figure 2 As shown, the process of an efficient XOR Oracle construction method under multiple constraints proposed by the present invention is as follows:
[0064] S101: Obtain n quantum bits with an initial state of |0>, denoted as SQ, m auxiliary quantum bits with an initial state of |0>, denoted as AQ, and k constraints f i (x)=0(i=1,2,3,…,k)=0;
[0065] S102: Perform the Hadamard gate evolution operation on SQ, so that the quantum state therein evolves into a uniform superposition state. At this time, n SQs can represent a state of size 2 n The search space.
[0066] S103: Based on the number of auxiliary quantum bits m and the number of constraints k, as inputs of the recursive tree construction device, the structure of the recursive tree is obtained.
[0067] S104: Input the recursive tree structure into the quantum circuit mapping device to obtain the mapped quantum circuit structure, which is the quantum circuit of the XOR Oracle to be constructed.
[0068] Furthermore, the recursive tree construction device described in S103 accepts a number m of auxiliary quantum bits and a number k of constraints and outputs a recursive tree structure. Figure 3 As shown, the recursive tree construction algorithm in the recursive tree construction device is as follows:
[0069] S103.1: Prepare an empty queue data structure Q, an empty tree structure tree, and several tree node data structures node. Each node is marked with a value, called the node size, which indicates the number of AQs owned by a module in the quantum circuit corresponding to the node.
[0070] S103.2: Take a node, denoted as node0, and insert it into the tree as the root node. The size of the root node is the total number m of AQ, and node0 is inserted at the end of the queue Q.
[0071] S103.3: Calculate the number of leaf nodes in the tree. If the number of leaf nodes is equal to the number of constraints k, output the current recursive tree structure and the construction algorithm ends; if the two are not equal, go to S103.4.
[0072] S103.4: If the queue Q is empty, an error is reported: too many constraints; otherwise, the node at the head of the queue Q is read, recorded as node', and the size of node' is recorded as m'.
[0073] S103.5: If m' is less than or equal to 2, pop this node from the queue Q and return to S103.4; otherwise, continue to execute S103.6.
[0074] S103.6: If the number of child nodes of node' is equal to m'-1, pop this node from the queue Q and return to S103.4; otherwise, continue to execute S103.7.
[0075] S103.7: Index all child nodes of node' from tree and compare to get the maximum size of the child nodes, denoted as max_m; if node' has no child nodes at this time, max_m is m'-1.
[0076] S103.8: Take a new data structure node, denoted as node', set the size of node' to max_m-1, insert node' into tree as a child node of node', and insert it into the tail of queue Q, and go to S103.3.
[0077] Furthermore, if Figure 4 As shown, the quantum circuit mapping device described in S104 works as follows:
[0078] Starting from the root node, traverse each node of the tree and map quantum circuits to each node in turn. The mapping rules are as follows:
[0079] ① If the node is a leaf node and the leaf node size is m', the AQ with index number m' is used to store the calculation result of the constraint to encode a constraint.
[0080] ②If the node is not a leaf node, first encode all its child nodes, then use the MCT gate to perform the constraint merging operation, and then perform the inverse operation of the quantum circuits of all child nodes to restore the state of AQ.
[0081] As a specific implementation method, assume that an application scenario is that a user uses the Grover algorithm to solve a Boolean equation system with 7 variables, and assumes that the number of auxiliary quantum bits is 4. The quantum circuit diagram of the Grover algorithm is as follows: Figure 5 shown.
[0082] A key issue involved is to construct the Oracle structure. It is known that the Oracle in Grover's algorithm is a Phase Oracle, and its function is O|x>|0>=(-1) f(x) |x>|0>, the circuit structure is as follows Figure 6 shown.
[0083] To solve this problem, combined with the XOR Oracle construction method proposed in this invention, the steps for solving this problem are as follows:
[0084] (1) Prepare 7 initializations The quantum bits are used to encode the search space, denoted as SQ; prepare 4 initializations The quantum bit is used as an auxiliary quantum bit, denoted as AQ.
[0085] (2) Performing Hadamard transformation on the 7 SQs, the quantum states of the 7 SQs evolve into a uniform superposition state.
[0086] (3) Use the Oracle conversion device to convert the Phase Oracle construction problem in the Grover algorithm into the XOR Oracle construction problem. Figure 7 shown.
[0087] (4) Execute the recursive tree construction device to generate a recursive tree under 7 constraints and 5 AQ conditions (an auxiliary quantum bit must be added when PhaseOracle is converted to XOR Oracle). Figure 8 shown.
[0088] (5) Execute the quantum circuit mapping device to map the recursive tree structure into a quantum circuit. Figure 9 shown.
[0089] (6) Execute the Oracle converter to convert the generated XOR Oracle quantum circuit structure into the Phase Oracle quantum circuit structure. Figure 10 shown.
[0090] (7) Execute Grover's algorithm to obtain the solution of the Boolean equations.
[0091] The flowchart of the whole process is as follows Figure 11 shown.
[0092] Based on the above embodiments, Figure 12 As shown, the present invention also proposes an efficient XOR Oracle construction system for multiple constraints, including:
[0093] The information acquisition unit is used to obtain n quantum bits with an initial state of |0>, which are encoded in the search space, denoted as SQ, m auxiliary quantum bits with an initial state of |0>, denoted as AQ, and k constraints f i (x)=0(i=1,2,3,…,k)=0;
[0094] The gate evolution unit is used to perform the Hadamard gate evolution operation on SQ, so that the quantum state therein evolves into a uniform superposition state. At this time, n SQs represent a size of 2 n Search space;
[0095] A recursive tree construction unit, configured to take the number m of auxiliary quantum bits and the number k of constraint conditions as inputs of a recursive tree construction device to obtain a recursive tree structure;
[0096] The quantum circuit mapping unit is used to input the recursive tree structure into the quantum circuit mapping device, obtain the mapped quantum circuit structure, and complete the quantum circuit construction of the XOR Oracle.
[0097] In summary, the main improvements of the present invention are:
[0098] 1. The quantum circuit structure within the XOR Oracle has a certain recursive nature. This paper uses a recursive tree structure to model the quantum circuit structure of the XOR Oracle and converts the quantum circuit construction process of the XOR Oracle into a corresponding recursive tree construction process. Each node in the recursive tree represents a quantum circuit module, and the size of the recursive tree represents the number of auxiliary qubits possessed by the module.
[0099] 2. By analyzing the circuit depth of each node on the recursive tree corresponding to the module in the quantum circuit, the priority of node growth in the recursive tree construction process can be obtained. Therefore, a recursive tree construction device is designed and a recursive tree construction algorithm is integrated.
[0100] 3. The constructed recursive tree is mapped to the actual quantum circuit structure through the quantum circuit mapping device to obtain the final XOR Oracle structure.
[0101] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An efficient XOR Oracle construction method for multiple constraints, characterized by: include: Step 1: Obtain n quantum bits with an initial state of |0>, denoted as SQ, m auxiliary quantum bits with an initial state of |0>, denoted as AQ, and k constraints f i (x) = 0, i = 1, 2, 3, ..., k; Step 2: Perform the Hadamard gate evolution operation on SQ, so that the quantum state evolves into a uniform superposition state. At this time, n SQs represent a size of 2 n Search space; Step 3: Using the number of auxiliary qubits m and the number of constraints k as inputs to the recursive tree construction device to obtain a recursive tree structure; Step 4: Input the recursive tree structure into the quantum circuit mapping device to obtain the mapped quantum circuit structure, completing the quantum circuit construction of XOROracle.
2. The efficient XOR Oracle construction method for multiple constraints according to claim 1, characterized in that: The recursive tree construction device constructs a recursive tree structure in the following manner: Step 3.1: Set up an empty queue data structure Q, an empty tree structure tree, and several tree node data structures node. Each node is marked with a value, called the node size, which indicates the number of AQs owned by a module in the quantum circuit corresponding to the node. Step 3.2: Take a node, denoted as node0, and insert it into the tree as the root node. The size of the root node is the total number m of AQ, and insert node0 into the tail of queue Q; Step 3.3: Calculate the number of leaf nodes in the tree. If the number of leaf nodes is equal to the number of constraints k, output the current recursive tree structure and the construction algorithm ends. If the two are not equal, go to step 3.
4. Step 3.4: If the queue Q is empty, an error message is displayed: too many constraints. Otherwise, read the node at the head of the queue Q, denoted as node', and the size of node' is denoted as m'. Step 3.5: If m' is not greater than 2, pop the node from the queue Q and go back to step 3.4; otherwise, continue to step 3.6; Step 3.6: If the number of child nodes of node' is equal to m'-1, pop this node from the queue Q and go back to step 3.
4. Otherwise, continue to step 3.
7. Step 3.7: Index all child nodes of node' from the tree and compare them to get the maximum size of the child nodes, which is recorded as max_m; if node' has no child nodes, max_m is m'-1; Step 3.8: Take a new node data structure node, denoted as node', set the size of node' to max_m-1, insert node' into tree as a child node of node', and insert it into the tail of queue Q, and go to step 3.
3.
3. The efficient XOR Oracle construction method for multiple constraints according to claim 2, characterized in that: The quantum circuit mapping device obtains the mapped quantum circuit structure based on the recursive tree structure in the following manner: Starting from the root node, traverse each node of the recursive tree structure and map quantum circuits to each node in turn. The mapping rules are as follows: If the node is a leaf node, the leaf node size is m', and the AQ with index number m' is used to store the result of the constraint calculation to encode a constraint; If the node is not a leaf node, all its child nodes are encoded first, and then the MCT gate is used to perform the merging operation of the constraints, and then the inverse operation of the quantum circuits of all child nodes is performed to restore the state of AQ.
4. An efficient XOR Oracle construction system for multiple constraints, characterized by: include: The information acquisition unit is used to obtain n quantum bits with an initial state of |0>, which is denoted as SQ, m auxiliary quantum bits with an initial state of |0>, which is denoted as AQ, and k constraints. i (x) = 0, i = 1, 2, 3, ..., k; The gate evolution unit is used to perform the Hadamard gate evolution operation on SQ, so that the quantum state therein evolves into a uniform superposition state. At this time, n SQs represent a size of 2 n Search space; A recursive tree construction unit, configured to take the number m of auxiliary quantum bits and the number k of constraint conditions as inputs of a recursive tree construction device to obtain a recursive tree structure; The quantum circuit mapping unit is used to input the recursive tree structure into the quantum circuit mapping device, obtain the mapped quantum circuit structure, and complete the quantum circuit construction of the XOR Oracle.
5. The efficient XOR Oracle construction system for multiple constraints according to claim 4, characterized in that: The recursive tree construction device constructs a recursive tree structure in the following manner: Step 3.1: Set up an empty queue data structure Q, an empty tree structure tree, and several tree node data structures node. Each node is marked with a value, called the node size, which indicates the number of AQs owned by a module in the quantum circuit corresponding to the node. Step 3.2: Take a node, denoted as node0, and insert it into the tree as the root node. The size of the root node is the total number m of AQ, and insert node0 into the tail of queue Q; Step 3.3: Calculate the number of leaf nodes in the tree. If the number of leaf nodes is equal to the number of constraints k, output the current recursive tree structure and the construction algorithm ends. If the two are not equal, go to step 3.
4. Step 3.4: If the queue Q is empty, an error message is displayed: too many constraints. Otherwise, read the node at the head of the queue Q, denoted as node', and the size of node' is denoted as m'. Step 3.5: If m' is not greater than 2, pop the node from the queue Q and go back to step 3.4; otherwise, continue to step 3.6; Step 3.6: If the number of child nodes of node' is equal to m'-1, pop this node from the queue Q and go back to step 3.
4. Otherwise, continue to step 3.
7. Step 3.7: Index all child nodes of node' from the tree and compare them to get the maximum size of the child nodes, which is recorded as max_m; if node' has no child nodes, max_m is m'-1; Step 3.8: Take a new node data structure node, denoted as node', set the size of node' to max_m-1, insert node' into tree as a child node of node', and insert it into the tail of queue Q, and go to step 3.
3.
6. The efficient XOR Oracle construction system for multiple constraints according to claim 5, characterized in that: The quantum circuit mapping device obtains the mapped quantum circuit structure based on the recursive tree structure in the following manner: Starting from the root node, traverse each node of the recursive tree structure and map quantum circuits to each node in turn. The mapping rules are as follows: If the node is a leaf node, the leaf node size is m', and the AQ with index number m' is used to store the result of the constraint calculation to encode a constraint; If the node is not a leaf node, all its child nodes are encoded first, and then the MCT gate is used to perform the merging operation of the constraints, and then the inverse operation of the quantum circuits of all child nodes is performed to restore the state of AQ.