A method for preparing a quantum state of flow information of a fluid physical system and related apparatus

By constructing a quantum circuit for the equation of flow state change in a fluid physics system, grid information and physical quantity information are directly encoded, solving the problem of high computational complexity in existing technologies, realizing efficient quantum state preparation of flow information in fluid physics systems, and saving computational resources.

CN116992969BActive Publication Date: 2026-01-13ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310900406.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2026-01-13
Estimated Expiration
2043-07-21

AI Technical Summary

Technical Problem

Existing technologies for solving flow information in fluid physics systems using quantum computers require classical calculations to obtain the coefficient matrix of linear equations and encode it into quantum states, resulting in high computational complexity and high resource consumption.

Method used

A quantum circuit is constructed to represent the flow state change equation of a reactive fluid physics system. This circuit directly utilizes the grid information and physical quantity information of the fluid physics system grid cells for quantum state encoding, avoiding classical calculations to solve the coefficient matrix.

Benefits of technology

This reduces the complexity of the coefficient matrix encoding in the flow state change equations, achieving exponential speedup and saving computational resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116992969B_ABST
    Figure CN116992969B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of computational fluid dynamics, and discloses a quantum state preparation method of flow information of a fluid physical system and a related device. The method comprises: obtaining grid information and physical quantity information of a grid unit of the fluid physical system; inputting the grid information and the physical quantity information into a quantum circuit of a reaction fluid physical system flow state change equation constructed in advance; and obtaining a quantum state of flow information of the fluid physical system by running the quantum circuit. Since the quantum circuit of the reaction fluid physical system flow state change equation is constructed in advance, the quantum state of the coefficient matrix of the flow state change equation can be directly encoded by using the grid information and the physical quantity information of the grid unit of the fluid physical system, so that the coefficient matrix does not have to be solved by a classical calculation method. The encoding complexity of the coefficient matrix of the flow state change equation is reduced, an exponential acceleration effect is achieved, and a large amount of computing resources is saved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computational fluid dynamics, and particularly relates to a quantum state preparation method for flow information of a fluid physical system and a related device. BACKGROUND

[0002] CFD (Computational Fluid Dynamics) is a product of the combination of modern fluid dynamics, numerical mathematics and computer science, and is a cross science with strong vitality. It starts from a calculation method, uses the calculation capacity of an electronic computer, and applies various discrete mathematical methods to solve various problems of fluid mechanics.

[0003] One of the core problems in the field of CFD is to solve large-scale sparse linear equations within a reasonable time. Compared with a classical computer, a quantum computer has obvious advantages in solving such problems. 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 a quantum algorithm, it is a quantum computer. A quantum computer has the ability to process mathematical problems more efficiently than a general computer, for example, it can speed up the time to crack RSA keys from hundreds of years to a few hours, so it has become a key technology under research.

[0004] When a quantum linear algorithm is used to accelerate the solution of linear equations, the coefficient matrix of the linear equations needs to be obtained through classical calculation first, and then encoded into a quantum state to facilitate the execution of the subsequent quantum linear algorithm. Therefore, the coefficient matrix needs to be calculated many times in the iteration process, and the calculation complexity of this process is high and a lot of computing resources are consumed. If a quantum circuit can be constructed to directly encode the quantum state of the coefficient matrix through quantum calculation, the encoding complexity will be greatly reduced and the computing resources will be saved. SUMMARY

[0005] The purpose of the application is to provide a quantum state preparation method for flow information of a fluid physical system and a related device. The quantum circuit for reacting to the flow state change equation of the fluid physical system is constructed, and the grid information and physical quantity information of the grid unit of the fluid physical system are obtained as the input of the quantum circuit, so as to obtain the quantum state of the flow information of the fluid physical system. The coefficient matrix does not need to be solved through classical calculation, so as to reduce the encoding complexity and save computing resources.

[0006] One embodiment of the application provides a quantum state preparation method for flow information of a fluid physical system, which comprises:

[0007] obtaining grid information and physical quantity information of a grid unit of a fluid physical system, the grid information being determined when the fluid physical system is meshed based on a selected geometric model, and the physical quantity information being information of a flow macro-quantity of the fluid physical system;

[0008] inputting the grid information and the physical quantity information into a quantum circuit pre-constructed to reflect a flow state change equation of the fluid physical system;

[0009] running the quantum circuit to obtain a quantum state of flow information of the fluid physical system.

[0010] Optionally, the flow information is a coefficient matrix of the flow state change equation, the coefficient matrix is a block matrix, and the quantum circuit includes a first sub-quantum circuit and a second sub-quantum circuit. The inputting the grid information and the physical quantity information into the quantum circuit pre-constructed to reflect the flow state change equation of the fluid physical system includes:

[0011] for any grid unit in the fluid physical system, inputting the grid information and the physical quantity information of the grid unit and its adjacent grid units into the first sub-quantum circuit, the first sub-quantum circuit being configured to obtain a quantum state of a unit block of the block matrix;

[0012] the second sub-quantum circuit being configured to obtain a quantum state of the coefficient matrix based on the quantum state of the unit block of the block matrix.

[0013] Optionally, the first sub-quantum circuit is configured to obtain a quantum state of a diagonal block of the block matrix based on the grid information and the physical quantity information of the grid unit and all adjacent grid units of the grid unit, and obtain a quantum state of a non-diagonal block of the block matrix based on the grid information and the physical quantity information of the grid unit and any adjacent grid unit of the grid unit.

[0014] Optionally, the grid information includes grid correlation information, and the obtaining the grid information and the physical quantity information of the grid unit of the fluid physical system includes:

[0015] for any grid unit in the fluid physical system, reading the grid information of the grid unit i based on a label i of the grid unit i through a quantum random access memory (QRAM);

[0016] determining a label j of an adjacent grid unit of the grid unit i based on grid correlation information of the grid unit i, and reading the grid information of the adjacent grid unit j through the QRAM;

[0017] reading the physical quantity information of the grid unit i and the adjacent grid unit j through the QRAM based on the label i and the label j.

[0018] Optionally, the first sub-quantum circuit comprises O Q gate and O M gate,

[0019] The O Q gate is used to encode the grid information and the physical quantity information of the grid cell and its adjacent grid cells into quantum bits in the first sub-quantum circuit for each category of flow macro-quantity, to obtain a composite quantum state

[0020] The O M gate is used to obtain the quantum state of all element blocks of the coefficient matrix A based on the composite quantum state

[0021] wherein the composite quantum state satisfies the following formula:

[0022]

[0023] wherein i represents the label of the grid cell, Δt represents the time step determined when the fluid physical system is constructed, V i represents the volume of the grid cell i, k represents the label of the flow macro-quantity, represents the kth physical quantity information of the grid cell i, s represents the number of adjacent grid cells of the grid cell i, j represents the label of the s-th adjacent grid cell of the grid cell i, represents the kth physical quantity information of the grid cell j, S ij represents the common boundary area vector of the grid cell i and the grid cell j, α ij , β ij respectively related to the distance of the grid cell i, the grid cell j to the common boundary, and satisfy α ij + β ij = 1.

[0024] Optionally, before the grid information and the physical quantity information of the grid cell and its adjacent grid cells are input into the first sub-quantum circuit, the method further comprises:

[0025] encoding to obtain the quantum state |i,s,k> of i, s and k using the O H gate;

[0026] performing the O j gate to obtain the quantum state |j> of j based on the mapping relationship of i, s and the label of the grid cell j.

[0027] Optionally, the second sub-quantum circuit comprises a first SWAP gate, gate, O mn ​Door, second SWAP door, third SWAP door, Door and Door,

