#makeSomeRings: makes all "ring" eigenfunctions (eigenvalue 5) at a given level where the rings are in # triangles of length trilength. starts writing functions at startfunc, and returns the next # free function number makeSomeRings:=proc(T,lvl,trilength,startfunc) local func, tris, t; if (lvl < 2) then return(startfunc); end if; if (trilength > (lvl - 2)) then return(startfunc); end if; func:=startfunc; if (trilength=0) then tris:=[[]]; else tris:=p([0,1,2],trilength); end if; for t in tris do makeRing5(T,lvl,func,t); func:=func+1; end do; return(func); end; #makeAllRings: makes all "ring" eigenfunctions (eigenvalue 5) at a given level of any valid triangle length. # starts at starfunc. returns a list. The entries in the list are starting function numbers for triangles # of each length (last one is the next free function number) makeAllRings:=proc(T,lvl,startfunc) local vm, i, func, newlevels, trilengths, l; if (lvl < 2) then return([startfunc]); end if; vm:=vertices(lvl); make_neighbors(T,lvl,vm); func:=startfunc; i:=1; for trilengths from (lvl-2) by (-1) to 0 do newlevels[i]:=func; func:=makeSomeRings(T,lvl,trilengths, func); i:=i+1; end do; newlevels[i]:=func; l:=[seq(newlevels[j], j=1..i)]; return(l); end; #makeOrthoEigen5: calls makeAllRings, and orthogonalizes them using the Gram-Schmidt Orthogonalization process. # writes out the functions to the path you give it. returns the number of functions it writes out (I think) makeOrthoEigen5:=proc(T,lvl,path) local newlevels, startfunc, i, j, k, l; newlevels:=makeAllRings(T,lvl,12); if (nops(newlevels) >= 2) then for i from newlevels[1] to (newlevels[2]-1) do normalizeFunc(T,lvl,i); numericFunc(T,lvl,i); end do; end if; startfunc:=newlevels[nops(newlevels)]; if (nops(newlevels) > 2) then for i from 2 to (nops(newlevels)-1) do for j from newlevels[i] to (newlevels[i+1]-1) do l:=[seq(m,m=newlevels[1]..(newlevels[i]-1)),j]; oneGramSchmidt(T,lvl,l); end do; end do; end if; makeEdge5(T,lvl,startfunc,[0,1]); if (nops(newlevels) >= 2) then l:=[seq(m,m=newlevels[1]..(startfunc-1)),startfunc]; oneGramSchmidt(T,lvl,l); else normalizeFunc(T,lvl,startfunc); end if; startfunc:=startfunc+1; makeEdge5(T,lvl,startfunc,[1,2]); l:=[seq(m,m=newlevels[1]..(startfunc-1)),startfunc]; oneGramSchmidt(T,lvl,l); startfunc:=startfunc+1; j:=1; for i from newlevels[1] to (startfunc -1) do saveFunc(T,i,lvl,cat(path,"ortheigen5level",lvl,".",j)); j:=j+1; end do; j:=j-1; return(j); end;