{'fraction_non_alphanumeric': 0.03709744586340922, 'fraction_numerical': 0.017524986118822874, 'mean_word_length': 4.491044207317073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Resonant interactions of nonlinear water waves in a finite basin

We study exact four-wave resonances among gravity water waves in a square box with periodic boundary conditions. We show that these resonant quartets are linked with each other by shared Fourier modes in such a way that they form independent clusters. These clusters can be formed by two types of quartets: (1) {\it angle-resonances} which cannot directly cascade energy but which can redistribute it among the initially excited modes and (2) {\it scale-resonances} which are much more rare but which are the only ones that can transfer energy between different scales. We find such resonant quartets and their clusters numerically on the set of 1000 x 1000 modes, classify and quantify them and discuss consequences of the obtained cluster structure for the wavefield evolution. Finite box effects and associated resonant interaction among discrete wave modes appear to be important in most numerical and laboratory experiments on the deep water gravity waves, and our work is aimed at aiding the interpretation of the experimental and numerical data.

Weakly nonlinear systems of random waves are usually studied in the framework of wave turbulence theory (WTT) (for introduction to WTT see book [1]). Besides weak nonlinearity and phase randomness, this statistical description is based on the infinite-box limit. This approach yields wave kinetic equations for the wave spectrum which have important stationary solutions, Kolmogorov-Zakharov (KZ) spectra [1]. Importance of KZ spectra is in that they correspond to a constant flux of energy in Fourier space and, therefore, they are analogous to the Kolmogorov energy-cascade spectrum in hydrodynamic turbulence. WTT approach can also be used to study evolution of higher momenta of wave amplitudes and even their probability density function, and, therefore, to examine conditions for deviation from Gaussianity and onset of intermittency [2,3,4,5]. Significant effort has been done in the past to test WTT and its predictions numerically [3,6,7,8,9] as well as experimentally [10,11,12,13]. It has been noted however that in both the numerical and the laboratory experiments the domain boundaries typically play a very important role and the infinite-box limit assumed by WTT is not achieved. Indeed, as mentioned in [9], to overcome the wavenumber discreteness associated with the final box one needs at least 10000 x 10000 numerical resolution which is presently unavailable for this type of problems.
On the other hand, as shown in [10], even in a 10m x 6m laboratory flume the finite-box effects are very strong. It is important to understand that WTT takes the infinitebox limit before the weak-nonlinearity limit, which physically means that a lot of modes interact simultaneously if they are in quasi-resonance, i.e. satisfy the following conditions |ω(k 1 ) ± ω(k 2 ) ± ... ± ω(k s )| < Ω, k 1 ± k 2 ± ... ± k s = 0 (1) with some resonance broadening Ω > 0 which is a monotonically increasing function of nonlinearity (mean wave amplitude). Here k and ω(k) are wave vector and dispersion function (frequency) which correspond to a general wave form ∼ exp i(kx − ωt). WTT is supposed to work when the resonance broadening Ω is greater than the spacing δ ω between the adjacent wave modes Ω > (∂ω/∂k)2π/L, where L is the box size. For some types of waves, for example for the capillary water waves, this condition is easy to satisfy, and therefore to achieve WTT regime [14]. However, this condition is often violated for some other types of waves, in particular for the surface gravity waves which will be the main object of this paper. This occurs in numerical simulations, due to limitations on the numerical resolution [7,9] and in laboratory experiments, due to an insufficient basin size [10,11]. In these cases, the Fourier space discreteness (which is due to a finite box size) leads to significant depletion of the number of wave resonances with respect to the infinite box limit. In turn, this results in a slowdown of the energy cascade through the k-space with respective steepening of the wave spectra [10,15]. In addition, the wavenumber grid will cause the wave spectra to be anisotropic in this case.
What happens when the condition (2) is so badly violated that only waves which are in exact resonance (i.e. Ω = 0) can interact? In this case, the mechanism of the wave phase randomization based on many quasiresonant waves interacting simultaneously will be absent and, therefore, one should expect less random and more coherent behavior. In [16] it was shown that in many wave systems, resonantly interacting waves in finite domains are partitioned into small independent clusters in Fourier space, such that there cannot be an energy flux between different clusters. In particular, in [17] some examples of wave systems were given in which no resonances exist (capillary water waves, ω = |k| 3/2 ), as well as systems with an infinite number of resonances (oceanic planetary waves, ω = |k| −1 ). Both of these examples are three-wave systems [i.e. s = 3 in (1)]. In the present paper we will concentrate on finding resonances for the deep water gravity waves, which is a four-wave system.
The problem of computing exact resonances in a confined laboratory experiment is highly non-trivial because the wavenumbers are integers and (1) is a system of Diophantine equations on many integer variables in large powers. Computational time of solving this system by a simple enumeration of possibilities in this case grows exponentially with each variable and the size of spectral domain under consideration. A specially developed qclass method [18,19,20] has allowed to accelerate the computation and find all the resonances among waves in large spectral domains, in a matter of minutes. In this paper we use q-class method to construct resonant wave clusters formed by 4-wave resonances among water gravity waves covered by the kinematic resonance conditions in the form: with k i = (m i , n i ) and integer |m i |, |n i | ≤ 1000. Our main aim is to understand how anisotropic resonance clusters influence the general dynamics of the complete wave field.

CONSTRUCTION OF q-CLASSES
We adopt the general definition of a q-class given in [18] for the dispersion function ω = |k| 1/2 in the following way. Consider the set of algebraic numbers R = ±k 1/4 . Any such number k has a unique representation where q is a product while p 1 , ...p n are all different primes and the powers e 1 , ....e n ∈ N are all smaller than 4. Then the set of numbers from R having the same q is called a q-class Cl q . The number q is called a class index. For a number k = γq 1/4 , γ is called the weight of k. For instance, wave vector k = (160, 40) belongs to the q-class with q = 1700. Obviously, for any two numbers k 1 , k 2 belonging to the same q-class, all their linear combinations with integer coefficients belong to the same class q.
It can be shown that Sys.(3) have two general types of solutions: Type I: All 4 wave vectors belong to the same class Cl q , in which case first equation of the Sys.(3) can be rewritten as with integer γ 1 , γ 2 , γ 3 , γ 4 . and Type II: All 4 wave vectors belong to two different classes Cl q1 , Cl q2 ; in this case first equation of the Sys.(3) can be rewritten as with integer γ 1 , γ 2 .
The I-and II-type of solutions describe substantially different energy exchanges in the k-space. The II-type resonances are called angle-resonances [23] and consist of wavevectors with pairwise equal lengths, i.e. |k 1 | = |k 3 | and |k 2 | = |k 4 | or |k 1 | = |k 4 | and |k 2 | = |k 3 |. Thus, these resonances do not transfer energy outside of the initial range of |k| and, therefore, cannot provide an energy cascade mechanism. However, these resonances can redistribute energy among the initial wavenumbers, in both the direction k/|k| and the scale |k|. Since the initial support of energy in |k| cannot change, the II-type resonances alone would form a finite dimensional system, and it would be reasonable expect a relaxation of such a system to a thermodynamic Rayleigh-Jeans distribution determined by the initial values of the motion integrals (the energy and the waveaction in the this case). Note that such a thermalization could happen only among the resonant wavenumbers, and many modes which are initially excited but not in resonance would not evolve at all. (Such an absence of the evolution was called "frozen turbulence" in [6] where the capillary waves were studied for which there are no exact resonances). Whether the thermalization does occur in finite clusters and under what conditions (e.g. the cluster size etc.) are interesting questions that remain to be studied in future.
On the other hand, the I-type resonances are called scaleresonances [23], and they can generate new wavelengths, -this corresponds to 3 or 4 different weights γ in (4) [23]. Thus, they are the only kind of resonances that can transfer energy outside of the range of initial |k|.
Before studying the structure of resonances let us notice the following simple but important fact. Suppose a quartet is a solution of (3), then each permutation of indexes 1 ↔ 2, 3 ↔ 4 or simultaneous 1 ↔ 3 and 2 ↔ 3 will generate a new solution of (6); in general case, all together 8 different symmetry generated solutions. Of course, in some particular cases, when some of the vectors belonging to a quartet coincide, the overall number of symmetry generated solutions can be smaller. For instance, the quartet belongs to the cluster of 4 such solutions. On the Fig. 1 the smallest tridents cluster is shown, with and without multi-edges. Graphical presentation of a cluster as a graph with multi-edges is of course mathematically correct but would make the pictures of bigger clusters somewhat nebulous (see Fig. 1, left panel). Notice that although formally we have solutions with multiplicities due to the symmetries, physically all these solutions correspond to the same quartet, and therefore we count them as one. Therefore, further on we omit multi-edges in our graphical presentations as it is shown in Fig. 1, right panel.
In the next sections, on all the Figures, the structure of resonance clusters in the spectral space is shown as follows: each wave vector is presented as a node of integer lattice and nodes belonging to one solution are connected by lines.

SCALE-RESONANCES
We have studied the cluster structure of the scaleresonances in the spectral domain |m|, |n| ≤ 1000. In our computational domain we have found 230464 such resonances, among them 213760 collinear (i.e. all 4 wave vectors are collinear) and only 16704 (7.25%) non-collinear resonances. However, the nonlinear interaction coefficient in collinear quartets is equal to zero and, therefore, they have no dynamical significance [24]. On the other hand, for mathematical completeness we will consider these solutions too, because there may exist 4-wave systems with the same dispersion law but with different forms of interaction coefficients such that are not necessarily zero on the collinear quartets. In the Table I the structure of all clusters is presented while in the Table II -the structure of non-collinear is given; cluster length is the number of quartets belonging to one cluster. Number of  length clusters  length clusters  1  43136  56  3  2  1256  60  6  8  452  72  1  10  184  80  1  12  20  92  2  16  14  128  1  20  10  152  1  40  7  176  1  48 2 208 1  In Fig. 2 structure of collinear and non-collinear quartets is shown ia a smaller domain m 2 i + n 2 i ≤ 100.

Collinear quartets
First of all, let us make an important remark. If a 4-tuple {{m 1 , n 1 }, {m 2 , n 2 }, {m 3 , n 3 }, {m 4 , n 4 }} consists of all collinear wave vectors, then the ratio |m i |/|n i | is the same for all 4 wave vectors. Let us assume that m i , n i = 0, then where c is an arbitrary finite rational constant and and Sys.(3) takes the form Parametrization of the resonances in this case was first given in [24]. As we have already mentioned before, these quartets are dynamically irrelevant because there is no nonlinear interaction within these quartets [24].

Tridents
Non-collinear scale-resonances have been studied first in [9,15] in the spectral domain m 2 i + n 2 i ≤ 100 and a special type of quartets named tridents have been singled out. By definition, a wave quartet is called a trident if: 1) There exist two vectors among four in a quartet, say k 1 and k 2 , such that k 1 ↑↓ k 2 , thus they satisfy (k 1 · k 2 ) = −k 1 k 2 ; 2) Two other vectors in the quartet, k 3 and k 4 , have the same length: k 3 = k 4 ; 3) k 3 and k 4 are equally inclined to k 1 , thus The following presentation for a trident quartet has been suggested in [9,15], and two-parametric series of solutions has been written out: with arbitrary integer s, t. It is easy to check that vectors k 1 , k 2 , k 3 , k 4 belong to the same class Cl 1 , with weights and obviously γ 1 + γ 2 = γ 3 + γ 4 , ∀s, t ∈ Z.