[0028] The first SWAP gate is used to convert the quantum states of all unit blocks of the coefficient matrix A. Swap it to the first most significant bit register;

[0029] The Gates are used for the composite quantum state Perform a refund calculation;

[0030] The O mn The gate is used to encode quantum states |m> and |n> based on the preset transformation relationship between i, j, k and the subscripts m and n of the elements in the coefficient matrix A;

[0031] The second SWAP gate and the third SWAP gate are used to swap the quantum states |m> and |n> to the second high-order register, respectively;

[0032] The The door and the The gate is used to perform decomputation on the quantum state |i,j,k> to obtain the quantum state |m,n>|A of the coefficient matrix A. m,n >

[0033] Optionally, after obtaining the quantum state of the flow information of the fluid physics system by running the quantum circuit, the method further includes:

[0034] Read the residual information of the fluid physics system and encode it as a quantum state;

[0035] Using a preset quantum linear solver, the quantum states of the coefficient matrix of the flow state change equation and the quantum states of the residual information are evolved to obtain the final state;

[0036] Based on the final state, determine the physical changes of the fluid physical system;

[0037] The physical quantity information and residual information of the fluid physical system are updated based on the physical changes.

[0038] Another embodiment of the present invention provides a quantum state preparation device for flow information in a fluid physics system, the device comprising:

[0039] The acquisition module is used to acquire the grid information and physical quantity information of the grid cells of the fluid physics system. The grid information is determined when the fluid physics system is meshed based on a selected geometric model, and the physical quantity information is the information of the macroscopic flow quantities of the fluid physics system.

[0040] an input module configured to input the grid information and the physical quantity information into a quantum circuit pre-constructed to react to a flow state change equation of the fluid physical system;

[0041] a preparation module configured to run the quantum circuit to obtain a quantum state of the flow information of the fluid physical system.

[0042] A further embodiment of the present application provides a storage medium having a computer program stored therein, wherein the computer program is configured to execute the method described in any one of the above embodiments when run.

[0043] A further embodiment of the present application provides an electronic device comprising a memory having a computer program stored therein and a processor configured to run the computer program to execute the method described in any one of the above embodiments.

[0044] Compared with the prior art, the present application provides a quantum state preparation method of flow information of a fluid physical system and related devices, grid information and physical quantity information of a grid unit of the fluid physical system are obtained, the grid information is determined when the fluid physical system is gridded based on a selected geometric model, and the physical quantity information is information of a flow macroscopic quantity of the fluid physical system; the grid information and the physical quantity information are input into a quantum circuit pre-constructed to react to a flow state change equation of the fluid physical system; and the quantum circuit is run to obtain a quantum state of the flow information of the fluid physical system.

[0045] The quantum circuit reacting to the flow state change equation of the fluid physical system can be pre-constructed, and the quantum state of the coefficient matrix of the flow state change equation can be directly encoded using the grid information and the physical quantity information of the grid unit of the fluid physical system, so that the coefficient matrix does not have to be solved by classical calculation. The encoding complexity of the coefficient matrix of the flow state change equation is reduced, and the effect of exponential acceleration is achieved, thereby saving a large amount of computing resources. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A network block diagram of a quantum state preparation system of flow information of a fluid physical system provided by an embodiment of the present application;

[0047] Figure 2 A flowchart of a quantum state preparation method of flow information of a fluid physical system provided by an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a quantum circuit reacting to a flow state change equation of a fluid physical system provided by an embodiment of the present application;

[0049] Figure 4A structural schematic diagram of a quantum state preparation device for fluid physical system flow information provided by an embodiment of the present application is shown in the figure.

[0050] Figure 5 A structural schematic diagram of a computer device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0051] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and cannot be explained as a limitation of the present application.

[0052] Figure 1 A network block diagram of a quantum state preparation system for fluid physical system flow information provided by an embodiment of the present application is shown in the figure. The above-mentioned quantum state preparation system can include a network 110, a server 120, a wireless device 130, a client 140, a storage 150, a classical computing unit 160, a quantum computing unit 170, and can also include additional storage, classical processors, quantum processors and other devices not shown.

[0053] The network 110 is a medium for providing communication links between various devices and computers connected together in the above-mentioned quantum state preparation system, including but not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof, and the connection mode can adopt wired, wireless communication links or optical fiber cables, etc.

[0054] The server 120, the wireless device 130 and the client 140 are conventional data processing systems, which can contain data and have application programs or software tools for performing conventional computing processes. The client 140 can be a personal computer or a network computer, so the data can also be provided by the server 120. The wireless device 130 can be a smart phone, a tablet, a notebook computer, a smart wearable device, etc. The storage unit 150 can include a database 151, which can be configured to store quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs and other data.

[0055] The classical computing unit 160 (quantum computing unit 170) can include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data), and the classical data (quantum data) can be a boot file, an operating system image, and an application 163 (application 173), which can be used to implement a quantum algorithm compiled according to the quantum state preparation method for fluid physical system flow information provided by an embodiment of the present application.

[0056] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0057] It should be noted that a real quantum computer is a hybrid structure, which includes at least two parts: a classical computing unit 160 responsible for performing classical computing and control; and a quantum computing unit 170 responsible for running quantum programs to implement quantum computing. Figure 1

[0058] The classical computing unit 160 and the quantum computing unit 170 described above can be integrated in one device or distributed in two different devices. For example, a first device including the classical computing unit 160 runs a classical computer operating system, on which quantum application development tools and services are provided, and storage and network services required by quantum application programs are also provided. A user develops a quantum program through the quantum application development tools and services thereon, and sends the quantum program to a second device including the quantum computing unit 170 through the network services thereon. The second device runs a quantum computer operating system, which parses and compiles the code of the quantum program into instructions that can be recognized and executed by the quantum processor 170, and the quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.

[0059] The computing unit of the classical processor 161 in the classical computing unit 160 is a CMOS tube based on a silicon chip. Such a computing unit is not limited by time and coherence, i.e., such a computing unit is not limited by the length of use and is available at any time. In addition, in a silicon chip, the number of such computing units is also sufficient, and the number of computing units in a classical processor 161 is currently thousands or even tens of thousands. The number of computing units is sufficient and the computing logic of the CMOS tube is fixed, for example: AND logic. When operating with CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the effect of operation.

