# Quantum Circuit Implementation of Multi-Dimensional Non-Linear Lattice Models
## 2 Non-Linear Lattice Modeling of Fluid Dynamics
### LBM for Iso-Thermal Two-Dimensional Flows  
The Lattice Boltzmann equation defines the governing equation for Lattice Boltzmann modeling. This equation can be derived from a discrete-velocity discretization of the Bhatnagar-Gross-Krook (BGK) equation, such that the discretized particle distribution function is governed by the following equation:  
\[\frac{\partial f_{a}}{\partial t}+\mathbf{e}_{a}\cdot\
abla f_{a}=-\frac{1}{ \tau}\Big{(}f_{a}-f_{a}^{eq}\Big{)}\ ;\ a\in[0,n_{DV}-1] \tag{3}\]  
where \(n_{DV}\) denotes the number of discrete velocities in the model. Furthermore, \(f_{a}(\mathbf{x},t)=f(\mathbf{x},\mathbf{e}_{a},t)\) is the non-equilibrium distribution for discrete velocity \(\mathbf{e}_{a}\) and \(f_{a}^{eq}\) is the corresponding equilibrium distribution function. In the collision term on the right-hand side, \(\tau\) represents the relaxation time. For iso-thermal LBM models, based on the two-dimensional D2Q9 model, or the three-dimensional D3Q15, D3Q19 and D3Q27 models, the equilibrium distribution function can be written as,  
\[f_{a}^{eq}=\rho w_{a}\Big{[}1+\frac{3}{c^{2}}\mathbf{e}_{a}\cdot\mathbf{V}+ \frac{9}{2c^{4}}\big{(}\mathbf{e}_{a}\cdot\mathbf{V}\big{)}^{2}-\frac{3}{2c^{ 2}}\mathbf{V}\cdot\mathbf{V}\Big{]} \tag{4}\]  
where \(w_{a}\) and \(\mathbf{e}_{a}\) denote the weighting factor and discrete velocity for direction \(a\), respectively. The lattice speed \(c\) is defined as \(c=\delta x/\delta t\). Then, in a single time step, discrete values of the distribution function move to the nearest neighbor lattice point (defined by the direction of the discrete velocity that is considered). This movement is typically referred to as'streaming'. For the D2Q9 model with \(N_{DV}=9\), the following discrete velocities are used,  
\[\mathbf{e}_{0}/c =(0,0)^{T}\] \[\mathbf{e}_{1}/c =(1,0)^{T}\ ;\ \mathbf{e}_{2}/c=(0,1)^{T}\ ;\ \mathbf{e}_{3}/c=(-1,0)^{T}\ ;\ \mathbf{e}_{4}/c=(0,-1)^{T} \tag{5}\] \[\mathbf{e}_{5}/c =(1,1)^{T}\ ;\ \mathbf{e}_{6}/c=(-1,1)^{T}\ ;\ \mathbf{e}_{7}/c=(-1,-1)^{T}\ ;\ \mathbf{e}_{8}/c=(1,-1)^{T}\]  
where the weighting factors \(w_{a}\) (\(a\in[0,8]\)) for the D2Q9 model are defined as,  
\[w_{0}=4/9\ ;\ w_{1-4}=1/9\ ;\ w_{5-8}=1/36 \tag{6}\]  
Based on the'streaming' from one lattice point to a nearest neighbor lattice point, the evolution of \(f_{a}\) can be written as,  
\[f_{a}\big{(}\mathbf{x}_{i}+\mathbf{e}_{a}\delta t,t+\delta t\big{)}-f_{a} \big{(}\mathbf{x}_{i},t\big{)}=-\frac{\delta t}{\tau}\Big{[}f_{a}\big{(} \mathbf{x}_{i},t\big{)}-f_{a}^{eq}\big{(}\mathbf{x}_{i},t\big{)}\Big{]} \tag{7}\]  
Fluid density and velocity components are related to the discretized distribution functions \(f_{a}\) and \(f_{a}^{eq}\) as follows,  
\[\rho=\sum_{a=0}^{n_{DV}-1}f_{a}=\sum_{a=0}^{n_{DV}-1}f_{a}^{eq}\ ;\ \rho \mathbf{V}=\sum_{a=0}^{n_{DV}-1}\mathbf{e}_{a}f_{a}=\sum_{a=0}^{n_{DV}-1} \mathbf{e}_{a}f_{a}^{eq} \tag{8}\]  
Lattice Boltzmann methods employ a stream-collide approach to update \(f_{a}\) from time \(t\) to \(t+\delta t\) in two steps:  
* The 'collision step' creates an intermediate update of \(f_{a}\) to \(f_{a}^{int}\) based on the collision term: \[f_{a}^{int}\big{(}\mathbf{x}_{i},t\big{)}=f_{a}\big{(}\mathbf{x}_{i},t\big{)} -\frac{\delta t}{\tau}\Big{[}f_{a}\big{(}\mathbf{x}_{i},t\big{)}-f_{a}^{eq} \big{(}\mathbf{x}_{i},t\big{)}\Big{]}\] (9)
* The convection on the left-hand side of Equation (7), is represented by the'streaming step', such that based on intermediate update \(f_{a}^{int}\) the final update is computed as, \[f_{a}\big{(}\mathbf{x}_{i}+\mathbf{e}_{a}\delta t,t+\delta t\big{)}=f_{a}^{int }\big{(}\mathbf{x}_{i},t\big{)}\] (10)As a first step toward creating quantum algorithms for D2Q9 and D3Q27, reduced models are considered first. Two non-linear lattice models for one-dimensional flow problems are described in the next sections.