Method and device for determining target object
By using the quantum approximation optimization algorithm QAOA circuit, combined with initialization and phase separation circuits, the problem of low accuracy in manually selecting representative objects is solved, and more efficient determination of object representativeness is achieved.
Patent Information
- Application Number
- CN202511562579.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, the accuracy of manually selecting representative objects is low, and subjective factors can affect the results, lacking an effective solution.
The quantum approximation optimization algorithm QAOA circuit is used to determine the target object by alternating between initialization circuit, phase separation circuit and hybrid circuit, combined with correlation coefficient.
It improves the accuracy of selecting representative objects, reduces errors from manual selection, and achieves more efficient determination of object representativeness.
Smart Images

Figure CN121390348A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and more specifically, to a method and apparatus for determining a target object. Background Technology
[0002] In relevant fields, it is often necessary to select representative objects for comprehensive analysis. For example, in the logistics industry, representative warehouses are selected from a large number of warehouses to analyze logistics operations. In the catering industry, representative restaurants are selected from a large number of restaurants to analyze consumer spending in the catering sector. In the tourism industry, representative tourist attractions are selected from a large number of tourist sites to analyze people's choices of travel destinations. In the financial industry, representative stocks are selected from a large number of stocks to analyze financial issues.
[0003] Currently, various fields typically require professionals to select representative warehouses, which demands a high level of expertise from these professionals. For example, in the logistics field, selecting warehouses usually requires understanding the logistics situation of warehouses in different regions to identify representative warehouses. Furthermore, manual selection of representative warehouses is subject to subjective factors, resulting in low accuracy.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method and apparatus for determining a target object, so as to at least solve the technical problem in the related art that the accuracy of manually selecting representative objects in the related field is low.
[0006] According to one aspect of the embodiments of this application, a method for determining target objects is provided, comprising: creating a quantum approximation optimization algorithm (QAOA) circuit, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit alternating, where p and n are integers greater than or equal to 1; obtaining correlation coefficients between n objects; and determining m target objects among the n objects using the correlation coefficients and the QAOA circuit, where m is an integer less than or equal to n.
[0007] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit includes: creating the QAOA circuit includes... n qubits; will store n 2 The container for the n qubits is defined as a first register, wherein the qubits in the first register are divided into n groups, each group comprising n qubits; and the container for storing the n qubits is defined as a second register.
[0008] In one exemplary embodiment, the second register is configured with a Dicke-state, and the first set of registers constructs the W state of n qubits.
[0009] In one exemplary embodiment, the method further includes: constructing the W state in the first register for the first time by constructing the n-qubit W state in a first set of qubits in the first register.
[0010] In one exemplary embodiment, the method further includes: preparing the W state on the last m qubits of the k-th group of the first register, where k is less than n.
[0011] In an exemplary embodiment, preparing the W state on the last m qubits in the kth group of the first register includes: determining the jth qubit of the second register as a control bit, wherein j is greater than 0 and less than or equal to n; and determining the last qubit in the (k+1)th group of the first register and the jth qubit in the kth group of the first register as active bits.
[0012] In one exemplary embodiment, the method further includes: in the second register, sequentially performing a swap gate between the first qubit and the remaining qubits.
[0013] In one exemplary embodiment, the method further includes: activating the j-th qubit of the i-th group of the first register. The gate is determined to be a phase-separated circuit, in which, Let represent the correlation coefficient between the i-th object and the j-th object, where i and j are greater than 0 and less than or equal to n.
[0014] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit includes: creating the initialization circuit, wherein the initialization circuit includes quantum gates of uniform superposition states. .
[0015] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit further includes: using quantum gates... The inverse gate, CNOT gate, RZ(β) gate, and the quantum gate. The splicing forms the hybrid circuit.
[0016] In one exemplary embodiment, after creating the quantum approximation optimization algorithm (QAOA) circuit, the method further includes optimizing the parameters in the QAOA circuit.
[0017] In one exemplary embodiment, determining m target objects from n objects using a correlation coefficient and the QAOA circuit includes: inputting the correlation coefficient into the QAOA circuit; measuring the qubits of the first register and the second register to obtain a first parameter value and a second parameter value, wherein the first parameter value indicates whether a target object is selected, and the second parameter value indicates whether a representative object exists; and determining m target objects from the n objects using the first parameter value and the second parameter value.
[0018] In one exemplary embodiment, determining m target objects from n objects using the first parameter value and the second parameter value includes: determining a target function value using the first parameter value and the second parameter value; and determining the object that maximizes the target function value as the target object.
[0019] According to another aspect of the embodiments of this application, an apparatus for determining target objects is also provided, comprising: a creation module for creating a quantum approximation optimization algorithm (QAOA) circuit, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit alternating, and p and n are integers greater than or equal to 1; an acquisition module for acquiring correlation coefficients among n objects; and a determination module for determining m target objects among the n objects using the correlation coefficients and the QAOA circuit, wherein m is an integer less than or equal to n.
[0020] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0021] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.
[0022] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.
[0023] This application utilizes a quantum approximation optimization algorithm (QAOA) circuit, which includes alternating initialization, p-p phase separation, and hybrid circuits, where p and n are integers greater than or equal to 1. It obtains correlation coefficients between n objects and uses the correlation coefficients and the QAOA circuit to determine m target objects from the n objects, where m is an integer less than or equal to n. Therefore, it solves the technical problem of low accuracy in manually selecting representative objects in relevant fields, thus improving the accuracy of selecting representative objects. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of a quantum circuit according to an embodiment of this application;
[0025] Figure 2 This is a schematic diagram of a CNOT gate according to an embodiment of this application;
[0026] Figure 3 This is a schematic diagram of an RX gate according to an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of a multi-control bit gate according to an embodiment of this application;
[0028] Figure 5 This is a schematic diagram of the hardware environment of a method for targeting an object according to an embodiment of this application;
[0029] Figure 6 This is a flowchart illustrating a method for determining a target object according to an embodiment of this application;
[0030] Figure 7 This is a schematic diagram of the QAOA circuit according to an embodiment of this application;
[0031] Figure 8 This is a schematic diagram of the GM-QAOA circuit according to an embodiment of this application;
[0032] Figure 9 This is a schematic diagram of the overall process according to an embodiment of this application;
[0033] Figure 10 This is a structural block diagram of an apparatus for determining a target object according to an embodiment of this application;
[0034] Figure 11 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0035] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0037] The unit of computation in quantum computing is called a qubit, and the state of a qubit is called a quantum state. Quantum states use Dirac notation. Alternatively, it can be represented as a vector, which carries information. During quantum computing, the quantum state changes (evolves). The component that can change the quantum state is called an operator, its physical representation is called a quantum gate, and its mathematical representation is a unitary matrix. The process of a quantum gate acting on a quantum state is the process of multiplying the unitary matrix represented by the quantum gate by the vector represented by the quantum state. The core of most quantum algorithms is designing quantum gates. Then, the quantum gate is applied to the initial quantum state (also called the initial state, which is generally a relatively easy-to-prepare quantum state, for example...). The initial quantum state evolves into the final quantum state (also called the last state). By observing the last state, the desired result is obtained. Generally, a quantum algorithm consists of multiple quantum gates, and to illustrate its structure, it is usually presented in the form of a circuit diagram.
[0038] Figure 1 A quantum circuit diagram is given, where the components represented by rectangles are called quantum gates. The left side shows the initial state of the input quantum, and you can see that the preceding qubits are... The last group is Generally speaking, each horizontal line in the diagram represents one qubit; if there is a slash on a horizontal line, it represents multiple qubits. For example, the last line in the diagram represents m qubits. Quantum gates are divided into single-qubit gates and multi-qubit gates. The H gate in the diagram acts on only one qubit, which is a single-qubit gate, while the U gate... It is a multi-qubit gate. The representative is The inverse gate. The final dashboard-shaped gate is the measurement gate, usually placed at the end of the circuit, indicating the qubit to be observed. The black dots in the diagram represent control bits, meaning that when the control bit is... When the control bit is set to a certain value, the quantum gate is activated; otherwise, it is not activated. Correspondingly, there are also white dots similar to '.', which represent the control bit when it is set to a certain value. When the time is right, the quantum gate is activated; otherwise, it is not activated.
[0039] Quantum states can be represented by vectors, while qubits can be represented by unitary matrices. Below are some quantum gates used. For example... Figure 2 The image shows a CNOT gate, the most common two-qubit gate.
[0040]
[0041] Figure 3 It is an RX gate: The RX gate is a parameterized gate, which means that it rotates around the X-axis by an angle.
[0042]
[0043] Figure 4 It is a multi-control qubit gate, a quantum gate with multiple control qubits, divided into white dot control and black dot control. The diagram below illustrates that when the 2nd and 5th qubits are... And 3,4 qubits are At that time, the U gate is applied to the first qubit. Here, U refers to the universal gate and has no specific meaning.
[0044] According to one aspect of the embodiments of this application, a method for determining a target object is provided. Optionally, in this embodiment, the above-described method for determining a target object may be applied, but is not limited to, to applications such as... Figure 5 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.
[0045] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. Terminal device 102 may be, but is not limited to, PC (Personal Computer), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.
[0046] The method for determining the target object in this application embodiment can be executed by server 104, by terminal device 102, or by both server 104 and terminal device 102.
[0047] Taking the method for determining the target object in this embodiment, executed by server 104, as an example, Figure 6 This is a flowchart illustrating an optional method for determining a target object according to an embodiment of this application, as shown below. Figure 6 As shown, the process of this method may include the following steps:
[0048] Step S602: Create a quantum approximation optimization algorithm (QAOA) circuit, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit, which alternate, and p and n are integers greater than or equal to 1;
[0049] Step S604: Obtain the correlation coefficients among the n objects;
[0050] Step S606: Determine m target objects from the n objects using the correlation coefficient and the QAOA line, where m is an integer less than or equal to n.
[0051] The QAOA algorithm is the most famous quantum algorithm using hybrid operators. It was initially used by Harvard professor Farhi to solve the maximum cut problem in graph theory. QAOA provides a framework for solving this problem, consisting of three steps: 1. Transforming the original model into an integer model. 2. Constructing a QAOA parameterized path. 3. Using the VQE method to obtain the optimal path parameters, and finally measuring the quantum states passing through the optimal path to obtain the final result.
[0052] Since the QAOA algorithm uses a finite number of qubits to represent data, if the original solution model is a continuous model, it is necessary to perform a conversion from decimal to integer.
[0053] like Figure 7The diagram shows a schematic of the QAOA circuit, which initially consists of an initialization circuit. Then, phase separation and mixing circuits are alternately processed by p. p is called the QAOA parameter, which can be adjusted according to the performance of the quantum computer and the accuracy requirements of the algorithm. The larger p is, the longer the computation time and the higher the accuracy. The following aspects need to be considered when constructing the QAOA parameter circuit:
[0054] (1) Encoding: The encoding method determines the number of qubits used and also the difficulty of constructing the hybrid operator. It is the interface for converting between classical and quantum data. Since qubits still use 0 / 1 to represent data, encoding needs to map the data of interest to 0 / 1.
[0055] (2) Initializing the circuit: In the QAOA algorithm, the parameterized circuit is applied to all circuits by default. qubits. When The state evolved after initializing the circuit is called the initial state. Initializing the circuit requires that the initial state be a quantum state satisfying the constraints or a superposition of multiple states satisfying the constraints. Although the more quantum states the initial state contains, the closer it is to the optimal solution and the better the computation result, there is no strict requirement for this. Generally, it is necessary to first determine the initial state of the target, and then the initialization circuit can be prepared according to some methods. For example, if x has two elements... and ,Require and The sum is 5. The encoding method uses binary representation, then... The state can be a valid initial state because 011 represents 3, 010 represents 2, and 3+2=5. We only need to use the 2nd, 3rd, and 5th qubits of the commonly used Pauli X-gate to construct the initial state. If we want to use a superposition state as the initial state, It is also a valid initial state, but the circuit it constructs is much more complex.
[0056] (3) Phase separation circuit:
[0057] The phase separation operator is the core issue in constructing phase-separated circuits. Once the phase separation operator C is obtained, the phase-separated circuit can be simulated using evolutionary algorithms in quantum mechanics (such as the Trotter algorithm). ). In physics, this represents the time of evolution; mathematically, it's considered a real parameter that is determined in the VQE method. The phase-separating circuit appears p times in the entire QAOA circuit, and the parameters of these p circuits are all different, denoted as... However, these p lines share a single phase separation operator C.
[0058] The purpose of a phase-separating circuit is to alter the phase of a quantum state with a smaller cost function when the cost function is encoded into the circuit diagram. This, in turn, affects the probability of that quantum state being measured after passing through a QAOA circuit.
[0059] When solving different models, as long as the cost function of the optimization problem is a function with integer variables, the steps to solve the phase separation operator are fixed. Let the cost function be... , Let there be n integer variables. The calculation of the phase separation operator follows these steps:
[0060] Step S1: For any i from 0 to n, represent it using an encoding method with a sequence of 0 / 1. For example, binary encoding:
[0061] .
[0062] Substituting the formula into the cost function, we get... polynomial function with variables This step is omitted in this patent.
[0063] Step S2, Simplify ,because If polynomial Appear Simplify all powers of 1 to 2. This step is omitted in this patent.
[0064] Step S3: Since the objective function in this application is represented using 0 and 1 bits, we will start directly from this step and... Substitute Obtain the polynomial .
[0065] Step S4, It is a polynomial consisting of multiple z-multiplications. Let z be defined uniformly as the Pauli Z-matrix (…). Redefine the z-product as the tensor product. The values are transformed into a matrix, and this matrix represents the values of the phase separation operator. For example, when N=3 and n=2,
[0066] Then the phase separation operator will become ,in , Let C represent the tensor product. C is a 16x16 matrix.
[0067] (4) Hybrid circuit:
[0068] The purpose of the hybrid operator is to diffuse a quantum state to all other quantum states that satisfy the constraints in order to find a solution with a smaller cost function. Similar to phase-separated circuits, the hybrid circuit can be simulated using evolutionary algorithms in quantum mechanics (such as the Trotter algorithm) by obtaining the phase-separated operator B. The parameters of the p hybrid circuits are all different, denoted as pp. However, calculating the hybrid operator is not the only way to obtain hybrid circuits. The algorithm proposes that hybrid circuits can also be constructed directly by combining parameterized gates (RX gate, RY gate, RZ gate) without calculating the hybrid operator.
[0069] The construction method of hybrid circuits varies depending on the constraint model and encoding method. Unlike phase-separated circuits, there is no uniform rule. If the matrix representing a hybrid circuit is denoted as... Hybrid circuits require that for any two quantum states x and y that satisfy the constraints, the following conditions must be met. ,definition exist and Mixed.
[0070] This article uses the Grover Mixer method to construct a mixer. Its circuit diagram is as follows: Figure 8 The blue part in the diagram. Its principle is as follows: 1. Construct a quantum gate that satisfies a uniform superposition of all feasible solutions. and its reverse door 2. Sequentially... CNOT gate, multi-control RX gate, CNOT gate The gate interacts with all qubits, forming a Grover Mixer. Therefore, for exponential pursuit scenarios, the problem becomes how to construct... Door.
[0071] After constructing the QAOA circuit, we variationally search for... and optimal value For any set of parameters, let the initial state be...
[0072] After passing through the phase-separated circuit and the hybrid circuit, the final state is represented as . and These represent the matrices for the hybrid circuit and the phase-separated circuit, respectively. Next, classical methods (such as the Coby-La method) are needed to obtain the optimal parameters. Make Minimum. Then, the optimal parameter values are substituted into the circuit to obtain the quantum state. The state is measured, and then decoded into the desired integer result according to the encoding.
[0073] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit includes: creating the QAOA circuit includes... Quantum bits; will store n 2 The container for the n qubits is defined as a first register, wherein the qubits in the first register are divided into n groups, each group comprising n qubits; and the container for storing the n qubits is defined as a second register.
[0074] like Figure 9 The diagram shows the overall process flow. The number of objects is n, which can be a warehouse in the logistics field, a restaurant in the catering field, a location in the tourism field, or a stock in the financial industry. This application can be applied to any scenario where m objects are selected from n objects.
[0075] The correlation coefficient ρ, where n is the total number of objects. This represents the similarity between object i and object j, or the degree to which object j represents object i. It is generally between -1 and 1.
[0076] The object size V represents the volume of express delivery that a warehouse can hold in the logistics field, the number of consumers that a restaurant can accommodate in the hotel field, and the assets in the financial industry. It is used to calculate the weight.
[0077] The QAOA circuit consists of three parts: the initial circuit, the phase separation circuit, and the hybrid circuit. First, the encoding method is given. The entire quantum circuit will be composed of... Composed of 10 qubits, the front Each qubit is used to represent x in a large-scale deterministic model of variables, and will store this... The container of n qubits is called register A (the first register), and the next n qubits are used to represent y in a large-scale deterministic model, storing this... The container for the qubits is called register B (the second register). The qubits in register A are then divided into n groups, with each group containing n qubits.
[0078] In one exemplary embodiment, the Dicke-state is constructed in the second register, and the W-state of the n-qubit is constructed in the first set of registers.
[0079] W state: The W state of n qubits can be denoted as... .
[0080] Dicke-state: nk Dicke-state can be written as
[0081] .in represent The number of 1s in the middle.
[0082] An nm Dicke State is constructed in register B (the second register) using existing techniques. An mW state with m control bits is constructed in register A (the first register).
[0083] In one exemplary embodiment, the W state is first constructed in the first register by constructing the n-qubit W state in the first set of qubits in the first register.
[0084] First construction of W-state: Construct an n-qubit W-state in the first group of qubits in register A. Unconstrained construction of W-states is a current technique.
[0085] In one exemplary embodiment, the method further includes: constructing the W state in the first register for the kth time by preparing the W state on the last m qubits of the kth group of the first register, where k is less than n.
[0086] In an exemplary embodiment, preparing the W state on the last m qubits in the kth group of the first register includes: determining the jth qubit of the second register as a control bit, wherein j is greater than 0 and less than or equal to n; and determining the last qubit in the (k+1)th group of the first register and the jth qubit in the kth group of the first register as active bits.
[0087] In one exemplary embodiment, the method further includes: in the second register, sequentially performing a swap gate between the first qubit and the remaining qubits.
[0088] Assuming that the (k-1)th construction of state W has already been performed, based on the existing steps, proceed to the kth construction of state W:
[0089] The k-th construction of the W state: Based on the position where register B (the first register) is 1, construct the W state in the k-th group of register A (the first register).
[0090] The specific operation is as follows: (1) Prepare the W state on the last m qubits in the k+1 group of register A. Since the position of the qubit is independent of register B, it can be prepared using the public method.
[0091] (2) For j from 1 to n, perform the following steps in sequence:
[0092] The control-swapping gate has a control bit at the j-th qubit of register B and an action bit at the last qubit of the last m qubits in the (k+1)-th group of register A, as well as the j-th qubit in the (k+1)-th group of register A. The control-swapping gate swaps the quantum states of the two action bits when the control bit is 1. The gate's fabrication technology is publicly available.
[0093] In register B, its first qubit is sequentially swapped with the remaining qubits below it using a swap gate. After executing the above loop, the W state can be prepared at the specified position in the k-th group of register A according to the mask.
[0094] Continue the above steps until k = n-1. At this point, a uniform superposition of all feasible solutions has been obtained.
[0095] In one exemplary embodiment, the j-th qubit of the i-th group of the first register is used The gate is determined to be a phase-separated circuit, in which, Let represent the correlation coefficient between the i-th object and the j-th object, where i and j are greater than 0 and less than or equal to n.
[0096] Applying RZ to the j-th qubit of the i-th group in register A The gate is a phase separation circuit. Optimize for variable quantum parameters.
[0097] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit includes: creating the initialization circuit, wherein the initialization circuit includes quantum gates of uniform superposition states. .
[0098] In one exemplary embodiment, creating a quantum approximation optimization algorithm (QAOA) circuit further includes: using quantum gates... The inverse gate, CNOT gate, RZ(β) gate, and the quantum gate. The splicing forms the hybrid circuit.
[0099] Will CNOT under control The gates are spliced into a hybrid circuit, and β is a variable quantum parameter for optimization. The initialization circuit, phase separation circuit, and hybrid circuit are spliced together to obtain the QAOA circuit.
[0100] In one exemplary embodiment, after creating the quantum approximation optimization algorithm (QAOA) circuit, the method further includes optimizing the parameters in the QAOA circuit. This step is a publicly disclosed method in quantum variational algorithms.
[0101] In one exemplary embodiment, determining m target objects from n objects using a correlation coefficient and the QAOA circuit includes: inputting the correlation coefficient into the QAOA circuit; measuring the qubits of the first register and the second register to obtain a first parameter value and a second parameter value, wherein the first parameter value indicates whether a target object is selected, and the second parameter value indicates whether a representative object exists; and determining m target objects from the n objects using the first parameter value and the second parameter value.
[0102] Measurements are performed on all qubits in registers A and B. The results are... (First parameter value) and (Second parameter value).
[0103] If the measurement result of the j-th qubit in the i-th group of register A is 1, then it is considered that... That is, the j-th object is used to represent the i-th object. Otherwise, it is not used. If the measurement result of the i-th qubit in register B is 1, then the i-th object is used to replace it.
[0104] In one exemplary embodiment, determining m target objects from n objects using the first parameter value and the second parameter value includes: determining a target function value using the first parameter value and the second parameter value; and determining the object that maximizes the target function value as the target object.
[0105] Based on the object size V and and The value of is used to calculate the objective function value.
[0106] The model categorizes similar objects and selects representative combinations from each category. It is based on a correlation matrix. Size is n is the total number of objects. This represents the similarity between object i and object j, or the degree to which object j represents object i. The model does not mandate this. and The same. If we select m objects from n objects, we have the following objective function:
[0107]
[0108] In this model, the variables to be solved are and . =1 means that the j-th object will be selected as the target object, while 0 means that it will not be selected as the target object. The value indicates that object j will represent object i; a value of 0 indicates that object i will not be represented.
[0109] The objective function represents maximizing the sum of correlation coefficients among all objects with representative relationships, which means that the selected objects are more representative. Constraint (1) restricts the selection of m target objects, constraint (2) restricts each object to be represented by only one object, constraint (3) restricts that only the selected target objects can represent other objects, and constraint (4) is generated by the encoding.
[0110] This application is based on the GM-QAOA algorithm, which can solve the discrete optimization problem under exponential pursuit by leveraging the parallelism of quantum algorithms.
[0111] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0113] According to another aspect of the embodiments of this application, an apparatus for determining a target object is also provided. This apparatus can be used to implement the method for determining a target object provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0114] Figure 10This is a structural block diagram of an optional apparatus for determining a target object according to an embodiment of this application, such as... Figure 10 As shown, the device for determining the target object includes:
[0115] A creation module 1002 is used to create a quantum approximation optimization algorithm (QAOA) circuit, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit, which alternate, and p and n are integers greater than or equal to 1;
[0116] Module 1004 is used to obtain the correlation coefficient between n objects;
[0117] The determination module 1006 is used to determine m target objects from the n objects by using the correlation coefficient and the QAOA line, where m is an integer less than or equal to n.
[0118] In one exemplary embodiment, the above-described apparatus is further configured to create the QAOA line including n qubits; will store n 2 The container for the n qubits is defined as a first register, wherein the qubits in the first register are divided into n groups, each group comprising n qubits; and the container for storing the n qubits is defined as a second register.
[0119] In one exemplary embodiment, the Dicke-state is constructed in the second register, and the W-state is constructed in the first register.
[0120] In an exemplary embodiment, the above-described apparatus is further configured to first construct the W state in the first register by constructing the W state of n qubits in a first set of qubits in the first register.
[0121] In an exemplary embodiment, the above-described apparatus is further configured to construct the W state in the first register for the kth time by preparing the W state on the last m qubits of the kth group of the first register, where k is less than n.
[0122] In an exemplary embodiment, the above-described apparatus is further configured to determine the j-th qubit of the second register as a control bit, wherein j is greater than 0 and less than or equal to n; and to determine the last qubit in the (k+1)-th group of the first register and the j-th qubit in the k-th group of the first register as active bits.
[0123] In one exemplary embodiment, the above-described apparatus is further configured to sequentially perform a swapping gate on the first qubit and the remaining qubits in the second register.
[0124] In one exemplary embodiment, the above-described apparatus is further configured to activate the j-th qubit of the i-th group of the first register. The gate is determined to be a phase-separated circuit, in which, Let represent the correlation coefficient between the i-th object and the j-th object, where i and j are greater than 0 and less than or equal to n.
[0125] In one exemplary embodiment, the above-described apparatus is further configured to create the initialization circuit, wherein the initialization circuit comprises a quantum gate of uniform superposition state. .
[0126] In one exemplary embodiment, the above-described apparatus is further used to connect quantum gates. The inverse gate, CNOT gate, RZ(β) gate, and the quantum gate. The splicing forms the hybrid circuit.
[0127] In one exemplary embodiment, the above-described apparatus is further configured to optimize the parameters in the QAOA circuit after creating the quantum approximation optimization algorithm (QAOA) circuit.
[0128] In an exemplary embodiment, the above-described apparatus is further configured to input the correlation coefficient into the QAOA line; measure the qubits of the first register and the second register to obtain a first parameter value and a second parameter value, wherein the first parameter value is used to indicate whether it is selected as the target object, and the second parameter value is used to indicate whether there is a representative object; and determine m target objects from the n objects using the first parameter value and the second parameter value.
[0129] In an exemplary embodiment, the above-described apparatus is further configured to determine a target function value using the first parameter value and the second parameter value; and to determine the object that maximizes the target function value as the target object.
[0130] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0131] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.
[0132] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.
[0133] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0134] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0135] According to another aspect of the embodiments of this application, a computer program product is also provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit 1101, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0136] Figure 11 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 11 As shown, the computer system 1100 includes a CPU (Central Processing Unit) 1101, which can perform various appropriate actions and processes based on programs stored in ROM 1102 or programs loaded into RAM 1103 from storage section 1108. Random access memory 1103 also stores various programs and data required for system operation. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. An I / O (Input / Output) interface 1105 is also connected to bus 1104.
[0137] The following components are connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including CRT (Cathode Ray Tube), LCD (Liquid Crystal Display), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1110 as needed so that computer programs read from them can be installed into storage section 1108 as needed.
[0138] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit 1101, it performs various functions defined in the system of this application.
[0139] It should be noted that, Figure 11 The computer system 1100 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0140] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0141] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
[0142] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0143] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
Claims
1. A method for determining a target object, characterized in that, include: A quantum approximation optimization algorithm (QAOA) circuit is created, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit, which alternate, where p and n are integers greater than or equal to 1; Obtain the correlation coefficient between n objects; Using the correlation coefficient and the QAOA line, m target objects are determined from the n objects, where m is an integer less than or equal to n.
2. The method according to claim 1, characterized in that, Creating a quantum approximation optimization algorithm (QAOA) circuit includes: Creating the QAOA line includes One quantum bit; Store n 2 The container for the qubits is defined as a first register, wherein the qubits in the first register are divided into n groups, each group comprising n qubits; The container storing the n qubits is designated as the second register.
3. The method according to claim 2, characterized in that, The Dicke-state is constructed in the second register, and the W-state is constructed in the first register.
4. The method according to claim 3, characterized in that, The method further includes: The W state is first constructed in the first register in the following manner: The W state of n qubits is constructed in the first group of qubits in the first register.
5. The method according to claim 3, characterized in that, The method further includes: The W state is constructed for the kth time in the first register in the following manner: The W state is prepared on the last m qubits of the k-th group in the first register, where k is less than n.
6. The method according to claim 5, characterized in that, The W state is prepared on the last m qubits in the k-th group of the first register, including: The j-th quantum bit of the second register is determined as the control bit, where j is greater than 0 and less than or equal to n; The last qubit in the (k+1)th group of the first register and the jth qubit in the kth group of the first register are designated as active bits.
7. The method according to claim 6, characterized in that, The method further includes: In the second register, the first qubit is sequentially swapped with the remaining qubits using a swap gate.
8. The method according to claim 2, characterized in that, The method further includes: The j-th qubit of the i-th group in the first register is used The gate is determined to be a phase-separated circuit, in which, Let represent the correlation coefficient between the i-th object and the j-th object, where i and j are greater than 0 and less than or equal to n.
9. The method according to claim 1, characterized in that, Creating a quantum approximation optimization algorithm (QAOA) circuit includes: The initialization circuit is created, wherein the initialization circuit includes quantum gates of uniform superposition states. .
10. The method according to claim 1, characterized in that, The creation of the quantum approximation optimization algorithm QAOA circuit also includes: Quantum gate The reverse door, CNOT door, Gate, the quantum gate The splicing forms the hybrid circuit.
11. The method according to claim 1, characterized in that, After creating the quantum approximation optimization algorithm QAOA circuit, the method further includes: The parameters in the QAOA line are optimized.
12. The method according to any one of claims 2 to 11, characterized in that, Based on the correlation coefficient and the QAOA circuit, m target objects are determined from the n objects, including: Input the correlation coefficient into the QAOA line; The qubits of the first register and the second register are measured to obtain a first parameter value and a second parameter value, wherein the first parameter value is used to indicate whether it is selected as the target object, and the second parameter value is used to indicate whether there is a representative object; The first parameter value and the second parameter value are used to determine m target objects from the n objects.
13. The method according to claim 12, characterized in that, Determining m target objects from the n objects using the first parameter value and the second parameter value includes: The objective function value is determined by the first parameter value and the second parameter value; The object that maximizes the value of the objective function is defined as the target object.
14. An apparatus for determining a target object, characterized in that, include: A creation module is used to create a quantum approximation optimization algorithm (QAOA) circuit, wherein the QAOA circuit includes: an initialization circuit, a p-p phase separation circuit, and a hybrid circuit, which alternate, where p and n are integers greater than or equal to 1; The acquisition module is used to obtain the correlation coefficient between n objects; The determination module is used to determine m target objects from the n objects by using the correlation coefficient and the QAOA line, where m is an integer less than or equal to n.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 13.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 13.