betaFeedback

WorksPhysics and Astronomy

Quantum Carleman Linearization of the Lattice Boltzmann Equation with Boundary Conditions

Abstract

The Lattice Boltzmann Method (LBM) is widely recognized as an efficient algorithm for simulating fluid flows in both single-phase and multi-phase scenarios. In this research, a quantum Carleman Linearization formulation of the Lattice Boltzmann equation is described, employing the Bhatnagar Gross and Krook equilibrium function. Our approach addresses the treatment of boundary conditions with the commonly used bounce back scheme. The accuracy of the proposed algorithm is demonstrated by simulating flow past a rectangular prism, achieving agreement with respect to fluid velocity In comparison to classical LBM simulations. This improved formulation showcases the potential to provide computational speed-ups in a wide range of fluid flow applications. Additionally, we provide details on read in and read out techniques.

Introduction

Fluid flow simulations have myriad applications across engineering and scientific domains. One notably significant application pertains to fluid flow in porous media, which holds relevance for scenarios such as bone marrow circulation, hydrocarbon extraction from reservoirs, and filtration processes [1]. However, the simulation of porous media poses challenges, such as the characterization of pore-space geometry and the integration of fluid-solid interfacial phenomena [1][2].

One possible technique to address these computational bottlenecks, the Lattice Boltzmann Method (LBM), has emerged as a promising contender for addressing flow through porous media in view of its ability to handle complex boundary conditions and efficiently simulate fluid/fluid interfaces [1]. However, computational efficiency remains a concern, particularly when simulating large-scale porous structures, as these simulations have significant memory demands [1], thereby motivating a quantum formulation of the LBM.

Several approaches have been established for a quantum Lattice Boltzmann (QLB) formulation, including the treatment of QLB as a quantum walk [3] and the implementation of the LBM with quantum Carleman Linearization [4][5]. While the Carleman Linearization technique applied to the LBM has showcased the potential for exponential quantum advantage in fluid dynamics simulations, the treatment of boundary conditions remains unaddressed [5]. Thus, an improvement of the Quantum Carleman Linearization of the Lattice Boltzmann model (QCL-LBM) is necessary to treat boundary conditions.

This study introduces a QCL-LBM approach aimed at enhancing the capabilities of fluid flow simulations in quantum computing. The collision operator of the LBM is formulated similarly to previous methodologies employing the Bhatnagar Gross and Krook (BGK) equilibrium function, however, adaptations are made to the propagation step [6]. This adapted step yields enhanced simulation accuracy and allows for treatment of boundary conditions using the widely adopted bounce back scheme [7].

The objective of this paper is to demonstrate the precision and potential applications of the improved QCL-LBM, as well as describe read-in and read-out methods for a complete quantum circuit. To achieve this objective, the proposed formulation is benchmarked against a classical LBM simulation. As a means of validation, the flow around a rectangular prism is considered, a classical benchmark scenario in the realm of fluid flow simulations [8].

Lattice Boltzmann Method

The LBM is a powerful numerical technique used to simulate fluid flows. Originating from the kinetic theory of gases, the LBM has gained popularity due to its simplicity, efficiency, and ability to handle complex geometries [9].

At the core of the LBM lies the Lattice Boltzmann Equation (LBE), which provides a discrete, mesoscopic representation of the fluid dynamics governed by the Boltzmann equation [10]. The LBE describes the evolution of particle distribution functions, denoted as fi(x,t)f_i(\mathbf{x},t), encoding the probability of finding particles with velocities ci\mathbf{c}_i at a lattice node x\mathbf{x} and time tt. A lattice is constructed from a spatial discretization, commonly done uniformly.

The evolution of these distribution functions over the lattice occurs through two fundamental steps: the collision step, where particles interact and redistribute their populations, and the streaming step, where particles propagate to neighboring lattice nodes based on their discrete velocities [7].

Collision and Propagation

The collision step is given by:

fi(x,t+δt)=fi(x,t)−Ω(fi(x,t))(1)f_i(\mathbf{x},t+\delta_t)=f_i(\mathbf{x},t)-\Omega\left(f_i(\mathbf{x},t)\right) \tag*{(1)}

where δt\delta_t is the time step size and Ω(fi(x,t))\Omega\left(f_i(\mathbf{x},t)\right) is the collision operator representing the interactions between particles. A common implementation of the collision operator is the BGK model which describes the fluid as relaxing towards equilibrium with collisions between the fluid molecules.

The equation for the BGK model is:

Ω(fi(x,t))=δtτ(fi(x,t)−fieq(x,t))(2)\Omega\left(f_i(\mathbf{x},t)\right)=\frac{\delta_t}{\tau}\left(f_i(\mathbf{x},t)-f_i^{eq}(\mathbf{x},t)\right) \tag*{(2)}

where τ\tau is the characteristic time scale and fieq(x,t)f_i^{eq}(\mathbf{x},t) is the equilibrium density calculated as follows:

fieq=wiρ[1+3ei⋅u+92(ei⋅u)2−32u⋅u](3)f_i^{eq}=w_i\rho\left[1+3\mathbf{e}_i\cdot\mathbf{u}+\frac{9}{2}\left(\mathbf{e}_i\cdot\mathbf{u}\right)^2-\frac{3}{2}\mathbf{u}\cdot\mathbf{u}\right] \tag*{(3)}

where wiw_i is a weighting coefficient dependent upon the velocity scheme, ei\mathbf{e}_i is the velocity direction vector associated with particle ii, $\rho(\mathbf{x},t)=

∑i=0Qfi(x,t)\sum_{i=0}^{Q}f_i(\mathbf{x},t) is the fluid density at lattice point x\mathbf{x}, u(x,t)=1ρ(x,t)∑i=0Qfi(x,t)ei\mathbf{u}(\mathbf{x},t)=\frac{1}{\rho(\mathbf{x},t)}\sum_{i=0}^{Q}f_i(\mathbf{x},t)\mathbf{e}_i is the macroscopic fluid velocity at point x\mathbf{x}, and QQ is the number of discrete velocity directions, discussed below.

The propagation step is given by:

fi(x+ei,t+δt)=fi(x,t)(4)f_i(\mathbf{x}+\mathbf{e}_i,t+\delta_t)=f_i(\mathbf{x},t) \tag*{(4)}

In this step, the particle distribution functions are propagated towards nearby lattice points based upon their velocity.

Common Velocity Schemes

In the LBM, velocity is discretized into a fixed number of directions. The dimension the simulation is performed in and the number of velocity directions governs the velocity scheme, represented as DiQjD_iQ_j. Two widely used velocity schemes are D2Q9 and D3Q19, operating in two and three dimensions, respectively [11]. D2Q9, shown in Figure 1, employs nine discrete velocities in a two-dimensional simulation, and is used in this paper.

D2Q9 velocity scheme for LBM with numbers corresponding to index

Figure 1. D2Q9 velocity scheme for LBM with numbers corresponding to index

Carleman Linearization of the LBE

In Carleman Linearization, a nonlinear dynamical system is transformed into an infinite dimensional linear system [12]. The linear system solution ϕk\phi^k is constructed from Kronecker products of the solution vector ff as such:

ϕk=(f,f⊗2,…,f⊗k)T(5)\phi^k=\left(f,f^{\otimes2},\ldots,f^{\otimes k}\right)^T \tag*{(5)}

and placed into a linear system:

∂ϕk∂t=Ckϕk(6)\frac{\partial\phi^k}{\partial t}=C^k\phi^k \tag*{(6)}

where CkC^k is derived from the nonlinear system associated with solution ff. As kk approaches infinity, the solution to this system gives the exact solution of the nonlinear system:

∂ϕ∞∂t=C∞ϕ∞(7)\frac{\partial\phi^\infty}{\partial t}=C^\infty\phi^\infty \tag*{(7)}

Scheme for D1Q3 model

For simplicity, we first consider the D1Q3 scheme for LBM depicted in Figure 2. For the D1Q3 scheme, the weighting coefficients are:

D1Q3 Grid with Two Lattice Points

Figure 2. D1Q3 Grid with Two Lattice Points

w=[23,16,16](8)w=\left[\frac{2}{3},\frac{1}{6},\frac{1}{6}\right] \tag*{(8)}

From equation 1, we derive the time evolution of f0(x0,t)f_0(\mathbf{x}_0,t) for the collision step as:

∂f0(x0,t)∂t=1τ[f0(x0,t)−23(ρ−32ρ(f1(x0,t)−f2(x0,t))2)](9)\frac{\partial f_0(\mathbf{x}_0,t)}{\partial t}=\frac{1}{\tau}\left[f_0(\mathbf{x}_0,t)-\frac{2}{3}\left(\rho-\frac{3}{2\rho}\left(f_1(\mathbf{x}_0,t)-f_2(\mathbf{x}_0,t)\right)^2\right)\right] \tag*{(9)}

where

ρ=f0(x0,t)+f1(x0,t)+f2(x0,t)(10)\rho=f_0(\mathbf{x}_0,t)+f_1(\mathbf{x}_0,t)+f_2(\mathbf{x}_0,t) \tag*{(10)}

