  This paper presents a numerical method based on the variational quantum
algorithm to solve potential and Stokes flow problems. In this method, the
governing equations for potential and Stokes flows can be respectively written
in the form of Laplace's equation and Stokes equations using velocity
potential, stream function and vorticity formulations. Then the finite
difference method and the generalised differential quadrature (GDQ) method are
applied to discretize the governing equations. For the prescribed boundary
conditions, the corresponding linear systems of equations can be obtained.
These linear systems are solved by using the variational quantum linear solver
(VQLS), which resolves the potential and Stokes flow problems equivalently. To
the best of authors' knowledge, this is the first study that incorporates the
GDQ method which is inherently a high-order discretization method with the VQLS
algorithm. Since the GDQ method can utilize much fewer grid points than the
finite difference method to approximate derivatives with a higher order of
accuracy, the size of the input matrix for the VQLS algorithm can be smaller.
In this way, the computational cost may be saved. The performance of the
present method is comprehensively assessed by two representative examples,
namely, the potential flow around a circular cylinder and Stokes flow in a
lid-driven cavity. Numerical results validate the applicability and accuracy of
the present VQLS-based method. Furthermore, its time complexity is evaluated by
the heuristic scaling, which demonstrates that the present method scales
efficiently in the number of qubits and the precision. This work brings quantum
computing to the field of computational fluid dynamics. By virtue of quantum
advantage over classical methods, promising advances in solving large-scale
fluid mechanics problems of engineering interest may be prompted.
