% Computing the Hamiltonian property for the
% local operator of the Heisenberg magnet equation
% O.I. Mokhov, Symplectic and Poisson geometry on loop spaces
% of smooth manifolds and integrable equations.
% In S.P. Novikov and I.M. Krichever, editors,
% Reviews in mathematics and mathematical physics,
% volume~11, pages 1--128. Harwood academic publishers, 1998

% R. Vitolo, 05 January 2021

load_package cde;

% Initialization of the jet environment of the differential equation.
indep_var:={x}$
dep_var_equ:={u1,u2}$
% Here we need one argument psi for each dependent variable in dep_var_equ
% in order to generate arguments psi^1,psi^2,psi^3 of the three-vector
% [P,Q]((psi^1_1,psi^1_2),(psi^2_1,psi^2_2),(psi^3_1,psi^3_2))
loc_arg:={psi1,psi2}$
total_order:=10$
% name for output file
resname:="hmag_wnl2_res.red"$

% Defining the local part of the operators
p:=(1/2)*(u1**2 + u2**2 + 1)$

mk_cdiffop(ham_2,1,{2},2);

for all psi11 let ham_2(1,1,psi11) = 0;

for all psi12 let ham_2(1,2,psi12) = - p**2*psi12;

for all psi21 let ham_2(2,1,psi21) = p**2*psi21;

for all psi22 let ham_2(2,2,psi22) = 0;

% Coefficient matrix; syntax: c^{alpha,beta} = c(alpha,beta)
% Tail vector; syntax: w^i_\alpha = w(i,alpha)
mk_wnlop(d,z,1);
d(1,1):=1$
z(1,1):=0$
z(2,1):=0$

% Input for the first wnl operator
ham1:={ham_2,d,z};

% Input for the second wnl operator
ham2:=ham1;

% The list of all distinct non-local variables to be used in the jetspace.
% Each (w^i_\alpha) (with given \alpha) gives rise to 3 distinct
% nonlocal variables \tilde{psi}^a_\alpha, a=1,2,3.
% The format of the list is:
% {nonlocal variable, tail vector, alpha}
nloc_var:={{tpsi,z,1}};

% Preparing the jetspace
dep_var_tot:=cde_weaklynl(indep_var,dep_var_equ,loc_arg,nloc_var,total_order);

% The list of the two names of nonlocal variables for the two operators;
% here the two names can be the same if necessary.
nloc_arg:={{tpsi,z},{tpsi,z}};

% Computing the Schouten bracket
sb_res:=schouten_bracket_wnl(ham1,ham2,dep_var_equ,loc_arg,nloc_arg);

;end;

Local Variables:
mode:reduce
End:
