Surrogate model training method, target object optimization method, and related devices
Patent Information
- Application Number
- CN202211353203.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2042-10-31
AI Technical Summary
训练好的代理模型可以替代原模型,代理模型的训练的时候需要使用到大量的样本点对应的计算结果,为了获得满足模型训练所需的计算结果,所需要的计算量非常大,从而使得计算耗时比较多,进而导致模型训练的效率比较低
[0075]本发明提供的代理模型优化方法,先对目标对象进行采样,获得样本点;然后基于所述样本点,获得针对所述目标对象的目标线性方程组;再构建求解所述目标线性方程组的变分量子线路,利用所述变分量子线路,获得计算结果;最后利用所述样本点和所述计算结果,对代理模型进行训练,直至获得训练好的代理模型。通过量子计算获得代理模型训练所需要的数据,提高计算速度,从而提高模型训练的效率。
Smart Images

Figure CN117993150B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of quantum computing technology, specifically surrogate model training methods, target object optimization methods, and related devices. Background Technology
[0002] Most engineering design problems require simulation experiments to evaluate the objective and constraint functions when different design parameters are used. For example, to find the optimal aerodynamic shape of an aircraft, the airflow around the aircraft is often simulated for different shape parameters (length, curvature, material, etc.). For many practical problems, such as design optimization, thousands or even millions of simulations are needed to complete the optimization. Simulating using the original model can take minutes, hours, or even days to complete a single simulation. Therefore, simulating directly on the original model is extremely time-consuming.
[0003] One way to improve this situation is to use a surrogate model instead of the original model. The surrogate model's calculation results are very close to those of the original model, and the computational cost is smaller. A well-trained surrogate model can replace the original model. However, training the surrogate model requires the calculation results corresponding to a large number of sample points. To obtain the calculation results required for model training, the computational cost is very high, resulting in a long computation time and consequently, low model training efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a surrogate model training method, a target object optimization method, and related apparatus, which obtain the data required for surrogate model training through quantum computing, improve computation speed, and thus improve the efficiency of model training.
[0005] One embodiment of this application provides a surrogate model training method, the method comprising:
[0006] Sample the target object to obtain sample points;
[0007] Based on the sample points, a system of target linear equations for the target object is obtained;
[0008] Construct a variable quantum circuit for solving the target linear equation system;
[0009] The calculation results are obtained using the variable quantum circuit described above;
[0010] Using the sample points and the calculation results, the proxy model is trained until a well-trained proxy model is obtained.
[0011] Optionally, obtaining the target linear equation system for the target object based on the sample points includes:
[0012] The initial conditions, boundary conditions, system of partial differential equations to be solved, and computational domain of the target object are obtained, wherein the computational domain is determined using the sample points;
[0013] Discretize the initial conditions, the boundary conditions and the computational domain to obtain the discretized algebraic equation system corresponding to the partial differential equation system to be solved.
[0014] Based on the discretized algebraic equations, the target linear equations are determined.
[0015] Optionally, constructing the variational quantum circuit for solving the target linear equation system includes:
[0016] A first sub-quantum circuit and a second sub-quantum circuit are constructed to form a variable quantum circuit. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system. The second sub-quantum circuit is used to obtain the value corresponding to the loss function, wherein the loss function is constructed based on the approximate solution.
[0017] Optionally, obtaining the calculation result using the variable quantum circuit includes:
[0018] The target linear equation system is run and the variable quantum circuit is measured to obtain an approximate solution to the target linear equation system.
[0019] Based on the approximate solution, determine whether the value corresponding to the loss function meets the convergence accuracy.
[0020] If so, the approximate solution is used as the calculation result; otherwise, the variational parameters contained in the variational quantum circuit are updated, and the approximate solution of the target linear equation corresponding to the updated variational parameters is obtained again until an approximate solution is obtained that satisfies the convergence accuracy of the value corresponding to the loss function.
[0021] Optionally, the target parameters required for training the surrogate model are obtained using quantum algorithms.
[0022] Optionally, training the proxy model using the sample points and the calculation results until a trained proxy model is obtained includes:
[0023] The sample points are input into the surrogate model to obtain the predicted values;
[0024] Based on the calculation results and the predicted values, the model accuracy is obtained;
[0025] Determine whether the model accuracy meets the training termination condition;
[0026] If not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain the predicted value, until a trained surrogate model is obtained.
[0027] Another embodiment of this application provides a target object optimization method, the method comprising:
[0028] Obtain the shape information of the target object for parametric modeling;
[0029] The shape information of the target object is input into the proxy model trained using the proxy model training method provided in this application to obtain the predicted value;
[0030] Based on the predicted values, optimization information is obtained using an optimization algorithm;
[0031] The target object is updated using the optimization information;
[0032] Based on the target objects before and after the update, the optimal target object is obtained.
[0033] Optionally, the target object is the aerodynamic shape of an aircraft.
[0034] Optionally, the optimization algorithm is a quantum genetic algorithm.
[0035] Optionally, obtaining the optimal target object based on the target objects before and after the update includes:
[0036] Compare the target objects before and after the update to determine whether to terminate the optimization.
[0037] If so, determine the optimal target object based on the target objects before and after the update;
[0038] If not, determine the target object to be updated, reselect optimization data from the optimization information, update the target object to be updated using the optimization data, and return to the step of inputting the shape information of the target object into the proxy model trained using the proxy model training method provided in this application to obtain the predicted value.
[0039] Another embodiment of this application provides a surrogate model training apparatus, the apparatus comprising:
[0040] The first acquisition module is used to sample the target object and obtain sample points;
[0041] The second obtaining module is used to obtain a set of target linear equations for the target object based on the sample points;
[0042] The module is used to construct a variable quantum circuit for solving the target linear equation system;
[0043] The third obtaining module is used to obtain the calculation results using the variable quantum circuit;
[0044] The training module is used to train the proxy model using the sample points and the calculation results until a trained proxy model is obtained.
[0045] Optionally, the second obtaining module is specifically used for:
[0046] The initial conditions, boundary conditions, system of partial differential equations to be solved, and computational domain of the target object are obtained, wherein the computational domain is determined using the sample points;
[0047] Discretize the initial conditions, the boundary conditions and the computational domain to obtain the discretized algebraic equation system corresponding to the partial differential equation system to be solved.
[0048] Based on the discretized algebraic equations, the target linear equations are determined.
[0049] Optionally, the building module is specifically used for:
[0050] A first sub-quantum circuit and a second sub-quantum circuit are constructed to form a variable quantum circuit. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system. The second sub-quantum circuit is used to obtain the value corresponding to the loss function, wherein the loss function is constructed based on the approximate solution.
[0051] Optionally, the third obtaining module is specifically used for:
[0052] The target linear equation system is run and the variable quantum circuit is measured to obtain an approximate solution to the target linear equation system.
[0053] Based on the approximate solution, determine whether the value corresponding to the loss function meets the convergence accuracy.
[0054] If so, the approximate solution is used as the calculation result; otherwise, the variational parameters contained in the variational quantum circuit are updated, and the approximate solution of the target linear equation corresponding to the updated variational parameters is obtained again until an approximate solution is obtained that satisfies the convergence accuracy of the value corresponding to the loss function.
[0055] Optionally, the target parameters required for training the surrogate model are obtained using quantum algorithms.
[0056] Optionally, the training module is specifically used for:
[0057] The sample points are input into the surrogate model to obtain the predicted values;
[0058] Based on the calculation results and the predicted values, the model accuracy is obtained;
[0059] Determine whether the model accuracy meets the training termination condition;
[0060] If not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain the predicted value, until a trained surrogate model is obtained.
[0061] Another embodiment of this application provides a target object optimization apparatus, the apparatus comprising:
[0062] The fourth module is used to obtain the shape information of the target object in parametric modeling;
[0063] The fifth obtaining module is used to input the shape information of the target object into the proxy model trained using the proxy model training method provided in this application to obtain the predicted value;
[0064] The sixth obtaining module is used to obtain optimization information based on the predicted value using an optimization algorithm;
[0065] The update module is used to update the target object using the optimization information;
[0066] The seventh module is used to obtain the optimal target object based on the target objects before and after the update.
[0067] Optionally, the target object is the aerodynamic shape of an aircraft.
[0068] Optionally, the optimization algorithm is a quantum genetic algorithm.
[0069] Optionally, the seventh obtaining module is specifically used for:
[0070] Compare the target objects before and after the update to determine whether to terminate the optimization.
[0071] If so, determine the optimal target object based on the target objects before and after the update;
[0072] If not, determine the target object to be updated, reselect optimization data from the optimization information, update the target object to be updated using the optimization data, and return to execute the fifth obtaining module.
[0073] One embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the agent model training method or the target object optimization method.
[0074] One embodiment of this application provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, it implements the agent model training method or the target object optimization method.
[0075] The surrogate model optimization method provided by this invention first samples the target object to obtain sample points; then, based on the sample points, it obtains a target linear equation system for the target object; next, it constructs a variable quantum circuit to solve the target linear equation system, and uses the variable quantum circuit to obtain the calculation results; finally, it uses the sample points and the calculation results to train the surrogate model until a trained surrogate model is obtained. Quantum computing is used to obtain the data needed for surrogate model training, improving computational speed and thus increasing the efficiency of model training. Attached Figure Description
[0076] Figure 1 A hardware structure block diagram of a computer terminal for a proxy model training method provided in an embodiment of the present invention;
[0077] Figure 2 This is a flowchart illustrating a proxy model training method provided in an embodiment of the present invention.
[0078] Figure 3 A flowchart illustrating a target object optimization method provided in an embodiment of the present invention;
[0079] Figure 4 This is a schematic diagram of the structure of a proxy model training device provided in an embodiment of the present invention;
[0080] Figure 5 This is a schematic diagram of a target object optimization device provided in an embodiment of the present invention. Detailed Implementation
[0081] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0082] This invention first provides a surrogate model training method, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0083] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Because of its ability to process mathematical problems more efficiently than ordinary computers—for example, reducing the time to crack RSA keys from hundreds of years to hours—quantum computers have become a key technology under research.
[0084] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a proxy model training method provided in an embodiment of the present invention. Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0085] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the agent model training method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0086] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0087] Quantum computing is a novel computing paradigm that manipulates quantum information units according to the laws of quantum mechanics. One of the most fundamental principles upon which quantum computing is based is the superposition principle of quantum mechanical states. This principle allows quantum information units to exist in a superposition of multiple possible states, thus giving quantum information processing greater potential efficiency compared to classical information processing. A quantum system contains several particles that move according to the laws of quantum mechanics; this system is said to be in a certain quantum state in the state space. For chemical molecules, quantum chemical simulation can be achieved, providing research support for quantum computing.
[0088] It's important to note that a true quantum computer has a hybrid structure, comprising two main parts: a classical computer responsible for performing classical computations and control, and a quantum device responsible for running quantum programs to achieve quantum computation. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can run on a quantum computer, supporting operations on quantum logic gates and ultimately enabling quantum computing. Specifically, a quantum program is a sequence of instructions that operates on quantum logic gates according to a specific timing order.
[0089] In practical applications, due to limitations in the development of quantum device hardware, quantum computing simulations are often required to verify quantum algorithms, quantum applications, and so on. Quantum computing simulation is the process of simulating the execution of a quantum program corresponding to a specific problem using a virtual architecture (i.e., a quantum virtual machine) built with the resources of a regular computer. Typically, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in this embodiment of the invention is a program written in a classical language that represents qubits and their evolution, wherein qubits, quantum logic gates, etc., related to quantum computing all have corresponding classical code representations.
[0090] Quantum circuits, also known as quantum logic circuits, are a common manifestation of quantum programming and are the most widely used general-purpose quantum computing model. They represent circuits that operate on qubits under an abstract concept. They consist of qubits, circuits (timelines), and various quantum logic gates. Finally, the results are often read out through quantum measurement operations.
[0091] Unlike traditional circuits that use metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time. That is, the state of a quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated on.
[0092] A quantum program corresponds to a single quantum circuit. The quantum program described in this invention refers to this single quantum circuit, where the total number of qubits in the single quantum circuit is the same as the total number of qubits in the quantum program. This can be understood as follows: a quantum program can consist of a quantum circuit, measurement operations on the qubits within the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A single quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all the quantum logic gates in a specific timing order. It should be noted that the timing order refers to the chronological sequence in which individual quantum logic gates are executed.
[0093] It should also be noted that this invention relates to quantum computers. In conventional silicon-based computing devices, the processing chip units are CMOS transistors. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, currently, the number of such computing units in silicon chips is sufficient; that is, the number of computing units in a single chip is currently in the tens of thousands. The sufficient number of computing units and the fixed selectable computing logic of CMOS transistors, such as AND logic, allow for computational efficiency through a combination of numerous CMOS transistors and limited logic functions.
[0094] Unlike the logical units in ordinary computing devices, the basic computing unit in current quantum computers is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its usage time and is not always available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is a crucial challenge. The number of qubits is also one of the representative indicators of a quantum computer's performance. Each qubit performs computational functions through on-demand configured logical functions. Given the limited number of qubits and the diverse logical functions in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), RX gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum logic gates are generally represented using unitary matrices. A unitary matrix is not only a matrix form but also a type of operation and transformation. In general, the action of a quantum logic gate on a quantum state is calculated by left-multiplying a unitary matrix by the matrix corresponding to the right vector of the quantum state. In quantum computing, a finite number of qubits combined with diverse logical functions achieves computational effects.
[0095] Given these differences in quantum computers, the design of logical functions applied to qubits (including the design of whether qubits are used and the design of the efficiency of each qubit's use) is crucial for improving the computational performance of quantum computers and requires specialized design. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to address. Therefore, to address the technical problem of low model training efficiency, this application proposes a surrogate model training method, a target object optimization method, and related devices, aiming to improve the efficiency of surrogate model training through quantum computing.
[0096] See Figure 2 , Figure 2 A flowchart illustrating a surrogate model training method provided in an embodiment of the present invention may include the following steps:
[0097] S201: Sample the target object to obtain sample points.
[0098] The target object is the object to be optimized, such as the aerodynamic shape of an aircraft wing. The sampling method can be Latin hypercube sampling, uniform design, or orthogonal experimental design, etc. Specifically, the sample points obtained using the selected sampling method are the data of the target object needed to train the surrogate model; these can be coordinate points, etc.
[0099] S202: Based on the sample points, obtain the target linear equation system for the target object.
[0100] Using the sample points obtained from sampling, the target linear equation system of the target object can be obtained. The sample points can be processed, and the processed data can be used to obtain the target linear equation system. Alternatively, the sample points can be used as elements in the target linear equation system. Furthermore, the sample points can be converted into the data required for the target linear equation system through other methods.
[0101] In some possible embodiments of the present invention, obtaining the target linear equation system for the target object based on the sample points may include:
[0102] The initial conditions, boundary conditions, system of partial differential equations to be solved, and computational domain of the target object are obtained, wherein the computational domain is determined using the sample points;
[0103] Discretize the initial conditions, the boundary conditions and the computational domain to obtain the discretized algebraic equation system corresponding to the partial differential equation system to be solved.
[0104] Based on the discretized algebraic equations, the target linear equations are determined.
[0105] Specifically, a system of linear equations to be solved can be derived from a system of partial differential equations through discretization. If a system of differential equations contains partial derivatives of multivariable functions, or if the unknown function is related to several variables and the system contains derivatives of the unknown function with respect to those variables, then this system of differential equations is a partial differential equation system. Partial differential equations are an important branch of modern mathematics. Both in theory and in practical applications, partial differential equations are used to describe problems in mechanics, control processes, ecological and economic systems, chemical cycle systems, and epidemiology.
[0106] There are usually multiple solutions to a system of partial differential equations, but when solving a specific physical problem, the solution required must be selected. Therefore, additional conditions, namely initial conditions, boundary conditions, and their computational domain, must also be known.
[0107] The sample points determine the geometric shape of the target object, and based on this determined geometry, the computational domain can be obtained. To compute a system of partial differential equations, the computational domain must first be discretized. This involves dividing the spatially continuous computational region into many sub-regions and determining the nodes in each region, thus generating a mesh. The partial differential equations are then discretized on this mesh, transforming the partial differential equations into a system of algebraic equations at each node. Due to different assumptions about the distribution of the dependent variable between nodes and different methods for deriving the discretization equations, different types of discretization methods have emerged, such as the finite difference method and the finite volume method.
[0108] For example, the finite difference method is used to discretize the partial differential equation system. The computational domain is replaced by a grid composed of a finite number of discrete points, and the function of the continuous variable in the computational domain is applied to the grid to obtain the discretized algebraic equation system, which is the finite difference equation system.
[0109] Specifically, the discretized algebraic equation system is transformed into the target linear equation system through a linear transformation method.
[0110] For example, taking the linear transformation method in the finite volume method as an example, the specific process of determining the target linear equation system based on the discretized algebraic equation system is explained as follows:
[0111] Take the steady-state, incompressible Navier-Stokes equations as an example:
[0112]
[0113] Where U is the velocity vector unknown for each grid, and ρ is the density. Let ν be the pressure gradient and ν be the kinetic viscosity. Let g be the velocity gradient, and g be the gravitational term.
[0114] Discretization is performed using a three-dimensional polyhedral mesh. In order to solve the Navier-Stokes equations using the SIMPLE (Semi-Implicit Method for Pressure Linked Equations) algorithm, the equations need to be rewritten in the following matrix form:
[0115] AU = b
[0116] Where A is the coefficient matrix, U is the velocity vector unknown for each grid, and b is the right-hand side term (a known vector).
[0117] In the second-order finite volume method, the flow variables (p, T, U) vary along the grid lines. These flow variables, including pressure, temperature, velocity, etc., are stored at the grid center P. Similarly, adjacent grids need to be considered. Typically, each grid has M adjacent grids, and the flow variables are stored at the grid centers N.
[0118] First, we need to integrate the above Navier-Stokes equations along the grid center P to obtain:
[0119]
[0120] Where V is the mesh volume.
[0121] By using integral addition to separate the different terms in the parentheses of the above expression and integrating them one by one, we obtain:
[0122]
[0123] in, Represents the convection term. Represents the pressure gradient term, Represents the diffusion term, ∫ V [g]dV represents the source term, i.e., the gravity term.
[0124] For the source term ∫ V Since the gravitational acceleration g is constant, [g]dV can be moved outside the integral sign, resulting in:
[0125] ∫ V [g]dV=gV p
[0126] Among them, V p Let be the volume of the grid.
[0127] It should be noted that gradient calculations are involved in the convection and diffusion terms, which are difficult to handle. The following mainly introduces the method for handling the convection term. The method for handling the diffusion term is similar, so it will not be repeated.
[0128]
[0129] The divergence theorem is generally used to handle convection terms. The divergence theorem states that the integral of the divergence gradient of any vector is equivalent to the surface integral of the vector, i.e.:
[0130]
[0131] Therefore, by modifying the convection and diffusion terms using the divergence theorem, and calculating the integral, we obtain:
[0132]
[0133] The dot product of the velocity unit normal vector and the surface is the volumetric flow rate flowing out of the surface, i.e.:
[0134] Here, the velocity U is the quantity that needs to be solved, which can be decomposed into a surface integral, i.e.:
[0135]
[0136] The velocity changes linearly along the surface, therefore it can be determined by taking the velocity U at the center of the surface. fi As an approximation of the surface integral of velocity, we obtain:
[0137]
[0138] Where M is the number of adjacent grid cells.
[0139] The integral can be eliminated using the method described above; only summation is needed. However, due to U... fi Since it is unknown, interpolation is still required for calculation, such as using upwind schemes, second-order / linear upwind schemes, central difference schemes, QUICK interpolation methods to solve for the surface velocity U. fi Therefore, the convection term can be written as:
[0140]
[0141] As shown below, convection terms result in diagonal and off-diagonal terms, which reflects the connectivity between adjacent grids:
[0142]
[0143] Therefore, each term in the Navier-Stokes equation can be integrated one by one, and each term contributes differently to matrix A. These contributions need to be added together to form the complete matrix form.
[0144] The partial differential equations to be processed are transformed into the target linear equations by the above linear transformation method, namely: AU = b.
[0145] S203: Construct a variable quantum circuit for solving the target linear equation system.
[0146] Specifically, the constructed variable quantum circuit has the function of solving linear equations. It can be constructed based on the characteristics of the target linear equation system itself, or it can be constructed using quantum linear equation solving algorithms. Of course, it can also be constructed in other ways, which will not be elaborated here.
[0147] In some possible embodiments of the present invention, constructing a variational quantum circuit for solving the target linear equation system includes:
[0148] A first sub-quantum circuit and a second sub-quantum circuit are constructed to form a variable quantum circuit. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system. The second sub-quantum circuit is used to obtain the value corresponding to the loss function, wherein the loss function is constructed based on the approximate solution.
[0149] Specifically, the first sub-quantum circuit is essentially used to solve the target linear equation system, while the second sub-quantum circuit is essentially used to obtain the criterion for determining whether the solution has converged. The first sub-quantum circuit can obtain the sub-quantum state of the approximate solution, and the second quantum circuit obtains the value of the loss function based on this sub-quantum state.
[0150] It should be noted that the loss function can include elements of the objective linear equation system, approximate solutions, variational parameters, etc. The value corresponding to the loss function can be a calculated value obtained by calculating the loss function, or it can be the gradient of the loss function. Variational parameters are the parameters contained in the variational quantum circuit, specifically the parameters contained in the quantum logic gates of the quantum circuit. By changing the variational parameters, different quantum states can be obtained, and thus different approximate solutions can be obtained.
[0151] S204: Obtain the calculation results using the variable quantum circuit.
[0152] When a variable quantum circuit is run and converges, the calculation result is obtained based on the final quantum state of the variable quantum circuit. The calculation result can be data calculated using sample points, or specifically, it can be a performance parameter measuring the target object. Different calculation results may correspond to different parameters of the target object. Taking the target object as the aerodynamic shape of an aircraft as an example, the calculation result can be the lift-to-drag ratio. A higher lift-to-drag ratio indicates a better aerodynamic shape of the aircraft.
[0153] In some possible embodiments of the present invention, obtaining the calculation result using the variable quantum circuit may include:
[0154] Run and measure the variable quantum circuit to obtain an approximate solution to the target linear equation system;
[0155] Based on the approximate solution, determine whether the value corresponding to the loss function meets the convergence accuracy.
[0156] If so, the approximate solution is used as the calculation result; otherwise, the variational parameters contained in the variational quantum circuit are updated, and the approximate solution of the target linear equation corresponding to the updated variational parameters is obtained again until an approximate solution is obtained that satisfies the convergence accuracy of the value corresponding to the loss function.
[0157] Before measuring a variable quantum circuit, information about its linear equations can be input. One approach is to input a linear combination of S unitary matrices into which matrix A is decomposed, so that matrix A can be encoded into the quantum circuit. Here, A can be represented as: Among them, l s Let σ be the coefficient of the linear combination. s The unitary matrix (unitary operator); another piece of information input to the variable component quantum circuit's linear equations is the unitary matrix U obtained by encoding the vector b. b unitary matrix U b To prepare a quantum state |b> proportional to the vector b, that is, after normalizing the vector b, encode it into the quantum circuit in the form |b>=U b |0>. The solution to the linear system is expressed using the quantum state trial wave function of the variational hypothesis as follows: The solution is the ground state of the Hamiltonian as described below.
[0158] Specifically, after the aforementioned variable quantum circuit, the final state is obtained. To read quantum state information, a pre-constructed Hamiltonian can be used. The final state is measured to obtain the expected value. The key to this process is the pre-constructed Hamiltonian. Expected value This is the loss function.
[0159] After obtaining an approximate solution, the approximate solution is substituted into the loss function to obtain the value of the loss function.
[0160] The convergence precision can be set by the user according to the computational needs, for example, 10. -6 Or 0.
[0161] If the value corresponding to the loss function meets the convergence accuracy, the calculation terminates, and the obtained approximate solution is the calculation result; otherwise, the variational parameters in the variational quantum circuit are updated through optimization algorithms.
[0162] For example, using the traditional optimization method—gradient descent—the variational parameters are updated using the following formula.
[0163]
[0164] Where k is an integer not less than 1, and β is the learning rate. Let θ be the gradient of the loss function with respect to θ.
[0165] Then, the updated variational parameters are passed to the variational quantum circuit, and the evolution and measurement steps described above are continued. The approximate solution is updated and the loss function is solved by iterating the variational parameters until an approximate solution with the required accuracy is obtained, which is taken as the solution to the target linear equation, i.e., the calculation result.
[0166] S205: Using the sample points and the calculation results, train the proxy model until a trained proxy model is obtained.
[0167] In some embodiments of the present invention, the surrogate model may be a Kriging model, an Artificial Neural Network (ANN), Radial Basis Functions (RBF), a Support Vector Machine (SVM), or a Polynomial Regression (PRG), etc.
[0168] The sample points are input into the pre-selected proxy model, and the proxy model is continuously trained. The calculation results are used to determine whether the proxy model is trained well. When the proxy model is trained well, it can be used to perform operations such as optimizing the target object.
[0169] In some possible embodiments of the present invention, the target parameters required for training the surrogate model may be obtained using quantum algorithms.
[0170] When training a proxy model, the target parameters need to be calculated using sample points, and then the proxy model with the target parameters is trained.
[0171] The following uses the Kriging model as an example to illustrate the basic principles of the model and the relationship between the target parameters and the sample points:
[0172] The Kriging model assumes that the functional relationship between the response value and the independent variable can be approximated as follows:
[0173] y = f(x) T β+z(x)
[0174] Where, f(x) = [f1(x), f2(x), ..., f p (x)] T A linear combination of p given functions is called a regression model, where p is the number of polynomial terms in the regression model. The regression model can be a constant model, a first-order polynomial model, or a second-order polynomial model, and β is the corresponding regression parameter. z(x) is the error of a Gaussian random process, with the following statistical characteristics:
[0175] E[z(x)]=0
[0176] Var[z(x)]=σ 2
[0177] Cov[Z(x i Z(x) j )]=σ 2 R(θ,x i x j )
[0178] Where, σ 2 R(θ, x) represents the variance of the random process. i x j Let x be any two sample points. i and x j between
[0179] Spline functions, etc.
[0180] Suppose that the k sample points used to construct the Kriging model are: x 1 , ..., x k ∈R n , where x i (i = 1, ..., n) is an n-dimensional vector, and the corresponding response value is Y = {y} 1 , ..., y k} T Therefore, based on the sample points and response values, the correlation matrix can be obtained:
[0181]
[0182] At the predicted point x, the correlation matrix between the predicted point and the sample point is:
[0183]
[0184] Furthermore, based on the sample points, the following coefficient matrix can be obtained:
[0185]
[0186] Using a linear weighted average of the sample point response values to predict the response value of the point to be predicted, we have:
[0187]
[0188] Where ω(x) is the weighted coefficient vector, ω(x)=(ω1,ω2,…,ω k ) T .
[0189] The error between the predicted value and the actual value of the point to be predicted is:
[0190]
[0191] Where Z = [z1, z2, ..., z k ] T For the error of the sample points, due to but That is, F T ω(x) = f(x).
[0192] The variance of this prediction is:
[0193]
[0194] An effective Kriging surrogate model requires prediction variance Minimum, then The weighting coefficients in the equation can be obtained by solving the optimization problem of the above equation, and must satisfy F. TThe constraints are w(x) = f(x). To solve this optimization problem, a weighted Lagrange equation is introduced:
[0195] L(ω,λ)=σ 2 (1+ω T Rω-2ω T r)-λ T (F T ω-f)
[0196] Differentiate with respect to the weighting coefficients:
[0197]
[0198] Let the reciprocal of the above equation be 0, then the joint constraint condition F T Given w(x) = f(x), we can obtain the following system of equations:
[0199]
[0200] in, Solving the above equation yields:
[0201]
[0202] The correlation matrix R obtained based on the sample points and response values is the target parameter. The process of inverting R can be obtained using quantum algorithms, specifically quantum linear solution algorithms, which can accelerate the training of the entire surrogate model.
[0203] Substituting the above equation into... The predicted value of the prediction point is obtained:
[0204]
[0205] in For the polynomial parameters of the regression model, the above equation is the unbiased estimate of the Kriging model for a one-dimensional problem.
[0206] In summary, given the sample points, and Since they are definite, when predicting unknown points, we only need to calculate f(x) and r(x).
[0207] For different proxy models, the required target parameters may be different, the methods for obtaining the target parameters may also be different, and the quantum algorithms used to obtain the target parameters may also be different. For example, if the target parameters are obtained by solving equations, a quantum equation solving algorithm can be used, and if the target parameters are obtained by searching data, a quantum search algorithm can be used.
[0208] In some possible embodiments of the present invention, training the proxy model using the sample points and the calculation results until a trained proxy model is obtained may include:
[0209] The sample points are input into the surrogate model to obtain the predicted values;
[0210] Based on the calculation results and the predicted values, the model accuracy is obtained;
[0211] Determine whether the model accuracy meets the training termination condition;
[0212] If not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain the predicted value, until a trained surrogate model is obtained.
[0213] Taking the Kriging model as an example, inputting sample points into the Kriging model will yield... This refers to the predicted value. Using this predicted value and the calculation result, the model accuracy can be verified. The criteria for judging model accuracy include average error, empirical cumulative variance, root mean square error, and standard residuals, etc. The training termination condition can be preset within a certain numerical range.
[0214] Model accuracy can be validated using either incremental validation or cross-validation. The main difference lies in the fact that the former requires additional sample points, while the latter can complete the validation using only the existing sample points.
[0215] The basic idea of the point-based validation method can be simply described as follows: First, several new sample points are randomly generated. For each sample point, the calculation result and prediction value are obtained. Then, the calculation results and prediction values of all new sample points are substituted into the calculation formula of the model accuracy judgment standard to obtain the accuracy of the surrogate model. Based on this accuracy, it is judged whether the model meets the subsequent use requirements, that is, whether the training termination condition is met.
[0216] The basic idea of cross-validation can be simply described as follows: First, the sample point set S is randomly divided into m subsets of sample points S{x,y} = S... 1 ,S 2 ,…,S m When validating the accuracy of the surrogate model, any subset of sample points is used as the data to be validated, and the remaining m-1 samples are used to construct the surrogate model to be tested. This allows us to obtain the cross-validation error e corresponding to that subset. XV and variance After performing m validations, and using all subsets of sample points as validation data, the cross-validation error and variance of all subsets can be obtained:
[0217]
[0218] in and These are the predicted values and variances of the i-th subset when the surrogate model is constructed using the i-th subset as the test sample and the remaining m-1 subsets. After obtaining the cross-validation error and variance, the standard residuals are used to determine the model accuracy.
[0219] In a special case where m = n, the number of sample point subsets is equal to the total number of sample points. The validation method in this case is called the stepwise cross-validation method.
[0220] When the model accuracy does not meet the training termination condition, it means that the model has not been trained well and more sample points need to be added for training. At this time, the target object is sampled again, and the corresponding calculation results are calculated based on the new sample points. The predicted value is obtained using the new sample points. Finally, using all calculation results and all predicted values (including the calculation results and predicted values corresponding to the previous sample points), it is determined whether the model training has terminated.
[0221] As can be seen, this application first samples the target object to obtain sample points; then, based on the sample points, it obtains a target linear equation system for the target object; next, it constructs a variable quantum circuit to solve the target linear equation system, and uses the variable quantum circuit to obtain the calculation results; finally, it uses the sample points and the calculation results to train the surrogate model until a trained surrogate model is obtained. By obtaining the data needed for surrogate model training through quantum computing, the computation speed is improved, thereby increasing the efficiency of model training.
[0222] See Figure 3 , Figure 3 A flowchart illustrating a target object optimization method provided in an embodiment of the present invention may include the following steps:
[0223] S301: Obtain the shape information of the target object in parametric modeling.
[0224] Methods for parametric modeling of target objects include polynomial and spline function methods, CAD (Computer-Aided Design) methods, Free Form Deformation (FFD) methods, and Class and Shape Transformation (CST) methods. Polynomial and spline function methods commonly use functions such as B-splines, Bezier splines, and NLTRBS (Non-uniform rational B-splines) for geometric parameterization, which have powerful modeling capabilities and are one of the most widely used parametric modeling methods.
[0225] After parametrically modeling the target object, its shape information can be obtained, which can be presented in the form of data. The shape information mentioned here is the same type of information contained in the sample points. For example, the sample points are the coordinates of the target object, and the shape information is also the coordinates of the target object. A piece of shape information can contain multiple data, and these data can be of different types, such as coordinates, angles, etc.
[0226] In some possible embodiments of the present invention, the target object may be the aerodynamic shape of an aircraft. The aircraft may be an aircraft, spacecraft, rocket, or missile.
[0227] S302: Input the shape information of the target object into the proxy model trained using the proxy model training method provided in the above embodiment to obtain the predicted value.
[0228] By inputting the shape information into the surrogate model trained using the model training method provided in this application, the predicted value can be obtained.
[0229] S303: Based on the predicted value, optimization information is obtained using an optimization algorithm.
[0230] By inputting the predicted values into the optimization algorithm, optimization information can be obtained. This optimization information can include the weights of the target object to be optimized, as well as the gradient and direction of optimization, etc.
[0231] Optimization algorithms can include simulated annealing, tabu search, particle swarm optimization, machine learning algorithms, gradient descent, and so on. To calculate optimization information more quickly and thus accelerate the optimization of the target object, optimization algorithms can also be quantum genetic algorithms. Because they are quantum algorithms, quantum genetic algorithms replace the original classical genetic algorithms by achieving quantization, thereby accelerating the process based on quantum properties.
[0232] S304: Update the target object using the optimization information.
[0233] After obtaining optimization information, some values are calculated using the optimization information, and these values are used to adjust the target object. Alternatively, the parameters corresponding to the target object can be adjusted based on the optimization information, thereby updating the target object.
[0234] S305: Obtain the optimal target object based on the target objects before and after the update.
[0235] In some embodiments of the present invention, it can be determined whether optimization is completed based on the target objects before and after the update. If optimization is completed, the optimal one is selected from all currently updated and optimized objects. If optimization is not completed, optimization continues.
[0236] In some possible embodiments of the present invention, obtaining the optimal target object based on the target object before and after the update may include:
[0237] Compare the target objects before and after the update to determine whether to terminate the optimization.
[0238] If so, determine the optimal target object based on the target objects before and after the update;
[0239] If not, determine the target object to be updated, reselect optimization data from the optimization information, update the target object to be updated using the optimization data, and return to the step of inputting the shape information of the target object into the proxy model trained using the proxy model training method provided in this application to obtain the predicted value.
[0240] There are two ways to determine whether to terminate the optimization:
[0241] The first method is to determine whether the difference between the predicted values of the target objects before and after the update is within a preset range.
[0242] The second method involves determining whether the updated target object is superior to the original target object. There are many ways to determine this, such as comparing the predicted values of the target object before and after the update. For example, the predicted value is the lift-to-drag ratio; the larger the lift-to-drag ratio, the better the target object. If the updated target object is superior to the original, the optimization process continues to determine if it has converged. The convergence criteria could be whether the difference between the predicted values before and after the update is within a certain range, or whether the variance of the predicted values before and after the update is within a certain range, etc. If the optimization converges, the optimal target object is determined and the optimization is terminated. If the original target object is superior to the updated target object or the optimization does not converge, the optimization continues.
[0243] Depending on the different termination conditions, the optimal target object may be the target object before the update or the target object after the update. For example, taking the second method of determining whether to terminate as an example, the optimal target object is the target object after the update.
[0244] When the termination conditions are no longer met, optimization needs to continue. At this point, the target object to be updated is required. This target object is the optimal one among the initial target object and the currently updated target objects. The optimization information contains many sets of data. A set of unused data can be selected from the optimization information as optimization data. This optimization data is then used to update the target object to be updated. For example, the second-ranked data can be selected from the optimization information as optimization data. The updated target object's shape information is then input into the proxy model, and optimization continues.
[0245] This invention accelerates the training of the proxy model through quantum computing, thereby accelerating the optimization of the target object. This can promote the development of the target object optimization field. Taking the aerodynamic shape of an aircraft as an example, the method provided by this invention can accelerate the optimization of the aerodynamic shape of the aircraft, shorten the aircraft design cycle, and thus promote the development of the aerospace industry.
[0246] See Figure 4 , Figure 4 This is a schematic diagram of the structure of a proxy model training device provided in an embodiment of the present invention. Figure 2 Corresponding to the process shown, the apparatus includes:
[0247] The first acquisition module 401 is used to sample the target object and obtain sample points;
[0248] The second obtaining module 402 is used to obtain a set of target linear equations for the target object based on the sample points;
[0249] Module 403 is used to construct a variable quantum circuit for solving the target linear equation system;
[0250] The third obtaining module 404 is used to obtain the calculation result using the variable quantum circuit;
[0251] The training module 405 is used to train the proxy model using the sample points and the calculation results until a trained proxy model is obtained.
[0252] In some possible embodiments of the present invention, the second obtaining module 402 may be specifically used for:
[0253] The initial conditions, boundary conditions, system of partial differential equations to be solved, and computational domain of the target object are obtained, wherein the computational domain is determined using the sample points;
[0254] Discretize the initial conditions, the boundary conditions and the computational domain to obtain the discretized algebraic equation system corresponding to the partial differential equation system to be solved.
[0255] Based on the discretized algebraic equations, the target linear equations are determined.
[0256] In some possible embodiments of the present invention, the construction module 403 may be specifically used for:
[0257] A first sub-quantum circuit and a second sub-quantum circuit are constructed to form a variable quantum circuit. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system. The second sub-quantum circuit is used to obtain the value corresponding to the loss function, wherein the loss function is constructed based on the approximate solution.
[0258] In some possible embodiments of the present invention, the third obtaining module 404 may be specifically used for:
[0259] The target linear equation system is run and the variable quantum circuit is measured to obtain an approximate solution to the target linear equation system.
[0260] Based on the approximate solution, determine whether the value corresponding to the loss function meets the convergence accuracy.
[0261] If so, the approximate solution is used as the calculation result; otherwise, the variational parameters contained in the variational quantum circuit are updated, and the approximate solution of the target linear equation corresponding to the updated variational parameters is obtained again until an approximate solution is obtained that satisfies the convergence accuracy of the value corresponding to the loss function.
[0262] In some possible embodiments of the present invention, the target parameters required for training the surrogate model are obtained using quantum algorithms.
[0263] In some possible embodiments of the present invention, the training module 405 may be specifically used for:
[0264] The sample points are input into the surrogate model to obtain the predicted values;
[0265] Based on the calculation results and the predicted values, the model accuracy is obtained;
[0266] Determine whether the model accuracy meets the training termination condition;
[0267] If not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain the predicted value, until a trained surrogate model is obtained.
[0268] As can be seen, this application first samples the target object to obtain sample points; then, based on the sample points, it obtains a target linear equation system for the target object; next, it constructs a variable quantum circuit to solve the target linear equation system, and uses the variable quantum circuit to obtain the calculation results; finally, it uses the sample points and the calculation results to train the surrogate model until a trained surrogate model is obtained. By obtaining the data needed for surrogate model training through quantum computing, the computation speed is improved, thereby increasing the efficiency of model training.
[0269] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a target object optimization device provided in an embodiment of the present invention. Figure 3 Corresponding to the process shown, the apparatus includes:
[0270] The fourth module 501 is used to obtain the shape information of the target object in parametric modeling;
[0271] The fifth obtaining module 502 is used to input the shape information of the target object into the proxy model trained using the proxy model training method provided in this application to obtain the predicted value;
[0272] The sixth obtaining module 503 is used to obtain optimization information based on the predicted value using an optimization algorithm;
[0273] Update module 504 is used to update the target object using the optimization information;
[0274] The seventh module 505 is used to obtain the optimal target object based on the target objects before and after the update.
[0275] In some possible embodiments of the present invention, the target object may be the aerodynamic shape of an aircraft.
[0276] In some possible embodiments of the present invention, the optimization algorithm may be a quantum genetic algorithm.
[0277] In some possible embodiments of the present invention, the seventh obtaining module 505 may be specifically used for:
[0278] Compare the target objects before and after the update to determine whether to terminate the optimization.
[0279] If so, determine the optimal target object based on the target objects before and after the update;
[0280] If not, determine the target object to be updated, reselect optimization data from the optimization information, update the target object to be updated using the optimization data, and return to execute the fifth obtaining module 502.
[0281] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the surrogate model training method or target object optimization method provided in this embodiment. The computer-readable storage medium can be any medium capable of storing program code, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0282] Specifically, in this embodiment of the invention, the computer storage medium may be configured to store a computer program for implementing the following steps:
[0283] S201: Sample the target object to obtain sample points;
[0284] S202: Based on the sample points, obtain the target linear equation system for the target object;
[0285] S203: Construct a variable quantum circuit for solving the target linear equation system;
[0286] S204: Obtain the calculation results using the variable quantum circuit;
[0287] S205: Using the sample points and the calculation results, train the proxy model until a trained proxy model is obtained.
[0288] Specifically, in this embodiment of the invention, the computer storage medium may also be configured to store a computer program for implementing the following steps:
[0289] S301: Obtain the shape information of the target object in parametric modeling;
[0290] S302: Input the shape information of the target object into the proxy model trained using the proxy model training method provided in the above embodiment to obtain the predicted value;
[0291] S303: Based on the predicted value, optimization information is obtained using an optimization algorithm;
[0292] S304: Update the target object using the optimization information;
[0293] S305: Obtain the optimal target object based on the target objects before and after the update.
[0294] This invention also provides an electronic device, which may include a processor and a memory. The processor and the memory can communicate via a system bus. Furthermore, the memory stores a computer program. When the electronic device is a surrogate model training device, the processor reads and executes the computer program in the memory corresponding to the above embodiments to implement the surrogate model training method provided in this invention. When the electronic device is a target object optimization device, the processor reads and executes the computer program in the memory corresponding to the above embodiments to implement the target object optimization method provided in this invention.
[0295] Specifically, in this embodiment, the processor described above can be configured to implement the following steps via a computer program:
[0296] S201: Sample the target object to obtain sample points;
[0297] S202: Based on the sample points, obtain the target linear equation system for the target object;
[0298] S203: Construct a variable quantum circuit for solving the target linear equation system;
[0299] S204: Obtain the calculation results using the variable quantum circuit;
[0300] S205: Using the sample points and the calculation results, train the proxy model until a trained proxy model is obtained.
[0301] Specifically, in this embodiment, the processor can also be configured to implement the following steps via a computer program:
[0302] S301: Obtain the shape information of the target object in parametric modeling;
[0303] S302: Input the shape information of the target object into the proxy model trained using the proxy model training method provided in the above embodiment to obtain the predicted value;
[0304] S303: Based on the predicted value, optimization information is obtained using an optimization algorithm;
[0305] S304: Update the target object using the optimization information;
[0306] S305: Based on the target objects before and after the update, obtain the optimal target object. The memory can be an information recording device based on any electronic, magnetic, optical, or other physical principles, used to record execution instructions, data, etc. In some embodiments, the memory can be, but is not limited to, volatile memory, non-volatile memory, memory drives, etc.
[0307] A processor may be an integrated circuit chip with signal processing capabilities, and may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor described above may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC) computer, or a microprocessor, or any combination thereof.
[0308] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A method for training a surrogate model, characterized in that, The method includes: Sample the target object to obtain sample points; Based on the sample points, a system of target linear equations for the target object is obtained; A first sub-quantum circuit and a second sub-quantum circuit are constructed respectively to form a variable quantum circuit for solving the target linear equation system. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system, and the second sub-quantum circuit is used to obtain the value corresponding to the loss function, which is constructed based on the approximate solution. The calculation results are obtained using the variable quantum circuit described above; The sample points are input into the surrogate model to obtain the predicted values; Based on the calculation results and the predicted values, the model accuracy is obtained; Determine whether the model accuracy meets the training termination condition; If not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain the predicted value, until a trained surrogate model is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining the target linear equation system for the target object based on the sample points includes: The initial conditions, boundary conditions, system of partial differential equations to be solved, and computational domain of the target object are obtained, wherein the computational domain is determined using the sample points; Discretize the initial conditions, the boundary conditions and the computational domain to obtain the discretized algebraic equation system corresponding to the partial differential equation system to be solved. Based on the discretized algebraic equations, the target linear equations are determined.
3. The method according to claim 2, characterized in that, The process of obtaining calculation results using the variable quantum circuit includes: Run and measure the variable quantum circuit to obtain an approximate solution to the target linear equation system; Based on the approximate solution, determine whether the value corresponding to the loss function meets the convergence accuracy. If so, the approximate solution is used as the calculation result; otherwise, the variational parameters contained in the variational quantum circuit are updated, and the approximate solution of the target linear equation corresponding to the updated variational parameters is obtained again until an approximate solution is obtained that satisfies the convergence accuracy of the value corresponding to the loss function.
4. The method according to claim 1, characterized in that, The target parameters required for training the surrogate model are obtained using quantum algorithms.
5. A method for optimizing a target object, characterized in that, The method includes: Obtain the shape information of the target object for parametric modeling; The shape information of the target object is input into the proxy model trained using the proxy model training method provided by any one of claims 1-4 to obtain the predicted value; Based on the predicted values, optimization information is obtained using an optimization algorithm; The target object is updated using the optimization information; Based on the target objects before and after the update, the optimal target object is obtained.
6. The method according to claim 5, characterized in that, The target object is the aerodynamic shape of an aircraft.
7. The method according to claim 5 or 6, characterized in that, The optimization algorithm is a quantum genetic algorithm.
8. The method according to claim 7, characterized in that, The process of obtaining the optimal target object based on the target objects before and after the update includes: Compare the target objects before and after the update to determine whether to terminate the optimization. If so, determine the optimal target object based on the target objects before and after the update; If not, determine the target object to be updated, reselect optimization data from the optimization information, update the target object to be updated using the optimization data, and return to the step of inputting the shape information of the target object into the proxy model trained using the proxy model training method provided by any one of claims 1-4 to obtain the predicted value.
9. A surrogate model training device, characterized in that, The device includes: The first acquisition module is used to sample the target object and obtain sample points; The second obtaining module is used to obtain a set of target linear equations for the target object based on the sample points; A construction module is used to construct a first sub-quantum circuit and a second sub-quantum circuit respectively to form a variational quantum circuit for solving the target linear equation system. The first sub-quantum circuit is used to form a sub-quantum state containing an approximate solution to the target linear equation system, and the second sub-quantum circuit is used to obtain the value corresponding to the loss function, which is constructed based on the approximate solution. The third obtaining module is used to obtain the calculation results using the variable quantum circuit; The training module is used to input the sample points into the surrogate model to obtain predicted values; based on the calculation results and the predicted values, obtain the model accuracy; determine whether the model accuracy meets the training termination condition; if not, add new sample points, and based on the new sample points, use the variable quantum circuit to obtain the corresponding calculation results, and return to execute the step of inputting the sample points into the surrogate model to obtain predicted values, until a trained surrogate model is obtained.
10. A target object optimization device, characterized in that, The device includes: The fourth module is used to obtain the shape information of the target object in parametric modeling; The fifth obtaining module is used to input the shape information of the target object into the proxy model trained using the proxy model training method provided by any one of claims 1-4, and obtain the predicted value; The sixth obtaining module is used to obtain optimization information based on the predicted value using an optimization algorithm; The update module is used to update the target object using the optimization information; The seventh module is used to obtain the optimal target object based on the target objects before and after the update.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the surrogate model training method according to any one of claims 1-4 or the target object optimization method according to any one of claims 5-8.
12. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing a computer program, which, when executed by the processor, implements the surrogate model training method according to any one of claims 1-4 or the target object optimization method according to any one of claims 5-8.
Citation Information
Patent Citations
Training quantum evolutions using sublogical controls
CN109478258A
Control parameter determination method and device, computer equipment and storage medium
CN114298317A