[0060] ​The basic computing unit of the quantum processor 171 in the quantum computing unit 170 is a quantum bit, the input of the quantum bit is limited by coherence, and is also limited by coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Sufficient use of the quantum bit within the available use time of the quantum bit is a key problem of quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of the quantum computer, and each quantum bit realizes a computing function through a logically configured function. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diversified, such as: Hadamard gate (H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, and the like. During quantum computing, the limited quantum bits need to be combined with various logical functions to achieve the operation effect.

[0061] Based on these differences, the design of the classical logic function acting on the CMOS tube and the design of the quantum logic function acting on the quantum bit are significantly and essentially different; the design of the classical logic function acting on the CMOS tube does not need to consider the individuality of the CMOS tube, such as the individual identification, position, and available time of each CMOS tube in the silicon chip. Therefore, the classical algorithm composed of the classical logic function only expresses the operation relationship of the algorithm, and does not express the dependence of the algorithm on the individuality of the CMOS tube.

[0062] And the quantum logic function acting on the quantum bit needs to consider the individuality of the quantum bit, such as the individual identification, position, and relationship with the surrounding quantum bits of the quantum bit in the quantum chip, as well as the available time of each quantum bit. Therefore, the quantum algorithm composed of the quantum logic function not only expresses the operation relationship of the algorithm, but also expresses the dependence of the algorithm on the individuality of the quantum bit.

[0063] The quantum chip only includes quantum bits and channels for regulating the quantum bits, and the quantum logic gate is realized through an analog signal. Different combinations of analog signals are applied to the quantum bits through the channels for regulating the quantum bits, so as to realize quantum circuits with different functions and complete the processing of data. Therefore, the design of the quantum logic function acting on the quantum bit (including the design of whether to use the quantum bit and the design of the use efficiency of each quantum bit) is the key to improving the operation performance of the quantum computer, and special design is required. This is also the uniqueness of the quantum algorithm based on the quantum logic function, which is essentially and significantly different from the classical algorithm based on the classical logic function. The above design for the quantum bit is a technical problem that ordinary computing devices do not need to consider and face.

[0064] Based on this, in order to reduce the coding complexity of the coefficient matrix of the flow state change equation in the fluid physical system and improve the coding efficiency, the present application provides a quantum state preparation method for fluid physical system flow information and related devices.

[0065] Referring to Figure 2 , Figure 2 The flowchart of the quantum state preparation method for fluid physical system flow information provided by the embodiment of the present application can include the following steps:

[0066] Step 201: Obtain the grid information and physical quantity information of the grid unit of the fluid physical system, wherein the grid information is determined when the fluid physical system is gridded based on the selected geometric model, and the physical quantity information is the information of the flow macroscopic quantity of the fluid physical system.

[0067] Step 202: Input the grid information and the physical quantity information into the quantum circuit for reacting the flow state change equation of the fluid physical system.

[0068] Step 203: Run the quantum circuit to obtain the quantum state of the flow information of the fluid physical system.

[0069] In the field of CFD technology, when performing flow simulation on a fluid, if an implicit time format is selected, the solving process can generally be divided into two steps:

[0070] First, a fluid physical system (i.e., a set of linear equations) is constructed based on the flow state of the fluid at the current time, and the solution of the fluid physical system can be used for flow field update;

[0071] Second, the fluid physical system is solved and the solution is used to obtain the flow state of the fluid at the next time.

[0072] As can be seen, in the implicit numerical simulation of the solving process, the change amount of the flow state at each time step needs to be obtained by solving a large sparse linear equation set (or linear control equation set), therefore, how to quickly construct the coefficient matrix of the linear control equation is one of the keys to improve the numerical simulation efficiency. The classical computer often needs very large computing resources when calculating such problems, while the quantum computer can perform parallel computing, so compared with the classical computer, it has an exponential speed-up effect in some specific computing scenarios. For example, the quantum computer has obvious advantages in solving large-scale sparse linear equations, therefore, quantum linear algorithms can be introduced in the field of CFD technology to perform flow simulation.

[0073] Currently, when quantum linear algorithm is used to accelerate CFD solving, more consideration is given to accelerating the second step of the above solving process, that is, the coefficient matrix A and the right end term b of the fluid physical system Ax=b are obtained through classical calculation, and then they are encoded into a quantum state to facilitate the subsequent execution of the quantum linear algorithm. Among them, the dimension of the coefficient matrix A is usually high, and it is very difficult to solve the coefficient matrix using classical calculation. Embodiments of the present application provide a new scheme, that is, a quantum circuit of the flow state change equation of the reaction fluid physical system is constructed, and the quantum state is directly encoded by using the quantum circuit, the physical quantity information of the grid unit of the fluid physical system and the geometric information obtained by the gridding processing, so as to prepare the quantum state of the coefficient matrix A.

[0074] It should be noted that the linear system generated in each time step in the CFD field is not unique according to the different selection of numerical format, and the embodiments of the present application select the basic and general format. Specifically, the scheme provided by the embodiments of the present application is described by taking the N-S (Navier-Stokes) control equation commonly used in the CFD field as an example.

[0075] Firstly, the N-S control equation without source term can be described as:

[0076]

[0077] Among them, U is a to-be-solved variable related to flow, taking two-dimensional compressible flow as an example, U=[p, p u, p v, p e], which are respectively the fluid mass density, the X direction momentum density, the Y direction momentum density and the total energy density; is a divergence operator; F c is a convection flux term; μ v is the dynamic viscosity coefficient of the fluid; F v is a viscous flux term.

[0078] The specific form of the two-dimensional convection flux term F c may be:

[0079]

[0080] The specific form of the two-dimensional viscous flux term F v may be:

[0081]

[0082]

[0083] If the above fluid medium is a Newtonian fluid, then:

[0084]

[0085]

[0086]

[0087]

[0088]

[0089] where i, j are the unit vectors in the X and Y directions, τ and q are the viscous stress and heat flux, and T is the fluid temperature.

[0090] Then, the N-S governing equations of the above two-dimensional compressible Newtonian fluid can be integrated by FVM (Finite Volume Method) over a small control volume. By combining the divergence theorem, the volume integral of the divergence term can be converted into the surface integral, i.e., the formula (1) can be converted into the following micro- partial control equation:

[0091]

[0092] where S is the outer normal of the surface of the small control volume, and if the time rate of all flow variables at any position in the small control volume is the same, it can be converted into ∫ S (F c -μ v F v )dS represents the influence of the boundary flux in the small control volume, and if the flux symbol R = ∑ j F·S j is introduced, the formula (5) can be written as:

[0093]

[0094] Since the formula (6) is a nonlinear equation, it can be linearized to facilitate the solution. If a first-order implicit Euler time format is used, the + approximation of r in a certain time period [t, t + Δt] can be represented as:

[0095]

[0096] If the boundary of the small control volume is fixed, i.e., the case of fixed grid, there is At this time, the Taylor expansion can be performed on the convection flux term r c+ and the first-order small quantity is omitted, which is represented as:

[0097]

[0098] where For the Jacobian matrix J of the convection term, in the two-dimensional compressible Newtonian fluid, the specific form of the Jacobian matrix of the convection term can be:

[0099]

[0100]

[0101]

[0102]

[0103] where γ is the specific heat ratio of the fluid, which is related to the properties of the fluid; e k is the specific kinetic energy of the fluid, e t is the specific internal energy of the fluid; the state equation of a perfect gas is used by default in the above derivation.

[0104] Since the viscous term does not have the property of homogeneous linearity, its Jacobian matrix is very complex, and it is very difficult to follow the above processing method for the convection term. In an embodiment, in order to improve the simulation stability of the area where the viscosity has a greater impact, the eigenvalue of the viscous direction in the convection flux Jacobian matrix is modified, that is, an implicit viscosity treatment is added. In this embodiment, the viscous term can be directly treated as explicit, that is, R v is selected instead of R v+ , and finally the linear control equation in each time step in the implicit FVM can be obtained as:

[0105]

[0106] Further, in order to solve the numerical value in formula (11), it can be discretized in space, that is, the linear control equation is grid processed to obtain a grid cell. In the case of a general unstructured grid, the flow domain can be decomposed into i grid cells, and the volume of each grid cell is V i , there are adjacent cells (that is, there is only one common boundary between two adjacent grid cells, so that the label ij can be positioned to a unique boundary, and the label ji is positioned to a boundary that is spatially coincident with the boundary positioned by ij, but the outer normal vector direction is opposite), and there are borders that are not shared with any other grid cell (that is, external boundaries).

[0107] The linear control equation satisfied by any grid cell i obtained by spatial discretization is:

[0108]

[0109] where, The flow rate on the boundary caused by the convection and viscous effect at time t can be represented as R i The above formula (1) can be unified as follows:

[0110]

[0111] Combining formula (12) and formula (13), the fully discrete linear control equation on each grid cell can be obtained as:

[0112]

[0113] Further, the boundary velocity increment ΔU ij is solved. The commonly used formats include upwind format, central format, Quick format, and special formats are also needed when dealing with Riemann problems to capture the discontinuity characteristics at the boundary. It should be noted that the selected format will affect the implementation of the specific quantum circuit used to prepare the coefficient matrix and the residual term. In this embodiment, the central format is selected, and the second-order central format can be described as:

[0114] U ij = α ij U i + β ij U j #(15)

[0115] Substituting formula (15) into formula (14), we can get:

[0116]

[0117] where U ij is the flow variable at the boundary S ij , the Jacobian matrix and F ij are functions of U ij , U i is the flow variable in cell i, U j is the flow variable in cell j, α ij , β ij are related to the distance of the two cells to the boundary, and satisfy α ij + β ij = 1.

[0118] Further, the boundary condition in the above formula (16) needs to be processed, that is, the external boundary ΔU ik term without complete two-sided grid cells is specially processed. In this embodiment, only the first type of boundary condition is considered, that is, U ik = const, ΔU ik = 0, so that formula (16) can be simplified as:

[0119]

[0120] The influence of the boundary condition on the flow at this time is fully reflected in the term.

[0121] Finally, formula (17) is coupled on all grid cells, and a linear system Ax = b, i.e., a fluid physical system, on the entire flow domain is obtained.

[0122] Specifically, in the embodiment, the physical quantity information is the information of the flow macroscopic quantity of the fluid physical system, i.e., the above-mentioned to-be-solved variable U. Taking two-dimensional compressible flow as an example, the fluid mass density ρ, the X-direction momentum density ρu, the Y-direction momentum density ρv, and the total energy density ρe can be included.

[0123] The grid information is a series of geometric information determined when the above-mentioned griding processing is performed on the fluid physical system based on the selected geometric model. For example, it can include the label of the grid, the grid correlation information, the geometric information of the flow domain, such as the area, the volume, the edge length, the centroid of each grid cell, the boundary and the surface normal of each grid cell, and the like, which are not limited here.

[0124] In order to facilitate the quick storage and reading of the physical quantity information and the grid information, in an implementation, the above-mentioned physical quantity information and grid information can be stored in a QRAM (Quantum Random Access Memory) according to a specified data structure. It should be noted that when the above-mentioned griding processing is performed, the grid information has been determined, and in the subsequent solving process, the grid information of the grid cell must remain fixed and cannot be changed. The physical quantity information can be updated in real time in reverse according to the solving result of the fluid physical system at the current time, and can be used to solve the solution of the fluid physical system at the next time.

[0125] In the above-mentioned process of constructing the fluid physical system, different formats of solving boundary velocity increments can be selected, which further affect the specific way of constructing the quantum circuit of the flow state change equation of the reaction fluid physical system. In the embodiment, the central format is selected, and the construction way of the quantum circuit is determined accordingly, so that the quantum circuit corresponding to the above-mentioned fluid physical system can be constructed in advance.

[0126] ​The flow information can include a coefficient matrix of a flow state change equation, and the quantum circuit corresponding to the fluid physical system can be used not only to prepare a quantum state of the coefficient matrix of the flow state change equation at a current time, but also to prepare a quantum state of the coefficient matrix at a next time after the fluid physical system is solved and a flow state at the next time is obtained from a solution of the fluid physical system. In this process, the quantum circuit does not need to be reconstructed, the structure of the quantum circuit does not change, and the task of preparing the quantum state of the coefficient matrix can be performed cyclically.

[0127] The elements in the coefficient matrix of the flow state change equation of the fluid physical system can represent the interaction, coupling relationship between different flow macroscopic quantities and the boundary condition of the fluid physical system, and are usually related to the position of the grid cell and the connection relationship between adjacent cells, and are associated with the flow macroscopic quantities. The physical quantity information includes the information of the flow macroscopic quantities of the fluid physical system, and the grid information includes the position, size and connection relationship of the grid cell, and the like. Therefore, based on the quantum circuit reacting to the flow state change equation of the fluid physical system, the elements in the coefficient matrix of the flow state change equation can be calculated, and then the quantum state of the coefficient matrix can be obtained.

[0128] As an embodiment of the present application, the flow information can be a coefficient matrix of a flow state change equation, the coefficient matrix can be a block matrix, the quantum circuit can include a first sub-quantum circuit and a second sub-quantum circuit, and the step of inputting the grid information and the physical quantity information into the pre-constructed quantum circuit reacting to the flow state change equation of the fluid physical system can include the following steps:

[0129] Step 301: For any grid cell in the fluid physical system, input the grid information and the physical quantity information of the grid cell and its adjacent grid cells into the first sub-quantum circuit, and the first sub-quantum circuit is used to obtain the quantum state of a cell block of the block matrix.

[0130] Specifically, in the present embodiment, the physical quantity information of each grid cell can include more than one flow macroscopic quantity, so that when the elements in the coefficient matrix are calculated based on the grid information and the physical quantity information of any grid cell and its adjacent grid cells, more than one matrix element can be obtained. Based on this, the calculated multiple matrix elements can be represented in the form of a cell block for each grid cell, and accordingly, the coefficient matrix can be a block matrix. The first sub-quantum circuit of the quantum circuit can be used to calculate the quantum state of the cell block of the block matrix.

[0131] In another embodiment, if the physical quantity information of the above grid cell only contains one flow macro-quantity, then based on the grid information and the physical quantity information of any grid cell and its adjacent grid cells, the above first sub-quantum circuit can directly calculate all elements in the coefficient matrix, which is obviously reasonable.

[0132] Preferably, the above first sub-quantum circuit can be used to obtain the quantum state of the diagonal block of the block matrix based on the grid information and the physical quantity information of the grid cell and all its adjacent grid cells; and obtain the quantum state of the non-diagonal block of the block matrix based on the grid information and the physical quantity information of the grid cell and any of its adjacent grid cells.

[0133] Further, in the process of simultaneously solving the linear equations of the grid cells in the entire flow domain to obtain the fluid physical system Ax = b, it can be determined that in the coefficient matrix A, there are:

[0134]

[0135]

[0136] Where i represents the label of the grid cell, V i represents the volume of the grid cell i, Δt represents the time step obtained by the above linearization process, represents the grid cell adjacent to the grid cell i, j represents the label of the grid cell , S ij represents the common boundary area vector of the grid cell i and the grid cell j, α ij , β ij are respectively related to the distance of the grid cell i and the grid cell j to the common boundary, and satisfy α ij + β ij = 1, represents the Jacobian matrix of the convection term in the fluid physical system, corresponding to the label k of the flow macro-quantity.

[0137] Based on the above formula (18), it can be obtained that the coefficient matrix A is a block matrix, A ii and A ij are unit blocks of the coefficient matrix A, where A ii represents the diagonal block, and A ij represents the non-diagonal block. Moreover, in this fluid physical system, the calculation of the coefficient matrix corresponding to different types of flow macro-quantities is different, and the above Jacobian matrix of the convection term can uniformly represent the influence of different types of flow macro-quantities on the coefficient matrix A. It can be seen that the diagonal block A iiWhen computing the non-diagonal block A ij When computing the non-diagonal block A

[0138] In an embodiment, the above-mentioned grid information and physical quantity information of the grid cell used for computing the non-diagonal block A ii and A ij are stored in the QRAM, so that the above-mentioned grid information and physical quantity information can be read using the QRAM.

[0139] As an embodiment of the embodiment of the present application, the above-mentioned grid information can include grid correlation information, and the above-mentioned obtaining the grid information and physical quantity information of the grid cell of the fluid physical system can include the following steps:

[0140] Step 401: For any grid cell in the fluid physical system, based on the label i of the grid cell, reading the grid information of the grid cell i through the quantum random access memory QRAM.

[0141] Specifically, the quantum random access memory QRAM is a storage device of a quantum computer, as a quantum simulation of RAM, the QRAM allows the quantum computer to obtain classical data of a given address in a quantum parallel manner. That is, the above-mentioned grid information and physical quantity information of the grid cell can be pre-stored in the classical memory in the form of classical data through a preset data structure, so that the QRAM can quickly implement the following quantum state encoding process:

[0142]

[0143] Wherein, i represents the address in the address register, represents the jth classical data stored at the address i, and specifically can be the above-mentioned grid information or physical quantity information.

[0144] It should be noted that the QRAM can input the superposition state of multiple addresses in common, rather than a single address, so as to output all classical data corresponding to the multiple addresses. And the QRAM at least has the classical RAM function, that is, it can access a single address in a fixed time, or use new data to overwrite the original data on the address. At the same time, the QRAM can be compatible with the classical computer, and the classical computer can read the data in the QRAM without increasing the cost.

[0145] Correspondingly, when storing the grid information and the physical quantity information of the grid cell through the preset data structure to the QRAM, the corresponding address in the address register can be determined based on the label of the grid cell. Furthermore, when reading the grid information and the physical quantity information of any grid cell in the fluid physical system, the label i of the above-mentioned grid cell can be taken as the input, and the QRAM can read the grid information of the grid cell stored in the corresponding address.

[0146] Step 402: based on the grid correlation information of the grid cell i, the label j of the adjacent grid cell of the grid cell i is determined, and the grid information of the adjacent grid cell j is read through the QRAM.

[0147] Specifically, the grid information can include grid correlation information, and the grid correlation information can be the information of the position topological relationship between the grid cells. In an embodiment, the mapping relationship between the number s of the grid cells adjacent to the inner boundary of the grid cell i and the label j of the adjacent grid cell can be established in advance, that is, j=g(i,s), so that in the solving process of the fluid physical system, as long as the grid does not change, the adjacent grid cells of each grid cell can be determined through the above-mentioned mapping relationship.

[0148] Through the above-mentioned method, after the QRAM reads the grid information of the grid cell i, based on the grid correlation information of the grid cell i, the label j of the adjacent grid cell of the grid cell i can be determined, and then the address corresponding to the label j in the address register can be determined, and the grid information of the adjacent grid cell j can be read. Wherein, according to the position relationship between different grid cells, the label of the adjacent grid cell can be one or more, which is not limited here.

[0149] Step 403: based on the label i and the label j, the physical quantity information of the grid cell i and the adjacent grid cell j is read through the QRAM.

[0150] Specifically, based on the label i of the grid cell and the label j of the adjacent grid cell, the addresses corresponding to the label i and the label j in the address register can be determined, and then the superposition state of the multiple addresses can be taken as the input of the QRAM, so that the physical quantity information of the grid cell i and all the adjacent grid cells j can be read.

[0151] As an embodiment of an embodiment of the present application, after reading the grid information and the physical quantity information of the grid cell through the QRAM, the above-mentioned inputting the grid information and the physical quantity information of the grid cell and its adjacent grid cells into the first sub-quantum circuit can include the following steps:

[0152] Step 501: for each category of flow macro-quantity, using O QThe goalkeeper encodes the grid information and the physical quantity information of the grid cell and its adjacent grid cells into quantum bits in the first sub-quantum circuit to obtain a composite quantum state Wherein, the composite quantum state Satisfies the following formula:

[0153]

[0154] Wherein, i represents the label of the grid cell, Δt represents the time step determined when the fluid physical system is constructed, V i represents the volume of the grid cell i, k represents the label of the flow macro-quantity, represents the kth physical quantity information of the grid cell i, s represents the number of adjacent grid cells of the grid cell i, j represents the label of the s-th adjacent grid cell of the grid cell i, represents the kth physical quantity information of the grid cell j, S ij represents the common boundary area vector of the grid cell i and the grid cell j, α ij , β ij respectively related to the distance of the grid cell i, the grid cell j to the common boundary, and satisfy α ij +β ij =1.

[0155] Based on the above formula (18) for calculating the cell block of the block matrix, it can be found that: first, for different types of flow macro-quantities, the calculation of the coefficient matrix is different, because the Jacobian matrix corresponding to different flow macro-quantities is different; second, for the two cases of i=j (i.e. the diagonal block A ii ) and i≠j (i.e. the non-diagonal block A ij ), the calculation of the coefficient matrix is also different, especially when i=j (i.e. the diagonal block A ii ), the calculation of needs to use the grid information and the physical quantity information of all adjacent grid cells j.

[0156] Since the above Jacobian matrix of the convection term can uniformly represent the influence of different types of flow macro-quantities on the coefficient matrix A, in order to facilitate the subsequent processing, the quantum state of all cell blocks of the coefficient matrix A can be calculated, the grid information and the physical quantity information of the grid cell and all its adjacent grid cells can be read in uniformly and encoded as a composite quantum state. Specifically, for each category of flow macro-quantity (the label of the flow macro-quantity in this category is k), the grid information and the physical quantity information of the grid cell i and its adjacent grid cells j can be read from the QRAM, and using O Q The goalkeeper encodes the above information into quantum bits in the first sub-quantum circuit to obtain a composite quantum state where, and are quantum states of physical quantity information of grid unit i and grid unit j, respectively, and the rest are quantum states of corresponding grid information.

[0157] Since classical access reads or modifies only one data entry at a time, while quantum query can perform a unitary transformation, and multiple data can be extracted into a quantum register using superposition addresses. If the data to be encoded satisfies i∈[1, N], j∈[1, M], then in the case of ordered data, the complexity of QRAM encoding is O(logM·logNM), and if the data is unordered, the complexity of QRAM encoding is In the field of CFD, since the total number of grid cells obtained by discretization is much larger than the number of adjacent grid cells of each grid cell, the data characteristics satisfy N>>M, at this time the complexity of QRAM encoding can be considered ~ O(logN). Therefore, compared with the classical computing method, the quantum state encoding using this scheme achieves exponential speedup effect.

[0158] The above encoding method inevitably requires a higher number of quantum bits, but in the subsequent calculation process, based on the specific calculation method in formula (18), the quantum states of all unit blocks of coefficient matrix A can be quickly obtained using quantum addition, quantum multiplication and exchange operations.

[0159] Step 502: based on the composite quantum state using O M gate calculation to obtain the quantum state of all unit blocks of coefficient matrix A

[0160] Specifically, based on the specific calculation method in formula (18) and the composite quantum state using O M gate, the quantum state of all unit blocks of coefficient matrix A can be calculated using quantum basic algorithms Quantum basic algorithms here mainly refer to quantum addition, quantum multiplication and exchange (SWAP) calculation, and the specific calculation method can be as follows:

[0161]

[0162]

[0163]

[0164] Based on the above quantum basis algorithm, unified four arithmetic operations of data on the same address of all superposition state addresses can be realized, that is, unified calculation of data of all grid cells at the same time can be performed, so that the quantum state of all element blocks of the coefficient matrix A can be quickly calculated

[0165] As an embodiment of the embodiment of the application, before the grid information and physical quantity information of the grid cell and its adjacent grid cells are input into the first sub-quantum circuit, the method can further include:

[0166] Using O H gate to obtain the quantum state |j> of j.

[0167] Based on the mapping relationship of i, s and the label of the grid cell j, an O j gate is executed to obtain the quantum state |j> of j.

[0168] The quantum circuit provided by the embodiment of the application for the flow state change equation of the reaction fluid physical system can be as shown in Figure 3 , wherein the initial state of all quantum bits is |0> state, and first, a limited number of H gates can be used to realize the following quantum state evolution:

[0169] O H |0>|0>|0>→|i,s,k>#(22)

[0170] That is, using an O H gate to encode the label i of all grid cells, the number s of adjacent grid cells and the label k of the flow macroscopic quantity in the fluid physical system, the corresponding quantum state |i,s,k> is obtained. Further, based on the mapping relationship of i, s and the label j of the adjacent grid cell established in advance during the grid processing, that is, j=g(i,s), an O j gate is executed, and the quantum state |s> changes as follows:

[0171] O j |i,s>→|i,j>#(23)

[0172] so as to obtain the quantum state |j> of j, that is, to obtain the quantum state |i,j,k>.

[0173] In the embodiment corresponding to the quantum circuit shown in Figure 3 , the quantum state |i,j,k> can also be input into the QRAM, and the QRAM can read the grid information and physical quantity information of each grid cell and its adjacent grid cells. Further, the grid information and physical quantity information of the grid cell i and its adjacent grid cell j can be read from the QRAM, and for each category of flow macroscopic quantity, an O QThe door encodes the above information into the quantum bits in the first sub-quantum circuit, and the quantum state of the quantum bits changes as follows:

[0174]

[0175] Based on the above composite quantum state O M The door calculates the quantum state of all element blocks of the coefficient matrix A

[0176]

[0177] Step 302: input the quantum state of the element block of the block matrix into the second sub-quantum circuit, and the second sub-quantum circuit is used to obtain the quantum state of the coefficient matrix based on the quantum state of the element block of the block matrix.

[0178] Specifically, after obtaining the quantum state of the element block of the block matrix through the above first sub-quantum circuit, all elements in the coefficient matrix A have been encoded into quantum states, but the elements have not been stored in the correct position. For a specific element A mn in the coefficient matrix A, the second sub-quantum circuit can determine the position information of the element in the coefficient matrix A based on the quantum basis algorithm through the above grid information and physical quantity information. Therefore, after inputting the quantum state of the element block of the block matrix into the second sub-quantum circuit, the second sub-quantum circuit can store all elements in the coefficient matrix A in the correct position, and further obtain the quantum state of the coefficient matrix of the fluid physical system flow state change equation.

[0179] As an embodiment of the embodiment of the present application, the second sub-quantum circuit can include a first SWAP gate, a H mn gate, a second SWAP gate, a third SWAP gate, a T gate, and a gate,

[0180] The first SWAP gate is used to exchange the quantum states of all element blocks of the coefficient matrix A to the first high register;

[0181] The gate is used to perform de-computation on the composite quantum state .

[0182] The O mn gate is used to encode the quantum state |m> and |n> based on the preset conversion relationship of i, j, k and the subscripts m, n of the elements in the coefficient matrix A.

[0183] The second SWAP gate and the third SWAP gate are used to swap the quantum states |m> and |n> to the second high-order register, respectively;

[0184] The The door and the The gate is used to perform decomputation on the quantum state |i,j,k> to obtain the quantum state |m,n>|A of the coefficient matrix A. m,n >

[0185] Specifically, such as Figure 3 As shown, a single swap operation can be performed through the first SWAP gate to change the quantum states of all unit blocks in coefficient matrix A. When swapped to the first most significant bit register, we have:

[0186]

[0187] Then use Gate pairs of the composite quantum state Performing the calculation, we have:

[0188]

[0189] Furthermore, in the solution provided by this embodiment of the invention, taking two-dimensional compressible flow as an example, U=[ρ,ρu,ρv,ρe], then k=0, U=ρ, and so on, k∈[0,1,2,3]. The preset conversion relationship between i, j, k and the subscripts m, n of the elements in the coefficient matrix A can satisfy the following formula:

[0190] m = 4 × i + k

[0191] n = 4 × j + k

[0192] Where i represents the label of the grid cell, j represents the label of the grid cell adjacent to grid cell i, and k represents the label of the macroscopic flow quantity.

[0193] Therefore, based on the preset conversion relationship between i, j, k and the subscripts m, n of the elements in the coefficient matrix A, O can be used. mn The gate, through quantum addition and quantum multiplication, encodes the quantum states |m> and |n>, that is:

[0194]

[0195] Furthermore, the quantum states |m> and |n> can be swapped to the second high-order register by performing swap operations through the second and third SWAP gates respectively:

[0196]

[0197] Furthermore, they can be used sequentially. The gate performs a reverse calculation on the quantum state |i,j,k>, resulting in:

[0198]

[0199] Based on the above first high-order register and second high-order register, the quantum state |m>|n>|A mn > can be obtained, that is, the quantum state |m,n>|A m,n > of the coefficient matrix A in the flow state change equation of the fluid physical system, and reverse calculations are performed on other qubits to remove some miscellaneous states in the quantum circuit, making it become the |0> state of the initial state, so as to facilitate the subsequent execution of the quantum linear algorithm.

[0200] Next, through specific embodiments, the process of constructing the quantum state |m,n>|A mn > of the coefficient matrix in the technical solution provided by the embodiments of the present invention will be described in detail. First, the physical meanings of all tags (i,j,k,s) and some variables (U,V,S,Δt,α,β) in this embodiment are given.

[0201] Tag i: Represents a certain grid cell i, and subsequent calculations are performed on this grid cell i. i is a natural number, that is and i < I, where I represents the total number of grid cells. Since the calculation processes on each grid cell are the same, parallel acceleration can be achieved through quantum computing, and tag i is the most important tag in this article.

[0202] Tag s: Represents the set of natural numbers (including the grid cell i itself) within the total number of grid cells adjacent to the grid cell i, and can be represented as a multivariate mapping in mathematics For example, if the grid cell i = 2 has 5 adjacent grid cells, then there is

[0203] Tag j: Represents the label of the second marked grid cell introduced with the grid cell i as the "origin", and its physical meaning is "the label of the adjacent grid cell of the grid cell i" (including the grid cell i itself), and can be represented as a multivariate mapping in mathematics For example, the adjacent grid cell labels of the grid cell i = 2 are 0, 2, 4, 8, 9 respectively, then there is Obviously, according to the definition, for a determined i, there must be a strict single mapping relationship between the elements of the set s and the set j and it satisfies Here corresponds to the Oracle O in the above quantum circuit j .

[0204] Tag k: represents the number of flow macro-quantity categories to be solved, for example, only fluid mass density, X direction momentum density, Y direction momentum density, total energy density, a total of 4 flow macro-quantities, then k = {0, 1, 2, 3}.

[0205] Based on the above four tags, any discrete flow macro-quantity in the fluid physical system can be completely described as The volume V of any grid cell in the fluid physical system can also be completely described i And any common boundary area vector S ij In addition, according to the grid information and the preset information of the fluid physical system, the time step Δt and the coefficients α ij ,β ij in the surface flux reconstruction process can also be determined. At this point, the elements required for constructing the coefficient matrix are complete.

[0206] Based on the above formulas (1) to (18), the element block function of the coefficient matrix can be derived. There can be two forms, but the calculation process of different element blocks can be described using a unified form. As for the part of the independent variable , it is obvious that all the information on the grid cell i and all the information on the adjacent grid cell j of i are required to solve an element block A ij .

[0207] To construct the above element block A ij , it is necessary to put in the QRAM memory according to its data structure for reading, but since i is a continuous natural number from 0 to I, but j is not, corresponding to the QRAM memory, the address of i in the memory is continuous, while the address of j in the memory is discontinuous. At this time, the above tag s is needed.

[0208] First, act on several H gates to realize the construction of the following quantum superposition state:

[0209] |0>|0>|0>→|i>|s>|k>

[0210] Then, act on the quantum state |s> Oracle O j , that is, the input address bit of the QRAM is positioned to the correct, discontinuous memory address, realizing the following quantum state evolution:

[0211] |i>|s>|k>→|i>|j>|k>

[0212] After that, the QRAM can be used to realize the following fast encoding process:

[0213]

[0214] After that, the A can be calculated in the form of ij . Where the main circuit involving quantum four operations and swap circuit, to achieve the following quantum state evolution:

[0215]

[0216] After that, the calculation of the operation can be performed, in the quantum state erasing information, to get the pure coefficient matrix block information, there are:

[0217]

[0218] It should be noted that according to the use of the skilled person in the art of habit, in the above calculation process of the embodiment, i, j, k, s represents the corresponding set of labels, in the above quantum state |i, j, k>、 In order to describe it more accurately, in one embodiment, it can be described as: i∈I, j∈J(i), k∈K, s∈S(i), i, j, k, s represent an element in the respective set, I is the set of grid cell labels, J(i) represents the set of labels of the adjacent cells of the unit i and the label i itself, which is a set varying with i. Correspondingly, the above quantum state Can be expressed as:

[0219]

[0220] Or

[0221]

[0222] Finally, only need to restore the block data structure to the general data structure, note that the index of the block data structure under the unit block The index of the coefficient matrix element A mn Under the general data structure m, n is:

[0223]

[0224] It is also an operation with a unified form, which can use the circuit of quantum four operations to realize the following quantum state transformation:

[0225]

[0226] The goal of this step is to change the data structure of the quantum state, i.e., only change its address bits, and no calculation is needed for the value of . In other words, A mn is actually one-to-one, and the correspondence between the upper and lower indexes and the value can be correctly realized through the above operation (i.e., the correspondence between the address bits and the data). Therefore, finally, by erasing the |i,j,k> information in the quantum state, the final goal of this embodiment is achieved, that is,

[0227]

[0228] According to the calculation requirements in the field of CFD, |m,n>|A mn > is the input form of the coefficient matrix required for subsequent execution of quantum linear algorithms (such as the CKS algorithm).

[0229] As an embodiment of the present application, after obtaining the quantum state of the flow information of the fluid physical system by running the quantum circuit, the method can further include the following steps:

[0230] Step 601: reading the residual quantity information of the fluid physical system and encoding it into a quantum state.

[0231] Specifically, the residual quantity information of the fluid physical system can be pre-stored in the QRAM memory according to a specified binary tree structure, so that the residual quantity information b at the current time can be quickly read from the QRAM and encoded into a quantum state |b>.

[0232] Step 602: using a preset quantum linear solver to evolve the quantum state of the coefficient matrix of the flow state change equation and the quantum state of the residual quantity information to obtain a final state.

[0233] The quantum linear solver is a quantum circuit constructed based on a quantum linear algorithm, where the quantum linear algorithm can be a CKS linear algorithm, an HHL algorithm, etc., which is not specifically limited here. Through the preset quantum linear solver, the quantum state |m,n>|A m,n > of the coefficient matrix of the flow state change equation of the fluid physical system and the quantum state |b> of the residual quantity information can be evolved to obtain a final state |ΔU>.

[0234] Step 603: determining the physical change quantity of the fluid physical system based on the final state.

[0235] The final state |ΔU> is the solution of the fluid physical system, which can be used for updating the flow field. Based on the final state |ΔU>, it can be inversely normalized and converted into the form of classical data to obtain the physical change quantity of the fluid physical system from the current time to the next time.

[0236] Step 604: updating the physical quantity information and the residual quantity information of the fluid physical system based on the physical change quantity.

[0237] Based on the above-mentioned physical change quantity, the physical quantity information and the residual quantity information of the fluid physical system can be updated in a classical calculation manner. Specifically, the updating of the physical quantity information can be completed by adding the physical change quantity to the physical quantity information at the current time. The updating of the residual quantity information satisfies the following formula:

[0238]

[0239] The updated physical quantity information and the residual quantity information are stored in the QRAM again, and then at the next time, the updated physical quantity information and the grid information can be input into the quantum circuit of the flow state change equation of the fluid physical system to obtain the quantum state of the coefficient matrix of the flow state change equation at the next time, and the quantum state of the updated residual quantity information is read and encoded, and the cycle iteration is continued to continuously update the flow field.

[0240] It can be seen that in the scheme provided by the embodiment of the present application, the grid information and the physical quantity information of the grid element obtained are input into the quantum circuit of the flow state change equation of the fluid physical system which is constructed in advance, and the quantum circuit is run, so that the quantum state of the coefficient matrix of the flow state change equation can be obtained. The coefficient matrix does not need to be solved by a classical calculation manner, which reduces the encoding complexity of the coefficient matrix of the flow state change equation, thereby saving a large amount of computing resources. From the perspective of query complexity, if the dimension of the coefficient matrix A is N and the sparsity is M, the query complexity of constructing the coefficient matrix A in the QFVM (Quantum Finite Volume Method) using the quantum circuit is O(M), and the query complexity of constructing the residual quantity b is O(log N). When N>>M, the query complexity of the entire construction process is O(log N), and compared with the query complexity O(N) of the classical calculation, the scheme provided by the embodiment of the present application has an exponential acceleration effect.

[0241] Referring to Figure 4 , Figure 4 A quantum state preparation device for fluid physical system flow information is provided in the embodiment of the present application, and the device can include:

[0242] The acquisition module 401 is configured to acquire grid information and physical quantity information of a grid element of a fluid physical system, wherein the grid information is determined when the fluid physical system is meshed based on a selected geometric model, and the physical quantity information is information of a flow macroscopic quantity of the fluid physical system.

[0243] The input module 402 is configured to input the grid information and the physical quantity information into a quantum circuit pre-constructed for solving the equation of fluid physical system flow state change.

[0244] The preparation module 403 is configured to run the quantum circuit to obtain a quantum state of the flow information of the fluid physical system.

[0245] The specific functions and effects of the quantum state preparation apparatus for the flow information of the fluid physical system can be explained in conjunction with other embodiments of the present specification, and will not be repeated here. Each module in the quantum state preparation apparatus for the flow information of the fluid physical system can be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be invoked and executed by the processor to perform the operations corresponding to each module.

[0246] Please refer to Figure 5 The present specification also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the quantum state preparation method for the flow information of the fluid physical system in any of the embodiments above when executing the computer program. Please refer to Figure 5 The computer device can be a classical computer. The computer device can also be a quantum computer.

[0247] The present specification also provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a computer to cause the computer to execute the quantum state preparation method for the flow information of the fluid physical system in any of the embodiments above.

[0248] The present specification also provides a computer program product including instructions, wherein the instructions are executed by a computer to cause the computer to execute the quantum state preparation method for the flow information of the fluid physical system in any of the embodiments above.

[0249] It can be understood that the specific examples in the present specification are only to help those skilled in the art better understand the embodiments of the present specification, and do not limit the scope of the present application.

[0250] It can be understood that in various embodiments of the present specification, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present specification.

[0251] It can be understood that the various embodiments described in the present specification can be implemented alone or in combination, and the embodiments of the present specification do not limit this.

[0252] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this specification belongs. The terminology used in the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. As used in this specification, the terms "may" and "can" include any one of, or a combination of, the corresponding inexcitables. As used in this specification and the appended claims, the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise.

[0253] It can be understood that the processor in the embodiments of the present specification can be an integrated circuit chip with processing capability of signals. In the implementation process, each step of the method embodiments described above can be completed by integrated logic circuits or instructions in the form of software in the processor. The processor described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step and logic block diagram disclosed in the embodiments of the present specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor or the like. The steps of the method disclosed in combination with the embodiments of the present specification can be directly embodied as a hardware coding processor to execute, or a combination of hardware and software modules in the coding processor. The software modules can be located in the random access memory, the flash memory, the read only memory, the programmable read only memory or the electrically erasable programmable memory, the register or other mature storage mediums in the art. The storage medium is located in the storage memory, and the processor reads the information in the storage memory, and combines the hardware to complete the steps of the above method.

[0254] It can be understood that the memory in the embodiments of the present specification can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read only memory (ROM), a programmable read only memory (PROM), an erasable programmable read only memory (EPROM), an electrically erasable programmable read only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM). It should be noted that the memory of the system and method described herein is intended to include but not limited to these and any other suitable types of memory.

[0255] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present specification.

[0256] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

[0257] In several embodiments provided in the present specification, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are merely schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0258] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.

[0259] In addition, each functional unit in each embodiment of the present specification can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit.

[0260] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0261] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method of quantum state preparation of flow information of a fluid physical system, characterized in that, The method comprises: obtaining grid information and physical quantity information of a grid unit of a fluid physical system, the grid information being determined when the fluid physical system is meshed based on a selected geometric model, and the physical quantity information being information of flow macro-quantities of the fluid physical system; inputting the grid information and the physical quantity information into a quantum circuit pre-constructed to reflect a flow state change equation of the fluid physical system; running the quantum circuit to obtain a quantum state of flow information of the fluid physical system; wherein the flow information is a coefficient matrix of the flow state change equation, the coefficient matrix is a block matrix, the quantum circuit comprises a first sub-quantum circuit and a second sub-quantum circuit, and the inputting the grid information and the physical quantity information into the quantum circuit pre-constructed to reflect the flow state change equation of the fluid physical system comprises: for any grid unit in the fluid physical system, inputting grid information and physical quantity information of the grid unit and its adjacent grid units into the first sub-quantum circuit, the first sub-quantum circuit being used to obtain a quantum state of a unit block of the block matrix; the second sub-quantum circuit being used to obtain a quantum state of the coefficient matrix based on the quantum state of the unit block of the block matrix; the first sub-quantum circuit being used to obtain a quantum state of a diagonal block of the block matrix based on the grid information and the physical quantity information of the grid unit and all adjacent grid units of the grid unit, and obtain a quantum state of a non-diagonal block of the block matrix based on the grid information and the physical quantity information of the grid unit and any adjacent grid unit of the grid unit.

2. The method of claim 1, wherein, The grid information comprises grid correlation information, and the obtaining the grid information and the physical quantity information of the grid unit of the fluid physical system comprises: For any grid cell in the fluid physics system, based on a label of the grid cell i reading grid information of the grid cell by a quantum random access memory QRAM i ​ determining a label of an adjacent grid cell of the grid cell based on the grid-related information of the grid cell i , and reading grid information of the adjacent grid cell through a QRAM i j j ​​​ based on the tag i and the tag j by QRAM reading the grid cell i and the adjacent grid cell j of the physical quantity information.

3. The method of claim 2, wherein, The first sub-quantum circuit includes a gate and a gate, The The door is used for encoding the grid information and physical quantity information of the grid cell and its adjacent grid cells into quantum bits in the first sub-quantum circuit for each category of flow macro-quantity, to obtain a composite quantum state ; The The gate is used to obtain the quantum state of all the unit blocks of the coefficient matrix A ;​​ wherein the composite quantum state satisfies the following equation: wherein, i represents a label of a grid cell, represents a time step determined when constructing the fluid physical system, represents a grid cell i , k represents a label of a flow macro variable, represents a grid cell i , k th physical quantity information of a grid cell s , i represents a number of grid cells adjacent to a grid cell j , s represents a label of a grid cell adjacent to a grid cell i , represents a grid cell j , k th physical quantity information of a grid cell , i represents a common boundary area vector of a grid cell j , , are respectively related to a distance of a grid cell i , a grid cell j to a common boundary, and satisfy .

