Quantum circuit-based method and apparatus for solving a system of quadratic nonlinear equations
The quadratic nonlinear equations are converted into a linear equation through the homotopy perturbation method and linear embedding method, and then solved using quantum circuits, which solves the problem of high complexity in solving quadratic nonlinear equations in the existing technology and realizes efficient quantum algorithm solution.
Patent Information
- Application Number
- CN202111425744.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-11-26
AI Technical Summary
Existing methods for solving quadratic nonlinear equations require a large amount of computing resources, have high computational complexity and difficulty, and it is difficult to obtain effective solutions through traditional methods. Research on quantum computing in this field is relatively scarce.
The initial quadratic nonlinear equations are transformed into the target linear equations through the homotopy perturbation method and linear embedding method. The quantum circuit corresponding to the quantum linear solver is constructed, and the quantum circuit is used to solve and measure to determine the solution of the initial quadratic nonlinear equations.
The complexity and difficulty of solving quadratic nonlinear equations are reduced, and quantum algorithms are used to achieve efficient solutions to quadratic nonlinear equations, filling the technological gap in the field of quantum computing.
Smart Images

Figure CN116186466B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method and device for solving a quadratic nonlinear equation system based on quantum circuits. Background Art
[0002] The study of nonlinear equations for application purposes or against the background of problems in other disciplines such as physics and mechanics is not only one of the most important contents in traditional applied mathematics, but also an important part of contemporary mathematics. It is an important bridge between mathematical theory and practical applications.
[0003] On the other hand, nonlinear problems are more common in nature, such as nonlinear finite element analysis, nonlinear dynamics, and nonlinear programming. Therefore, constructing quantum algorithms to solve nonlinear problems is important. However, due to the inherent linearity of quantum computing, constructing quantum algorithms to solve nonlinear problems is difficult, and research on quantum algorithms for solving nonlinear equations is still relatively scarce.
[0004] Currently, the main focus of nonlinear equation research is on quadratic nonlinear equations. Many significant problems in natural science and engineering technology can be attributed to the study of quadratic nonlinear equations. Mathematical models in many areas of real life can be described using quadratic nonlinear equations. However, traditional numerical methods generally make it difficult to easily obtain effective solutions to quadratic nonlinear equations. Therefore, research on how to accurately and quickly solve quadratic nonlinear equations has shown significant theoretical and applied value. Quantum computing is a new type of computing method that uses a computational framework based on quantum mechanics theory. When solving some problems, quantum computing can exponentially accelerate the performance of optimal classical algorithms.
[0005] Existing methods for solving quadratic nonlinear equations require a lot of computing resources, which may exceed the computing power of traditional computers. In addition, the calculation complexity is high, and it takes a long time and is computationally difficult to obtain an exact solution. In this context, it is very important to develop more efficient algorithms for solving quadratic nonlinear equations. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and device for solving quadratic nonlinear equations based on quantum circuits to address the shortcomings of the existing technology. It can realize the solution technology of quadratic nonlinear equations using quantum algorithms, reduce the complexity and difficulty of solving quadratic nonlinear equations, and fill the relevant technical gaps in the field of quantum computing.
[0007] One embodiment of the present application provides a method for solving a quadratic nonlinear equation system based on a quantum circuit, comprising:
[0008] Obtaining a target linear equation system, wherein the target linear equation system is determined by transforming an initial quadratic nonlinear equation system;
[0009] Constructing a quantum circuit corresponding to a quantum linear solver, running the quantum circuit and measuring to solve the target linear equations;
[0010] Based on the solved solution of the target linear equation system, a solution of the initial quadratic nonlinear equation system is determined.
[0011] Optionally, the initial quadratic nonlinear equations are specifically:
[0012]
[0013] Where x∈R n ,R represents the real number space, The sparsity of F1 and F2 is s.
[0014] Optionally, obtaining the target linear equation system includes:
[0015] Converting the initial quadratic nonlinear equations into a preset pseudo-linear equations according to a homotopy perturbation method;
[0016] The preset pseudo-linear equations are transformed into a target linear equations using a linear embedding method.
[0017] Optionally, the preset pseudo-linear equations are:
[0018] v0=-F1 -1 F0
[0019]
[0020]
[0021] …
[0022]
[0023] Wherein, the F1 is reversible, v i is the variable to be solved of the preset pseudo-linear equation group, 0≤i≤c, and c is the number of the variables to be solved of the preset pseudo-linear equation group.
[0024] Optionally, the target linear equation is:
[0025]
[0026] Among them, A i,i yes dimensional matrix, A i,i+1 is n i+1 βi ×n i+2 β i+1 dimensional matrix, y=y0,y1,…,y c ,y i Satisfies y0=v0+v1+v2+...+v c ,y i =[y i,0 ,y i,1 ,y i,2 ,...,y i,βi-1 ], β i represents y i The number of items in .
[0027] Optionally, constructing a quantum circuit corresponding to a quantum linear solver includes:
[0028] Construct a quantum circuit for realizing a first functional module V, wherein the first functional module is defined as
[0029] Construct a quantum circuit for realizing the second functional module combination, wherein the quantum circuit of the second functional module combination includes T, W and T + , the T = ∑ j∈[N] |Ψ j > <j|, The S is the unitary matrix of the exchange operation module, the T + is the transposed conjugate of T, 4N 2 -dimensional identity matrix;
[0030] Construct a module for implementing the third function V + A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module;
[0031] The first functional module, the second functional module and the third functional module are sequentially inserted into the quantum circuit to form a quantum circuit corresponding to the quantum linear solver.
[0032] Another embodiment of the present application provides a device for solving a quadratic nonlinear equation system based on a quantum circuit, comprising:
[0033] An acquisition module, configured to acquire a target linear equation group, wherein the target linear equation group is determined by transforming an initial quadratic nonlinear equation group;
[0034] A construction module is used to construct a quantum circuit corresponding to a quantum linear solver, run the quantum circuit and measure to solve the target linear equations;
[0035] A determination module is used to determine the solution of the initial quadratic nonlinear equation system based on the solved solution of the target linear equation system.
[0036] Optionally, the acquisition module includes:
[0037] A first conversion unit is used to convert the initial quadratic nonlinear equation group into a preset pseudo-linear equation group according to a homotopy perturbation method;
[0038] The second conversion unit is used to convert the preset pseudo linear equation group into a target linear equation group by using a linear embedding method.
[0039] Optionally, the building blocks include:
[0040] The first construction unit is used to construct a quantum circuit for realizing a first functional module V, wherein the first functional module is defined as
[0041] The second construction unit is used to construct a quantum circuit for realizing a second functional module combination, wherein the quantum circuit of the second functional module combination includes T, W and T + , the T = ∑ j∈[N] |Ψ j > <j|, The S is the unitary matrix of the exchange operation module, the T + is the transposed conjugate of T, 4N 2 -dimensional identity matrix;
[0042] The third construction unit is used to construct a module for implementing the third functional module V + A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module;
[0043] The combining unit is used to sequentially insert the first functional module, the second functional module and the third functional module into the quantum circuit to form a quantum circuit corresponding to the quantum linear solver.
[0044] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when run.
[0045] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods.
[0046] Compared with the existing technology, the present invention first determines the target linear equation group based on the transformation of the initial quadratic nonlinear equation group, then constructs the quantum circuit corresponding to the quantum linear solver, runs the quantum circuit and measures, solves the target linear equation group, and determines the solution of the initial quadratic nonlinear equation group based on the solution of the target linear equation group. By utilizing the relevant characteristics of quantum, the technology of calculating the quadratic nonlinear equation group using quantum algorithms can be realized, reducing the complexity and difficulty of solving the quadratic nonlinear equation group, and filling the relevant technical gap in the field of quantum computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a hardware structure block diagram of a computer terminal for a method for solving quadratic nonlinear equations based on quantum circuits provided by an embodiment of the present invention;
[0048] Figure 2 1 is a flow chart of a method for solving a quadratic nonlinear equation system based on quantum circuits provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of a quantum circuit for solving a quadratic nonlinear equation system provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a quantum circuit corresponding to a quantum linear solver provided in an embodiment of the present invention;
[0051] Figure 5 is a schematic diagram of a quantum circuit for a walking operator W provided in an embodiment of the present invention;
[0052] Figure 6 This is a schematic structural diagram of a device for solving quadratic nonlinear equations based on quantum circuits provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.
[0054] The embodiment of the present invention first provides a method for solving a set of quadratic nonlinear equations based on quantum circuits. The method can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0055] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal for solving a quadratic nonlinear equation system based on quantum circuits provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1The computer terminal shown in FIG. 1 includes only one processor 102 (the processor 102 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data. Optionally, the computer terminal can further include a transmission device 106 for communication functions, and an input / output device 108. Those skilled in the art can understand that Figure 1 The structure shown in FIG. 1 is only illustrative and does not limit the structure of the computer terminal. For example, the computer terminal can include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG. 1. Figure 1 Figure 1 The structure shown in FIG. 1 is only illustrative and does not limit the structure of the computer terminal. For example, the computer terminal can include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG. 1.
[0056] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the method for solving a system of quadratic nonlinear equations based on a quantum circuit according to an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, i.e., implements the method described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely located with respect to the processor 102, which can be connected to the computer terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0057] The transmission device 106 is used to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
[0058] It should be noted that a real quantum computer is a hybrid structure, which includes two parts: one part is a classical computer responsible for performing classical computation and control; the other part is a quantum device responsible for running a quantum program to implement quantum computation. The quantum program is a sequence of instructions written in a quantum language such as the QRunes language that can run on a quantum computer, which supports quantum logic gate operations and ultimately implements quantum computation. Specifically, the quantum program is a sequence of instructions for operating quantum logic gates in a certain time sequence.
[0059] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulations are usually required to verify quantum algorithms, quantum applications, and the like. Quantum computing simulation is the process of simulating the operation of quantum programs corresponding to specific problems using a virtual architecture (i.e., a quantum virtual machine) built with the resources of an ordinary computer. Generally, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of the present invention is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, and the like related to quantum computing are represented by corresponding classical codes.
[0060] Quantum circuits, as a manifestation of quantum programs, also known as quantum logic circuits, are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0061] Unlike traditional circuits, which are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time. In other words, the state of the quantum bit naturally evolves over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0062] A quantum program as a whole corresponds to a single quantum circuit. The quantum program described in this disclosure refers to this quantum circuit, where the total number of qubits in this quantum circuit is the same as the total number of qubits in the quantum program. A quantum program can be understood as consisting of a quantum circuit, measurement operations on the qubits in the quantum circuit, registers storing the measurement results, and control flow nodes (jump instructions). A quantum circuit can contain tens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all quantum logic gates in a specific time sequence. It should be noted that the time sequence refers to the chronological order in which individual quantum logic gates are executed.
[0063] It's important to note that in classical computing, the most fundamental unit is the bit, and the most basic control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, quantum logic gates are used to manipulate qubits. Quantum logic gates enable the evolution of quantum states. Quantum logic gates are the foundation of quantum circuits. Quantum logic gates include single-bit quantum logic gates such as the Hadamard gate (H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), RX gate, RY gate, and RZ gate; and multi-bit quantum logic gates such as the CNOT gate, CR gate, iSWAP gate, and Toffoli gate. Quantum logic gates are generally represented using unitary matrices. Unitary matrices are not only a matrix form but also a type of operation and transformation. The effect of a quantum logic gate on a quantum state is typically calculated by multiplying the unitary matrix on the left by the matrix corresponding to the quantum state's right vector.
[0064] The quantum state, that is, the logical state of the quantum bit, is represented in binary in quantum algorithms (or quantum programs). For example, a group of quantum bits is q0, q1, and q2, representing the 0th, 1st, and 2nd quantum bits, and is sorted from high to low as q2q1q0. The quantum state corresponding to this group of quantum bits is the superposition of the eigenstates corresponding to this group of quantum bits. The eigenstates corresponding to this group of quantum bits have a total of 2 to the power of the total number of quantum bits, that is, 8 eigenstates (determined states): |000>, |001>, |010>, |011>, |100>, |101>, |110>, |111>. The bit of each eigenstate corresponds to the quantum bit. For example, in the |000> state, 000 corresponds to q2q1q0 from high to low, and |> is the Dirac symbol.
[0065] Using a single quantum bit to illustrate the logical state of a single quantum bit It may be in the |0> state, |1> state, or the superposition state of |0> state and |1> state (uncertain state), which can be specifically expressed as Where c and d are complex numbers representing the quantum state amplitude (probability amplitude), and the square of the amplitude modulus |c| 2 and |d| 2 denote the probabilities of the |0> state and the |1> state respectively, and |c| 2 +|d| 2 = 1. In short, the quantum state is a superposition state composed of various eigenstates. When the probability of other eigenstates is 0, it is in a unique and definite eigenstate.
[0066] See also Figure 2 , Figure 2 A schematic flow chart of a method for solving a quadratic nonlinear equation system based on quantum circuits provided in an embodiment of the present invention may include the following steps:
[0067] S201: Obtain a target linear equation group, wherein the target linear equation group is determined by transforming an initial quadratic nonlinear equation group.
[0068] Nonlinear problems are very common in nature, such as nonlinear finite element analysis, nonlinear dynamics, nonlinear programming, etc. Therefore, it is very important to construct algorithms to solve nonlinear problems.
[0069] A nonlinear equation is one in which the relationship between the dependent variable and the independent variable is not a linear relationship. It is a generalization of mathematics made after the emergence of various practical problems and the establishment of equations based on problems in real life. Nonlinear equations are increasingly attracting people's attention and have become an important research direction in modern mathematics.
[0070] Nonlinear equations provide crucial theoretical support and play a vital role in many areas of science and technology. For example, in fields such as mechanics, economics, biotechnology, and electronics, exact solutions to these equations are often difficult to obtain, often requiring approximate solutions. Consequently, methods for finding approximate solutions are gaining increasing attention. Quadratic nonlinear equations, as a crucial component of nonlinear equations, are of great significance both theoretically and practically.
[0071] Exemplarily, obtaining the target linear equation system may include:
[0072] Step 1: Convert the initial quadratic nonlinear equations into a preset pseudo-linear equations according to the homotopy perturbation method.
[0073] Specifically, the initial quadratic nonlinear equations are:
[0074]
[0075] Where x∈R n , R represents the real number space, The sparsity of F1 and F2 is s.
[0076] For example, the following initial quadratic nonlinear equations are solved:
[0077]
[0078] The corresponding F0, F1, and F2 are:
[0079]
[0080] Given an oracle of non-zero element positions and non-zero element values for query F1 and F2
[0081]
[0082]
[0083]
[0084]
[0085] Given an oracle to prepare F0 It implements the following functions:
[0086]
[0087] The homotopy perturbation method is a method that combines homotopy thinking and perturbation technology. Unlike traditional perturbation theory, this method does not rely on small parameters. Instead, it uses homotopy technology to construct an equation with embedded parameters, and then treats the embedded parameters as small parameters. Therefore, this method can not only overcome the shortcomings of traditional perturbation theory, but also fully apply various perturbation methods. The essence of the homotopy perturbation method is to transform nonlinear problems into an infinite number of linear problems for processing. In this method, the approximate solution of the equation can be written as a series of infinite series, and the sum of these series converges to its exact solution. A large number of examples show that this method is simple and effective, and its first-order approximate solution often has very high accuracy. It should be said that the homotopy perturbation method is a very common method for solving nonlinear problems.
[0088] Specifically, the homotopy perturbation method is used to transform the equation Converted into a series of v0,v1,...,v c Related preset pseudo-linear equations.
[0089] First, construct the homotopy H:R n ×[0,1]→R n , Assume that the solution of H(v,p)=0 is: v=v0+pv1+p 2 v2+...+p c v c , we can get:
[0090] F1v0+F0=0
[0091]
[0092]
[0093] …
[0094]
[0095] Assuming F1 is reversible, the preset pseudo-linear equations are:
[0096] v0=-F1-1 F0
[0097]
[0098]
[0099] …
[0100]
[0101] Among them, v i is the variable to be solved of the preset pseudo-linear equation group, 0≤i≤c, and c is the number of the variables to be solved of the preset pseudo-linear equation group.
[0102] When p = 1, we can get:
[0103] Step 2: Use the linear embedding method to transform the preset pseudo linear equations into the target linear equations.
[0104] Specifically, the homotopy perturbation method is used to transform the equation Converted into a series of v0, v1, ..., v c is the preset pseudo linear equation system of the variables to be solved. Secondly, v0, v1, ..., v c The pseudo-linear equations with variables are embedded into a large linear system, that is, the above equations are embedded into a high-dimensional linear system:
[0105] Ay=b
[0106] Where y=y0,y1,…,y c ,y i Satisfy the following form:
[0107] y0=v0+v1+v2+...+v c
[0108]
[0109] Among them, β i represents y i The number of items in y i,j The expression of β i The value of y i,j Written as follows:
[0110] And a i,j,k Satisfy a i,j,k ≥0, You can deduce y i Includes term, so β i It can be expressed as:
[0111]
[0112] definition There is a one-to-one correspondence with j, so the following two operations can be constructed:
[0113]
[0114]
[0115] and It can be implemented using quantum arithmetic using O(c)-bit quantum circuits, with a gate complexity of O(ploy(c)).
[0116] right when When a value greater than 0 is included, the first value greater than 0 is assumed to be a i,j,k , then
[0117]
[0118] in, We take Then we have:
[0119] From the above formula, we can deduce Finally, the equation Ay=b can be expanded as:
[0120]
[0121] Among them, A i,i yes dimensional matrix, A i,i+1 is n i+1 β i ×n i+2 β i+1 dimensional matrix, y=y0,y1,…,y c ,y i Satisfies y0=v0+v1+v2+...+v c , β i represents y i The number of items in .
[0122] Make some optimizations on the linear system Ay=b. From the above formula, we can see that A contains block matrices This will cause the condition number of A to increase exponentially with c, so Split:
[0123]
[0124] The condition number of the split linear system is better and y i,0 is redefined as follows:
[0125]
[0126] Taking c = 2 in the above example, the components of the optimized y are written as:
[0127] y0= [v0+ v1+ v2]
[0128]
[0129]
[0130] The corresponding matrix A can be written as:
[0131]
[0132] where 04= [0, 0, 0, 0], 08is similar to 04.
[0133] The linear system Ay = b is also adjusted accordingly. In the following, by default Ay = b is the optimized linear system, and the dimension of the optimized matrix A is:
[0134]
[0135] For the condition number of matrix A, the following lemmas are given:
[0136] Lemma 1: Given an n-dimensional invertible matrix M and Define a new matrix:
[0137]
[0138] Then P is invertible, and satisfies
[0139]
[0140] Lemma 2: ||A|| satisfies ||A|| ≤ ||F1|| + 1 + (c + 1)||F2||
[0141] Lemma 3: Given the optimized linear system Ay = b, the truncation order c, F1, F2 satisfy: when A -1 satisfies:
[0142]
[0143] Therefore, for a given optimized linear system Ay = b, the truncation order c, F1, F2 satisfy: When , the condition number κ(A) of the matrix A satisfies:
[0144]
[0145] S202: Constructing a quantum circuit corresponding to a quantum linear solver, running the quantum circuit and performing measurements to solve the target linear equations.
[0146] Specifically, a quantum circuit corresponding to a quantum linear solver is constructed, that is, a quantum circuit corresponding to a quantum linear solver including an Oracle and a quantum logic gate functional module is constructed, and quantum state evolution operations are performed on the quantum circuit to measure the quantum state of the evolved quantum circuit.
[0147] For example, Figure 3 The figure shows a schematic diagram of a quantum circuit for solving a quadratic nonlinear system of equations provided by an embodiment of the present application. The figure includes a quantum linear solver module and four measurement modules. By constructing an oracle related to Ay=b, the oracle can be regarded as an interface for inputting equation information into the quantum circuit, or as an input to the quantum linear solver algorithm. Specifically, the oracle can output the quantum state |y> by inputting Ay=b. By measuring the first bit register of |y>, when |0,0> is measured, the normalized approximate solution of the original nonlinear equation can be obtained.
[0148] For the OracleO of matrix A A The construction method is to regard A as a c+1 dimensional block matrix. The expression and corresponding position of the non-zero block matrix elements of A can be obtained by O(poly(c)) classical operations. Then, the non-zero element positions and non-zero element values of the matrix elements inside the block matrix are extracted through the Oracle of F1 and F2. The arithmetic operations in this process are realized by quantum circuits to construct O A The query complexity of the construction process for F1 and F2 Oracle is O(poly(c)). Since it only involves some simple arithmetic operations, the line length is also O(poly(c)). b You can also Preparation, query complexity is O(poly(c)).
[0149] Constructing the quantum circuit corresponding to the quantum linear solver is mainly to construct Figure 3 The sub-quantum circuits corresponding to the quantum linear solver module shown include:
[0150] Step S2021: Construct a quantum circuit for implementing a first functional module V, wherein the first functional module is defined as
[0151] Step S2022: constructing a quantum circuit for implementing a second functional module combination, wherein the quantum circuit of the second functional module combination includes T, W and T + , the T=∑ j∈[N] |Ψ j > <j|, The S is the unitary matrix of the exchange operation module, the T + is the transposed conjugate of T, 4N 2 dimensional identity matrix.
[0152] Step S2023: Construct a module for implementing the third functional module V + A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module.
[0153] Step S2024: inserting the first functional module, the second functional module, and the third functional module into the quantum circuit in sequence to form a quantum circuit corresponding to the quantum linear solver.
[0154] Specifically, the above steps S2021 to S2023 sequentially construct the first functional module, the second functional module and the third functional module, and insert the three functional modules into the quantum circuit in sequence to form the following: Figure 4 Schematic diagram of the quantum circuit corresponding to a quantum linear solver shown.
[0155] Specifically, such as Figure 4 In the quantum circuit diagram shown, V and T represent Oracles with different functions. represents the transposed conjugate, T represents the overall functional module T of the H gate and each Oracle combination, and the function of the T module is to transform |j> into |Ψ j >. Moreover, the matrix obtained as input to the T module is an N-order matrix. The constructed T module can be equivalent to a quantum logic gate in the quantum circuit, and its matrix form is: ∑ j∈[N] |Ψ j > <j|,其中,<j|为量子态左矢。
[0156] It should be noted that solving the target linear system requires first constructing a quantum circuit diagram for the walk operator W. Those skilled in the art will appreciate that any simple function can be linearly approximated as a linear combination of other functions, and that the inverse function of a matrix can be approximated using Chebyshev polynomials. Implementing Chebyshev polynomials requires working within the quantum walk framework.
[0157] Because quantum walks are performed in space Some states in On the top, define a mapping from arrive
[0158]
[0159] And the walk operator:
[0160]
[0161] Operator S executes The flip operation of the product state in . So we have:
[0162]
[0163] is a Chebyshev polynomial of the first kind.
[0164] It should be noted that, as mentioned above |Ψ j >, using a combination of vertical lines and angle brackets to describe a quantum state, indicating that the quantum state is a vector (called a state vector, basis vector, etc.), |Ψ j > indicates a right arrow, <Ψ j | indicates the left arrow.
[0165] For example, Figure 5 As shown, the quantum circuit of the wandering operator W is explained. S can be constructed from a group of swap operations (e.g. a SWAP gate, Figure 5 The two symbols marked with bold X in the quantum bit represent a SWAP gate), and the rest is
[0166] To build It is necessary to construct the unitary operator form of T and define the unitary operator T u Should meet:
[0167] T u |j>|0>=|Ψ j >
[0168] So we have:
[0169]
[0170] in,
[0171]
[0172] And: K=2|0><0|-I 2N .
[0173] It should be noted that the schematic diagram only shows part of the quantum circuit related to the present application. The various symbols and connection relationships in the figure are merely examples and do not constitute a limitation of the present invention. In addition to using the above-mentioned Chebyshev linear solver, the HHL algorithm or variational quantum linear solver can also be used for solution.
[0174] Perform quantum state evolution and measurement on the target linear equation group to obtain a solution to the target linear equation group.
[0175] Specifically, a quantum linear solver is used to solve the linear system based on the constructed matrix A and the corresponding oracle. The input of the quantum linear solver is the constructed oracle, and the solution of the target linear equation system is obtained through the quantum linear solver.
[0176] It's important to note that a quantum oracle is a black box that represents a transition in a quantum state. A typical example of a quantum oracle is the linear system: O|x>|0>=|x>|f(x)>, where the computation of f(x) uses the first quantum register as input and the second quantum register as output. Another example is QRAM, which can be considered an oracle. Many quantum algorithms use oracles, but their implementation is irrelevant; it can be decomposed into quantum gates or implemented as a QRAM. In QPanda, this can be defined using the "Oracle" function. Oracles are considered to have user-provided names.
[0177] In quantum applications, an oracle or combination of oracles is constructed, and the internal principles of this oracle or combination represent the process flow of the present invention. Specifically, an oracle can be understood as a module (similar to a black box) that performs a specific function in a quantum algorithm, and specific implementation methods will be used for specific problems.
[0178] Currently, existing quantum circuit construction can only utilize existing single quantum logic gates, double quantum logic gates, etc., which usually have the following problems:
[0179] For quantum circuits with more complex functions, the number of qubits required is very large. Simulating them on a classical computer consumes a huge amount of memory space, requires a large number of logic gates, and takes a very long time. Furthermore, some complex algorithms are difficult to implement using quantum circuits.
[0180] Based on this, we use Oracle simulation to implement specific complex functions and realize controlled and transposed conjugate operations. The parameters that users pass into Oracle can include: Oracle name (used to identify the functional purpose of Oracle, such as A1 ), quantum bits, matrix elements, etc.
[0181] The advantage of this approach is that the oracle is treated as a known module, eliminating the need to focus on its internal implementation details. This makes the representation of quantum applications, such as quantum circuits, very simple and clear. Since the classically simulated oracle functional modules can be equated with quantum logic gates, the constructed quantum circuits are simplified, saving runtime memory space and accelerating the simulation verification of quantum algorithms.
[0182] S203: Determine a solution to the initial quadratic nonlinear equation system based on the solved solution to the target linear equation system.
[0183] like Figure 4 The quantum circuit shown can execute the quantum state from |b> to |A -1 b>, for example, run the entire quantum circuit and measure |j> and |anc>. When |j> and |anc> both collapse to |0>, |A can be obtained in the second register. -1 b>.
[0184] Similarly, according to the quantum circuit corresponding to the quantum linear solver, by measuring some quantum registers on the corresponding quantum circuit, the solution of the target linear equations can be obtained. Finally, based on the solution of the target linear equations, the solution of the initial quadratic nonlinear equations can be calculated. Each component in is v i The tensor product form of , that is, by calculating y0, is the solution to the initial quadratic nonlinear equations.
[0185] It should be noted that the first qubit register and the second qubit register are the first register and the second register of the output state of the quantum linear solution algorithm corresponding to the quantum circuit, that is, Figure 4 Middle|A -1 b>The subdivision of the quantum circuit, Figure 4The quantum circuits in the figure only show some quantum circuits related to the present application. The symbols and connection relationships in the figure are only for examples and do not constitute a limitation of the present invention.
[0186] Furthermore, for the success rate of the algorithm, we need to get |y0>, which is the success rate of The first quantum register in the quantum state is measured to obtain the probability of |0,0>. The specific expression is: y=[y0,y1,…,y c ], assuming ||y0||=ηR, where η is a constant. R is defined as: R:=max{4||F1 -1 || 2 ||F0||||F2||,||F0||}, then ||F1 -1 ||<1, When:
[0187] Therefore, given the quadratic nonlinear algebraic equation system defined Definition parameters: ∈<0.01, R:=max{4||F1 -1 || 2 ||F0||||F2||,||F0||}, α:=||F1 -1 ||||F0||, β:=||F1 -1 ||||F2||,η=||x|| / R, G:=||F1 -1 ||(1+(c+1)||F2||, then the condition is satisfied: ||F1 -1 ||<1,G<1, When there is a quantum algorithm with success rate Ω(1) to obtain the normalized quantum state satisfy where x represents the exact solution. The algorithm's query complexity for the oracle of F0, F1, and F2 is O(s(A)κ(A)poly(log(s(A)κ(A) / ∈))). Considering the algorithm's success rate and optimizing it with the amplitude amplification algorithm, the query complexity when the success rate is Ω(1) is:
[0188] Continuing with the above example, solving Ay=b, we get the component y0 of y as:
[0189]
[0190] A solution obtained by iterative method is:
[0191] x=[-4.8765625×10 -2 ,5.1265625×10-2 ]
[0192] Thus:
[0193]
[0194] It can be seen that this application transforms the initial quadratic nonlinear equations into the matrix and vector information of the linear equations through the homotopy perturbation method, and encodes it into the quantum state, links the classical data structure with the quantum state in the quantum field, and performs the evolution operation of encoding the classical data structure into the quantum state to obtain the quantum state of the evolved quantum circuit. It can utilize the superposition characteristics of quantum to accelerate the solution of quadratic nonlinear equations with higher complexity and expand the simulation application scenarios of quantum computing.
[0195] Compared with the existing technology, the present invention first determines the target linear equation group based on the transformation of the initial quadratic nonlinear equation group, then constructs the quantum circuit corresponding to the quantum linear solver, runs the quantum circuit and measures, solves the target linear equation group, and determines the solution of the initial quadratic nonlinear equation group based on the solution of the target linear equation group. By utilizing the relevant characteristics of quantum, the technology of calculating the quadratic nonlinear equation group using quantum algorithms can be realized, reducing the complexity and difficulty of solving the quadratic nonlinear equation group, and filling the relevant technical gap in the field of quantum computing.
[0196] See also Figure 6 , Figure 6 A schematic diagram of a device for solving a quadratic nonlinear equation system based on a quantum circuit according to an embodiment of the present invention is provided. Figure 2 The process shown in the figure may include:
[0197] An acquisition module 601 is configured to acquire a target linear equation system, wherein the target linear equation system is determined by transforming an initial quadratic nonlinear equation system;
[0198] A construction module 602 is configured to construct a quantum circuit corresponding to a quantum linear solver, run the quantum circuit, and perform measurements to solve the target linear equations.
[0199] The determination module 603 is configured to determine a solution to the initial quadratic nonlinear system of equations based on the obtained solution to the target linear system of equations.
[0200] Specifically, the acquisition module includes:
[0201] A first conversion unit is used to convert the initial quadratic nonlinear equation group into a preset pseudo-linear equation group according to a homotopy perturbation method;
[0202] The second conversion unit is used to convert the preset pseudo linear equation group into a target linear equation group by using a linear embedding method.
[0203] Specifically, the building blocks include:
[0204] The first construction unit is used to construct a quantum circuit for realizing a first functional module V, wherein the first functional module is defined as
[0205] The second construction unit is used to construct a quantum circuit for realizing a second functional module combination, wherein the quantum circuit of the second functional module combination includes T, W and T + , the T=∑ j∈[N] |Ψ j > <j|, The S is the unitary matrix of the exchange operation module, the T + is the transposed conjugate of T, 4N 2 -dimensional identity matrix;
[0206] The third construction unit is used to construct a module for implementing the third functional module V + A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module;
[0207] The combining unit is used to sequentially insert the first functional module, the second functional module and the third functional module into the quantum circuit to form a quantum circuit corresponding to the quantum linear solver.
[0208] Compared with the existing technology, the present invention first determines the target linear equation group based on the transformation of the initial quadratic nonlinear equation group, then constructs the quantum circuit corresponding to the quantum linear solver, runs the quantum circuit and measures, solves the target linear equation group, and determines the solution of the initial quadratic nonlinear equation group based on the solution of the target linear equation group. By utilizing the relevant characteristics of quantum, the technology of calculating the quadratic nonlinear equation group using quantum algorithms can be realized, reducing the complexity and difficulty of solving the quadratic nonlinear equation group, and filling the relevant technical gap in the field of quantum computing.
[0209] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when running.
[0210] Specifically, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:
[0211] S201: Obtain a target linear equation group, wherein the target linear equation group is determined by transforming an initial quadratic nonlinear equation group;
[0212] S202: Constructing a quantum circuit corresponding to a quantum linear solver, running the quantum circuit and performing measurements to solve the target linear equations;
[0213] S203: Determine a solution to the initial quadratic nonlinear equation system based on the solved solution to the target linear equation system.
[0214] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0215] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
[0216] Specifically, 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.
[0217] Specifically, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0218] S201: Obtain a target linear equation group, wherein the target linear equation group is determined by transforming an initial quadratic nonlinear equation group;
[0219] S202: Constructing a quantum circuit corresponding to a quantum linear solver, running the quantum circuit and performing measurements to solve the target linear equations;
[0220] S203: Determine a solution to the initial quadratic nonlinear equation system based on the solved solution to the target linear equation system.
[0221] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the scope of implementation of the present invention is not limited to what is shown in the drawings. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which do not exceed the spirit covered by the description and drawings, should be within the scope of protection of the present invention.
Claims
1. A method for solving quadratic nonlinear equations based on quantum circuits, characterized in that: include: Obtain a target linear equation system, wherein the target linear equation system is determined by transforming an initial quadratic nonlinear equation system, and the initial quadratic nonlinear equation system is: ;in, , represents the real number space, , 、 The sparsity is ; Constructing a quantum circuit corresponding to a quantum linear solver, running the quantum circuit and measuring to solve the target linear equations; said constructing a quantum circuit corresponding to a quantum linear solver includes: constructing a first functional module for implementing The quantum circuit, wherein the first functional module is defined as ; Constructing a quantum circuit for realizing a second functional module combination, wherein the quantum circuit of the second functional module combination comprises 、 and , , the S is the unitary matrix of the exchange operation module, the For the The transposed conjugate of , for Dimensional identity matrix; constructs a module for implementing the third function A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module; the first functional module, the second functional module and the third functional module are sequentially inserted into the quantum circuit to form a quantum circuit corresponding to the quantum linear solver; Based on the solved solution of the target linear equation system, a solution of the initial quadratic nonlinear equation system is determined.
2. The method according to claim 1, characterized in that The obtaining of the target linear equations comprises: Converting the initial quadratic nonlinear equations into a preset pseudo-linear equations according to a homotopy perturbation method; The preset pseudo-linear equations are transformed into a target linear equations using a linear embedding method.
3. The method according to claim 2, characterized in that The preset pseudo-linear equations are: Among them, the reversible, is the variable to be solved for the preset pseudo linear equations, , is the number of variables to be solved for the preset pseudo linear equation system.
4. The method according to claim 2, characterized in that The target linear equation is: in, yes dimensional matrix, yes dimensional matrix, , satisfy , , express The number of items in .
5. A device for solving quadratic nonlinear equations based on quantum circuits, characterized in that: include: An acquisition module is used to acquire a target linear equation group, wherein the target linear equation group is determined by transforming an initial quadratic nonlinear equation group, and the initial quadratic nonlinear equation group is: ;in, , represents the real number space, , 、 The sparsity is ; A construction module is used to construct a quantum circuit corresponding to a quantum linear solver, run the quantum circuit and measure to solve the target linear equations; the construction of the quantum circuit corresponding to the quantum linear solver includes: constructing a first functional module The quantum circuit, wherein the first functional module is defined as ; Constructing a quantum circuit for realizing a second functional module combination, wherein the quantum circuit of the second functional module combination comprises 、 and , , the S is the unitary matrix of the exchange operation module, the For the The transposed conjugate of , for Dimensional identity matrix; constructs a module for implementing the third function A quantum circuit, wherein the third functional module is a transposed conjugate form of the first functional module; the first functional module, the second functional module and the third functional module are sequentially inserted into the quantum circuit to form a quantum circuit corresponding to the quantum linear solver; A determination module is used to determine the solution of the initial quadratic nonlinear equation system based on the solved solution of the target linear equation system.
6. The device according to claim 5, characterized in that The acquisition module includes: A first conversion unit is used to convert the initial quadratic nonlinear equation group into a preset pseudo-linear equation group according to a homotopy perturbation method; The second conversion unit is used to convert the preset pseudo linear equation group into a target linear equation group by using a linear embedding method.
7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Sorting method and device for importances of network nodes
CN112073126A
Quantum computing simulation platform and linear equation set quantum solving simulation method and system
CN112232512A