-
Notifications
You must be signed in to change notification settings - Fork 171
Fix PQuotient error for large groups. #5816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2087635
ee883b6
721958b
99056db
a2b9ba2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,11 @@ DeclareGlobalFunction( "AbelianPQuotient" ); | |
|
||
############################################################################# | ||
## | ||
#F PQuotient(<F>, <p>[, <c>][, <logord>][, <ctype>]) . . pq of an fp group | ||
#F PQuotient(<F>, <p>[, <c>][, <logord>][, <ctype>] : noninteractive) . . pq of an fp group | ||
## | ||
## <#GAPDoc Label="PQuotient"> | ||
## <ManSection> | ||
## <Func Name="PQuotient" Arg='F, p[, c][, logord][, ctype]'/> | ||
## <Func Name="PQuotient" Arg='F, p[, c][, logord][, ctype] : noninteractive'/> | ||
## | ||
## <Description> | ||
## computes a factor <A>p</A>-group of a finitely presented group <A>F</A> | ||
|
@@ -57,16 +57,21 @@ DeclareGlobalFunction( "AbelianPQuotient" ); | |
## In case <A>F</A> does not have a largest factor <A>p</A>-group, | ||
## the algorithm will not terminate. | ||
## <P/> | ||
## By default the algorithm computes only with factor groups of order at | ||
## most <M>p^{256}</M>. If the parameter <A>logord</A> is present, it will | ||
## compute with factor groups of order at most <M>p^{<A>logord</A>}</M>. | ||
## If this parameter is specified, then the parameter <A>c</A> must also be | ||
## given. The present | ||
## implementation produces an error message if the order of a | ||
## <M>p</M>-quotient exceeds <M>p^{256}</M> or <M>p^{<A>logord</A>}</M>, | ||
## respectively. | ||
## Note that the order of intermediate <M>p</M>-groups may be larger than | ||
## the final order of a <M>p</M>-quotient. | ||
## By default the value of the paramter <A>logord</A> is set to <M>256</M>. | ||
## If the parameter <A>logord</A> is specified, then the parameter <A>c</A> must also be | ||
## given. | ||
## The algorithm only computes with factor groups of order | ||
## at most <M>p^{<A>logord</A>}</M>. | ||
## If the order of a factor group exceeds <M>p^{<A>logord</A>}</M>, | ||
## the behaviour of the algorithm depends on the option | ||
## <A>noninteractive</A>: if it is present, the current implementation | ||
## produces an error message; otherwise it returns <C>fail</C>. | ||
## Note that the order of intermediate <M>p</M>-groups, which are constructed by the algorithm | ||
## during the computation, may be larger than the final order of a <M>p</M>-quotient | ||
## in the series. Thus a <M>p</M>-quotient is not necessarily computed | ||
## even if its order does not exceed <M>p^{<A>logord</A>}</M>. | ||
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this sentence, or rather, I don't understand how the previous text implies ("thus") this sentence. Could you elaborate? |
||
## However, for the first quotient we can guarantee that it is found, | ||
## if the order does not exceed <M>p^{<A>logord</A>}</M>. | ||
## <P/> | ||
## The parameter <A>ctype</A> determines the type of collector that is used | ||
## for computations within the factor <A>p</A>-group. | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1310,7 +1310,9 @@ | |||||
|
||||||
############################################################################# | ||||||
## | ||||||
#F AbelianPQuotient . . . . . . . . . . . initialize an abelian p-quotient | ||||||
#F AbelianPQuotient . . . . . . . . try to initialize an abelian p-quotient | ||||||
## | ||||||
## Return true if we are successful, return false otherwise. | ||||||
## | ||||||
InstallGlobalFunction( AbelianPQuotient, | ||||||
function( qs ) | ||||||
|
@@ -1342,6 +1344,9 @@ | |||||
generators := DifferenceLists( [1..n], trailers ); | ||||||
|
||||||
## Their images are the first d generators. | ||||||
if Length(gens) < d then | ||||||
return false; | ||||||
fi; | ||||||
qs!.images{ generators } := gens{[1..d]}; | ||||||
|
||||||
## Fix their definitions. | ||||||
|
@@ -1367,6 +1372,8 @@ | |||||
qs!.collector![SCP_WEIGHTS]{[1..qs!.numberOfGenerators]} := | ||||||
[1..qs!.numberOfGenerators] * 0 + 1; | ||||||
|
||||||
return true; | ||||||
|
||||||
end ); | ||||||
|
||||||
############################################################################# | ||||||
|
@@ -1376,7 +1383,8 @@ | |||||
InstallGlobalFunction( PQuotient, | ||||||
function( arg ) | ||||||
|
||||||
local G, p, cl, ngens, collector, qs, t,noninteractive; | ||||||
local G, p, cl, ngens, collector, qs, t,noninteractive, | ||||||
isAbelianPQuotientSucessful; | ||||||
|
||||||
|
||||||
## First we parse the arguments to this function | ||||||
|
@@ -1453,7 +1461,20 @@ | |||||
LengthOfDescendingSeries(qs)+1, " quotient" ); | ||||||
|
||||||
t := Runtime(); | ||||||
AbelianPQuotient( qs ); | ||||||
isAbelianPQuotientSucessful := AbelianPQuotient( qs ); | ||||||
if not isAbelianPQuotientSucessful then | ||||||
if noninteractive then | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to initialize To use GAP options, use the
Suggested change
|
||||||
return fail; | ||||||
else | ||||||
Error( "Collector not large enough ", | ||||||
"to define generators for abelian p-quotient.\n", | ||||||
"To return the current quotient (of class ", | ||||||
LengthOfDescendingSeries(qs), ") type `return;' ", | ||||||
"and `quit;' otherwise.\n" ); | ||||||
|
||||||
return qs; | ||||||
fi; | ||||||
fi; | ||||||
|
||||||
Info( InfoQuotientSystem, 1, " rank of this layer: ", | ||||||
RanksOfDescendingSeries(qs)[LengthOfDescendingSeries(qs)], | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# see <https://github.com/gap-system/gap/issues/5809> | ||
gap> F := FreeGroup(["a", "b"]);; | ||
gap> a := F.1;; | ||
gap> b := F.1;; | ||
gap> p := 5;; | ||
gap> G := F / [a^p, b^p, Comm(a,b)];; | ||
gap> PQuotient(G, p, 1, 2 : noninteractive) <> fail; | ||
true | ||
gap> PQuotient(G, p, 1, 1 : noninteractive) = fail; | ||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the reverse of what the code does? If
noninteractive
is set (totrue
), then it returnsfail
; if it is not set or if it is set tofalse
, then raise an error?