LBM-based quantum flow simulation method, device, medium and equipment
By quantizing the equilibrium distribution function, collision, and migration steps in the LBM method, the problem of high computational cost in classical LBM is solved, enabling rapid simulation of high Reynolds number flows and broadening the application scope.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
- Filing Date
- 2022-07-06
- Publication Date
- 2026-05-12
AI Technical Summary
The classic LBM method is computationally intensive when simulating high Reynolds number flows, and it is difficult to effectively reduce the dependence of computation time on the number of grids.
A quantum flow simulation method based on the D2Q9 model is adopted, which uses four qubits to encode the flow field information and distribution function. Quantum gate operations are used to quantize the equilibrium distribution function, collision and migration steps, thereby reducing computational complexity.
It enables rapid solutions to flow problems, increases the upper limit of the Reynolds number, broadens the scope of practical applications of the method, and achieves exponential speedup.
Smart Images

Figure CN117408343B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum design, and in particular to a quantum flow simulation method, apparatus, medium and device based on LBM. Background Technology
[0002] LBM (Lattice Boltzmann Method) is a mesoscopic simulation method whose core is the Boltzmann equation, the fundamental equation of gas kinetic theory. Its specific form is as follows:
[0003]
[0004] Where f is the particle distribution function, which is related to the particle's spatial position r, velocity ξ, and time t. The first term of the equation characterizes the evolution of the particle distribution function over time, the second term characterizes the contribution of the particle's own motion, the third term characterizes the contribution of external forces, and the fourth term characterizes the contribution of particle collisions. The specific form of the collision term depends on the chosen collision model and is generally called the collision integral term. The collision integral term is usually very complex, posing a great challenge to solving the Boltzmann equation.
[0005] To numerically solve the Boltzmann equations, the Bhatnagar-Gross-Krook single-relaxation collision model is used to simplify the collision terms. The D2Q9 model is used for velocity space discretization. After integrating the Boltzmann equations along the characteristic line, the first-order rectangular method is used for time-space discretization. External force terms are ignored, and the discrete governing equations of the LBM are obtained as follows:
[0006] Collision process:
[0007]
[0008] Migration process:
[0009] f i (x+e i δ t ,t+δ t )=f i (x,t+δ t )
[0010] Where x is the spatially discretized node position, τ is the collision relaxation time, and e i For discrete velocities, δ t f is the time step size after discretization. eq Let i be the local equilibrium distribution function, and let i be the direction of the discrete velocity.
[0011] Please refer to Figure 4 , Figure 4This is a schematic diagram of a two-dimensional nine-velocity discrete model provided for an exemplary embodiment of this application. (See diagram below.) Figure 4 As shown, the D2Q9 model has 9 discrete velocity directions, namely: e0=(0,0),e1=(1,0)c,e2=(0,1)c,e3=(-1,0)c,e4=(0,-1)c,e5=(1,1)c,e6=(-1,1)c,e7=(-1,-1)c,e8=(1,-1)c.
[0012] The parameters of the model can be derived from the equations of each order of moments:
[0013]
[0014] Where, ω i δ is the weighting factor for each discrete velocity direction. x The grid step size is c = δ. x / δ t For lattice velocity, numerical simulations typically take c = 1. s Let the dimensionless speed of sound of the fluid be used to determine the characteristic velocity of the LBM. The equilibrium distribution function in the LBM is taken as a Maxwell distribution, with the following form:
[0015]
[0016] The relationship between macroscopic quantities of flow and the distribution function can be derived from conservation conditions, in the following form:
[0017] ρ=f0+f1+f2+f3+f4+f5+f6+f7+f8
[0018] ρu=f1-f3+f5-f7+f8-f6
[0019] ρv=f2-f4+f5-f7+f6-f8
[0020] Where ρ is the fluid density, v is the velocity in the Y direction, u is the velocity in the X direction, ρu represents the component of fluid momentum in the X direction, and ρv represents the component of fluid momentum in the Y direction.
[0021] The Chapman-Enskog multi-scale analysis technique can reduce the discrete governing equations of the LBM to the incompressible Navier-Stokes equations, thus proving the effectiveness of the LBM method. During the multi-scale analysis, the relationship between the relaxation time τ and flow characteristic quantities in the LBM can be obtained as follows:
[0022]
[0023] Where, N xMa, Re, and Ma' represent the number of grid nodes in the characteristic direction, the flow Mach number, and the flow Reynolds number, respectively. The numerical stability of LBM requires the relaxation time τ to not approach 0.5. Clearly, when the flow Reynolds number Re is large, a larger number of grid nodes are needed to ensure the stability of the method.
[0024] In summary, since the computational time complexity of the classical LBM method is linearly related to the number of grid nodes, the computational burden of the classical LBM method is unbearable when simulating high Reynolds number flows. Summary of the Invention
[0025] The purpose of this application is to provide a quantum flow simulation method, apparatus, medium, and device based on LBM to solve the problem of the huge computational cost of classical LBM in the prior art, reduce the dependence of LBM solution time on the number of grids, thereby achieving fast solution of flow problems, or greatly increasing the number of simulation grids under the constraint of the same computational time.
[0026] To address the aforementioned technical problems, in a first aspect, this application provides a quantum flow simulation method based on LBM, comprising:
[0027] Initialize the flow field information; wherein, the flow field information includes fluid density and fluid momentum;
[0028] The flow field information and distribution function are encoded using four types of qubits based on the D2Q9 model. The four types of qubits are auxiliary qubits, discrete velocity direction control qubits, Y-axis coordinate control qubits, and X-axis coordinate control qubits. Among them, the discrete velocity direction control qubits are four bits, and the auxiliary qubits are two bits.
[0029] Based on the encoded flow field information, the first-order equilibrium distribution function in each discrete velocity direction is obtained;
[0030] Based on the first-order equilibrium distribution function and the encoded distribution function, a collision operation is performed;
[0031] After the collision operation, the migration operation is performed;
[0032] The flow field information is updated after the migration operation;
[0033] Determine whether the updated flow field information satisfies the convergence condition;
[0034] If not, perform boundary condition processing on the updated flow field information, and based on the processed flow field information, return to the step of encoding the flow field information and distribution function using four qubits based on the D2Q9 model, until the updated flow field information satisfies the convergence condition, and output the updated flow field information.
[0035] Optionally, the D2Q9-based model uses four types of qubits to encode the flow field information and distribution function, including:
[0036] The encoding format using four qubits is: |F1F0X3X2X1X0YZ>
[0037] Among them, bits X3, X2, X1, and X0 represent discrete velocity direction control bits, bit Y represents Y-direction coordinate control bits, bit Z represents X-direction coordinate control bits, and bits F1 and F0 represent auxiliary bits; the number of bits Y and Z is related to the number of grids when simulating fluid.
[0038] The encoding format based on the auxiliary bit pair distribution function and the flow field information is as follows:
[0039]
[0040] Where f represents the distribution function and m represents the flow field information.
[0041] Optionally, obtaining the first-order equilibrium distribution function in each discrete velocity direction based on the encoded flow field information includes:
[0042] Quantum gate operations are performed on the discrete velocity direction control bits with the auxiliary bit quantum state |01> to obtain the first-order equilibrium state distribution function in each discrete velocity direction.
[0043] Optionally, the quantum gate operation on the discrete velocity direction control bit with the auxiliary bit quantum state |01> includes:
[0044] Perform quantum gate operations on the discrete velocity direction control bits with auxiliary bit quantum states of |01> in the following order to obtain the first-order equilibrium state distribution function for each discrete velocity direction:
[0045] Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum states of bits X3, X2, and X1 are all |0>.
[0046] Using bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is |0>, the R(α1) gate is executed;
[0047] With bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is |1>, the R(θ1) gate is executed;
[0048] Using bits X3 and X2 as control bits and bit X1 as the target bit, when the quantum state of bit X3 is |1> and the quantum state of bit X2 is |0>, the R(α2) gate is executed;
[0049] Using bits X3 and X2 as control bits and bit X1 as target bit, when the quantum states of bits X3 and X2 are both |1>, the R(θ2) gate is executed;
[0050] Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum states of bits X3, X2, and X1 are all |1>.
[0051] Using bit X3 as the control bit and bit X2 as the target bit, the H gate is executed when the quantum state of bit X3 is |1>.
[0052] Optionally, performing the collision operation based on the first-order equilibrium distribution function and the encoded distribution function includes:
[0053] Apply an R(θ) gate to bit F0 to perform a collision operation.
[0054] Optionally, the step of performing a migration operation after the collision operation includes:
[0055] Quantum gate operations are performed sequentially on bits Z and Y in their respective discrete velocity directions to transfer the distribution function after the collision operation.
[0056] Optionally, the sequential quantum gate operation on bits Z and Y in their respective discrete velocity directions includes:
[0057] Quantum gate operations are performed on bits Z and Y in the following order to shift the distribution function after the collision operation according to their respective discrete velocity directions:
[0058] Perform the first quantum gate operation on bit Z, which is in the quantum state of |1000> for discrete velocity direction control bit;
[0059] Perform the first quantum gate operation on bit Y in the quantum state |1001> of the discrete velocity direction control bit;
[0060] Perform a second quantum gate operation on bit Z in the discrete velocity direction control bit quantum state |1100>;
[0061] Perform a second quantum gate operation on bit Y with the discrete velocity direction control bit quantum state |1101>;
[0062] Perform the first quantum gate operation on bit Z, which is in the quantum state of |1010> for discrete velocity direction control bit;
[0063] Perform the first quantum gate operation on bit Y with the discrete velocity direction control bit quantum state |1010>;
[0064] Perform a second quantum gate operation on bit Z, which is in the quantum state of |1111> for discrete velocity direction control bit;
[0065] Perform the first quantum gate operation on bit Y with the discrete velocity direction control bit quantum state |1111>;
[0066] Perform a second quantum gate operation on bit Z, which is in the quantum state of |1110> for discrete velocity direction control bit;
[0067] Perform a second quantum gate operation on bit Y with the discrete velocity direction control bit quantum state |1110>;
[0068] Perform the first quantum gate operation on bit Z, which is in the quantum state of |1011> for discrete velocity direction control bit;
[0069] Perform a second quantum gate operation on bit Y with the discrete velocity direction control bit quantum state |1011>.
[0070] Optionally, when bit Y or bit Z includes j+1 qubits, the encoding format of bit Y or bit Z is: Where j is an integer greater than or equal to 0, and n is an integer where 0 ≤ n ≤ j;
[0071] The first quantum gate operation includes:
[0072] By bit to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit When all quantum states are |0>, the X gate is executed; where, the bit When the target bit is used, directly in the bit The upper action X gate;
[0073] The second quantum gate operation includes:
[0074] By bit to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit When all quantum states are |1>, the X gate is executed; where, qubit When the target bit is used, directly in the bit The X-gate is used for action.
[0075] Optionally, updating the flow field information after the migration operation includes:
[0076] Apply an H gate to bit F1 after the transfer operation to obtain data when the auxiliary bit quantum state is |10>.
[0077] A quantum gate operation is performed on the discrete velocity direction control bit with the auxiliary bit quantum state |10> to update the flow field information.
[0078] Optionally, the quantum gate operation on the discrete velocity direction control bit with the auxiliary bit quantum state |10> includes:
[0079] The flow field information is updated by performing quantum gate operations on the discrete velocity direction control bits with auxiliary bit quantum state |10> in the following order:
[0080] With bit X3 as the control bit and bit X2 as the target bit, the H gate is executed when the quantum state of bit X3 is |1>.
[0081] Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, execute the H gate when the quantum states of bits X3, X2, and X1 are all |1).
[0082] With bits X3 and X2 as control bits and bit X1 as target bits, when the quantum states of bits X3 and X2 are both |1>, the R(d) gate is executed;
[0083] Using bits X3 and X2 as control bits and bit X1 as target bits, the H gate is executed when the quantum state of bit X3 is |1> and the quantum state of bit X2 is |0>.
[0084] Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum state of bit X3 is |1> and the quantum states of bits X2 and X1 are |0>.
[0085] Apply an R(e) gate to bit X3.
[0086] Secondly, a quantum flow simulation device based on LBM is provided, comprising:
[0087] An initialization module is used to initialize flow field information; wherein, the flow field information includes fluid density and fluid momentum;
[0088] The encoding module is used to encode the flow field information and distribution function using four types of qubits based on the D2Q9 model; the four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-axis coordinate control bits, and X-axis coordinate control bits; wherein, the number of discrete velocity direction control bits is four and the number of auxiliary bits is two.
[0089] The first acquisition module is used to acquire the first-order equilibrium distribution function in each discrete velocity direction based on the encoded flow field information;
[0090] The collision module is used to perform collision operations based on the first-order equilibrium distribution function and the encoded distribution function;
[0091] The migration module is used to perform migration operations based on collision operations.
[0092] An update module is used to update the flow field information based on the migration operation.
[0093] The judgment module is used to determine whether the updated flow field information meets the convergence condition.
[0094] The processing module is used to perform boundary condition processing on the updated flow field information if no, and return to the step of encoding the flow field information and distribution function using four qubits based on the D2Q9 model based on the processed flow field information, until the updated flow field information satisfies the convergence condition, and output the updated flow field information.
[0095] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any of the first aspects above.
[0096] Fourthly, a storage medium is provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method described in any of the first aspects above when it is run.
[0097] Fifthly, a quantum computer operating system is provided, wherein the quantum computer operating system implements LBM-based quantum flow simulation according to the method described in any one of the first aspects above.
[0098] In a sixth aspect, a quantum computer is provided, the quantum computer comprising the quantum computer operating system described in the fifth aspect above.
[0099] Based on the aforementioned LBM-based quantum flow simulation method, the calculation steps of the equilibrium distribution function, collision step, migration step, and macroscopic quantities in the fluid simulation process are quantized, resulting in an exponential speedup. Since the complexity of other steps in the LBM-based flow simulation method is much lower than that of the calculation steps of the equilibrium distribution function, collision step, migration step, and macroscopic quantities, these other steps can be implemented using classical computation. In other words, this application achieves a global exponential speedup in the overall solution. Although this application imposes stronger constraints on the flow Mach number, its more significant speedup effect results in a higher upper limit for the Reynolds number in the simulated flow, solving the problem of the enormous computational cost of classical LBM in existing technologies, increasing the Reynolds number simulated by the flow method, and broadening the practical application range of the method.
[0100] The LBM-based quantum flow simulation device, storage medium, and electronic device provided in this application belong to the same inventive concept as the LBM-based quantum flow simulation method, and therefore have the same beneficial effects, which will not be repeated here. Attached Figure Description
[0101] Figure 1 This is a hardware structure block diagram of a computer terminal for a quantum flow simulation method based on LBM provided in an exemplary embodiment of this application;
[0102] Figure 2 A schematic diagram illustrating a quantum circuit as provided in an exemplary embodiment of this application;
[0103] Figure 3 A schematic flowchart of an LBM-based quantum flow simulation method provided for an exemplary embodiment of this application;
[0104] Figure 4 This is a schematic diagram of a two-dimensional nine-velocity discrete model;
[0105] Figure 5 for Figure 3 A schematic diagram of a quantum circuit for obtaining the first-order equilibrium distribution function;
[0106] Figure 6 for Figure 3 A schematic diagram of the quantum circuit for the mid-transfer operation;
[0107] Figure 7 for Figure 6 A schematic diagram of the S1 quantum circuit, the first quantum gate for the mid-transfer operation;
[0108] Figure 8 for Figure 6 A schematic diagram of the S2 quantum circuit, the second quantum gate for the mid-transfer operation;
[0109] Figure 9for Figure 3 A schematic diagram of a quantum circuit for updating flow field information.
[0110] Figure 10 This is a schematic block diagram of an LBM-based quantum flow simulation device provided for an exemplary embodiment of this application. Detailed Implementation
[0111] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.
[0112] This application first provides a quantum flow simulation method based on LBM, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0113] 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 quantum flow simulation method based on LBM, provided as an embodiment of this application. Figure 1 As shown, computer terminal 10 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, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0114] The memory 104 can be used to store software programs and modules for application software, such as the program instructions / modules corresponding to the LBM-based quantum flow simulation 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 the computer terminal 10 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.
[0115] 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 the communication provider of the computer terminal 10. 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.
[0116] 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.
[0117] 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.
[0118] 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.
[0119] Quantum circuits can be represented as a sequence of quantum logic gates arranged in a specific time order. For example:
[0120] q0: RX(q0), H(q0), CNOT(q0, q2), X(q0)
[0121] q1: X(q1), RY(q1), H(q1), CNOT(q2, q1)
[0122] q2: H(q2), X(q2), CNOT(q0, q2), CNOT(q2, q1), RZ(q2)
[0123] A more intuitive representation of the quantum circuits corresponding to the aforementioned quantum logic gate sequence is shown below. Figure 2 As shown.
[0124] 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 quantum logic gate and is manipulated.
[0125] A quantum program corresponds to a single quantum circuit. The quantum program described in this application 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 storing the 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.
[0126] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, the way to process qubits is through quantum logic gates. Quantum logic gates enable the evolution of quantum states and are the foundation of quantum circuits. Quantum logic gates include single-qubit gates, 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, etc.; and multi-qubit quantum logic gates, such as CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc. Quantum logic gates are generally represented using unitary matrices, which are not only matrix forms but also operations and transformations. The effect of a quantum logic gate on a quantum state is generally calculated by left-multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.
[0127] A quantum state, or the logical state of a qubit, is represented in binary in quantum algorithms (or quantum programs). For example, a set of qubits q0, q1, and q2 represents the 0th, 1st, and 2nd qubits, ordered from most significant bit to least significant bit as q2q1q0. This set of qubits corresponds to a total of 2^(1 / 2) qubits, which refers to 8 eigenstates (determined states): |000>, |001>, |010>, |011>, |100>, |101>, |110>, and |111>. Each bit in a quantum state corresponds to a qubit. For example, in the state |000>, 000 corresponds to q2q1q0 from most significant bit to least significant bit. |> is the Dirac notation.
[0128] Taking a single qubit as an example, the logical state ψ of a single qubit may be in a superposition of the |0> state, the |1> state, and the |0> state and the |1> state (an uncertain state), specifically expressed as ψ = a|0> + b|1>, where a and b are complex numbers representing the amplitude (probability amplitude) of the quantum state, the square of the amplitude represents the probability, a² and b² represent the probabilities of the logical state being the |0> state and the |1> state, respectively. 2 +b 2 =1. In short, a quantum state is a superposition of eigenstates. When the probability of other states is 0, it is in a uniquely determined eigenstate.
[0129] The following is a further description of a quantum flow simulation method based on LBM provided by an embodiment of the present invention.
[0130] See Figure 3 , Figure 3 This is a schematic flowchart of an exemplary embodiment of the present application providing a quantum flow simulation method based on LBM, including steps S310 to S390, wherein:
[0131] S310, initialize flow field information.
[0132] The flow field information includes fluid density and fluid momentum. The initialization information for fluid density and fluid momentum is manually set according to requirements.
[0133] After initializing the flow field information, step S320 is executed.
[0134] S320 uses four qubits to encode the flow field information and distribution function based on a two-dimensional nine-velocity discrete model.
[0135] The four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-axis coordinate control bits, and X-axis coordinate control bits; the number of discrete velocity direction control bits is four, and the number of auxiliary bits is two.
[0136] Specifically, the encoding format using four qubits is: |F1F0X3X2X1X0YZ>
[0137] Among them, bits X3, X2, X1, and X0 represent discrete velocity direction control bits, bit represents Y-direction coordinate control bits, bit represents X-direction coordinate control bits, and bits F1 and F0 represent auxiliary bits; the number of bits Y and bit Z is related to the number of grids when simulating fluid.
[0138] The encoding format based on the auxiliary bit pair distribution function and the flow field information is as follows:
[0139]
[0140] Where f represents the distribution function, and m represents all the flow field information, including the fluid density ρ, the component of fluid momentum in the X direction ρu, and the component of fluid momentum in the Y direction ρv.
[0141] The distribution function encoding position on the discrete velocity direction control bits remains unchanged, and is:
[0142]
[0143] The flow field information encoding position on the discrete velocity direction control bit is:
[0144]
[0145] The specific encoding format of the subsequent row and column position bits depends on the number of row and column bits. For example, for a 16*16 grid, the number of row bits and column bits is 4 each. Thus, we encode all classical information into quantum state amplitudes.
[0146] After encoding the flow field information and distribution function using four types of qubits, step S330 is executed.
[0147] S330, based on the encoded flow field information, obtain the first-order equilibrium distribution function in each discrete velocity direction.
[0148] In the classic LBM, the equilibrium distribution function takes the Maxwell distribution, with the following form:
[0149]
[0150] Since the equilibrium distribution function is nonlinear, it is difficult to implement using quantum circuits. An iteration step of LBM at a given time step includes five main steps: collision, migration, macroscopic quantity calculation, boundary conditions, and equilibrium distribution function update. Among these, the boundary condition update only involves a portion of the boundary nodes, which can be considered a small quantity compared to all grid nodes, and the time cost of this step can be ignored.
[0151] Therefore, the main processes contributing to the time overhead of the LBM algorithm are the collision process, the migration process, the macroscopic quantity calculation process, and the equilibrium distribution function, which involve the calculation of variables on all grid nodes. To further achieve higher quantum speedup, the equilibrium distribution function process must be quantized. Based on the above considerations, this application further truncates the equilibrium distribution function, considering only the first-order equilibrium distribution function, as shown below:
[0152]
[0153] The first-order equilibrium distribution function is a linear expression, although its accuracy is reduced, but under the assumption of extremely low Mach numbers:
[0154]
[0155] The accuracy of the first-order equilibrium distribution function can still be guaranteed. Based on this assumption, this application updates the equilibrium distribution function using a linear expression and further utilizes quantum circuits to implement this process, thereby obtaining an LBM algorithm with a more significant acceleration effect.
[0156] Based on the D2Q9 model, expanding the first-order equilibrium distribution function yields the following specific forms for each discrete direction:
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166] Step S330 can be achieved by using a quantum circuit to obtain the first-order equilibrium state distribution function in each discrete velocity direction. To obtain the first-order equilibrium state distribution function, the designed quantum circuit, during execution, can perform quantum gate operations on the control bits in the discrete velocity directions sequentially, thereby obtaining the first-order equilibrium state distribution function in each discrete velocity direction. This application uses a specific quantum circuit diagram as an example to illustrate the process of obtaining the first-order equilibrium state distribution function. It should be noted that in other embodiments, other quantum circuit diagrams can also be used to obtain the first-order equilibrium state distribution function; this application does not impose specific limitations.
[0167] Please refer to Figure 5 , Figure 5 for Figure 3 A schematic diagram of a quantum circuit for obtaining the first-order equilibrium distribution function. Specifically, such as... Figure 5 As shown, step S330 targets data with auxiliary bit quantum states of |01>. Here, each quantum gate in the circuit diagram is interpreted, and quantum gate operations are performed on the data with auxiliary bit quantum states of |01> in the following order to obtain the first-order equilibrium state distribution function in each discrete velocity direction:
[0168] First, using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum states of bits X3, X2, and X1 are all |0>. This quantum gate operates on the data as follows:
[0169]
[0170] Next, using bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is |0>, the R(α1) gate is executed. Then, using bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is |1>, the R(θ1) gate is executed. It should be noted that the specific values of angles α1 and θ1 can be reasonably deduced by those skilled in the art from the data manipulated. The data operations performed by this quantum gate are as follows:
[0171]
[0172] Next, using bits X3 and X2 as control bits and bit X1 as the target bit, the R(α2) gate is executed when the quantum state of bit X3 is |1> and the quantum state of bit X2 is |0>. Then, using bits X3 and X2 as control bits and bit X1 as the target bit, the R(θ2) gate is executed when the quantum states of bits X3 and X2 are both |1>. It should be noted that the specific values of angles α2 and θ2 can be reasonably deduced by those skilled in the art from the data manipulated. The data operations performed by this quantum gate are as follows:
[0173]
[0174] Next, using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum states of bits X3, X2, and X1 are all |1>. The data operations performed by this quantum gate are as follows:
[0175]
[0176] Then, using bit X3 as the control bit and bit X2 as the target bit, the H gate is executed when the quantum state of bit X3 is |1>. The data operations performed by this quantum gate are as follows:
[0177]
[0178] After the above operations, it can be observed that the specific form in each discrete velocity direction can be found to correspond to a quantum state. Further, based on the coefficients of each term, those skilled in the art can reasonably deduce the values of tanα2, tanα1, tanθ2, and tanθ1. Then, substituting the specific rotation angle yields the first-order equilibrium distribution function in each discrete velocity direction, and the position strictly corresponds to the position of the distribution function. It should be noted that the equilibrium distribution function in step S330 has undergone proportional scaling, and the influence of this coefficient needs to be considered in the subsequent collision process.
[0179] After obtaining the first-order equilibrium distribution function in each discrete velocity direction, proceed to step S340.
[0180] S340, based on the first-order equilibrium distribution function and the encoded distribution function, perform a collision operation.
[0181] Based on the first-order equilibrium distribution function and the encoded distribution function, a collision operation must first be performed. The collision process can be described as follows:
[0182]
[0183] Clearly, a revolving door is introduced here:
[0184]
[0185] As the generator of the collision unitary matrix, a rotation gate R(θ) is applied to bit F0. Specifically, in this application, performing a collision operation includes applying an R(θ) gate to bit F0 to perform the collision operation. The data operations performed by this rotation gate R(θ) are as follows:
[0186]
[0187] Here, k represents the amplitude. It should be noted that the specific value of the rotation angle θ needs to take into account the effect of the proportional scaling of the equilibrium distribution function in step S330, which can be reasonably inferred by those skilled in the art from the operational data.
[0188] After performing the collision operation, proceed to step S350.
[0189] S350 performs a migration operation after a collision operation.
[0190] The classic process of a migration operation can be represented as follows:
[0191] f i (x+e i δ t ,t+δ t )=f i (x, t+δ) t )
[0192] That is, the distribution function is migrated according to the direction of its discrete velocity.
[0193] In this application, to perform the transfer operation, the designed quantum circuit can sequentially perform quantum gate operations on bits Z and Y in their respective discrete velocity directions to transfer the distribution function after the collision operation. This application uses a specific quantum circuit diagram as an example to illustrate the transfer process of the distribution function. It should be noted that in other embodiments, the transfer of the distribution function can also be performed using other quantum circuit diagrams, and this application does not make specific limitations.
[0194] Please refer to Figure 6 and Figure 7 , Figure 6 for Figure 3 A schematic diagram of the quantum circuit for the mid-transfer operation. Figure 7 for Figure 6 A schematic diagram of the S1 quantum circuit, the first quantum gate for the transfer operation. The example here uses the e1 = (1, 0) direction. The transfer in this direction can be described using classical code as follows:
[0195] f[y][x] = f[y][x-1]
[0196] Here, y represents the row number (Y-direction coordinate) and x represents the column number (X-direction coordinate), and the two-dimensional flow field mesh is described in the form of a two-dimensional array.
[0197] Taking a three-qubit quantum system as an example, the process involves the following quantum state operations:
[0198]
[0199] Here, there's an additional first-order loop operation: the data at position 0 should be missing after the transition, but it's filled with the last data. Now, let's explain in detail how this quantum state transition is achieved.
[0200] First, it is stated that the data contains only one qubit. How to achieve this operation? For example... Figure 7 As shown, when there is only one bit At that time, the data operation is as follows:
[0201]
[0202] This operation corresponds to: on this single bit Functions of the X-gate.
[0203] Next, it explains how this operation is achieved when the data contains two qubits. For example... Figure 6 and Figure 7 As shown, when there are bits and bit Data operations can be divided into the following two processes:
[0204]
[0205] like Figure 7 As shown, firstly, in bits Apply an X gate; then, in bits To control bits, bits For the target bit, when bit When the quantum state is |0>, the X gate is executed.
[0206] Next, it explains how this operation is achieved when the data contains three qubits. For example... Figure 6 and Figure 7 As shown, when there are bits Bit and Data operations can be divided into the following three processes:
[0207]
[0208] like Figure 7 As shown, firstly, in bits Apply an X gate; then, in bits To control bits, bits For the target bit, when bit When the quantum state is |0>, the X gate is executed; then, bits are used... Bit To control bits, bits For the target bit, when bit Bit When all quantum states are |0>, the X gate is executed.
[0209] As described above, the core migration path in step S350 is as follows: Figure 5 As shown. Figure 5 As shown, the migration operation performed after the collision operation includes the following steps: performing a first quantum gate S1 operation on bit Z with a discrete velocity direction control quantum state of |1000>; performing a first quantum gate S1 operation on bit Y with a discrete velocity direction control quantum state of |1001>; performing a second quantum gate S2 operation on bit Z with a discrete velocity direction control quantum state of |1100>; performing a second quantum gate S2 operation on bit Y with a discrete velocity direction control quantum state of |1101>; performing a first quantum gate S1 operation on bit Z with a discrete velocity direction control quantum state of |1010>; performing a second quantum gate S2 operation on bit Y with a discrete velocity direction control quantum state of |1010>; performing a second quantum gate S2 operation on bit Z with a discrete velocity direction control quantum state of |1010>. Bit Y undergoes a first quantum gate S1 operation; bit Z, whose discrete velocity direction control bit quantum state is |1111>, undergoes a second quantum gate S2 operation; bit Y, whose discrete velocity direction control bit quantum state is |1111>, undergoes a first quantum gate S1 operation; bit Z, whose discrete velocity direction control bit quantum state is |1110>, undergoes a second quantum gate S2 operation; bit Y, whose discrete velocity direction control bit quantum state is |1110>, undergoes a second quantum gate S2 operation; bit Z, whose discrete velocity direction control bit quantum state is |1011>, undergoes a first quantum gate S1 operation; bit Y, whose discrete velocity direction control bit quantum state is |1011>, undergoes a second quantum gate S2 operation.
[0210] When bit Y or bit Z comprises j+1 qubits, the encoding format of bit Y or bit Z is as follows: Where j is an integer greater than or equal to 0, and n is an integer where 0 ≤ n ≤ j.
[0211] like Figure 7 As shown, the first quantum gate operation includes: bit-wise operations. to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit When all quantum states are |0>, the X gate is executed; where, the bit When the target bit is used, directly in the bit The X-gate is used for action.
[0212] In other words, the transfer operation is performed on the j+1 qubits of bit Y or bit Z in the following order:
[0213] In bits The upper action X gate;
[0214] In bits To control bits, bits For the target bit, when bit When the quantum state is |0>, the X gate is executed;
[0215] In bits Bit To control bits, bits For the target bit, when bit Bit When all quantum states are |0>, the X gate is executed;
[0216] …in bits Bit … bits To control bits, bits For the target bit, when bit Bit … bits When all quantum states are |0>, the X gate is executed; where n is an integer greater than 1 and less than j;
[0217] …
[0218] In bits Bit … bits To control bits, bits For the target bit, when bit Bit ... bits When all quantum states are |0>, the X gate is executed.
[0219] like Figure 8 As shown, the second quantum gate operation includes: bit-wise operations. to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit When all quantum states are |1>, the X gate is executed; where, qubit When the target bit is used, directly in the bit The X-gate is used for action.
[0220] In other words, the transfer operation is performed on the j+1 qubits of bit Y or bit Z in the following order:
[0221] In bits The upper action X gate;
[0222] In bits To control bits, bits For the target bit, when bit When the quantum state is |1>, execute the X gate;
[0223] In bits Bit To control bits, bits For the target bit, when bit Bit When all quantum states are |1>, execute the X gate;
[0224] …
[0225] In bits Bit … bits To control bits, bits For the target bit, when bit Bit … bits When all quantum states are |1>, the X gate is executed; where n is an integer greater than 1 and less than j;
[0226] …
[0227] In bits Bit … bits To control bits, bits For the target bit, when bit Bit … bits When all quantum states are |1>, the X gate is executed.
[0228] After the migration operation is completed, proceed to step S360.
[0229] S360, Update the flow field information based on the migration operation.
[0230] It should be noted that the classic flow field information calculation process performs the following operations:
[0231] ρ=f0+f1+f2+f3+f4+f5+f6+f7+f8
[0232] ρu=f1-f3+f5-f7+f8-f6
[0233] ρv=f2-f4+f5-f7+f6-f8
[0234] Step S370 uses quantum circuitry to calculate and update the flow field information. The quantum state after the quantum transfer is as follows:
[0235]
[0236] The discrete velocity direction control bit X includes bit X3, bit X2, bit X1, and bit X0, and their specific distribution in each discrete velocity direction is as follows:
[0237]
[0238] To update the flow field information, the designed quantum circuit, during execution, can perform quantum gate operations on the discrete velocity direction control bits sequentially, thereby updating the flow field information. This application uses a specific quantum circuit diagram as an example to illustrate the process of updating the flow field information. It should be noted that in other embodiments, other quantum circuit diagrams can also be used to update the flow field information, and this application does not make specific limitations.
[0239] This application provides a quantum circuit diagram for updating the flow field information, such as... Figure 9 As shown. Figure 9 The quantum circuit diagram shown omits two auxiliary bits, as well as row and column bits, because fluid information computation only involves data calculations along different discrete velocity directions, not calculations between information at different positions. Clearly, there will be no quantum gate operations on the row and column bits. To ensure that the computation of flow field information does not destroy the original distribution function information, an H-gate is applied to bit F1 after the migration operation before the flow field information computation operation, obtaining the data when the auxiliary bit quantum state is |10>, achieving the following operation:
[0240]
[0241] This step is to "backup" the transferred distribution function, which is the significance of the second auxiliary bit. In this embodiment, the flow field information is calculated on the quantum state on |10XYZ>. Obviously, the specific form of the quantum state here is still...
[0242]
[0243] In this embodiment, only the data at the auxiliary bit quantum state |10> is considered, thus avoiding the destruction of the distribution function information stored at the auxiliary bit quantum state |00>. Therefore, step S360 only applies to the data at the auxiliary bit quantum state |10>. Here, each quantum gate in the circuit diagram is interpreted, and quantum gate operations are performed on the discrete velocity direction control bits at the auxiliary bit |01> after the migration operation to update the flow field information in the following order:
[0244] First, using bit X3 as the control bit and bit X2 as the target bit, the H gate is executed when the quantum state of bit X3 is |1>. The data operations performed by this quantum gate are as follows:
[0245]
[0246] Next, using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum states of bits X3, X2, and X1 are all |1>. The data operations performed by this quantum gate are as follows:
[0247]
[0248] Next, using bits X3 and X2 as control bits and bit X1 as the target bit, an R(d) gate is executed when the quantum states of bits X3 and X2 are both |1>. It should be noted that the value of sin d can be reasonably inferred by those skilled in the art from the data manipulated. The data operations performed by this quantum gate are as follows:
[0249]
[0250] It is evident that the fluid momentum in the X and Y directions has been stored in |101100YZ> and |101101YZ>.
[0251] Next, using bits X3 and X2 as control bits and bit X1 as the target bit, the H gate is executed when the quantum state of bit X3 is |1> and the quantum state of bit X2 is |0>. The data operations performed by this quantum gate are as follows:
[0252]
[0253] Next, using bits X3, X2, and X1 as control bits and bit X0 as the target bit, the H gate is executed when the quantum state of bit X3 is |1> and the quantum states of bits X2 and X1 are |0>. The data operations performed by this quantum gate are as follows:
[0254]
[0255] Finally, an R(e) gate is applied to bit X3; the value of sin e can be reasonably inferred by those skilled in the art from the manipulated data. The data operations performed by this quantum gate are as follows:
[0256]
[0257] It can be seen that the fluid density information is stored in the amplitude in the direction of |100000YZ>.
[0258] In summary, after the flow field information is updated through the calculation circuit, the flow field information (fluid density, fluid momentum in the X direction, and fluid momentum in the Y direction) is stored in the quantum state amplitudes in the directions of |100000YZ>, |101100YZ>, and |101101YZ>.
[0259] After obtaining the updated flow field information, proceed to step S370.
[0260] S370, determine whether the updated macroscopic quantity meets the convergence condition.
[0261] The convergence conditions in this application are similar to those in the classical LBM calculation, and the judgment process is also similar. In other words, judging whether the flow field information meets the convergence conditions is a technical means known to those skilled in the art. Therefore, for the sake of brevity, this application will not elaborate on it in detail.
[0262] If the updated flow field information meets the convergence condition, proceed to step S380.
[0263] If the updated flow field information does not meet the convergence condition, perform boundary condition processing, and return to step S320 based on the processed flow field information until the updated flow field information meets the convergence condition, and then proceed to step S380.
[0264] The boundary condition processing procedure in this application is similar to that in the classical LBM calculation. In other words, performing boundary condition processing is a technique well-known to those skilled in the art; therefore, for the sake of brevity, this application will not elaborate on it further.
[0265] S380 outputs the updated flow field information.
[0266] Compared with existing technologies, based on Figure 3The LBM-based quantum flow simulation method presented quantizes the calculation steps of the equilibrium distribution function, collision step, migration step, and macroscopic quantities in the fluid simulation process, resulting in an exponential speedup. Since the complexity of other steps in the LBM-based quantum fluid simulation method is much lower than that of the calculation steps of the equilibrium distribution function, collision step, migration step, and macroscopic quantities, these other steps can be implemented using classical computation. In other words, this application achieves a global exponential speedup in the overall solution. Although this application imposes stronger constraints on the flow Mach number, its more significant speedup effect results in a higher upper limit for the Reynolds number of the simulated flow, solving the problem of the enormous computational cost of classical LBM in existing technologies, increasing the Reynolds number simulated by the method, and broadening the practical application range of the method.
[0267] The above combination Figure 3 This application provides a detailed description of the LBM-based quantum flow simulation method provided in its embodiments. The following is in conjunction with... Figure 10 This document describes in detail the apparatus for performing the LBM-based quantum flow simulation method provided in the embodiments of this application.
[0268] For example, see Figure 10 , Figure 10 A schematic block diagram of an LBM-based quantum flow simulation device provided as an exemplary embodiment of this application, and... Figure 3 Corresponding to the process shown, the LBM-based quantum flow simulation device 800 includes:
[0269] An initialization module 810 is used to initialize flow field information; wherein, the flow field information includes fluid density and fluid momentum;
[0270] The encoding module 820 is used to encode the flow field information and distribution function using four types of qubits based on the D2Q9 model; the four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-direction coordinate control bits, and X-direction coordinate control bits; wherein, the number of discrete velocity direction control bits is four bits, and the number of auxiliary bits is two bits;
[0271] The acquisition module 830 is used to acquire the first-order equilibrium distribution function in each discrete velocity direction based on the encoded flow field information;
[0272] The collision module 840 is used to perform a collision operation based on the first-order equilibrium distribution function and the encoded distribution function;
[0273] The migration module 850 is used to perform migration operations based on collision operations.
[0274] The update module 860 is used to update the flow field information based on the migration operation;
[0275] The judgment module 870 is used to determine whether the updated flow field information meets the convergence condition.
[0276] The processing module 880 is used to perform boundary condition processing on the updated flow field information if no, and return to the step of encoding the flow field information and distribution function using four qubits based on the D2Q9 model based on the processed flow field information, until the updated flow field information satisfies the convergence condition, and output the updated flow field information.
[0277] The LBM-based quantum flow simulation device provided in this application belongs to the same inventive concept as the LBM-based quantum flow simulation method, and therefore has the same beneficial effects, which will not be repeated here.
[0278] This application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0279] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:
[0280] S310, Initialize flow field information; wherein, the flow field information includes fluid density and fluid momentum;
[0281] S320 uses four types of qubits to encode the flow field information and distribution function based on the D2Q9 model; the four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-direction coordinate control bits, and X-direction coordinate control bits; among them, the number of discrete velocity direction control bits is four and the number of auxiliary bits is two.
[0282] S330, Based on the encoded flow field information, obtain the first-order equilibrium distribution function in each discrete velocity direction;
[0283] S340, based on the first-order equilibrium distribution function and the encoded distribution function, perform a collision operation;
[0284] S350, performs a migration operation based on the collision operation;
[0285] S360, Update the flow field information based on the migration operation;
[0286] S370, determine whether the updated flow field information meets the convergence condition;
[0287] S380, if not, perform boundary condition processing on the updated flow field information, and return to the step of encoding the flow field information and distribution function using four qubits based on the D2Q9 model based on the processed flow field information, until the updated flow field information satisfies the convergence condition, and output the updated flow field information.
[0288] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.
[0289] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0290] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0291] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0292] S310, Initialize flow field information; wherein, the flow field information includes fluid density and fluid momentum;
[0293] S320 uses four types of qubits to encode the flow field information and distribution function based on the D2Q9 model; the four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-direction coordinate control bits, and X-direction coordinate control bits; among them, the number of discrete velocity direction control bits is four and the number of auxiliary bits is two.
[0294] S330, Based on the encoded flow field information, obtain the first-order equilibrium distribution function in each discrete velocity direction;
[0295] S340, based on the first-order equilibrium distribution function and the encoded distribution function, perform a collision operation;
[0296] S350, performs a migration operation based on the collision operation;
[0297] S360, Update the flow field information based on the migration operation;
[0298] S370, determine whether the updated flow field information meets the convergence condition;
[0299] S380, if not, perform boundary condition processing on the updated flow field information, and return to the step of encoding the flow field information and distribution function using four qubits based on the D2Q9 model based on the processed flow field information, until the updated flow field information satisfies the convergence condition, and output the updated flow field information.
[0300] This application also provides a quantum computer operating system, which implements LBM-based quantum flow simulation according to any of the above-described method embodiments provided in this application.
[0301] Embodiments of this application also provide a quantum computer, which includes the quantum computer operating system described above.
[0302] The above description is merely a specific embodiment of this application, but the scope of protection of this application 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 application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A quantum flow simulation method based on LBM, characterized in that, The method includes: Initialize the flow field information; wherein, the flow field information includes fluid density and fluid momentum; based on The model uses four types of qubits to encode the flow field information and distribution function; these four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-axis coordinate control bits, and X-axis coordinate control bits. The encoding format using these four types of qubits is as follows: The discrete velocity direction control bits consist of four bits, and the auxiliary bits consist of two bits. Bits X3, X2, X1, and X0 represent the discrete velocity direction control bits. Bit Y represents the control bit for the Y-direction coordinate, bit Z represents the control bit for the X-direction coordinate, and bits F1 and F0 represent auxiliary bits; the number of bits Y and Z is related to the number of grids when simulating fluid. The encoding format based on the auxiliary bit pair distribution function and the flow field information is as follows: in, Characterizing the distribution function, m Characterizes the flow field information; Based on the encoded flow field information, the first-order equilibrium distribution function in each discrete velocity direction is obtained; Based on the first-order equilibrium distribution function and the encoded distribution function, a collision operation is performed; After the collision operation, the migration operation is performed; The flow field information is updated after the migration operation; Determine whether the updated flow field information satisfies the convergence condition; If not, perform boundary condition processing on the updated flow field information, and return the execution based on the processed flow field information. The model uses four qubits to encode the flow field information and distribution function steps until the updated flow field information satisfies the convergence condition, and then outputs the updated flow field information.
2. The method according to claim 1, characterized in that, The step of obtaining the first-order equilibrium distribution function in each discrete velocity direction based on the encoded flow field information includes: For auxiliary bit quantum state is Quantum gate operations are performed on the discrete velocity direction control bits to obtain the first-order equilibrium distribution function in each discrete velocity direction.
3. The method according to claim 2, characterized in that, The quantum state of the auxiliary bit is The discrete velocity direction control bits on the qubits are used for quantum gate operations, including: The auxiliary bit quantum states are arranged in the following order: Quantum gate operations are performed on discrete velocity direction control bits: Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, when the quantum states of bits X3, X2, and X1 are all... At that time, execute gate H; Using bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is When, execute Door; Using bit X2 as the control bit and bit X3 as the target bit, when the quantum state of bit X2 is When, execute Door; Using bits X3 and X2 as control bits and bit X1 as the target bit, when the quantum state of bit X3 is The quantum state of qubit X2 is When, execute Door; Using bits X3 and X2 as control bits and bit X1 as the target bit, when the quantum states of bits X3 and X2 are both... When, execute Door; Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, when the quantum states of bits X3, X2, and X1 are all... At that time, execute gate H; Using bit X3 as the control bit and bit X2 as the target bit, when the quantum state of bit X3 is At that time, execute gate H.
4. The method according to claim 2, characterized in that, The collision operation based on the first-order equilibrium distribution function and the encoded distribution function includes: In bits The above function The door is designed to perform a collision operation.
5. The method according to claim 4, characterized in that, The migration operation performed after the collision operation includes: Quantum gate operations are performed sequentially on bits Z and Y in their respective discrete velocity directions to transfer the distribution function after the collision operation.
6. The method according to claim 5, characterized in that, The sequential quantum gate operation performed on bits Z and Y in their respective discrete velocity directions includes: Quantum gate operations are performed on bits Z and Y in the following order to shift the distribution function after the collision operation according to their respective discrete velocity directions: The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Z on the bit; The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Y on the bit; The quantum state of the discrete velocity direction control bit is Perform a second quantum gate operation on bit Z on the qubit; The quantum state of the discrete velocity direction control bit is Perform a second quantum gate operation on bit Y on the bit; The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Z on the bit; The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Y on the bit; The quantum state of the discrete velocity direction control bit is Perform a second quantum gate operation on bit Z on the qubit; The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Y on the bit; The quantum state of the discrete velocity direction control bit is Perform a second quantum gate operation on bit Z on the qubit; The quantum state of the discrete velocity direction control bit is Perform a second quantum gate operation on bit Y on the bit; The quantum state of the discrete velocity direction control bit is Perform the first quantum gate operation on bit Z on the bit; The quantum state of the discrete velocity direction control bit is The second quantum gate operation is performed on bit Y.
7. The method according to claim 6, characterized in that, When bit Y or bit Z comprises j+1 qubits, the encoding format of bit Y or bit Z is as follows: Where j is an integer greater than or equal to 0, and n is an integer where 0 ≤ n ≤ j; The first quantum gate operation includes: By bit to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit All quantum states are At that time, the X gate is executed; where, bits When the target bit is used, directly in the bit The upper action X gate; The second quantum gate operation includes: By bit to bit The order is such that each bit is the target bit, and when the bit... For target bit and bit To Bit All quantum states are At that time, the X gate is executed; where, bits When the target bit is used, directly in the bit The X-gate is used for action.
8. The method according to claim 5, characterized in that, The step of updating the flow field information after the migration operation includes: Applying an H gate to bit F1 after the transfer operation yields the auxiliary bit quantum state as follows: Data at that time; For auxiliary bit quantum state is The discrete velocity direction control bits are used to perform quantum gate operations to update the flow field information.
9. The method according to claim 8, characterized in that, The quantum state of the auxiliary bit is The discrete velocity direction control bits on the qubits are used for quantum gate operations, including: The auxiliary bit quantum states are arranged in the following order: The discrete velocity direction control bits are used to perform quantum gate operations to update the flow field information: Using bit X3 as the control bit and bit X2 as the target bit, when the quantum state of bit X3 is At that time, execute gate H; Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, when the quantum states of bits X3, X2, and X1 are all... At that time, execute gate H; Using bits X3 and X2 as control bits and bit X1 as the target bit, when the quantum states of bits X3 and X2 are both... When, execute Door; Using bits X3 and X2 as control bits and bit X1 as the target bit, when the quantum state of bit X3 is The quantum state of qubit X2 is At that time, execute gate H; Using bits X3, X2, and X1 as control bits and bit X0 as the target bit, when the quantum state of bit X3 is The quantum states of bits X2 and X1 are At that time, execute gate H; Acting on bit X3 Door.
10. A quantum flow simulation device based on LBM, characterized in that, The device includes: An initialization module is used to initialize flow field information; wherein, the flow field information includes fluid density and fluid momentum; Encoding module, used for... The model uses four types of qubits to encode the flow field information and distribution function; these four types of qubits are auxiliary bits, discrete velocity direction control bits, Y-axis coordinate control bits, and X-axis coordinate control bits. The encoding format using these four types of qubits is as follows: The discrete velocity direction control bits consist of four bits, and the auxiliary bits consist of two bits. Bits X3, X2, X1, and X0 represent the discrete velocity direction control bits. Bit Y represents the control bit for the Y-direction coordinate, bit Z represents the control bit for the X-direction coordinate, and bits F1 and F0 represent auxiliary bits; the number of bits Y and Z is related to the number of grids when simulating fluid. The encoding format based on the auxiliary bit pair distribution function and the flow field information is as follows: in, Characterizing the distribution function, m Characterizes the flow field information; The acquisition module is used to acquire the first-order equilibrium distribution function in each discrete velocity direction based on the encoded flow field information; The collision module is used to perform collision operations based on the first-order equilibrium distribution function and the encoded distribution function; The migration module is used to perform migration operations based on collision operations. An update module is used to update the flow field information based on the migration operation. The judgment module is used to determine whether the updated flow field information meets the convergence condition. The processing module is used to, if not, perform boundary condition processing on the updated flow field information, and return the result based on the processed flow field information. The model uses four qubits to encode the flow field information and distribution function steps until the updated flow field information satisfies the convergence condition, and then outputs the updated flow field information.
11. A storage medium, characterized in that, The storage medium stores a computer program, which is configured to execute the LBM-based quantum flow simulation method according to any one of claims 1 to 9 when it is run.
12. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the LBM-based quantum flow simulation method according to any one of claims 1 to 9.