Introduction

The Navier-Stokes equations remain one of the biggest open problems in physics1, with closed-form solutions known only in restricted cases. This has given rise to the field of Computational Fluid Dynamics (CFD)2. Most CFD methods rely on a problem-specific discretization of the spatial domain, a mesh. There, the velocity and pressure fields are represented by vectors whose dimension is given by the mesh size. However, the precision required to capture relevant dynamics often translates into prohibitively high dimensions. For instance, for an accurate description of turbulent flows, the ratio between the largest and the smallest length scale in the mesh must grow with the Reynolds number (Re)3,4. The resulting mesh can then have sizes that render the problem intractable for standard methods. This is a manifestation in CFD of the infamous curse of dimensionality, a major limitation of state-of-the-art mesh-based solvers.

A similar limitation arises in simulations of quantum systems, described by vector spaces exponentially large in the number N of particles5,6. There, sophisticated tensor-network techniques7,8,9 have been developed to tackle the problem under the assumption of low entanglement, i.e. non-factorability of the quantum state10. The best-known example is matrix-product states (MPSs)11,12, also known as tensor trains13. These represent 2N-dimensional quantum states as a set of 2N matrices whose maximal size (called bond dimension) depends on the amount of entanglement. For instance, low-entangled states of 1D systems can be exponentially compressed by MPSs5,7,8,9. In fact, MPSs and their tensor-network extensions provide the state-of-the-art framework for simulating complex quantum dynamics14,15.

In view of this, MPSs have been applied to a variety of other high-dimensional problems16,17,18,19,20,21,22. In particular, turbulent fluids in simple geometries have been observed to also admit an efficient MPS description23,24,25,26. The rationale is that the energy cascade mechanism3, whereby energy transfer takes place only between adjacent spatial scales, may play a similar role to local interactions in 1D quantum systems. This may open a new arena for CFD solvers. Nevertheless, for this to happen, compression efficiency should be combined with versatility to describe immersed objects of diverse geometries, with non-trivial boundary conditions. Moreover, a practical solver should also allow for accessing the solution directly in the MPS encoding, without passing through the dense vector. Otherwise, potential speed-ups in solving the problem may be lost at evaluating the solution. It is an open question whether these requirements can be harmoniously met and, most importantly, if there are settings of practical relevance where this can be achieved with a moderate bond dimension.

Here, we answer these questions in the affirmative. We deliver an MPS-based toolbox for simulating incompressible fluids, with complexity logarithmic in the mesh size and polynomial in the bond dimension. This is achieved via three major contributions: First, approximate MPS masks to encode object shapes into MPSs of low bond dimension. Second, a native time-integration scheme incorporating the masks as built-in features. This is based on finite-differences as in refs. 23,24, but it operates with open boundary conditions, as in ref. 25, crucial to treat immersed objects without very large spatial domains. Additionally, the proposed scheme embeds open boundary conditions into a matrix-product differential operator. Third, an MPS solution oracle for querying the solution directly from the MPS, bypassing dense-vector evaluations. This features two main operation modes: coarse-grained evaluation and pixel sampling. In particular, the latter generates random points weighted by the squared magnitude of a target property (vorticity, pressure, etc.), mimicking the measurement statistics on a quantum state. This is ideal for Monte-Carlo simulations.

We validate the framework by reproducing text-book regimes of flows around a cylinder and by comparing our solutions for flows around a square, and even a collection of squares, with those of the popular commercial solver Ansys Fluent. To our knowledge, this is the first MPS algorithm for differential-equation systems validated to such extents. Finally, we venture into flows around a real-life airfoil from the NACA data set. MPSs of 18,800 parameters are enough for an accurate simulation with a mesh of 219 = 524288 pixels, a significant 27.9X compression. Among others, we use pixel sampling to randomly explore the regions of highest vorticity around the wing, without evaluating a single component of the 219-dimensional vorticity vector field itself. These tools may be relevant for aero- and hydro-dynamic design optimizations.

Results

MPS framework for CFD

