Skip to content

Commit

Permalink
Add OrbitalGraph for a group and a base-pair
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Oct 16, 2021
1 parent af82d83 commit c282ea0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 11 deletions.
7 changes: 5 additions & 2 deletions gap/OrbitalGraphs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ DeclareOperation("OrbitalGraphs", [IsPermGroup, IsInt]);
# TODO: Implement constructing the orbital graph with a given base pair
#! @BeginGroup orbital
#! @Returns An orbital graph
#! @Arguments G, u, v
#! @Arguments G, basepair, n
#! @Description
#! TODO.
DeclareOperation("OrbitalGraph", [IsPermGroup, IsPosInt, IsPosInt]);
DeclareOperation("OrbitalGraph", [IsPermGroup, IsHomogeneousList, IsPosInt]);
#! @Arguments G, basepair, points
DeclareOperation("OrbitalGraph", [IsPermGroup, IsHomogeneousList,
IsHomogeneousList]);
#! @EndGroup
#! @Group orbital
#! @Arguments G, basepair
Expand Down
39 changes: 39 additions & 0 deletions gap/OrbitalGraphs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,45 @@ function(G, points)
end);


# Individual orbital graphs

InstallMethod(OrbitalGraph, "for a permutation group and homogenous list",
[IsPermGroup, IsHomogeneousList],
function(G, basepair)
if not (Length(basepair) = 2 and ForAll(basepair, IsPosInt)) then
ErrorNoReturn("the second argument <basepair> must be a pair of ",
"positive integers");
fi;
return OrbitalGraph(G, basepair,
Maximum(NrMovedPoints(G), Maximum(basepair)));
end);

InstallMethod(OrbitalGraph,
"for a permutation group, homogeneous list, and pos int",
[IsPermGroup, IsHomogeneousList, IsPosInt],
function(G, basepair, max)
return OrbitalGraph(G, basepair, [1 .. max]);
end);

InstallMethod(OrbitalGraph,
"for a permutation group and two homogeneous lists",
[IsPermGroup, IsHomogeneousList, IsHomogeneousList],
function(G, basepair, points)
local D;
if not ForAll(points, IsPosInt) then
ErrorNoReturn("the third argument <points> must be... TODO");
elif not (Length(basepair) = 2 and IsSubset(points, basepair)) then
ErrorNoReturn("the second argument <basepair> must be... TODO");
fi;
# FIXME This is naive, and doesn't respect <points>
D := DigraphByEdges(Orbit(G, basepair, OnPairs), Maximum(points));
SetFilterObj(D, IsOrbitalGraphOfGroup);
SetUnderlyingGroup(D, G);
SetBasePair(D, basepair);
return D;
end);


# Transformation semigroups

InstallMethod(OrbitalGraphs, "for a transformation semigroup",
Expand Down
18 changes: 9 additions & 9 deletions tst/orbitalgraphs01.tst
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ gap> OrbitalGraphs(D8);
, <self-paired orbital graph of D8 on 4 vertices
with base-pair (1,2), 8 arcs> ]

# doc/_Chapter_Orbital_graphs.xml:95-98
# doc/_Chapter_Orbital_graphs.xml:97-100
gap> true;
true

# doc/_Chapter_Orbital_graphs.xml:129-132
# doc/_Chapter_Orbital_graphs.xml:131-134
gap> true;
true

# doc/_Chapter_Orbital_graphs.xml:148-151
# doc/_Chapter_Orbital_graphs.xml:150-153
gap> true;
true

# doc/_Chapter_Orbital_graphs.xml:167-170
# doc/_Chapter_Orbital_graphs.xml:169-172
gap> true;
true

# doc/_Chapter_Orbital_graphs.xml:199-211
# doc/_Chapter_Orbital_graphs.xml:201-213
gap> OrbitalClosure(PSL(2,5)) = SymmetricGroup(6);
true
gap> C6 := CyclicGroup(IsPermGroup, 6);;
Expand All @@ -47,7 +47,7 @@ gap> IsConjugate(SymmetricGroup(6),
> closure, WreathProduct(Group([(1,2)]), Group([(1,2,3)])));
true

# doc/_Chapter_Orbital_graphs.xml:227-236
# doc/_Chapter_Orbital_graphs.xml:229-238
gap> OrbitalIndex(PSL(2,5));
12
gap> OrbitalIndex(PGL(2,5));
Expand All @@ -57,23 +57,23 @@ gap> OrbitalIndex(AlternatingGroup(6));
gap> OrbitalIndex(DihedralGroup(IsPermGroup, 6));
1

# doc/_Chapter_Orbital_graphs.xml:263-270
# doc/_Chapter_Orbital_graphs.xml:265-272
gap> IsOrbitalGraphRecognisable(QuaternionGroup(IsPermGroup, 8));
true
gap> IsOGR(AlternatingGroup(8));
false
gap> IsOGR(TrivialGroup(IsPermGroup));
true

# doc/_Chapter_Orbital_graphs.xml:294-301
# doc/_Chapter_Orbital_graphs.xml:296-303
gap> IsStronglyOrbitalGraphRecognisable(CyclicGroup(IsPermGroup, 8));
true
gap> IsStronglyOGR(QuaternionGroup(IsPermGroup, 8));
false
gap> IsStronglyOGR(TrivialGroup(IsPermGroup));
true

# doc/_Chapter_Orbital_graphs.xml:325-332
# doc/_Chapter_Orbital_graphs.xml:327-334
gap> IsAbsolutelyOrbitalGraphRecognisable(DihedralGroup(IsPermGroup, 8));
true
gap> IsAbsolutelyOGR(CyclicGroup(IsPermGroup, 8));
Expand Down

0 comments on commit c282ea0

Please sign in to comment.