Since the distribution at index i=0i=0 doesn’t change in propagation, this is the final equation for the time step of f0(x0,t)f_0(\mathbf{x}_0,t). To treat the 1ρ\frac{1}{\rho} prefactor, a first order Taylor approximation will be made as such:

1ρ≈−1ρˉ2(ρ−ρˉ)+1ρˉ(11)\frac{1}{\rho}\approx-\frac{1}{\bar{\rho}^2}(\rho-\bar{\rho})+\frac{1}{\bar{\rho}} \tag*{(11)}

where ρˉ\bar{\rho} is the average fluid density. This approximation results in O(Ma4)O(Ma^4) error, which is acceptable since the LBE approximates the Navier-Stokes Equations (NSE) to an error of O(Ma2)O(Ma^2) [5].

For f2(x0,t)f_2(\mathbf{x}_0,t), however, propagation must be taken into account. In a single time step, the particle population will be replaced by a collision adjusted population coming from lattice point x1\mathbf{x}_1.

Specifically, f2(x1,t)f_2(\mathbf{x}_1,t) will be propagated into its place. This can be represented as:

f2(x0,t+δt)=f2(x1,t)−f2(x0,t)+δtΩ(f2(x1,t))(12)f_2(\mathbf{x}_0,t+\delta t)=f_2(\mathbf{x}_1,t)-f_2(\mathbf{x}_0,t)+\delta t\Omega\left(f_2(\mathbf{x}_1,t)\right) \tag*{(12)}

This is formulated differently than the previous QCL-LBM, with the populations being subtracted fully and replaced with propagated neighboring populations and the collision operator being dependent on that propagated population rather than the current population.

Carleman Linearization

Since third order terms appear in the derivative of the first order terms, a truncation of at least order 3 is required to recover the NSE using Carleman Linearization [5]. This can be represented as:

∂f∂t=Sf+F1f+F2f⊗2+F3f⊗3(13)\frac{\partial f}{\partial t}=Sf+F_1f+F_2f^{\otimes2}+F_3f^{\otimes3} \tag*{(13)}

where

f(t)=(f0(x0,t),f1(x0,t),…,f0(xn,t),…,fQ(xn,t))T(14)f(t)=\left(f_0(\mathbf{x}_0,t),f_1(\mathbf{x}_0,t),\ldots,f_0(\mathbf{x}_n,t),\ldots,f_Q(\mathbf{x}_n,t)\right)^T \tag*{(14)}

and SS denoting the streaming operator defined as:

Sf(xi,t)=1δt[f(xi−ei,t)−f(xi,t)](15)Sf(\mathbf{x}_i,t)=\frac{1}{\delta t}\left[f(\mathbf{x}_i-\mathbf{e}_i,t)-f(\mathbf{x}_i,t)\right] \tag*{(15)}

Now, we may represent the collision and streaming operator in a Carleman Linearization matrix as such:

C3=(F1F2F30F12F2200F13)(16)C^3=\begin{pmatrix} F_1 & F_2 & F_3\\ 0 & F_1^2 & F_2^2\\ 0 & 0 & F_1^3 \end{pmatrix} \tag*{(16)}

and

S3=(S1000S12000S13)(17)S^3=\begin{pmatrix} S_1 & 0 & 0\\ 0 & S_1^2 & 0\\ 0 & 0 & S_1^3 \end{pmatrix} \tag*{(17)}

where

Fin=Fi⊗I⊗(n−1)+I⊗Fi⊗I⊗(n−2)+…+I⊗(n−1)⊗Fi(18)F_i^n=F_i\otimes I^{\otimes(n-1)}+I\otimes F_i\otimes I^{\otimes(n-2)}+\ldots+I^{\otimes(n-1)}\otimes F_i \tag*{(18)}

A larger truncation number may be used, but the resulting variable blowup would limit the number of nodes that are computationally tractable. The total number of variables associated with a truncation number NN can be represented as:

∑n=1N[(Nf−NBC)⋅Q]n(19)\sum_{n=1}^{N} \left[(N_f-N_{BC}) \cdot Q\right]^n \tag*{(19)}

where NfN_f is the number of fluid nodes and NBCN_{BC} is the number of boundary condition nodes within simulation bounds. A forwards Euler approximation can now be made with C3C^3 and S3S^3 inserted into the linear system equation:

A=(I0⋯0−O^I⋯0⋮⋱⋱⋮00−O^I)(20)A = \begin{pmatrix} I & 0 & \cdots& 0 \\ -\hat{O} & I & \cdots& 0 \\ \vdots& \ddots& \ddots& \vdots\\ 0 & 0 & -\hat{O} & I \end{pmatrix} \tag*{(20)}

where

O^=[I+δt(C3+S3)](21)\hat{O} = \left[I+\delta_t(C^3+S^3)\right] \tag*{(21)}

and

A(ϕ(t0)ϕ(t1)⋮ϕ(tn))=(ϕ(t0)0⋮0)(22)A \begin{pmatrix} \phi(t_0) \\ \phi(t_1) \\ \vdots\\ \phi(t_n) \end{pmatrix} = \begin{pmatrix} \phi(t_0) \\ 0 \\ \vdots\\ 0 \end{pmatrix} \tag*{(22)}

where ϕ(tn)\phi(t_n) is the solution ϕ\phi at the nn-th time step, ϕ(t0)\phi(t_0) is the initial condition generated as:

ϕ(t0)=[f(t0)f(t0)⊗2f(t0)⊗3](23)\phi(t_0)= \begin{bmatrix} f(t_0) \\ f(t_0)^{\otimes2} \\ f(t_0)^{\otimes3} \end{bmatrix} \tag*{(23)}

Boundary Conditions

Treatment of the interaction of fluid with solid boundary conditions is important to the accuracy of the LBM. The bounce back scheme is commonly used to impose no-slip boundary conditions, particularly for solid walls [13]. In this method, when particles collide with a boundary, their velocities are reversed. This results in a modified propagation step, depicted in Figure 3.

Bounce back scheme for LBM

Figure 3. Bounce back scheme for LBM

Using the bounce back scheme, boundary conditions can be implemented under this streaming operator construction. To demonstrate, the example from Figure 4 will be worked out. In a time step, populations that propagate into boundaries "bounce" back and adopt an opposing velocity. Imposing the bounce back scheme will result in the distribution f1(x1,t)f_1(x_1,t) reflecting back towards the population of f2(x1,t)f_2(x_1,t). As such the time stepping equation can be written out as:

D1Q3 Grid with Two Lattice Points and Boundary Condition

Figure 4. D1Q3 Grid with Two Lattice Points and Boundary Condition

f2(x1,t+δt)=f1(x1,t)−f2(x1,t)+δtΩ(f1(x1,t))(24)\begin{aligned} f_2(x_1,t+\delta_t)=f_1(x_1,t)-f_2(x_1,t) \\ &+\delta_t\Omega\left(f_1(x_1,t)\right) \tag*{(24)} \end{aligned}

To implement this, the CC and SS operators must be modified. To do so, a pre-streaming step is performed, determining the resulting location of various populations after a classical streaming step. The results of this step are then used to shift terms in CC with various swaps making the operator dependent upon the correct populations. This entails using the streaming step of the imaginary node outside the boundaries and replacing it with the reflected population. To create SS, a similar process is performed. Since the streaming operator defined in Equation (15) depends on itself regardless of streamed population, the identity matrix is adjusted with identical swaps to represent the f(xi−ei,t)f(x_i-e_i,t) term, and then added to a negative identity matrix, representing the −f(xi,t)-f(x_i,t) term. This allows the population to be adjusted by subtracting the current population and adding the new streamed population. Modifying these two operators allows for the QCL-LBM to properly treat boundary conditions both within and on the bounds of the simulation.

Computational Results

To test the improved schema for the QCL-LBM, code was developed to process the collision and streaming matrices. These can then be placed into the large A matrix formulated in Equation (20). However, a complete quantum computer would be required to solve the linear system, thus to simulate, we iteratively step the solution through time. This was done with a D2Q9 formulation to test flow past a rectangular prism, although extending the method to 3 dimensions is trivial. The solution was then tested against a classical simulation of Lattice Boltzmann with respect to total fluid velocity to verify the effectiveness of the method.

This was done on a grid of size 10×510 \times5 nodes with a Reynolds number of 50. An initial velocity uu was enforced by weighting the initial distributions of the nodes such that their fluid velocity acted towards the right:

finit=ρˉ(49,19+u2,19,19−u2,136,136,136,136)(25)f_{\mathrm{init}}=\bar{\rho}\left(\frac{4}{9},\frac{1}{9}+\frac{u}{2},\frac{1}{9},\frac{1}{9}-\frac{u}{2},\frac{1}{36},\frac{1}{36},\frac{1}{36},\frac{1}{36}\right) \tag*{(25)}

The initial condition was applied to all nodes to mimic common flow past objects simulations [14].