Our toolbox is summarized in Fig. 1. The details of the Navier–Stokes equations as well as of the MPS encoding of velocity and pressure fields are given in the Methods. Our presentation is restricted to the 2D case for simplicity, but all components of the framework can be straightforwardly generalized to the 3D case.

Fig. 1: Schematics of the framework.
figure 1

a Main steps of the solver, featuring the paradigmatic steady flow around a cylinder. The first step is the flow initialization with constant velocity. The second one is the Matrix Product State (MPS) mask application, which nullifies the velocity field inside the object. This produces an artificial field that is not divergence-free. To correct this, in the third step, we project the field back onto the divergence-free manifold. The fourth step is the time integration over a small evolution time, using an explicit Euler method. The last three steps are then iterated T times to get the final MPS field at time T. Finally, the fifth step is the MPS solution oracle. The two boxes there represent the main operation modes: coarse-grained evaluation and pixel sampling. b Construction of approximate MPS masks (for a 1D object for clarity). Given a smooth function q(x) (in light blue, its absolute value in green) that vanishes on the boundary of the object, we define \(m(x)=1-{e}^{-\alpha \left(q(x)+| q(x)| \right)}\) (red solid). This approximates the object’s indicator function θ(x) (black dashed) up to a tunable small error (through α). Next, we apply the TT-cross algorithm to produce an MPS approximation to m(x) from a few queries of it. c Coarse-grained evaluation: a 4-bit MPS, encoding an average over the smallest (pink) spatial scale, is obtained directly from a 6-bit MPS through simple contractions with constant single-site gadget tensors in green. d Pixel sampling: mesh cells (red points) are randomly chosen with probabilities proportional to the squared vorticity field at those points. The key tool are the marginals of the joint probability distributions over the binary representation of the cell positions. These allow one to sample the entire string bit by bit and can be efficiently obtained directly from the MPS. In the figure, a 2-bit marginal is obtained through simple single-site contractions of two copies of 4-bit MPS and the gadget tensors in yellow. Neither operation mode of the oracle requires field evaluations in the dense-vector representation (see Section MPS solution oracle).

Approximate MPS masks

If a rigid body is immersed in a fluid at a fixed position, the velocity field must be zero both inside the object and on its boundary (no-slip condition). This is a crucial requirement that, to our knowledge, has not been addressed in the literature of quantum-inspired solvers. To incorporate it, we introduce the notion of approximate MPS masks (see Fig. 1b). These are MPSs encoding functions that approximate the target indicator function θ of the object – i.e. the function equal to zero within the object and to one outside it – up to arbitrary, tunable precision. We apply these masks on the MPS representing the field by simple element-wise multiplication.

To build such MPSs, we first consider a scalar function q(x), with \({{{{{{{\bf{x}}}}}}}}\in {{{{{{{{\mathcal{R}}}}}}}}}^{D}\), such that it i) vanishes on the boundary of the D-dimensional object in question, ii) takes negative values in the interior of the object, and iii) tends to infinity far away from the boundary. For example, for a circular object of unit radius in D = 2, q(x, y) = x2 + y2 − 1 does the job. Using such boundary functions, we define the smooth function

$$m({{{{{{{\bf{x}}}}}}}}):=1-{e}^{-\alpha \left(q({{{{{{{\bf{x}}}}}}}})+| q({{{{{{{\bf{x}}}}}}}})| \right)},$$
(1)

with α > 0. By construction, m approximates θ increasingly better for growing values of α. In particular, the l2 distance between m(x) and θ(x) decreases with α as \(1/\sqrt{\alpha }\) (see Supplementary Note 1).

The next step is to obtain an MPS representation of m(x). If m(x) consists of elementary functions, the MPSs can be constructed analytically 27,28. However, in general, one must resort to numerical approximations. In this work, we use the standard TT-cross algorithm29 to find an MPS approximation of m(x). This approximation can be found, up to a controllable l2 distance ϵ, from few evaluations of the function. TT-cross is a classical tensor sketching algorithm, and more details can be found in Supplementary Note 1. We observe that ϵ = 10−3 is enough to generate high-quality masks of the cylinder up to meshes of 230 cells (see Supplementary Note 1). The 30-bit MPS masks generated there have χ = 30 and a total of 24,200 parameters, corresponding to a compression factor of more than 44,360. Our observations consistently show that the TT-cross approximation directly on the discontinuous function θ produces significantly worse masks than via the intermediate approximation m. This is shown in full-resolution in Fig. 2 for a 22-bit mesh. (The 30-bit case is too large for full resolution evaluation, see Supplementary Note 1.).

Fig. 2: Reconstruction error of the MPS mask.
figure 2

The figure shows the absolute error between the exact indicator function θ(x) and the MPS masks obtained from TT-cross approximation of (a) θ(x) and (b) m(x). The domain discretization is Nx = Ny = 11 bits both horizontally and vertically (we show only a 6X close-up of the object); and the bond dimension is χ = 30. Clearly, the deviations seen in panel a are much larger, not only close to the object’s boundary but also far from it (note the thin vertical lines). That is, the intermediate step through m leads to masks of significantly higher accuracy. This is crucial for the solver, which applies the mask at every time iteration.

Time evolution

We discretize the differential operators in Eqs. (2) using finite differences with an 8-th order stencil30. We use open boundary conditions (BCs), necessary to treat immersed objects using limited spatial domains. More precisely, we apply inlet-outlet BCs31 at the left- and right-hand edges, where the fluid enters and exits the domain, respectively; and use closed BCs at the upper and lower edges. We note that, in ref. 25, inlet-outlet BCs are enforced via application of a mask. Instead, we embed them directly into the differential operator. This operator can in turn be analytically recast as a matrix product operator (MPO), as shown in refs. 28,32,33 for simpler BCs. As a result, we obtain differential MPOs with inlet-outlet BCs as built-in features, with low bond dimensions (see Supplementary Note 2). With the differential MPOs in place, we can perform the time evolution.

The first step (see Fig. 1a) is to initialize the velocity MPSs [see Eq. (3)] as a constant vector field (flow far away from the object). Next, we loop T times over steps 2–4, with T the desired evolution time. Step 2 is the object mask application, described above. Steps 3 and 4 consist respectively of projecting the resulting MPS velocity field onto the divergence-free manifold, defined by Eq. (2b), and integrating over a small time step Δ t. We implement these two steps with Chorin’s projection method34,35. That is, we first solve for the pressure from a Poisson equation, and use that pressure to project the velocity back onto the divergence-free manifold, enforcing the incompressibility condition (see Supplementary Note 2 for details). Then, we solve for the velocity at the next time instant by integrating the momentum equation [Eq. (2a)] without its pressure term. This iterative splitting procedure is equivalent to directly solving Eqs. (2) (see Supplementary Note 2). The resulting velocity field satisfies neither the no-slip nor the incompressibility conditions, but this is corrected for in (steps 2 and 3 of) the next iteration (and, after the last iteration, we run one extra round of steps 2 and 3). The fifth and final step is to retrieve the solution from its MPS encoding, explained in Sec. MPS solution oracle.

The Poisson equation is the most computationally-expensive task in each iteration (see Section Computational complexity analysis). We tackle this with a DMRG-type algorithm that solves an equivalent linear system36. As for the time integration, we use the Euler explicit time stepping, with time and spatial steps chosen according to known numerical-stability criteria (see Supplementary Note 2). Finally, every operation on an MPS typically increases its bond dimension. We keep it under a chosen threshold by periodic truncation (see Supplementary Note 3).

MPS solution oracle

Our solver outputs the solution in the MPS form, requiring up to exponentially fewer parameters than the dense-vector representation. This is specially relevant for turbulent flows (large \({{{{{{{\rm{Re}}}}}}}}\)), where the separation between the Kolmogorov scale (η) and integral scale (l) grows with Reynolds number, given by \(\eta /l \sim {{{{{{{{\rm{Re}}}}}}}}}^{-3/4}\)3,4. For fields in 3D, this means a mesh size which scales as \({{{{{{{{\rm{Re}}}}}}}}}^{9/4}\). This raises the question of how to retrieve the solution without mapping the MPS to the dense vector, which can eliminate potential speed-ups gained in solving the problem. We propose two methods to extract the main features of the solution directly from the MPS: coarse-grained evaluation and pixel sampling.

