user@local:~$ wget https://github.com/mcmartins/francy/archive/v0.8.2.tar.gz && \
mkdir -p $GAPROOT/pkg/francy && \
tar xzvf v0.8.2.tar.gz -C $GAPROOT/pkg/francy francy-0.8.2/gap
user@local:~$ pip install jupyter_francy
user@local:~$ jupyter lab build # for JupyterLab
user@local:~$ jupyter nbextension enable --py --sys-prefix jupyter_francy # for Notebook
In [2]:
LoadPackage("francy");
LoadPackage("digraph");
Out[2]:
Out[2]:
In [3]:
FrancyDigraphs := function(G)
local as, d, v, e, graph, nodes, m, IsGroupSimple, canvas, i;
as := AllSubgroups(G);;
d := Digraph(as, {H, K} -> IsSubgroup(H, K));;
v := DigraphVertices(d);;
e := DigraphEdges(d);;
graph := Graph(GraphType.DIRECTED);;
canvas := Canvas(Concatenation("Subgroups Digraph of ", String(G)));;
Add(canvas, graph);;
nodes := [];;
m := FrancyMessage(FrancyMessageType.INFO, "Simple Groups",
"A group is simple if it is nontrivial and has no nontrivial normal subgroups.");;
IsGroupSimple := function(i)
Add(canvas, m);;
if IsSimpleGroup(as[i]) then
Add(canvas, FrancyMessage("Simple", Concatenation("The vertex ",
String(i), ", representing the subgroup ", String(as[i]), ", is simple.")));;
else
Add(canvas, FrancyMessage("Not Simple", Concatenation("The vertex ",
String(i), ", representing the subgroup ", String(as[i]), ", is not simple.")));;
fi;;
return Draw(canvas);
end;;
for i in v do;
nodes[i] := Shape(ShapeType.CIRCLE, String(i));;
Add(nodes[i], Menu("Simple", Callback(IsGroupSimple, [i])));;
Add(graph, nodes[i]);;
od;;
for i in e do
Add(graph, Link(nodes[i[1]], nodes[i[2]]));;
od;;
return Draw(canvas);
end;
Out[3]:
In [5]:
G := DihedralGroup(4);
FrancyDigraphs(G);
Out[5]:
Out[5]:
In [ ]: