**3. Hybrid quantum/classical vortex-in-cell method**

The vortex-in-cell method is a well-studied hybrid particle-mesh method for incompressible flows and is particularly well suited for flows in regular domains such that efficient Poisson solvers can be used. In the present work, the Fourier

**35**

**Figure 2.**

*simulation using full QFT.*

*Quantum Algorithms for Fluid Simulations DOI: http://dx.doi.org/10.5772/intechopen.86685*

∂ω

the QFT for the required discrete Fourier transforms.

<sup>→</sup> \_\_\_ <sup>∂</sup>*<sup>t</sup>* <sup>+</sup> *<sup>u</sup>* <sup>→</sup> ∂ω <sup>→</sup> \_\_\_ ∂*x* <sup>→</sup> = (ω <sup>→</sup>.∇)*u*

tions of three Poisson problems for stream function *<sup>A</sup>*

∆*A*

analysis approach to solving the problem in a fully periodic domain is used, using

The vortex-in-cell (VIC) method solves the incompressible-flow Navier-Stokes equations, transformed into the Helmholtz equations for vorticity evolution [5]:

> <sup>→</sup> + νΔω <sup>→</sup>;ω

<sup>→</sup> = ∇*x A*

In simulations using the VIC, the flow evolves through a (large) number of time steps. During each of these time steps, the velocity field is recomputed using solu-

This part of the VIC is of particular interest here, as it represents the part that would be performed by the quantum processor in the quantum coprocessor model.

<sup>→</sup> = −ω <sup>→</sup>;*u*

*Vortex-in-cell simulation of leapfrogging vortex rings. Effect of mesh refinement is shown. "Noiseless"* 

<sup>→</sup> = ∇*x u*

→ : <sup>→</sup> (1)

<sup>→</sup> (2)

*Quantum Algorithms for Fluid Simulations DOI: http://dx.doi.org/10.5772/intechopen.86685*

*Advances in Quantum Communication and Information*

in the quantum circuit model.

*Quantum circuit for QFT on six-qubit register.*

transform in bit-reversed ordering.

rotation gate is not included in the quantum circuit.

**3. Hybrid quantum/classical vortex-in-cell method**

"k," i.e., 2*π*/2*<sup>k</sup>*

**Figure 1.**

storage of discrete data can be extended to multidimensional problems as well. For

mesh. In application in which multiple variables are to be stored in each mesh point, as in the discrete-velocity method discussed in the second part of this chapter, we add further qubits to the quantum register. Specifically, for each qubit added in the coherent register, the number of degrees of freedom is doubled. Once a mapping of the considered computational problem onto the quantum state vector has been designed, calculations are then performed through application of quantum gates as

The ability to implement the quantum Fourier transform (QFT) efficiently on a quantum computer is of paramount importance for many quantum algorithms. **Figure 1** shows the "standard" quantum circuit implementation of the QFT for an example register with 6 qubits. In **Figure 1**, "H" represents the one-qubit Hadamard gate, and the "Rk" gates are controlled rotation gates over an angle defined by index

chapter, the qubit register is represented vertically, with the leftmost qubit in the register at the top. The horizontal direction determines the sequence of gates that are applied to the quantum state. In the QFT example shown, it can be seen that the qubit indices have been reversed in the output state (right-hand side) relative to the input, to represent that this standard QFT circuit returns the discrete Fourier

A particular challenge is presented by the controlled rotation gates particularly

The vortex-in-cell method is a well-studied hybrid particle-mesh method for incompressible flows and is particularly well suited for flows in regular domains such that efficient Poisson solvers can be used. In the present work, the Fourier

those involving small angles. The QFT can be implemented approximately by removing all rotation gates with angles smaller than a certain threshold value, resulting in the approximate QFT (AQFT). In particular for fault-tolerant implementations, this is desirable as it greatly reduces the gate count. In the following, we define the approximation or "band-limiting" in the AQFT as follows. The rotation gates are eliminated above a limit value "k," i.e., for an angle smaller than 2*π*/2*<sup>k</sup>*

. In this circuit and all subsequent quantum circuits shown in this

regular

, the

example, 24 qubits suffice to store a single discretized function on a 2563

**2.2 Approximate quantum Fourier transform (AQFT)**

**34**

analysis approach to solving the problem in a fully periodic domain is used, using the QFT for the required discrete Fourier transforms.

The vortex-in-cell (VIC) method solves the incompressible-flow Navier-Stokes equations, transformed into the Helmholtz equations for vorticity evolution [5]:

$$\frac{\partial \vec{u}}{\partial t} + \vec{u}\frac{\partial \vec{u}}{\partial \vec{x}} = \{\vec{\alpha}\Delta\nabla\}\vec{u} + \nu\Delta\vec{\alpha}\vec{\alpha}; \vec{\alpha} = \nabla \propto \vec{u} \tag{1}$$

In simulations using the VIC, the flow evolves through a (large) number of time steps. During each of these time steps, the velocity field is recomputed using solutions of three Poisson problems for stream function *<sup>A</sup>* → :