Coarse-grained evaluation (Fig. 1c) produces an MPS with fewer spatial scales, encoding an averaged version of the solution. The averaging is done directly on the MPSs in a highly efficient manner: one simply contracts the physical indices of the fine scales one wishes to average out with single-site constant gadget tensors (in light-green in the figure). To evaluate the averaged field in full resolution, one then maps the obtained, smaller MPS to its corresponding dense vector, contracting the virtual indices between all N − 1 nearest-neighbors. Clearly, the finest-scales details are lost in this operation mode. A convenient, complementary alternative is pixel sampling.

Pixel sampling (Fig. 1d) is an exact sampling method that generates random points (xi, yj) chosen with probability P(i, j) = vi,j2/v2, where v2 is the l2-norm of v. Next, one can efficiently query the MPS to assess the encoded solution at the sampled points. This reproduces the measurement statistics of a quantum state that encodes v in its amplitudes, hence being potentially relevant also to future quantum solvers37. We note that related sampling methods have been used for training mesh-free neural-network solvers38. However, there, the points are sampled uniformly, whereas here according to their relevance to the field. Our approach relies on standard techniques for l2-norm sampling physical-index values from an MPS7,8. The key ingredient is the marginals of P(i, j), which can be computed by simple single-site tensor contractions on two copies of the MPS (with the gadget tensors in yellow in the figure). All N marginals are calculated in this fashion, without a single evaluation of v at any point (i, j). With the marginals, the conditional distribution for each bit given the previous ones is obtained, allowing one to sample the entire bit string. Importantly, the technique applies to any MPS39,40. For instance, one can obtain the MPS encoding the vorticity field from that of the velocity.

In Fig. 3 below, we showcase the real-life applicability of coarse-grained evaluation and pixel sampling for assessing the vorticity field around a wing in a mesh of 219 cells. Moreover, in Supplementary Note 1, these evaluation modes allow us to benchmark the MPS masks generated for a mesh of 230 cells. The hardware used for that is a standard Intel i9 CPU with 16 GB RAM, where such high-dimensional benchmarks would be impossible using dense vectors.

Fig. 3: Vorticity field around a NACA 0040 airfoil, for different evaluation modes of the MPS solution oracle.
figure 3

The mesh size is 219 = 524,288, the number of time steps T = 5000, and Reynolds number \({{{{{{{\rm{Re}}}}}}}}=750\). We compress the corresponding fields into 19-bit MPSs of 18,800 parameters, a 27.9X compression. a Vorticity field in full resolution. This requires mapping the MPS to the dense-vector representation. b Coarse-grained evaluation, with the two smallest scales in both x and y directions averaged out. The resulting 15-bit MPS has 16 times fewer parameters than the 19-bit MPS solution. c Pixel sampling, featuring 2500 pixels randomly selected according to their squared vorticity. No evaluation of the vorticity field itself is required for that.

Finally, these oracle modes can optionally be combined by close-ups, i.e. zoomed-in evaluations of specifically chosen subdomains. Close-ups are obtained fixing a number of large-scale bits of an MPS solution which results in a smaller MPS on the remaining bits, that corresponds to the solution on the target subdomain. Depending on the use case, one can perform either full-resolution evaluation, coarse-grained evaluation or pixel sampling of the smaller MPS. For example, one can extend pixel sampling to sample densely from several subdomains using close-ups.

Computational complexity analysis

