






(*heritian linear algebra:

This file contains some basic linear algebra 
routines.  These routines are used by the
file gamma47 to compute the generators for the
group Gamma(4,7). 

*)

(*the hermitian form: type (2,1) form*)
DOT[X_,Y_]:=X[[1]] Conjugate[Y[[1]]]+
            X[[2]] Conjugate[Y[[2]]]-
	    X[[3]] Conjugate[Y[[3]]]



(*box, or hermitian cross, product*)
CROSS[X_,Y_]:=Conjugate[{X[[3]] Y[[2]]-X[[2]] Y[[3]],
			 X[[1]] Y[[3]]-X[[3]] Y[[1]],
			 X[[1]] Y[[2]]-X[[2]] Y[[1]]}]


(*distance formula*)
DELTA[x_,y_]:= DOT[x,y] DOT[y,x]/DOT[x,x]/DOT[y,y]
DIST[x_,y_]:=ArcCosh[Sqrt[DIST[x,y]/2]]


(*inversion*)
Inv[X_,z_]:=-z+2 DOT[z,X]/DOT[X,X] X


(*standard basis*)
e1={1,0,0};
e2={0,1,0};
e3={0,0,1};


(* discriminant, and discriminant of trace*)
Disc[z_]:=Abs[z]^4-8 Re[z^3]+18 Abs[z]^2 -27
DISC[M_]:=Disc[Tr[M]]  


(* projectivization map*)
PROJ[X_]:={X[[1]]/X[[3]],X[[2]]/X[[3]],1}


(* angular invariant*)
Ang[a_,b_,c_]:=Arg[-DOT[a,b] DOT[b,c] DOT[c,a]]/Pi;


