Skip to content

Commit

Permalink
pre-release tweaks for 1.61
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamknockillaree committed Jan 5, 2024
1 parent 6ee53d5 commit fa4df59
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 78 deletions.
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SetPackageInfo( rec(
PackageName := "HAP",
Subtitle := "Homological Algebra Programming",
Version := "1.61",
Date := "12/12/2023",
Date := "02/0q/2024",
License := "GPL-2.0-or-later",

SourceRepository := rec(
Expand Down
2 changes: 1 addition & 1 deletion date
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12 Dec 2023
02 Jan 2024
1 change: 1 addition & 0 deletions doc/Test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@
<C>HAP_PERMMOVES_DIM_2</C><Br/>
<C>HAP_PERMMOVES_DIM_3</C><Br/>
<C>HAP_XYXYXYXY</C><Br/>
<C>HAP_type</C><Br/>
<C>HAPchildFunctionToggle</C><Br/>
<C>HAPchildToggle</C><Br/>
<C>HAPchildren</C><Br/>
Expand Down
8 changes: 4 additions & 4 deletions doc/Undocumented.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Chapter><Heading>HAP variables that are not yet documented</Heading>
<Section><Heading> &nbsp;</Heading><Br/><C>2CoreducedChainComplex</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Section><Heading> &nbsp;</Heading><C>2CoreducedChainComplex</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>AbelianGOuterGroupToCatOneGroup</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
Expand Down Expand Up @@ -1398,6 +1398,9 @@
<URL><Link>../www/SideLinks/About/aboutKnotsQuandles.html</Link><LinkText>10</LinkText></URL>&nbsp;
<Br/>
<Br/>
<C>Category_Of_Groups</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <URL><Link>../www/SideLinks/About/aboutAbelianCategories.html</Link><LinkText>1</LinkText></URL>&nbsp;
<Br/>
<Br/>
<C>ElementsSL2Z</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>HAP_knot_census</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
Expand Down Expand Up @@ -5840,9 +5843,6 @@
<Br/>
<C>CATONEGROUP_DATA_SIZE</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>Category_Of_Groups</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <URL><Link>../www/SideLinks/About/aboutAbelianCategories.html</Link><LinkText>1</LinkText></URL>&nbsp;
<Br/>
<Br/>
<C>Cedric_PlanarDiagram</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>ChildKill</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
Expand Down
57 changes: 38 additions & 19 deletions lib/CatGroups/identities.gi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local
Boundary,
Elts, Mult, Inv,
Frels, rels,
Fgens,gens,
Fgens,gens,gens2,
FirstBoundaryHomomorphism,
Boundary2Relator,
start,
Expand All @@ -20,7 +20,7 @@ local
COLOURS,
tmpDir,tmpInlog,tmpIn2log,tmpIngif,
AppendTo, PrintTo,
b, r, x,i,X;
b, r, x,i,X,pos;

AppendTo:=HAP_AppendTo;
PrintTo:=HAP_PrintTo;
Expand Down Expand Up @@ -54,8 +54,8 @@ Dimension:=R!.dimension;
Boundary:=R!.boundary;
Elts:=R!.elts;
Frels:=[];
start:=List([1..Dimension(2)],x->List(Boundary(2,x),y->y[2]));
start:=SortedList(Intersection(start))[1];
#start:=List([1..Dimension(2)],x->List(Boundary(2,x),y->y[2]));
#start:=SortedList(Intersection(start))[1];
gens:=[];


Expand All @@ -72,7 +72,7 @@ end;
Inv:=function(g)
local pos;
pos:= Position(Elts,Elts[g]^-1);
if pos=fail then Add(Elts[g]^-1); pos:=Length(Elts); fi;
if pos=fail then Add(Elts,Elts[g]^-1); pos:=Length(Elts); fi;
return pos;
end;
#####################################################################
Expand All @@ -91,8 +91,12 @@ end;
Boundary2Relator:=function(b)
local c, rel, w;

b:=SortedList(AlgebraicReduction(b));
rel:=[start];
rel:=[b[1][2]];
#b:=SortedList(AlgebraicReduction(b));
b:=SortedList(b);
#rel:=[start];



while Length(b)>0 do
for x in b do
Expand All @@ -116,11 +120,21 @@ Append(Frels,[Boundary2Relator(Boundary(2,r))]);
od;

for r in Frels do
if (not Inv(r[2]) in gens) then AddSet(gens,r[2]);fi;
if (not Inv(r[Length(r)-1]) in gens) then AddSet(gens,r[Length(r)-1]);fi;
for i in [1..Length(r)-1] do
Add(gens, Mult( Inv(r[i]), r[i+1]));
od;
Add(gens, Mult( Inv(r[Length(r)]), r[1]));
od;

gens2:=SSortedList(gens);

gens:=[];
for i in gens2 do
if not (i in gens or Inv(i) in gens) then Add(gens,i); fi;
pos:=Position(gens,i);if not pos=fail and Inv(i)<i then gens[pos]:=Inv(i); fi;
od;

COLOURS:=["blue","red","green","yellow","brown","black"];
COLOURS:=["blue","red","green","black","brown","yellow","antiquewhite4","aquamarine4","bisque","blueviolet"];

#####################################################################
Color:=function(r)
Expand All @@ -130,7 +144,7 @@ local g,h;
if Mult(r[1],g)=r[2] then h:=Position(gens,g); break; fi;
if Mult(r[1],Inv(g))=r[2] then h:=Position(gens,g); break; fi;
od;

if not IsBound(h) then return COLOURS[10]; fi;
h:=(h-1) mod 6;
h:=h+1;
return COLOURS[h];
Expand All @@ -151,25 +165,30 @@ Add(idnt,x);
od;

Edges:=[];
for b in idnt do
for b in idnt do
for x in [1..Length(b)-1] do
if b[x]<b[x+1] then r:=[b[x],b[x+1]];
else r:=[b[x+1],b[x]]; fi;
#AddSet(Edges,r);
Add(Edges,r);
AddSet(Edges,r);
#Add(Edges,r);
od;
od;

Edges:=SortedList(Edges);
Edges:=List([1..Length(Edges)/2],i->Edges[2*i]);
Edges:=SSortedList(Edges);
#Print(Collected(Edges));
#Edges:=List([1..Length(Edges)/2],i->Edges[2*i]);


################ WRITE TO TMPIN.LOG #################################

AppendTo(tmpInlog," graph G { \n size=\"4,4\" \n subgraph cluster0 {\n node [shape=ellipse, width=.2,height=.2,fixedsize=true,style=filled, color=gray35,label=\"\"] \n edge [style=\"setlinewidth(2)\"] \n");
AppendTo(tmpInlog," digraph G { \n size=\"4,4\" \n subgraph cluster0 {\n node [shape=ellipse, width=.2,height=.2,fixedsize=true,style=filled, color=gray35,label=\"\"] \n edge [style=\"setlinewidth(2)\"] \n");

for x in Edges do
AppendTo(tmpInlog,x[1]," -- ", x[2], "[color=",Color(x), "] \n");
if Mult(Inv(x[1]),x[2]) in gens then
AppendTo(tmpInlog,x[1]," -> ", x[2], "[color=",Color(x), "] \n");
else
AppendTo(tmpInlog,x[2]," -> ", x[1], "[color=",Color(x), "] \n");
fi;
od;

####
Expand All @@ -179,7 +198,7 @@ AppendTo(tmpInlog," }\n subgraph cluster1 {\n node [shape=box, width=2,height=1

if Maximum(List(X,x->Length(String(x))))<20 then
for i in [1..Length(X)] do
AppendTo(tmpInlog,-i," [fontcolor= ",COLOURS[i],",label=\"", X[i],"\" ] \n");
#AppendTo(tmpInlog,-i," [fontcolor= ",COLOURS[i],",label=\"", X[i],"\" ] \n");
od;
fi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ DeclareAttribute( "Mapping" , IsCategoryArrow );
##
DeclareProperty("IsAbelianCategory", IsString);
DeclareProperty("IsAdditiveCategory", IsString);
DeclareProperty("HasTerminalObject", IsString);
DeclareProperty("HasInitialObject", IsString);
DeclareProperty("HasPullbacks", IsString);
DeclareProperty("HasPushouts", IsString);
DeclareAttribute("TerminalObject", IsString);
#DeclareProperty("HasTerminalObject", IsString);
DeclareAttribute("InitialObject", IsString); #changed from Propertry
DeclareAttribute("Pullbacks", IsString); #changed from Propertry
DeclareAttribute("Pushouts", IsString); #changed from Propertry

#############################################################################
##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
## The category of groups. As the implementation improves the properties
## of this category will increase!
##
BindGlobal("Category_Of_Groups", Objectify(
NewType(NewFamily("Category_Of_Groups"),
Category_Of_Groups:="Category_Of_Groups";
HAP_type:= NewType(NewFamily("Category_Of_Groups"),
IsString and
HasInitialObject
and HasTerminalObject), []));
and HasTerminalObject);
ObjectifyWithAttributes(Category_Of_Groups,HAP_type);
MakeReadOnlyGlobal("Category_Of_Groups");


#############################################################################
Expand Down
22 changes: 16 additions & 6 deletions lib/Kelvin/cw-functions.gi
Original file line number Diff line number Diff line change
Expand Up @@ -926,16 +926,20 @@ InstallGlobalFunction(
ViewArc2Presentation,
function(l)
local
arc, cross, cols, AppendTo, PrintTo, file, filetxt,
bin_arr, coord, res, colours, i, j, x, k, y, z, clr;
arc, cross, cols, AppendTo, PrintTo, file, filetxt, filepng,
bin_arr, coord, res, colours, i, j, x, k, y, z, clr, tmpdir;

arc:=List(l[1],x->[SignInt(x[1])*x[1],SignInt(x[2])*x[2]]);
cross:=l[2]*1;
cols:=l[3]*1;
AppendTo:=HAP_AppendTo;
PrintTo:=HAP_PrintTo;
file:="/tmp/HAPtmpImage";
filetxt:="/tmp/HAPtmpImage.txt";
#file:="/tmp/HAPtmpImage";
#filetxt:="/tmp/HAPtmpImage.txt";
tmpdir := DirectoryTemporary();;
file:=Filename( tmpdir , "HAPtmpImage" );
filetxt:=Filename( tmpdir , "HAPtmpImage.txt" );
filepng:=Filename( tmpdir , "HAPtmpImage.png" );

# create a binary array from the arc presentation
bin_arr:=Sum(PureCubicalKnot(arc)!.binaryArray);
Expand Down Expand Up @@ -1042,12 +1046,18 @@ InstallGlobalFunction(
Concatenation("rm ",filetxt)
);
# display the image
#Exec(
# Concatenation(DISPLAY_PATH," ","/tmp/HAPtmpImage.png")
#);
Exec(
Concatenation(DISPLAY_PATH," ","/tmp/HAPtmpImage.png")
Concatenation(DISPLAY_PATH," ",filepng)
);
# delete the image on window close
#Exec(
# Concatenation("rm ","/tmp/HAPtmpImage.png")
#);
Exec(
Concatenation("rm ","/tmp/HAPtmpImage.png")
Concatenation("rm ",filepng)
);
end);

Expand Down
2 changes: 1 addition & 1 deletion lib/Kelvin/tutex/kelvin-07.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ gap> arc:=ArcPresentation(PureCubicalKnot(6,1));
[ [ 5, 8 ], [ 4, 6 ], [ 3, 5 ], [ 2, 4 ], [ 1, 3 ], [ 2, 7 ], [ 6, 8 ], [ 1, 7 ] ]
gap> cross:=[0,0,1,-1,-1,0];;
gap> cols:=[1,4,3];;
gap> ViewColouredArcDiagram(arc,cross,cols);
gap> ViewArc2Presentation([arc,cross,cols]);
convert-im6.q16: pixels are not authentic `/tmp/HAPtmpImage.txt' @ error/cache.c/QueueAuthenticPixelCacheNexus/4381.

4 changes: 3 additions & 1 deletion lib/PolyComplexes/prog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# Program to convert image text files to GAP matrices.

$file = '/tmp/im.txt'; # Name the file
($file) = @ARGV;
#$file = '/tmp/im.txt'; # Name the file

open(INFO, $file); # Open the file
my $line = <INFO>;
@parts = split /(:|,)/, $line;
Expand Down
6 changes: 1 addition & 5 deletions lib/PolyComplexes/pureCubicalComplexes.gi
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,15 @@ if IsString(file) then
tmpdir := DirectoryTemporary();;
file1:=Filename( tmpdir , "im.txt" );
file2:=Filename( tmpdir , "im.g" );
file1:="/tmp/im.txt"; #I HAVE NO IDEA WHY I NEED TO DO THIS, BUT IF
#I DON'T THEN THE FUNCTION CRASHES

#i:=Concatenation("convert -colorspace RGB -depth 8 ",file," /tmp/im.txt");
i:=Concatenation("convert -colorspace RGB -depth 8 ",file," ",file1);
Exec(i);
#i:=Concatenation("perl ",prog," /tmp/im.txt >/tmp/im.g");
i:=Concatenation("perl ",prog," ",file1," > ",file2);
Exec(i);

Exec(Concatenation("rm ",file1));
#Read("/tmp/im.g");
Read(file2);

B:=StructuralCopy(HAPAAA);
HAPAAA:=0;

Expand Down
7 changes: 7 additions & 0 deletions lib/Resolutions/presentation.gi
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ local
Tree,Verts, NTree, NNTree, VertElts,
index, cnt, gens, Gens, F,
src,trg,
alpha, len,
B,i,a, b,bb,x,y,g,lst,bool;

if not (IsHapResolution(R) or IsHapEquivariantCWComplex(R)) then
Expand Down Expand Up @@ -428,7 +429,13 @@ a:=List(a,i->SignInt(i[3])*index[AbsInt(i[3])]);
Add(HRels1,a);
od;

alpha:=["x","y","z","w","v","u","t","s","r","q","p"];
len:=Length(HGens)-Length(Tree);
if len<12 then
F:=FreeGroup(alpha{[1..len]});
else
F:=FreeGroup(Length(HGens)-Length(Tree));
fi;
gens:=GeneratorsOfGroup(F);
HRels:=[];

Expand Down
Loading

0 comments on commit fa4df59

Please sign in to comment.