Search

CN-117408343-B - Quantum flow simulation method, device, medium and equipment based on LBM

CN117408343BCN 117408343 BCN117408343 BCN 117408343BCN-117408343-B

Abstract

The application provides a quantum flow simulation method, a device, a medium and equipment based on LBM, which can solve the problem of huge calculation amount of classical LBM in the related technology, improve the Reynolds number simulated by the simulation method and widen the practical application range of the simulation method. The method comprises the steps of initializing flow field information, using four quantum bits to encode the flow field information and a distribution function based on a two-dimensional nine-speed discrete model, obtaining a first-order equilibrium state distribution function in each discrete speed direction based on the encoded flow field information, executing collision operation, executing migration operation, updating the flow field information based on the migration operation, judging whether the updated flow field information meets a convergence condition, if not, executing boundary condition processing on the updated flow field information, and returning to execute the steps of encoding the flow field information and the distribution function based on the processed flow field information until the updated flow field information meets the convergence condition, and outputting the updated flow field information.

Inventors

  • Ma Tengyang
  • LI YE
  • Dou Menghan

Assignees

  • 本源量子计算科技(合肥)股份有限公司

Dates

Publication Date
20260512
Application Date
20220706

Claims (12)

  1. 1. A method of LBM-based quantum flow simulation, the method comprising: initializing flow field information, wherein the flow field information comprises fluid density and fluid momentum; Based on The model uses four kinds of quantum bits to encode the flow field information and the distribution function, wherein the four kinds of quantum bits are respectively auxiliary bits, discrete speed direction control bits, Y-direction coordinate control bits and X-direction coordinate control bits, and the encoding format using the four kinds of quantum bits is as follows: wherein the number of discrete speed direction control bits is four, the number of auxiliary bits is two, and bits X3, X2, X1 and X0 represent discrete speed direction control bits Representing Y-direction coordinate control bits, representing X-direction coordinate control bits by bit Z, representing auxiliary bits by bit F1 and bit F0, and correlating the number of bits Y and Z with the number of grids when simulating fluid; the coding format of the distribution function and the flow field information based on the auxiliary bit is as follows: Wherein, the Characterizing a distribution function, wherein m characterizes the flow field information; Acquiring a first-order equilibrium state distribution function in each discrete speed direction based on the encoded flow field information; performing a collision operation based on the first-order equilibrium distribution function and the encoded distribution function; after the collision operation, executing a migration operation; Updating the flow field information after the migration operation; Judging whether the updated flow field information meets a convergence condition or not; If not, executing boundary condition processing on the updated flow field information, and executing back based on the processed flow field information And the model uses four quantum bits to encode the flow field information and the distribution function until the updated flow field information meets the convergence condition, and the updated flow field information is output.
  2. 2. The method of claim 1, wherein the obtaining a first order equilibrium state distribution function for each discrete velocity direction based on the encoded flow field information comprises: for the auxiliary bit quantum state as The discrete speed direction control bits are subjected to quantum gate operation to obtain first-order equilibrium state distribution functions in each discrete speed direction.
  3. 3. The method of claim 2, wherein the pair of auxiliary bit quantum states are The discrete speed direction control bits thereon perform a quantum gate operation, comprising: for the auxiliary bit quantum states in the following order The discrete speed direction control bit on the clock signal performs quantum gate operation: taking the bit X3, the bit X2 and the bit X1 as control bits, taking the bit X0 as target bits, and taking the quantum states of the bit X3, the bit X2 and the bit X1 as Executing an H gate; Taking the bit X2 as a control bit and the bit X3 as a target bit, when the quantum state of the bit X2 is When executing A door; Taking the bit X2 as a control bit and the bit X3 as a target bit, when the quantum state of the bit X2 is When executing A door; taking the bit X3 and the bit X2 as control bits, taking the bit X1 as a target bit, and taking the quantum state of the bit X3 as The quantum state of bit X2 is When executing A door; Taking the bit X3 and the bit X2 as control bits, taking the bit X1 as target bits, and taking the quantum states of the bit X3 and the bit X2 as control bits When executing A door; taking the bit X3, the bit X2 and the bit X1 as control bits, taking the bit X0 as target bits, and taking the quantum states of the bit X3, the bit X2 and the bit X1 as Executing an H gate; Taking the bit X3 as a control bit, taking the bit X2 as a target bit, and taking the quantum state of the bit X3 as At that time, the H gate is performed.
  4. 4. The method of claim 2, wherein performing a collision operation based on the first-order equilibrium distribution function and the encoded distribution function comprises: In bits Acting on The door performs a collision operation.
  5. 5. The method of claim 4, wherein performing a migration operation after the collision-based operation comprises: And carrying out quantum gate operation on the bit Z and the bit Y in the respective discrete speed directions in sequence so as to migrate the distribution function after the collision operation is carried out.
  6. 6. The method of claim 5, wherein quantum gate operating on bit Z and bit Y in respective discrete speed directions in sequence comprises: The quantum gate operation is performed on the bit Z and the bit Y in the following order to migrate the distribution function after the collision operation is performed in the respective discrete speed directions: Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction Bit Z on the first quantum gate operation; Controlling the bit quantum state to be the discrete speed direction The bit Y above performs a second quantum gate operation.
  7. 7. The method of claim 6, wherein when bit Y or bit Z comprises j+1 qubits, the encoding format of bit Y or bit Z is: Wherein j is an integer greater than or equal to 0, n is an integer, and n is greater than or equal to 0 and less than or equal to j; The first quantum gate operation includes: Per bit To bit In the order of (1) respectively targeting each bit as a target bit when Is the target bit and bit To bits Are all of the quantum states Executing X gate, wherein the bit For the target bit, directly at the bit Acting on an X gate; the second quantum gate operation includes: Per bit To bit In the order of (1) respectively targeting each bit as a target bit when Is the target bit and bit To bits Are all of the quantum states Executing X gate, wherein the bit For the target bit, directly at the bit The X gate is acted on.
  8. 8. The method of claim 5, wherein updating the flow field information after the migration-based operation comprises: the H gate is acted on the bit F1 after the migration operation is executed, and the auxiliary bit quantum state is obtained Data at that time; for the auxiliary bit quantum state as The discrete speed direction control bits thereon perform a quantum gate operation to update the flow field information.
  9. 9. The method of claim 8, wherein the pair of auxiliary bit quantum states are The discrete speed direction control bits thereon perform a quantum gate operation, comprising: for the auxiliary bit quantum states in the following order The discrete speed direction control bits thereon perform a quantum gate operation to update the flow field information: Taking the bit X3 as a control bit and the bit X2 as a target bit, when the quantum state of the bit X3 is Executing an H gate; taking the bit X3, the bit X2 and the bit X1 as control bits and the bit X0 as target bits, when the quantum states of the bit X3, the bit X2 and the bit X1 are all Executing an H gate; taking the bit X3 and the bit X2 as control bits and the bit X1 as target bits, when the quantum states of the bit X3 and the bit X2 are both When executing A door; Taking the bit X3 and the bit X2 as control bits and the bit X1 as target bits, when the quantum state of the bit X3 is The quantum state of bit X2 is Executing an H gate; taking the bit X3, the bit X2 and the bit X1 as control bits and the bit X0 as target bits, when the quantum state of the bit X3 is The quantum states of bit X2 and bit X1 are Executing an H gate; acting on bit X3 And (3) a door.
  10. 10. A LBM-based quantum flow simulation device, the device comprising: the device comprises an initialization module, a flow field information processing module and a flow field information processing module, wherein the initialization module is used for initializing flow field information, and the flow field information comprises fluid density and fluid momentum; an encoding module for based on The model uses four kinds of quantum bits to encode the flow field information and the distribution function, wherein the four kinds of quantum bits are respectively auxiliary bits, discrete speed direction control bits, Y-direction coordinate control bits and X-direction coordinate control bits, and the encoding format using the four kinds of quantum bits is as follows: wherein the number of discrete speed direction control bits is four, the number of auxiliary bits is two, and bits X3, X2, X1 and X0 represent discrete speed direction control bits Representing Y-direction coordinate control bits, representing X-direction coordinate control bits by bit Z, representing auxiliary bits by bit F1 and bit F0, and correlating the number of bits Y and Z with the number of grids when simulating fluid; the coding format of the distribution function and the flow field information based on the auxiliary bit is as follows: Wherein, the Characterizing a distribution function, wherein m characterizes the flow field information; the acquisition module is used for acquiring a first-order equilibrium state distribution function in each discrete speed direction based on the encoded flow field information; the collision module is used for executing collision operation based on the first-order equilibrium state distribution function and the encoded distribution function; The migration module is used for executing migration operation after collision operation; The updating module is used for updating the flow field information after the migration operation; The judging module is used for judging whether the updated flow field information meets a convergence condition; the processing module is used for executing boundary condition processing on the updated flow field information and returning to execute the processing module based on the flow field information after processing if not And the model uses four quantum bits to encode the flow field information and the distribution function until the updated flow field information meets the convergence condition, and the updated flow field information is output.
  11. 11. A storage medium having stored therein a computer program arranged to perform the LBM-based quantum flow simulation method of any of claims 1 to 9 when run.
  12. 12. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor being arranged to run the computer program to perform the LBM-based quantum flow simulation method of any of claims 1 to 9.

