

(*This file computes the variables from Ch 5 of the paper.
To actually derive the Compatilibity equations, you run
this file with the constants commented out.
To verify that the variables in the
paper really work, uncomment the variables.
At the end you should see a list of 0,s.
This is the list {R1,...,R8}, which are
the 8 relations which are supposed to vanish.

This file is not called by any of the other files.
It is best to run it without loading in any other
files.*)


(*the variables
a0= 1.04089513419341888394 + 0.29367056890017413779 I
b0= -1.17056359766375053197 + 0.11471366227894184414 I
a1= 1.07764793661677308510 - 0.11418655404355694261 I
Z=-0.339650525469147956078290 + 1.03111131757904071611487 I
*)
a0= 1.04089513419341888394 + 0.29367056890017413779 I
b0= -1.17056359766375053197 + 0.11471366227894184414 I
a1= 1.07764793661677308510 - 0.11418655404355694261 I
Z=-0.339650525469147956078290 + 1.03111131757904071611487 I


(*the basic group elements*)
A0={{a0,-1},{1,-a0}}
B0={{b0,-1},{1,-b0}}
A1={{a1,-Z},{1/Z,-a1}}
K={{Z,0},{0,1/Z}}
KK={{1/Z,0},{0,Z}}   (*inverse of K*)


(*the matrices mu, nu, eta are as in Ch 5.2 of the paper*)

(*setting R1=0 gives the relation for a0^2*)
mu=KK.A0.K.K.K.K.K.A0.KK
R1=Tr[mu] 


(*Setting R2=0 gives the relation for b0^2 in terms of
a0^2*)
R2=mu[[1,1]] mu[[2,2]]/mu[[1,2]]/mu[[2,1]] -b0 b0

(*setting R3=0 gives the relation for a0b0*)
nu=KK.KK.B0.K.K.K.K.A0.K 
R3=Tr[nu]

(*setting R4=0 gives the relation for a1^2*)
R4=nu[[1,1]] nu[[2,2]]/nu[[1,2]]/nu[[2,1]]-a1 a1;

(*set R5=0 and solve, to get the relation for Z in
terms of a0^1, a0b0,b0^2.  Note that
Z is called lambda in the paper*)
R5=Expand[Power[Z,14] (nu[[1,2]] nu[[1,2]] - Z Z Z Z nu[[2,1]] nu[[2,1]])];

(*set R6=0 to see that Z satisfies the polynomial
H[Z Z + 1/Z/Z]=0.  This routine is only used when the
variables are uncommented*)
H[x_]:=x x x x x x + x x x x x - 4 x x x x - 3 x x x + 4 x x -2
R6=H[Z Z + 1/Z Z];


(*set R6,R7,R8=0 to check the relations for the matrix eta*)
eta=K.K.A0.K.K.K.K.B0.KK.KK.KK
R6=Expand[eta[[1,1]]-nu[[1,1]]];
R7=Expand[eta[[2,2]]-nu[[2,2]]];
R8=Simplify[eta/nu-{{1,1},{1,1}}];

(* check that H[Z Z +1/Z/Z] divides the second
relation for Z -- i.e. lambda -- from the
compatitility equation.  You need to check this
relation before entering in the variables.
Otherwise you get 0/0.*)


V[n_]:=Power[Z,n]+Power[Z,-n]
(*
R9=Factor[(2 V[5] - V[7] V[8])/H[Z Z + 1/Z/Z]]
*)

Chop[{R1,R2,R3,R4,R5,R6,R7,R8}]



num=V[3] V[3] V[7]+ V[7] V[5] V[5] - 2 V[3] V[5] V[5];
den=V[3] V[7] V[7] -V[3] V[5] V[5] ;



num/den