$$
\Delta \vec{A} = -\vec{\alpha} \mathbf{j}; \vec{\mu} = \nabla \mathbf{x} \cdot \vec{A} \tag{2}
$$

This part of the VIC is of particular interest here, as it represents the part that would be performed by the quantum processor in the quantum coprocessor model.

**Figure 2.**

*Vortex-in-cell simulation of leapfrogging vortex rings. Effect of mesh refinement is shown. "Noiseless" simulation using full QFT.*

**Figure 3.**

*Vortex-in-cell simulation of leapfrogging vortex rings. For two different mesh resolutions, the effect of applying AQFT is shown ("k" limit is 5).*

**Figure 2** shows an example of a VIC simulation of two leapfrogging vortex rings, i.e., flow structures of fundamental importance in fluid mechanics. The lower vortex ring is stronger than the ring above it, and it will therefore convect upward faster, leading to the interaction of the vortex rings as shown. The iso-surface represents vorticity strength, i.e., a direct indicator of the "strength" of the considered vortex. Results are compared for two different meshes, 1283 and 2563 , to highlight the dependency of the solution on the chosen mesh size. Also, in the shown simulation, no quantum errors were simulated, and the full QFT was used. If we now replace the QFT with the AQFT, the results shown in **Figures 3** and **4** are obtained. In **Figure 3**, the "k" limit in the QFT is set to five for both meshes, showing that for the finer mesh this leads to unacceptable errors, while the coarser-mesh simulation still produces worthwhile results. If the "k" limit for the finer mesh is increased from 5 to 6, i.e., more controlled rotation gates are included in the AQFT circuit, the simulation on the finer mesh can also be made to produce similarly useful results. These example results show what level of approximation in the QFT is tolerable for application of the VIC method. For other QFT-based CFD solvers, a similar sensitivity study would need to be conducted.

**37**

**Figure 4.**

*mesh, "k" limit in AQFT is 6.*

the considered domain [10].

coordinates in (physical) space and *c*

*Quantum Algorithms for Fluid Simulations DOI: http://dx.doi.org/10.5772/intechopen.86685*

**4. Quantum algorithm for discrete-velocity method**

For a monatomic gas, the distribution function *f*(*x,*

space") is governed by the Boltzmann equation:

In computational fluid dynamics, the most widely used methods involve solving the Navier-Stokes equations for a continuum fluid, i.e., where fluid density, velocity components, and energy in each location in the computational domain are to be found from conservation equations. The vortex-in-cell method used in the previous section employs the Navier-Stokes equations in a transformed form involving vorticity rather than velocity, but importantly it still uses the continuum flow assumption. An alternative approach to the Navier-Stokes-based modeling is a description of the flow at a more detailed level, i.e., at the kinetic level [11]. Instead of governing equations for mass, momentum, and energy conservation, the flow is now described by the Boltzmann equation governing a particle distribution function in state space (or 3D velocity space for a 3D monatomic gas flow) for each location in

*Vortex-in-cell simulation of leapfrogging vortex rings. For 1283 mesh, AQFT ("k" limit 5) is used. For 2563* 

<sup>→</sup> *c*

<sup>→</sup>;*t*) with *x*

<sup>→</sup> the molecular velocity (defined in "velocity

<sup>→</sup> defining the

*Quantum Algorithms for Fluid Simulations DOI: http://dx.doi.org/10.5772/intechopen.86685*

*Advances in Quantum Communication and Information*

**Figure 2** shows an example of a VIC simulation of two leapfrogging vortex rings,

*Vortex-in-cell simulation of leapfrogging vortex rings. For two different mesh resolutions, the effect of applying* 

and 2563

, to highlight

i.e., flow structures of fundamental importance in fluid mechanics. The lower vortex ring is stronger than the ring above it, and it will therefore convect upward faster, leading to the interaction of the vortex rings as shown. The iso-surface represents vorticity strength, i.e., a direct indicator of the "strength" of the considered

the dependency of the solution on the chosen mesh size. Also, in the shown simulation, no quantum errors were simulated, and the full QFT was used. If we now replace the QFT with the AQFT, the results shown in **Figures 3** and **4** are obtained. In **Figure 3**, the "k" limit in the QFT is set to five for both meshes, showing that for the finer mesh this leads to unacceptable errors, while the coarser-mesh simulation still produces worthwhile results. If the "k" limit for the finer mesh is increased from 5 to 6, i.e., more controlled rotation gates are included in the AQFT circuit, the simulation on the finer mesh can also be made to produce similarly useful results. These example results show what level of approximation in the QFT is tolerable for application of the VIC method. For other QFT-based CFD solvers, a similar sensi-

vortex. Results are compared for two different meshes, 1283

tivity study would need to be conducted.

**36**

**Figure 3.**

*AQFT is shown ("k" limit is 5).*

**Figure 4.**

*Vortex-in-cell simulation of leapfrogging vortex rings. For 1283 mesh, AQFT ("k" limit 5) is used. For 2563 mesh, "k" limit in AQFT is 6.*