We perform a full time-complexity analysis of the solver and its components. Table 1 shows the asymptotic (worst-case) upper bounds as well as the numerically observed runtimes, per subroutine. For the tasks within the time integration loop, the estimates are per time iteration. The complexity of the mask generation is due to the TT-cross approximation29. Those of the other tasks are dominated by their corresponding tensor-network operations (contractions and truncation of χ)7,39. As for the numerical estimates, they correspond to an average over ten time iterations (see Supplementary Note 4). Note that the projection onto the divergence-free manifold is the most expensive subroutine, with a worst-case performance \({{{{{{{\mathcal{O}}}}}}}}(N{\chi }^{6})\). The latter is dominated by a sub-task involving N linear systems of size 4χ2 × 4χ2, which we solve exactly since χ is low in our cases. However, this can also be solved approximately via variational approaches (see Supplementary Note 4), which render the complexity \({{{{{{{\mathcal{O}}}}}}}}(N{\chi }^{4})\) and are therefore a convenient alternative for high χ23. Finally, the last row shows the total numerically observed runtime per time iteration. The scaling there is a conservative estimate from numerical fits to the runtimes obtained for fixed N (between 15 and 23) as function of χ (varying from 20 to 50). Those fits are consistent with scalings αNχ4.1, with 10−7 ≤ α ≤ 10−6 (see Supplementary Note 4 for details). This is significantly below the worst-case bound \({{{{{{{\mathcal{O}}}}}}}}(N\,{\chi }^{6})\).

Table 1 Time complexities

Numerical results

To showcase the versatility of our framework with three classes of immersed objects. First, we show how our simulations reproduce well-known regimes of flows around a cylinder at different Reynolds numbers. Second, we benchmark our results for flows around squared cylinders against those of the popular commercial solver Ansys Fluent. Third, we tackle the challenging case of flows around an realistic airfoil, where we also showcase the different operation modes of the MPS solution oracle.

The flow around a circular cylinder is one of the paradigmatic problems in fluid dynamics41. We simulate the three characteristic dynamics of laminar flow at different \({{{{{{{\rm{Re}}}}}}}}\le 150\) (see Fig. 4). We solve for the velocity and pressure fields on a mesh with Nx = 8 and Ny = 7, encoded in a 15-bit MPS with χ = 30 (see Supplementary Table S1 for details). The solutions obtained reproduce the textbook sub-regimes as Re increases: from a flow without downstream circulation to the well-known Kármán vortex street42.

Fig. 4: Flow around a circular cylinder at various Reynolds numbers.
figure 4

Each column shows one of the three paradigmatic phases of a laminar flow around a cylinder42. ac Streamlines, originating at the inlet (left side), are shown. The color code indicates the magnitude of velocity. The insets show the features of the flow near the boundary of the object. df Vorticity field \({{{{{{{\boldsymbol{\omega }}}}}}}}=\nabla \times {{{{{{{{\bf{v}}}}}}}}}_{}^{}\) is shown. The first column corresponds to Reynolds number \({{{{{{{\rm{Re}}}}}}}}=1.7\): in panel a, we observe that the streamlines do not detach from the edge of the cylinder. In turn, in panel d, no vorticity is observed behind the object. These are the signatures of a potential flow, where v is given by the gradient of a scalar field. The second column corresponds to \({{{{{{{\rm{Re}}}}}}}}=25\). As seen in panel b, streamlines detach from the object’s boundary. In turn, in panel e, a pair of counter-rotating vortices appears behind the object. These are the characteristics of a steady laminar flow. The third column corresponds to \({{{{{{{\rm{Re}}}}}}}}=125\). In this regime, the flow becomes unsteady and develops the well-known Kármán vortex street41. This can be observed in panels c and f, where clear oscillations in the streamlines and in the vortices behind the object are shown. A 15-bit MPS with χ = 30 is used for all cases. In all of them, the simulated flow reproduces the expected behavior.

Next, we simulate flows around a squared cylinder and a collection of four squared cylinders at \({{{{{{{\rm{Re}}}}}}}}=127\) and \({{{{{{{\rm{Re}}}}}}}}=141\), respectively. Both simulations are performed on a mesh with Nx = 8 and Ny = 7 using MPSs of χ = 30. As shown in Fig. 5, we compare our solutions with the ones obtained using Ansys Fluent. We note that comparison between conceptually different solvers are meaningful only in the fully developed phase of the flow, after the initial transient behavior. The evolution times used for Fig. 5 were carefully chosen as to guarantee this condition (see Supplementary Note 5). This rules out possible mismatches in the transient regimes due to different numerical approaches. In addition, in Supplementary Note 5, we also report simulations for the squared cylinder at \({{{{{{{\rm{Re}}}}}}}}=630\) and \({{{{{{{\rm{Re}}}}}}}}=2230\).

Fig. 5: Comparison with Ansys Fluent.
figure 5

Panels a and b show the flows around a square cross-section for Reynolds number \({{{{{{{\rm{Re}}}}}}}}=127\) and at time step T = 19,900, obtained by our solver (in a) and by the commercial solver Ansys Fluent (in b). Panels c and d show a similar comparison for a collection of four squares, for \({{{{{{{\rm{Re}}}}}}}}=141\) and at T = 2500, where panel c corresponds to our solver and panel d corresponds to Ansys Fluent. For both cases, we have MPSs with Nx = 8 and Ny = 7 and χ = 30. Importantly, the values of T were chosen high enough for the flows to be in the fully-developed regime (see Supplementary Note 5). In both cases the agreement between our solver and Ansys Fluent is excellent.

Finally, we consider the simulation of flows around a realistic airfoil in a mesh of Nx = 10 and Ny = 9, shown in Fig. 3. The flow inclination angle used is \(2{2}^{\circ },{{{{{{{\rm{Re}}}}}}}}=750\), and χ = 45. We take advantage of this complex geometry to showcase the different evaluation modes of the MPS solution oracle. As a specific example, we consider the vorticity field \({{{{{{{\boldsymbol{\omega }}}}}}}}=\nabla \times {{{{{{{{\bf{v}}}}}}}}}_{}^{}\). We obtain its associated MPS directly from the velocity MPSs and the matrix-product form of  . The vorticity MPS is then taken as the solution oracle for the plots in Fig. 3. We stress that neither coarse-grained evaluation nor pixel sampling require the vector representation of \({{{{{{{{\boldsymbol{\omega }}}}}}}}}_{}^{}\), only its MPS.

The observed versatility for flows around realistic geometries, together with the built-in ability to access the solution directly from the MPS, renders our framework potentially interesting to hydro-dynamic design problems. In particular, pixel sampling is well-suited for Monte-Carlo estimations of objective functions that may be relevant to industrial optimizations.

Discussion

We have presented a quantum-inspired framework for CFD based on matrix-product states (MPSs). Our solver supersedes previous works in that it incorporates immersed objects of diverse geometries, with non-trivial boundary conditions, and can retrieve the solution directly from the compressed MPS encoding, i.e. without passing through the expensive dense-vector representation. For a mesh of size 2N, both memory and runtime scale linearly in N and polynomially in the bond dimension χ. The latter grows with the complexity of the geometry in question. Nevertheless, we showed that our toolbox can handle highly non-trivial geometries using not only moderate χ but also very few parameters. For instance, the most challenging flow simulation considered is for a wing airfoil in a mesh of 219 pixels. Our machinery accurately captures the flows with MPSs of N = 19 bits, χ = 45, and a total of 18,800 parameters (27.9X compression). In turn, it can also accurately represent a cylinder in a mesh of 230 cells with an MPS of N = 30, χ = 30, and a total of 24,200 parameters: a compression of more than 44,360X.

A core technical contribution to enable such high efficiencies is the approximate MPS masks. In fact, we have provided a versatile mask generation recipe exploiting standard tensor-network tools such as the TT-cross algorithm. Another key ingredient is the alternative methods we have proposed to query the solution directly from its MPS: coarse-grained evaluation and pixel sampling. In particular, pixel sampling explores random mesh points distributed according to the square of a chosen property, such as for instance vorticity or pressure (or, through an equation of state, also temperature). This mimics the measurement statistics of a quantum state encoding the property in its amplitudes, hence being relevant also to future quantum solvers37. It does so by efficiently computing marginals of the target distribution via local tensor contractions directly on the MPS, without evaluating the property itself at any mesh point. Pixel sampling is ideal for Monte-Carlo simulations, relevant to optimizations via stochastic gradient descent, e.g. This can be interesting to aero- or hydro-dynamic design problems as well as to training neural-network models.