Non-tridents
Our study of the resonance solution set in the spectral domain |m i |, |n i | ≤ 1000 shows that not all non-collinear cascading quartets are tridents. They are called further non-tridents, e.g. Notice that, since collinear quartets of gravity water waves have zero interaction coefficients [24], the cluster shown on the right panel can dynamically be regarded as two independent quartets. One of the most important characteristics of the resonance structure is the wavevector multiplicity (introduced in [20]), which describes how many times a given wavevector is a part of some solution. In the Table IV the wavevectors multiplicities are given for non-collinear quartets. It turned out that 91% of all these wavevectors (6720 from overall amount 7384) have multiplicity 1 (counting the 8 symmetry generated solutions as the same quartet.)  In Fig. 1, we see an example of such a simple cluster consisting from just one physical quartet. In the Fig. 6 the cluster of 4 connected quartets is shown (the symmetry generated solutions are omitted), with all together only 7 different wave-frequencies. Obviously, the cluster structure defines the form of dynamical system corresponding to the cluster. The main motivation of our detailed study of clusters is, of course, in constructing an isomorphism (i.e. one-to-one correspondence) between a cluster and a dynamical system. In [21] this construction has been presented for an arbitrary 3-wave resonance system, with triads as primary elements of the planar graph. Its implementation in Mathematica was given in [22], where interaction coefficients similar to Z in (18) were also computed. To construct this isomorphism two following facts were used: 1) in a 3-wave resonance system only scale-resonances exist, and 2) if we add an arbitrary triad to a cluster, in general we always add some new wave-frequencies as well (the only exception is identified in [21]). A 4-wave resonance system does not possess these nice properties; on the contrarythere exist scale-and angle-resonances, and most of the quartets are parts of symmetry generated solution sets. It would be a challenge to develop a general approach to construct dynamical systems for resonance clusters in an arbitrary 4-wave system.

ANGLE-RESONANCES
Until now we have studied the structure of the scaleresonances which are described by (4) and which generate new scales (i.e. new values of |k|, thereby providing the energy cascade mechanism. The angle-resonances represented by (5) do not generate new scales but they can redistribute energy among the modes which were excited initially (or which are forced externally). Taken on their own, these resonances could lead to the thermal equilibrium distribution of the energy and the waveaction among the (initially excited) resonant waves, if the number of such waves is large, or they could lead to a periodical behavior or a strange attractor, if the number of the initially excited modes is small. The important fact, however, is that the scale-and the angleresonances are not independent and can form a mixed cluster containing both types of this resonances [23]. The energy cascade mechanism in such a mixed cluster is presented schematically in Fig.7 where the quadrangles (not shown in Fig.7) via a node-vector (−49, −196).
The energy flux over scales due to the mixed cluster is weak: one wave can participate in a few dozen of angleresonances (see Fig. 8), which means that only a small part of its energy will go to a scale-resonance. Moreover, even this weak energy cascade may terminate at finite wavenumber if it happens to move along a finite cluster which terminates before reaching the dissipation range (or before reaching the range of high frequencies where the nonlinearity gets large enough for the quasiresonances to take over the energy flux from the exact resonances).
Simple algebraic transformations and known parameterizations of the sum of two integer squares (e.g. for a circle or for the Pythagorean triples) yield This is an easy task to check then that the solutions of (12) can be written out (perhaps with repetitions) via five integer parameters s, t, f, g, c (rational solutions should be renormalized to integer). Notice that (11) degenerates to trivial resonances if n = 0, i.e. it does not include any resonances of wavevectors of the form (m, 0), for instance (1,0). In this case the choice f = 1, g = 1 in (13) gives Analytical series are very helpful not only for computing resonance quartets and clusters structure but also while investigating the asymptotic behavior of interaction coefficients. The multiplicity histogram for the angle-resonances is shown in Fig.9. On the axis X the multiplicity of a vector is shown and on the axis Y the number of vectors with a given multiplicity. This graph has been cut offmultiplicities go very high, indeed the vector (1000,1000) takes part in 11075 solutions. All this indicates that the angle-resonances play an important role in the overall dynamics of the wave field.

DYNAMICS
The wave field Once the clusters are found, one can consider an evolution of amplitudes of waves that belong to each individual cluster by considering a respective reduction of the dynamical equation. For the gravity wave case, the appropriate dynamical equation is Zakharov equation for the complex amplitude a k (t) corresponding to the k-mode, where T k,k1 k2,k3 ≡ T (k, k 1 , k 2 , k 3 ) is an interaction coefficient for gravity water waves which can be found in [25].
For very weak waves, amplitudes a k (t) vary in time much slower than the linear oscillations. The factor e i(ω k +ω k 1 −ω k 2 −ω k 3 )t on RHS will rapidly oscillate for most waves except for those in an exact resonance for which this factor is 1. Thus, only the resonant modes will give a contribution to the dynamics in this case and the oscillating contributions of the non-resonant terms will average out in time to zero and will not give any contribution to the cumulative change of a k (t). Leaving only the resonant terms, we have where R means a summation only over k 1 , k 2 and k 3 which are in resonance with k. Obviously, we should consider k's from the same cluster only (i.e. solve the problem for one cluster at a time). Note that the fast timescale of the linear dynamics completely disappeared from this equation. Thus, paradoxically, the dynamics of very weak waves in finite boxes is strongly nonlinear: it is more nonlinear than in WTT which works for larger amplitudes and where quasi-resonances ensure phase randomness. This explains the fact found in the three-wave example that even relatively large clusters often exhibit a periodic or quasi-periodic behavior [26].
A study of the system (17) is possible analytically for small clusters (perhaps even integrating the system in some lucky cases) and numerically for large clusters, which is an interesting subject for future research. Some properties, however, can already be seen in the example of a single quartet which has been studied before [27]. Let us briefly discuss these properties.

A quartet
The dynamical system describing slowly changing amplitudes of a quartet has the form [27]: and Z = T k1,k2 k3,k4 . The mathematical analysis of the system (18) can be performed similar to what has been done in [28] for an integrable 3-wave system of resonantly interacting planetary waves, though computations of the modulus of elliptic integral are more involved and variety of different dynamical scenarios is substantially reacher (see [27] for details). The general answer can be given in terms of Jacobean elliptic functions.
Obviously, the quartets with interaction coefficient Z = 0 do not influence the general dynamics of the wave field at the corresponding time scale. As it was shown in [24], for all collinear quartets Z ≡ 0, and therefore they can be excluded form consideration.
On the other hand, in [29] so-called "degenerate quartets" (tridents in our terminology) have been studied and it was established numerically that they have strictly periodic behavior: after appropriate translation in the horizontal plane, two snapshots of the free-surface taken at t = 0 and t = T are identical.
For a general quartet and for arbitrary and arbitrary initial conditions, the system (18) "does not exhibit strict periodicity" in numerical simulations [27]. Thus, the general formulae for the solutions of (18) have to be studied in more details in order to distinguish periodic and non-periodic dynamics of an arbitrary quartet. On the other hand, since our main interest in this paper is the large-scale dynamics, all scale-resonances with a non-zero interaction coefficient are tridents and therefore demonstrate a periodic time behavior. Of course, if a trident is involved into a cluster with some other quartets then one should be cautious about the predictions obtained for an isolated quartet.

SUMMARY AND DISCUSSION OF RESULTS
• In this paper, we studied properties of deep water gravity waves bounded by a square periodic box. At very small wave amplitudes, when the nonlinear resonance broadening is less than the k-space spacing, WTT fails and only the waves which are in exact four-wave resonance can interact. This situations appears to be typical for all existing numerical simulations [9] and laboratory experiments [10]. Thus, to understand the wave behavior in laboratory experiments and in numerical simulations it is crucial to study exact resonances among discrete wave modes, which was the focus of the present paper. Of course, the notation of "very small amplitudes" has to be worked out explicitly for interpreting the results of laboratory experiments. The smallness of amplitudes is defined by the choice of a small parameter 0 < ε ≪ 1 and depends of the intrinsic characteristics of the wave system, for instance, for atmospheric planetary waves it is usually taken as the ratio of the particle velocity to the phase velocity which allows to obtain explicit estimation [30] for a wave amplitude a(m, n) (correspond-ing to the weakly nonlinear regime) as a function of m and n. For the water surface waves, the wave steepness, |a(m, n)|/(m 2 + n 2 ) 1/2 L, is usually taken as a small parameter ε and ε ∼ 0.1 corresponds then to the weakly nonlinear regime. For such weakly nonlinear waves to feel discreteness of the k-space, their nonlinear frequency broadening has to be less than the distance between adjacent k-modes. In terms of the wave steepness this condition reads ε < (m 2 + n 2 ) −1/8 , see [9,15].
• We found numerically all resonant quartets on the set of 1000 x 1000 modes making use of the q-class method originally developed in [18]. We found that all resonant quartets separate into noninteracting with each other clusters. Each cluster may consist of two types of quartets: scale-and angle-resonances. The angle-resonances cannot transfer energy to any k-modes which are not already present in the system. They cannot carry an energy flux through scales and their main role is to thermalize the initially excited modes. The scale-resonances are much more rare than the angle ones and yet their role is important because they are the only resonances that can transfer energy between different scales. Most of the scale-resonances, but not all, are of the trident type, for which a partial parametrization can be written out explicitly. If one is interested in large-scale modes only, say 100 x 100 domain, then the tridents are the only scaleresonances, which is very fortunate due to the available parametrization.
• Even though the angle-resonances cannot cascade energy, they are important for the overall cascade process because they are involved in the same wave clusters with the scale-resonances. One wave mode may typically participate in many angle resonances and only one scale resonance. Thus, one can split large clusters into "reservoirs", each formed by a large number of angle quartets in quasi-thermal equilibrium, and which are connected with each other by sparse links formed by scale quartets. This structure suggests a significant energy cascade slowdown and anisotropy with respect to the infinite-box limit. Further study is needed to examine the structure of such large clusters and possible energy cascade routes from the region of excitation at low wavenumbers to the dissipative large k range. In the essentially finite domain the situation is opposite. Quite recently results of the laboratory experiments with surface waves on deep water were reported [31,32,33] in which regular, nearly permanent patterns of the water surface have been observed. A feasible way to interpret these results would be 1) to establish that the conditions of the experiments correspond to the weakly nonlinear regime; if yes -to proceed as follows: 2) to compute all exact resonances in the wavelengths range corresponding to those in the experiments; 3) to demonstrate that for chosen wave-lengths and the size of laboratory tank no scale-resonances appear, 4) to attribute the regular patterns to the corresponding angle-resonances. Obviously, the scale-resonances would produce the spectrum anisotropy and disturb the regular patterns.
• We also discussed consequences of the cluster structures for the dynamics, and argued that one should expect a less random and more regular behavior in the case of very low amplitude waves with respect to larger (but still weak) waves described by WTT. More study is needed in future both analytically, for small clusters, and numerically, for large clusters. A particularly interesting question to answer in this case is about any possible universal mechanisms of transition between the regular dynamics to chaos and possible coexistence of the regular and chaotic motions.
• Last not least. The knowledge of the 2D-resonance structure might yield new insights into the origin of some well-known physical phenomena, for instance, Benjamin-Feir (B-F)instability [34] or McLean instability. This is "a modulational instability in which a uniform train of oscillatory waves of finite amplitude losses energy to a small perturbation of waves with nearly the same frequency and direction" [35]. As it was shown recently in [35,36,37], the modulational instability, though well established not only water waves theory but also in plasmas and optics, has to be seriously reconsidered. It turned out that 1) it can be shown analytically that arbitrary small dissipation stabilizes the B-F instability, and 2) results of laboratory experiments show that B-F theory generally over-predicts the growth rate. Moreover, the growth rate changes with the time [35]. Some researchers state even that "... this effect is far less significant than was believed and should be disregarded" [38]. The other way to treat the problem would be to try and and explain the modulational instability through noncollinear (that is, essentially two-dimensional) exact resonances [39]. Similar questions arise in the study of McLean instabilities defined by the magnitudes of the water depth on which surface waves are studied. For instance, as it was demonstrated in [40], in some regimes of shallow water the instabilities are due to higher order resonances among 5 to 8 waves. It would, therefore, be interesting to see how the B-F and McLean instabilities are modified by the finite flume effects and the corresponding discreteness of the wave resonances, and to see what role this could have played in the past laboratory and numerical experiments. Results presented in our paper can be regarded as a necessary first step for such an investigation, and the future work would involve application of the q-class method to computing the higher order resonances which may be involved in modulational instabilities.