No slip boundary conditions implemented using bounce back were placed on the yy direction walls of the grid, while periodic boundary conditions were placed on the xx direction walls to model flow towards the right. This was done over a timescale of 5 seconds and a step size of .00025, with results shown in Figure 5. A boundary condition was included at point x=2x = 2, y=2y = 2 to model model a square object and an initial velocity of 0.0001 lattice units per time step was enforced in the positive xx direction. These simulations demonstrate the ability of the proposed QCL-LBM model to achieve agreement with a classical LBM simulation, despite sacrificing the exactness of streaming [4].

Percent error of total fluid velocity for quantum simulation compared to classical simulation

Figure 5. Percent error of total fluid velocity for quantum simulation compared to classical simulation

Read Out

In order to run a useful quantum computation, the problems of read in and read out must be addressed. An initial condition can be applied to all lattice nodes creating the input vector algorithmically, and the AA matrix can be constructed as described above. The linear system can then be solved for the solution vector with

various quantum linear solvers [15][16]. However, decoding quantum states into a classical vector normally removes quantum advantage, requiring some extractable metric to remain efficient [17]. Hence, the extraction of a sub-exponential number of numerical quantities from the large solution vector is integral to maintain speedup. We propose the extraction of the drag coefficient, a commonly extracted measure for porous media simulation[18][19]. The drag coefficient can be calculated by[20]:

CD=2FxρUl2S(26)C_D = 2\frac{F_x}{\rho U_l^2 S} \tag*{(26)}

where UlU_l is the inflow speed in lattice units, SS is the cross section area of the boundary condition in lattice units, and FxF_x is the force acting on the boundary condition calculated with[20]:

F=∑xsf∑i(f−i(xsf,t)+fi(xsf,t+δt))ei(27)F = \sum_{x_{sf}}\sum_i\left(f_{-i}(x_{sf},t)+f_i(x_{sf},t+\delta t)\right)e_i \tag*{(27)}

where xsfx_{sf} are the fluid lattice units which have solid neighbors, and the subscript −i-i is defined by e−i=−eie_{-i}=-e_i.

The drag coefficient can be extracted from the resultant solution vector of the linear system solver, giving a useful read out value of the quantum simulation.

Conclusion

The presented improvement to the QCL-LBM framework, with a modified formulation to increase accuracy and account for boundary conditions, results in high accuracy fluid simulation and enables integration of boundary conditions. This broadens the utility of the quantum Lattice Boltzmann approach and addresses memory constraints inherent in complex porous media scenarios. Additionally, we introduced a state preparation and read out technique, facilitating the construction of a complete quantum circuit. Further research is necessary to explore diverse approaches for handling boundary conditions, thereby extending the method’s applicability even further.

References

  1. [8]Henk Kaarle Versteeg and Weeratunge Malalasekera. An introduction to computational fluid dynamics: the finite volume method. Pearson education, 2007.
  2. [9]Shiyi Chen and Gary D Doolen. Lattice boltzmann method for fluid flows. Annual review of fluid mechanics, 30(1):329–364, 1998.
  3. [10]Xiaoyi He and Gary Doolen. Lattice boltzmann method on curvilinear coordinates system: flow around a circular cylinder. Journal of Computational Physics, 134(2):306–315, 1997.DOI
  4. [11]Yue-Hong Qian, Dominique d’Humières, and Pierre Lallemand. Lattice bgk models for navier-stokes equation. Europhysics letters, 17(6):479, 1992.DOI
  5. [12]Arash Amini, Qiyu Sun, and Nader Motee. Error bounds for carleman linearization of general nonlinear systems. In 2021 Proceedings of the Conference on Control and its Applications, pages 1–8. SIAM, 2021.DOI
  6. [13]Anthony JC Ladd. Short-time motion of colloidal particles: Numerical simulation via a fluctuating lattice-boltzmann equation. Physical Review Letters, 70(9):1339, 1993.pubmed.ncbi.nlm.nih.gov/10054351
  7. [14]Yanbing Li, Richard Shock, Raoyang Zhang, and Hudong Chen. Numerical study of flow past an impulsively started cylinder by the lattice-boltzmann method. Journal of Fluid Mechanics, 519:273–300, 2004.DOI
  8. [16]Pedro CS Costa, Dong An, Yuval R Sanders, Yuan Su, Ryan Babbush, and Dominic W Berry. Optimal scaling quantum linear-systems solver via discrete adiabatic theorem. PRX Quantum, 3(4):040303, 2022.arxiv.org/abs/2111.08152
  9. [17]Kaining Zhang, Min-Hsiu Hsieh, Liu Liu, and Dacheng Tao. Quantum gram-schmidt processes and their application to efficient state readout for quantum algorithms. Physical Review Research, 3(4):043095, 2021.DOI
  10. [19]Øystein Patursson, M Robinson Swift, Igor

Paper details

vlnc:W_56mzwg4f
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents