alex_twist.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
-- Copyright (C) 2002 Kouji KODAMA
-- 2002/12 twisted Alexander based on ALEXMAT class.
--K. Kodama


class ALEXMAT_TWIST

class ALEXMAT_TWIST is shared AMat:MAT_POLYS_INTI; shared jPivot:ARRAY{INT}; shared rep_deg:INT; -- degree of representation matrix shared num_gen:INT; -- number of generatrs shared trimN:INT; -- number of free generators shared trimC:INT; -- component of over bridge of deleted relation shared Relator:ARRAY{WORD}; shared g2c:ARRAY{INT}; -- map: generator to comploent shared compoN:INT; -- #of component WriteMatrix(p0:INT) is LOGOUT::Title("Alexander","matrix"); zFlg:BOOL; zFlg:=true; degR::=AMat.nr; degG::=AMat.nc; --if p0>degR then p0:=degR; end; --if p0>degG then p0:=degG; end; -- Alexander matrix is the form of -- \pmatrix{ -- diagonal & 0 \cr -- 0 & matrix \cr -- } if (degR=degG)and(p0=degR-1) then p0:=degR; end; -- Write diagonal part. d0:INT:=(p0).min(degR).min(degG);-- length of diagonel part loop i::=1.upto!(trimN); zFlg:=false; #LOGOUT+"diagonal part: 0\n"; end; loop i::=0.upto!(d0-1); j::=jPivot[i]; if (~AMat[i][j].is_one)and(~AMat[i][j].negate.is_one) then zFlg:=false; #LOGOUT+"diagonal part: "+AMat[i][j].str("tex","t",true)+"\n"; end; end; -- Write other part if (p0<degR)or(p0<degG) then sub1:ARRAY{INT}:=#(degR-p0); loop sub1[0.up!]:=p0.upto!(degR-1); end; sub2:ARRAY{INT}:=#(degG-p0); loop sub2[0.up!]:=jPivot[p0.upto!(degG-1)]; end; #LOGOUT+AMat.sub_matrix(sub1,sub2).str_pmatrix("t"); if (p0<degR)and(p0<degG) then zFlg:=false; end; end; if zFlg then #LOGOUT+"0\n"; end; LOGOUT::flush; end; MakeMatrix(TCode:TCODE,Rep:ARRAY{MAT_POLYS_INTI},RepR:ARRAY{MAT_POLYS_INTI}) is -- RLength rep_deg:=Rep[0].nc; KNOT_GROUP::get_Relator(TCode, out Relator, out g2c); #OUT+"Rel:\n"; loop i::=Relator.ind!; #OUT+Relator[i].str+"\n"; end; trimN:=0; trimC:=0; compoN:=TCode[TCode.length].compo; g:INT:=g2c.size-1; -- # of generators num_gen:=g; r:INT:=Relator.size; -- # of relators jPivot:=#(g*rep_deg); loop i::=jPivot.ind!; jPivot[i]:=i; end; AMat:=#(r*rep_deg,g*rep_deg); AMat.clear; if (r=0)or(g=0) then return; end; warr:MAT_POLYS_INTI:=#(rep_deg,rep_deg); warr.to_unit; p_one::=POLYS_INTI::one; p_x::=#POLYS_INTI(1.inti,1); loop i::=0.upto!(r-1); -- Make relation matrix with Fox's free differential -- w=(a b a~ c~) or (a b c~ b~) AMat.plus(warr,i*rep_deg,(Relator[i][0]-1)*rep_deg); warr:=warr*Rep[Relator[i][0]]; AMat.plus(warr*p_x,i*rep_deg,(Relator[i][1]-1)*rep_deg); if Relator[i].w.has_ind(2) then warr:=warr*Rep[Relator[i][1]]*RepR[-Relator[i][2]]; AMat.minus(warr*p_x, i*rep_deg, (-Relator[i][2]-1)*rep_deg); end; if Relator[i].w.has_ind(3) then warr:=warr*RepR[-Relator[i][3]]; AMat.minus(warr, i*rep_deg, (-Relator[i][3]-1)*rep_deg); end; --#OUT+"AMat "+i.int+"-th relation:"+"\n"; end; end; trimMat1(TCode:TCODE) is trimN:=0; -- Set # of "0" element. delR,delG:INT; pt:INT:=0; word:WORD; if TCode.has_band then -- 2-dim knot/link res::=KNOT_GROUP::getCrossR(TCode, inout pt, out word); if res and (pt<TCode.bandStart) then ; end; else -- 1-dim knot/link -- delete a crossing relation res::=KNOT_GROUP::getCrossR(TCode, inout pt, out word); if res and (pt<TCode.bandStart) then trimN:=rep_deg; delR:=1; delG:=word[1]; trimC:=g2c[delG]; loop i::=(delR*rep_deg-1).downto!((delR-1)*rep_deg); AMat:=AMat.minor_matrix_row(i); end; loop i::=(delG*rep_deg-1).downto!((delG-1)*rep_deg); AMat:=AMat.minor_matrix_column(i); end; jPivot:=#(AMat.nc); loop i::=jPivot.ind!; jPivot[i]:=i; end; end; end; end; AlexPoly(p0:INT, out apoly:POLYS_INTI) is apoly:=POLYS_INTI::one; if AMat.nr/=AMat.nc then #OUT+"Alexander matrix is not square.\n"; apoly:=POLYS_INTI::zero; return; end; pw:POLYS_INTI; -- work -- diagonal part countz::=0; -- count "0" loop i::=0.upto!(p0-1); pw:=AMat[i,jPivot[i]]; if pw.is_zero then countz:=countz+1; else apoly:=apoly*pw; end; end; -- non-diagonal part if countz+trimN<=rep_deg then if p0<AMat.nr then mat::=AMat.copy; jPivotm::=jPivot.copy; loop i::=0.upto!(p0-1); mat:=mat.minor_matrix(0,jPivotm[i]); loop j::=i.upto!(jPivotm.size-1); if jPivotm[j]>jPivotm[i] then jPivotm[j]:=jPivotm[j]-1; end; end; end; apoly:=apoly*mat.det; end; else apoly:=POLYS_INTI::zero; end; if apoly.is_zero.not then apoly:=apoly.shift_deg(-(apoly.low_deg)); --if (trimN=1)and(compoN>1) then -- apoly:=apoly/(#POLYS_INTI(1.inti,1)-1.inti); --end; if apoly.substitute(1.inti)<0.inti then apoly:=-apoly; end; end; end; APolyOut(p0:INT) is pa:POLYS_INTI; AlexPoly(p0,out pa); ALEXMAT::printApoly(pa); end; AlexMat(TCode:TCODE, Rep:ARRAY{MAT_POLYS_INTI},RepR:ARRAY{MAT_POLYS_INTI}) is -- Rep/RepR: Representation / reverse -- Rep[i] : image of generator x_i. -- Rep[0] : not used. #LOGOUT+"\n"; num_gen:=Rep.size-1; if num_gen<=1 then #LOGOUT+"The "; if TCode[TCode.length].compo=1 then #LOGOUT+"knot"; else #LOGOUT+"link"; end; if num_gen=0 then #LOGOUT+" is empty."; else #LOGOUT+" is Trivial."; end; LOGOUT::flush; return; end; rDeg:INT; POLYS_INTI::init; MakeMatrix(TCode,Rep,RepR); LOGOUT::LogTime; WriteMatrix(0); LOGOUT::flush; trimMat1(TCode); MAT_POLYS_INTI_REDUCTION::reduce(inout AMat,out jPivot,out rDeg); WriteMatrix(rDeg); LOGOUT::flush; if ~TCode.has_band then APolyOut(rDeg); end; #LOGOUT+"\n"; LOGOUT::flush; AMat:=#(0,0); end; end;