4. The method of claim 3, wherein, Before the inputting the grid information and the physical quantity information of the grid unit and its adjacent grid units into the first sub-quantum circuit, the method further comprises: Using The door code is obtained i , s , k The quantum state ; Based on i , s and the mapping relationship of the labels of the grid cells j , the gate obtains j the quantum state .

5. The method of claim 4, wherein, the second sub-quantum circuit includes a first SWAP gate, gate, gate, a second SWAP gate, a third SWAP gate, gate, and gate, said first SWAP gate is configured to swap quantum states of all unit blocks of said coefficient matrix A onto a first high register;​ The The gate is used to perform a postcomputation on the composite quantum state ​ The Doors are used based on presets i , j , k and the coefficient matrix A Subscript of element m , n The transformation relationship is encoded to obtain the quantum state. , ; The second SWAP gate and the third SWAP gate are respectively used for swapping the quantum state , to a second high register; The gate and the gate are used to perform the quantum state decomputation to obtain the quantum state A of the coefficient matrix .

6. The method of claim 1, wherein, After the running the quantum circuit to obtain the quantum state of the flow information of the fluid physical system, the method further comprises: reading residual quantity information of the fluid physical system and encoding the residual quantity information into a quantum state; using a preset quantum linear solver to evolve the quantum state of the coefficient matrix of the flow state change equation and the quantum state of the residual quantity information to obtain a final state; based on the final state, determining a physical change quantity of the fluid physical system; updating the physical quantity information and the residual quantity information of the fluid physical system based on the physical change quantity.

7. An apparatus for quantum state preparation of flow information of a fluid physical system, characterized in that The device comprises: an obtaining module configured to obtain grid information and physical quantity information of a grid unit of a fluid physical system, the grid information being determined when the fluid physical system is meshed based on a selected geometric model, and the physical quantity information being information of flow macro-quantities of the fluid physical system; an inputting module configured to input the grid information and the physical quantity information into a quantum circuit pre-constructed to reflect a flow state change equation of the fluid physical system; wherein the flow information is a coefficient matrix of the flow state change equation, the coefficient matrix is a block matrix, and the quantum circuit comprises a first sub-quantum circuit and a second sub-quantum circuit. The input module is specifically configured to: input grid information and physical quantity information of any grid cell and its adjacent grid cells in the fluid physical system into the first sub-quantum circuit, and the first sub-quantum circuit is configured to obtain a quantum state of a unit block of the block matrix; The second sub-quantum circuit is configured to obtain a quantum state of the coefficient matrix based on the quantum state of the unit block of the block matrix; The first sub-quantum circuit is configured to obtain a quantum state of a diagonal block of the block matrix based on the grid information and physical quantity information of the grid cell and all adjacent grid cells of the grid cell, and obtain a quantum state of a non-diagonal block of the block matrix based on the grid information and physical quantity information of the grid cell and any adjacent grid cell of the grid cell; The preparation module is configured to run the quantum circuit to obtain a quantum state of flow information of the fluid physical system.

8. A storage medium, characterized by The storage medium stores a computer program, and the computer program is configured to execute the method in any one of claims 1 to 6 when running. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the computer program to execute the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Grid equation and physical equation coupled quantum solving method and device

    CN115618663A

  • Fluid dynamics calculation system based on quantum calculation and quantum computer

    CN115809705A