Description

Quantum flow simulation method, device, medium and equipment based on LBM Technical Field The application relates to the field of quantum design, in particular to a quantum flow simulation method, device, medium and equipment based on LBM. Background LBM (English: lattice Boltzmann Method; chinese: lattice Boltzmann method) is a mesoscopic simulation method, the core of which is the basic equation of the aerodynamic theory, boltzmann equation. The concrete form is as follows: Where f is the particle distribution function, and is related to the particle 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 motion contribution of the particles themselves, the third term characterizes the external force contribution, and the fourth term characterizes the contribution of the particles to each other's collision. The specific form of the collision term is related to the selected collision model, and is generally called a collision integral term. The collision integral term is often complex, presenting great difficulty to the boltzmann equation solution. In order to carry out numerical solution on the Boltzmann equation, a Bhatnagar-Gross-Krook single-relaxation collision model is adopted to simplify collision terms, a D 2Q9 model is utilized to carry out speed space dispersion, a first-order rectangular approach is adopted to approach the Boltzmann equation to carry out time space dispersion after integration along characteristic lines, and external force terms are ignored, so that a discrete control equation of the LBM is obtained as follows: collision process: migration process: fi(x+eiδt,t+δt)=fi(x,t+δt) Where x is the node position after spatial dispersion, τ is the relaxation time of the collision, e i is the dispersion speed, δ t is the time step after dispersion, f eq is the local equilibrium state distribution function, and subscript i represents the dispersion speed direction. Referring to fig. 4, fig. 4 is a schematic diagram of a two-dimensional nine-speed discrete model according to an exemplary embodiment of the present application. As shown in FIG. 4, the D 2Q9 model has 9 discrete velocity directions, respectively :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. The parameters of the model can be deduced from the moment equations of each order as follows: Wherein ω i is a weight factor for each discrete velocity direction, and δ x is a grid step size. c=δ x/δt is the lattice speed, and the numerical simulation generally takes c=1. c s is the fluid dimensionless speed of sound, from which the LBM characteristic speed is determined. The equilibrium distribution function in LBM takes Maxwell distribution as follows: The relationship between flow macroscopic quantity and distribution function can be deduced from conservation-oriented conditions in the form: ρ=f0+f1+f2+f3+f4+f5+f6+f7+f8 ρu=f1-f3+f5-f7+f8-f6 ρv=f2-f4+f5-f7+f6-f8 Where ρ is the fluid density, v is the velocity in the Y direction, u is the velocity in the X direction, ρu is the component of the fluid momentum in the X direction, ρv is the component of the fluid momentum in the Y direction. Discrete control equations of the LBM can be reduced to incompressible Navier-Stokes equations using the Chapman-Enskog multiscale analysis technique, thus demonstrating the effectiveness of the LBM method. The relation between the relaxation time tau and the flow characteristic quantity in the LBM can be obtained in the multi-scale analysis process: Wherein N x, ma and Re are the number of characteristic direction grid nodes, the flow Mach number and the flow Reynolds number respectively. LBM numerical stability requires a relaxation time τ of just as close to 0.5, it is evident that a larger number of grid nodes is required to ensure process stability when the flow reynolds number Re is larger. In summary, since the calculation time complexity of the classical LBM is linearly related to the number of grid nodes, the calculation amount of the classical LBM method is not acceptable when simulating a flow with a high reynolds number. Disclosure of Invention The application aims to provide a quantum flow simulation method, device, medium and equipment for LBM, which are used for solving the problem of huge calculation amount of classical LBM in the prior art, reducing the dependency relationship between LBM solving time and grid number, thereby realizing quick solving of flow problems or greatly improving simulation grid number under the constraint of same calculation time consumption. To solve the above technical problem, in a first aspect, the present application provides a quantum flow simulation method based on LBM, including: initializing flow field information, wherein the flow field information comprises fluid density and fluid momentum; The flow field information and the