WDVV equations: Hamiltonian operators and symbolic computations

We describe software for symbolic computations that we developed in order to find Hamiltonian operators for Witten--Dijkgraaf--Verlinde--Verlinde (WDVV) equations, and verify their compatibility. The computation involves nonlocal (integro-differential) operators, for which specific canonical forms and algorithms have been used.


Introduction
The Witten-Dijkgraaf-Verlinde-Verlinde (WDVV) equations, also known as associativity equations, originated in 2D-topological field theory, but they acquired mathematical interest from the work of B. Dubrovin [6], who showed the deep connections between solutions of WDVV equations and integrable systems of PDEs, in particular, bi-Hamiltonian hierarchies.
Recently [25], we proved that, in low dimensions, the WDVV equations themselves are bi-Hamiltonian systems of PDEs. The proof required sophisticated symbolic computational tools that have been only recently made available [5,4].
In this paper, we would like to describe the algorithms and symbolic software that we developed in order to carry out the computations in [25]. To do that, let us first describe the mathematical problem that we solved. Following [7], in R N we are to find a function F = F(t 1 , . . . ,t N ) such that 1.
The conditions of associativity, or WDVV equations, are the system of PDEs η µλ ∂ 3 F ∂t λ ∂t α ∂t β ∂ 3 F ∂t ν ∂t µ ∂t γ = η µλ ∂ 3 F ∂t ν ∂t α ∂t µ ∂ 3 F ∂t λ ∂t β ∂t γ . (1) Item 1 implies that F can be rewritten as η sk t s t k t 1 + f (t 2 , . . . ,t N ), up to a second degree polynomial of the field variables. This implies that the WDVV system is an overdetermined system in one unknown function f of N − 1 independent variables. A technique introduced in [17] (see also [10]) allows to rewrite the WDVV system as N − 2 commuting quasilinear first-order systems of conservation laws of the form there is only one WDVV equation: Introducing the new coordinates a = f xxx , b = f xxt , c = f xtt we have the compatibility conditions   The above representation allowed to look for a bi-Hamiltonian formalism. That was found in [9]: the right-hand side of (6) was rewritten in two ways where δ /δ u i stands for the variational derivative, H 1 and H 2 are two Hamiltonian densities and A 1 , A 2 are two compatible local Hamiltonian operators. Here, 'compatible' means that the pencil A 1 + λ A 2 is a Hamiltonian operator for every value of the parameter λ . We recall that the Hamiltonian property for a differential operator is equivalent to differential conditions on its coefficients, to be discussed later. Such a property is crucial for the integrability of the system of PDEs. Only a few other examples of bi-Hamiltonian WDVV systems were known until recently. In [25] we were able to prove that, for N = 3, all WDVV systems admit a bi-Hamiltonian formulation, with Hamiltonian operators of the form with suitable Hamiltonian densities H 1 and H 2 . We observe that A 1 is a nonlocal firstorder homogeneous Hamiltonian operator of Ferapontov type [8]. That is a member of a more general family of nonlocal operators, namely weakly nonlocal operators, that is discussed in [5]. In this context, 'nonlocal' means integro-differential operator (derivatives are taken with respect to the variable x). A 2 is a local third-order homogeneous Hamiltonian operator in canonical form [11,12]. See more on these operators in next Section. One of the computations that is needed in order to prove the bi-Hamiltonian property is the compatibility of the operators. That is made difficult by the fact that one of the operators is weakly-nonlocal (the Ferapontov operator A 1 ). The computation has been made possible by the recent computer algebra packages developed in [4].
Here we will describe how we used the Reduce computer algebra system, see https://reduce-algebra.sourceforge.io/, and its CDE package in particular (see [14] for a general description and [4] for calculations with weakly-nonlocal operators) in the nontrivial calculations that led to the results presented in [25]. We also checked some of the computations in Maple using the package jacobi.mpl from [4]. Maple was also used in a significant part of the computation in the case N = 5.
All files that are described in the text can be found in a GitHub repository. The files are also downloadable as a single .zip file, see [26].
2 Computing the first-order Hamiltonian operator A 1 Below we will focus on finding a first-order, weakly nonlocal Hamiltonian operator of Ferapontov type.
In the expression (8) (g i j ) is a non-degenerate matrix of functions of the field variables (u i ), whose inverse (g i j ) can be interpreted as a covariant 2-tensor. The matrix V i q is just the Jacobian of the vector function (V i ) of the fluxes of the system (3), and α, β , γ are three constants.
The Hamiltonian property of A 1 is equivalent to the following conditions [8]: g i j is symmetric; -Γ i jk = −g js Γ si k are the Christoffel symbols of g i j , regarded as a metric; the identities: hold, where ∇ denotes the covariant derivative with respect to the Levi-Civita connection of g i j and R i j kl = g is R j skl is the Riemannian curvature tensor. The above conditions also imply that the operator is a Hamiltonian operator for the system of PDEs (3) [24,27].
Thus, finding an operator (8) actually reduces to finding the constants α, β and γ and the metric g i j . However, finding the metric in general is by no means an easy computational task. To this end, we shall use a theorem from [2] which states that the metric of a first-order Hamiltonian operator for a non-diagonalizable quasilinear first-order system in n = 3 unknown functions is proportional to a contraction of the square of the Haantjes tensor: We recall that the Haantjes tensor is obtained from (V i ) and its derivatives by means of a straightforward formula (see [25]). After this simplification we are left with a much less demanding computational problem -we need to find one unknown function f (u) and the above constants. To this end, we will use a computer algebra system to determine our unknowns.

The computation
The computation of a nonlocal first-order operator is divided into three smaller steps. Firstly, we will write down the candidate metric g i j = f H i j and check (10a). Next we will solve the equation (10b) which will yield an explicit form of the metric g i j and as a final step, we find the constants α, β and γ after plugging the found metric into the condition (10c). We will concentrate on a case from Mokhov-Pavlenko's classification [18], where the determining matrix η has the following form: since it is not as computationally demanding and can be solved in full generality with respect to the constants λ , µ. The WDVV equation takes the form: After introducing the coordinates u 1 = f xxx , u 2 = f xxt , u 3 = f xtt we obtain the firstorder WDVV system in conservative form: All files used for computation are available at a GitHub repository [26].

The first step
The following computation can be found in the file WDVV-3c-Eta4\dne3 lho2.red.
In Reduce, we start by loading the package cde and initialization of our environment by the following sequence: followed by initialization of the right hand-side of the system: where the last element is just the WDVV equation. Next, define the velocity matrix V i j (and its operator) of our system: nc:=length(dep_var); matrix av(nc,nc); for i:=1:nc do for j:=1:nc do av(i,j):=df(part(de,i),part(ford_var,j)); operator avt; for i:=1:ncomp do for j:=1:ncomp do avt(i,j):=av(i,j); We also need to load a riemann4.red library in order to generate the Nijenhuis and Haantjes tensors by the commands: generate_all_nt(avt,dep_var); generate_all_ht(avt,dep_var); And finally the contraction of the square of Haantjes tensor is obtained by: and save the result hmet for later computations. We remark that, by construction, hmet is a rational function of the field variables u1, u2, u3 and the parameters lam, mu.

The second step
The following computation can be found in the file WDVV-3c-Eta4\dne3 lho3.red. We, again, start by initializing the environment as in previous step. After constructing the velocity matrix V i j and loading the previous result we proceed to defining the metric g i j as a functional factor of the contraction of the square of the Haantjes tensor: for each el in dep_var do depend f,el; gl1:=f*hmet; Besides the metric itself, we will need its inverse g i j and Christoffel symbols of the third kind Γ i j k (which are constructed inside the package riemann3.red by means of Christoffel symbols of the first and second kind): gu1:=gl1^(-1); operator gl1_op,gu1_op; for i:=1:nc do for j:=1:nc do gl1_op(i,j):=gl1(i,j); for i:=1:nc do for j:=1:nc do gu1_op(i,j):=gu1(i,j); generate_all_chr1(gl1_op,chr1_,dep_var); generate_all_chr2(gl1_op,gu1_op,chr1_,chr2_,dep_var); generate_all_chr3(gl1_op,gu1_op,chr2_,chr3_,dep_var); operator gamma_hi; for i:=1:nc do for j:=1:nc do for k:=1:nc do gamma_hi(i,j,k):=mk_chr3(chr3_,i,j,k); To find the coefficients of the metric we will use the condition (10b) which is in our case equivalent to: Hence, we first construct the left and right hand-side respectively: operator ag1; for all s,i,j let ag1(s,i,j)= (for k:=1:nc sum av(k,j)*gamma_hi(s,i,k)); operator ag2; for all s,i,j let ag2(s,i,j)= (for k:=1:nc sum av(s,k)*gamma_hi(k,i,j)); and we assemble the system: total_eq:= for i:=1:nc join for j:=1:nc join for s:=1:nc collect ag1(s,i,j) -ag2(s,i,j); Using the package crack, a solver of overdetermined systems of PDEs [28,29], we obtain a solution for our unknown function f (u) by the following sequence: Then by a mere substitution, have the explicit form of the metric g: gl1:=sub(sol_unk,gl1); gu1:=sub(sol_unk,gu1); We again export this result in order to finish the final step -finding the nonlocal part of the first-order operator.

The third step
The following computation can be found in the file WDVV-3c-Eta4\dne3 lho4.red. At last, we need to find the nonlocal tail of the operator A 1 . We simply need to plug everything we found into the condition (1) and see for which values of constants α, β , γ it is satisfied.
As usual, we initialize the environment. As an addition to that we load the results from the previous file and then construct the metric and generate all Christoffel symbols Γ i j k : Let us also define the identity matrix which will represent the Kronecker δ i j : idm:=mat((1,0,0),(0,1,0),(0,0,1)); and finally assemble the condition (10c): eq_curv:=for i:=1:nc join for j:=1:nc join for k:=1:nc join for h:=1:nc collect The system is a rational expression that should vanish for any value of the field variables u1, u2, u3. That yields an overdetermined linear system on the coefficients alpha, beta, gamma that can be solved only if alp=mu, bet=0, gam=lam. The substitution: yields a list of non-zero equations in terms of the parameters mu, lam. However, we should check only for all the possible combinations of the values of constants µ, λ : which finally yields four lists of zeroes.
The metric g i j that defines A 1 , according with the expression (8), is: 3 Computing the third-order Hamiltonian operator A 2 To find a bi-Hamiltonian structure for the system (3) we need a second Hamiltonian operator compatible with A 1 . It was proved in [25] that in the case N = 3, 4 and 5 the WDVV systems admit a third-order homogeneous Hamiltonian operator in the canonical form (we always require det (h i j ) = 0; (h i j ) denotes the inverse matrix). We recall that the Hamiltonian property of A 2 is equivalent to the conditions and that the equation (17b) implies that h i j is a Monge metric [11,12]. For computational purposes, that implies that the coefficients h i j are quadratic polynomials of the field variables. Then, it is also known [13] that the conditions under which a third-order Hamiltonian operator is the Hamiltonian operator for a quasi-linear system of first-order conservation laws are: Thus, with respect to the problem of finding a third-order operator for WDVV systems, knowing the vector of fluxes (V i (u)) reduces the above system of equations to a linear system of algebraic equations in the coefficients of the quadratic polynomials h i j that can be solved in short time for small values of N.
For the particular example that we discussed in the previous section (system (14)) we can easily solve the system (18) and verify that the unique solution h i j that we get fulfills the conditions (17b) and (17c). This implies that h i j generates a thirdorder homogeneous Hamiltonian operator (16) using the formula (17a). We have the expression: As this computation is not using any special package, there is no need to go into details in the code itself. The computation is provided in the file WDVV-3c-Eta4\ wdvv 3ord op eta4.red 4 Compatibility of the Hamiltonian operators A 1 , A 2 A bi-Hamiltonian system is just a system of PDEs which is Hamiltonian with respect to two Hamiltonian operators, A 1 and A 2 in our case, which are compatible. The compatibility condition can be either checked by means of the requirement that the pencil A 1 + λ A 2 is a Hamiltonian operator for every value of the parameter, or, equivalently, by computing the Schouten bracket [A 1 , A 2 ] (see [5]).
However, tensorial conditions which are equivalent to the compatibility condition of A 1 and A 2 as in our case are not available. So, the calculation should be made through the definition, which makes a pen-and-paper approach to the problem almost completely unfeasible. This is also due to the fact that an algorithm to do the calculation in the nonlocal case was missing until recently. A computational algorithm [5] and software packages [4] became available a short time ago. Through this software we checked the compatibility of the operators A 1 and A 2 .
All de:={u2_x, u3_x, td((mu*u2^2 -mu*u1*u3 + lam*u3^2 -1)/(lam*u2),x)}; From now on, we initialize the Ferapontov operator A 1 . The metric of the firstorder operator is loaded from another file: in "dne3_lho3_res.red"; gu1:=gl1**(-1); To construct the local part we further need to initialize the Christoffel symbols Γ i j k in the same way as before. We construct the local part of the operator by the following lines: We assemble the local part: 1,{3},3); for all i,j,psi let ham2_l(i,j,psi) = td( gu3(i,j)*td(psi,x,2)+c_hi_con(i,j)*td(psi,x), x); and even though there is no nonlocal part, we need to introduce a zero tail: mk_wnlop(d,z,1); d(1,1):=0; for i:=1:nc do z(i,1):=0; and put the two parts together: ham2:={ham2_l,d,z}; All that remains to do is to configure the nonlocal variables. Here we have two distinct operators so we need three nonlocal variables and their names will be different this time: Thus we have proved by a direct computation that previously found operators A 1 and A 2 are compatible Hamiltonian operators.

A computation in Maple using jacobi
In this section we describe another tool which might be used to check if a weakly nonlocal operator is Hamiltonian and possibly compatible with another one: the package jacobi [4]. Since that package is written in Maple some readers might find it more convenient, and we thought that it is worth to explain how to achieve the same result with a different computer algebra system.
The main structural difference with the computation in the previous section is that jacobi uses the language of distributions, which is more popular among Theoretical Physicists.
The plan is the same as before, we need the metrics of both operators to generate their local parts and the three constants for the nonlocal part. However the notation is slightly different and that will be the main point of this section.
For the following computation we also need the external Maple library jacobi.mpl which can be found on [23]. The computation itself is contained in the file WDVV-3c-Compat Example Eta4.mw. For simplicity, we consider λ = µ = 1 for this case.
We start by constructing A 1 . The metric is declared as follows: where by u[1, x, 0] we denote in our case u 1 0x (with the convention u 0x = u). Other coefficients are defined in a similar way. After the matrix, we need the Christoffel symbols which can be computed in Maple or, if we have them available from previous computations, input them as a three-dimensional field: and so on. Next, we input the two tail vectors W1X and W1Y which in this notation differ only by using a different symbol for the independent variable. The W1X is introduced as follows: Next for the third-order operator we need its metric h i j as well as constants c i j k . We input the metric, denoted by g3, as before and similarly to Christoffel symbols for the previous metric the constants c i j k are handled as a three-dimensional field:  . N, 1 .. N, 0  We can then proceed to computing the Schouten bracket itself. We load the package jacobi by: The bracket is calculated by the following command and saved into an array T3:

Large scale computations
While doing the above computations for N = 3 is not a time demanding task, the situation quickly changes for N = 4, where just finding the third-order operator usually takes around 5 hours on an average PC. To obtain the results for N = 5 in a similar way one would have to have an access to a huge amount of computational resources.
In this section, we describe the way in which we found the third-order operators in the case N = 5 (results in [25]). Since we did not even try to find a first-order operator when N = 5, we will not deal with related problems. Only partial results are known in the case N = 4 [20].
There are two ways how to approach this problem. First, we could find a powerful enough machine to handle this computation. However, we are talking about hundreds of GB of RAM memory and possibly a week of computing time.
The other option is to optimize the computation itself, so that it not so resourcedemanding. It can be done in a few ways, but the most effective at the beginning is to reduce the number of equations we try to solve at once.
As both approaches were used to obtain the results for N = 5 let us explore those below in more detail. All files used below are in a separate folder \WDVV-5c-Large scale.

Using a supercomputer
If you have an access to a supercomputer it could be beneficial to try to use a rather "brute force" approach. Given the fact we cannot say for sure how many equations need to be solved in order to obtain the solution, it is by far the best first try.
To obtain the result in case of N = 5 for a canonical choice of η we have used the whole super-computing grid provided by a virtual organization CESNET -Meta-Centrum. The command to start the computation on the grid can be found in the file starter.sh.
It is also important to mention that we need to provide the file with the generated system in the conservative form as the algorithm has not been transferred into Maple yet. The algorithm itself is contained inside the file w10 hydro system gen.red whose output file (w10 eta2 eq.red) is then loaded into Maple. Finding the quasilinear system in the conservative form using an algorithm was described in detail in [25] and is an interesting computational problem. However, since the program literally follows the steps described there, we will omit repeating the details. Note that some syntax adjustments are required before importing.
After we obtain the result from a remote computation it is important to have an independent check. We will use Reduce, file w10 ham1 eta2 check.red. We initialize as usual: where in the files w10 eta2 eq.red and w10 eta gl3.red we saved the general WDVV system and the result of the computation -the metric h i j respectively which again needs to be transformed into the proper syntax.
Then we need to confirm that the equations (18) holds for the metric h i j already in place (in form of the constants c i jk ) to confirm the compatibility with the first-order system. Lastly we need to check the Hamiltonian condition which we assemble by: gu3:=gl3**(-1); for k:=1:nc do for l:=1:nc do for m:=1:nc do for n:=1:nc do << if df(c_lo(m,n,k),part(dep_var,l)) + ( for i:=1:nc sum ( for j:=1:nc sum ( gu3(i,j)*c_lo(i,m,l)*c_lo(j,n,k) )) ) neq 0 then rederr "Error -not Hamiltonian!" >> which also passes in our case and confirms the result obtained by a super-computation.

Simplifying the computation
If we look into the algorithm we can quickly realize that it is massively inefficient in the sense of computational resources. The unknowns are exactly the coefficients of the quadratic polynomials in the metric of the third-order operator. In the case of N = 5 we need to find 1540 unknown constants.
On the other hand, the conditions (18) generate 2100 equations but those equations are polynomial with respect to the field variables. We need to collect the coefficients of each monomial out. There will be an immense amount of those collected equations. Just for comparison, in the case N = 4 we have 231 unknown coefficients, slightly more than 450 equations polynomial in the field variables and we generate around 350,000 of such linear equations.
It is now obvious that solving all of the collected equations is completely unnecessary and in this case a waste of resources. We could try to make an algorithm that will solve only a few of the equations which are polynomial in the field variables at once, plug the result into the rest and repeat the process batch by batch until all the equations are solved. This process could work, however, it is very hard to predict how much resources it will consume and what is the optimal size of the mentioned batch. The two extreme cases being the batch is too small and the number of iterations will project into the time of the computation or the batch being too big literally clogging the memory and maybe never finish.
There is certainly enough space to optimize the whole process of solving those massively over-determined system of linear equations. However, by experiment we have found out that in our case there are around 60 equations out of the original 2100 polynomial ones needed to completely solve the posed problem. They originate from the system (20) below.
Also, saving partial results in the whole process is an absolute must. While the setup of the problem does not consume much time, relative to solving it, it is much easier to plug in a partial result from earlier and continue the computation.
More specifically, instead of solving the whole set of equations (18) we can simply restrict the system to This computation takes around 8 hours on an average PC and the result is checked in the same way as in the previous case.

Conclusions
In this paper we described the computations that we performed in [25] in order to support the conjecture that all WDVV equations are endowed with bi-Hamiltonian formalism. These are symbolic software calculations that are nontrivial under both the viewpoint of the mathematical algorithm and the viewpoint of the symbolic programming that is needed to achieve the goal. However, we think that further computational goals might be achieved to support and broaden the above conjecture.
-First of all, in the N = 4 case the bi-Hamiltonian property has been proved only for one of the two canonical forms of η, η (1) . This was a result found in [20]. For the system arising from the second canonical form η (2) we found a third-order operator but we haven't even tried to find a first-order operator. It should be said that the method that we used in the case N = 3, coming from a characterization in [2], is not applicable in higher dimensions, hence the calculation might be a real challenge. Of course, the case N = 5 is even harder. A way to find a first-order operator might be to restrict the search to matrices g i j of rational functions of a certain degree. This common pattern can be observed in our examples (see also [25]) and might greatly simplify the search.
More generally, it should be possible to program a cde or jacobi computation of all first-order nonlocal operators that are compatible with a given third-order operator. This is a task for a future research project. -Then, there is a well-known generalization of the WDVV equations, the oriented associativity equation [15]. These equations and the associated geometric structures are called F-manifolds with compatible flat structures [16], or simply flat F-manifolds. They share many properties with WDVV equations and Dubrovin-Frobenius manifolds including the existence of an associated integrable dispersive hierarchy (see [1] for details). We observe, in particular, that the oriented associativity equation has an infinite hierarchy of nonlocal symmetries [22], a first-order local Hamiltonian operator of the same type as A 1 [19] and a third-order nonlocal Hamiltonian operator which is the straightforward generalization of A 2 [3,21]. Until now, the results on Hamiltonian operators are known only for one of the simplest cases of oriented associativity equation; more calculations are needed in order to support a conjecture on the bi-Hamiltonianity of the F-manifold equation. Indeed, the compatibility of A 1 and A 2 is still an open question even in the simplest case, see [21] for a discussion.
The above problems are on our schedule.