Our work offers several directions for future research. In particular, the extension to the 3D case will enable probing the framework in truly turbulent regimes. This will also require in-depth studies of the dependence of the bond dimension with the evolution time. We anticipate that further optimization of the tensor-network Ansatz will play a crucial role for that, as well as extensions to non-uniform meshes. Another possibility is the exploration of tensor networks with other natural function bases for turbulent phenomena, such as Fourier43 or wavelets44. In turn, an interesting opportunity is the application of our framework to other partial differential equations21,22,45. This may be combined with extensions to finite elements or finite volumes, which can in principle also be formulated with tensor networks25. Moreover, our method may be relevant to mesh-free solvers too. For instance, pixel sampling on small meshes could be explored to speed-up the training of mesh-free neural-network schemes38. Finally, a further prospect could be to combine the framework with quantum sub-routines, in view of hybrid classical-quantum solvers. For example, our main computational bottleneck is the Poisson equation, and future quantum linear solvers may offer significant speed-ups for that37,46,47.

All in all, our findings open a playground with potential to build radically more efficient solvers of real-life fluid dynamics problems as well as other high-dimensional partial differential equation systems, with far-reaching research and development implications.

Methods

Incompressible Navier–Stokes equations

We solve the incompressible Navier–Stokes equations in the absence of external forces (for simplicity):

$$\frac{\partial {{{{{{{\bf{v}}}}}}}}}{\partial t}+({{{{{{{\bf{v}}}}}}}}\cdot \nabla )\,{{{{{{{\bf{v}}}}}}}}=-\frac{1}{\varrho }\nabla p+\nu \,{\nabla }^{2}\,{{{{{{{\bf{v}}}}}}}},$$
(2a)
$$\nabla \cdot {{{{{{{\bf{v}}}}}}}}=0,$$
(2b)

where v = v(x, t) and p = p(x, t) are respectively the velocity and pressure fields at position x and time t, ϱ is the density, and ν the kinematic viscosity. Eqs. (2a) and (2b) follow respectively from momentum and mass conservations4,48,49. They give rise to a variety of behaviors, ranging from laminar to turbulent flows. The flow regime is determined by the Reynolds number, Re \(=\frac{UL}{\nu }\), where U and L are characteristic velocity and length scales of the problem4. This dimensionless parameter quantifies the ratio between the inertial [(v ) v] and dissipative [ν2v] force terms. At high Re, the nonlinear inertial term dominates and the flow is highly chaotic and turbulent. Instead, at low Re, the dissipative term dominates and the flow is stable and laminar.

Field encoding with matrix product states

We encode scalar functions – such as the velocity components vx(x) and vy(x), or the pressure p(x) – into matrix-product states (MPSs)7,8,9. We discretize the 2D domain into a mesh of 2N points, specified by N = Nx + Ny bits. There, we represent a continuous function v(x, y) by a vector of elements vi,jv(xi, yj), where the strings i (i1, i2, …iNx) and j (j1, j2, …jNy) give the binary representation of xi and yj, respectively. Then, we write each vi,j as a product of N matrices:

$${v}_{{{{{{{{\bf{i}}}}}}}},{{{{{{{\bf{j}}}}}}}}}={A}_{1}^{({i}_{1})}{A}_{2}^{({i}_{2})}\ldots {A}_{{N}_{x}}^{({i}_{{N}_{x}})}\,{B}_{1}^{(\,{j}_{1})}{B}_{2}^{({j}_{2})}\ldots {B}_{{N}_{y}}^{({j}_{{N}_{y}})}.$$
(3)

This is the MPS form (see also Fig. 1c). The indices ik and jk are referred to as physical indices of the matrices Aj and Bj, respectively. Note that, the first Nx matrices correspond to xi and the remaining Ny ones to yj, as in refs. 21,24. However, other arrangements are possible16,23,50. The bond dimension χ is defined as the maximum dimension over all 2 N matrices used. Importantly, the total number of parameters is at most 2 Nχ2. Hence, if χ constant, the MPS provides an exponentially compressed representation of the 2N-dimensional vector. Moreover, instead of fixing all virtual dimensions at χ, we dynamically adapt each site’s dimension to the amount of inter-scale correlations. This typically reduces the number of parameters to well below the bound 2 Nχ2.