Skip to content
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

Added Documentation for DecomPoly and NormalizerViaRadical #2360

Merged
merged 2 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/ref/algfld.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ gap> m^2;

<#Include Label="IsAlgebraicElement">

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Finding Subfields">
<Heading>Finding Subfields</Heading>

<#Include Label="IdealDecompositionsOfPolynomial">

</Section>
</Chapter>

Expand Down
9 changes: 8 additions & 1 deletion doc/ref/groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ see <Cite Key="BJR87"/>.

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Tests for the Availability of Methods">
<Heading>Tests for the Availability of Methods</Heading>
Expand All @@ -601,6 +600,14 @@ see <Cite Key="BJR87"/>.
<#Include Label="CanComputeIsSubset">
<#Include Label="KnowsHowToDecompose">

</Section>

<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Specific functions for Normalizer calculation">
<Heading>Specific functions for Normalizer calculation</Heading>

<#Include Label="NormalizerViaRadical">

</Section>
</Chapter>

Expand Down
42 changes: 42 additions & 0 deletions lib/algfld.gd
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,45 @@ DeclareGlobalFunction("AlgExtEmbeddedPol");

DeclareGlobalFunction("AlgExtSquareHensel");

#############################################################################
##
#F IdealDecompositionsOfPolynomial( <f> [:"onlyone"] ) finds ideal decompositions of rational f
##
## <#GAPDoc Label="IdealDecompositionsOfPolynomial">
## <ManSection>
## <Func Name="IdealDecompositionsOfPolynomial" Arg='pol'/>
##
## <Description>
## Let <M>f</M> be a univariate, rational, irreducible, polynomial. A
## pair <M>g</M>,<M>h</M> of polynomials of degree strictly
## smaller than that of <M>f</M>, such that <M>f(x)|g(h(x))</M> is
## called an ideal decomposition. In the context of field
## extensions, if <M>\alpha</M> is a root of <M>f</M> in a suitable extension
## and <M>Q</M> the field of rational numbers. Such decompositions correspond
## to (proper) subfields <M>Q\lt Q(\beta)\lt Q(\alpha)</M>, where <M>g</M> is the
## minimal polynomial of <M>\beta</M>.
## This function determines such decompositions up to equality of the subfields
## <M>Q(\beta)</M>, thus determining subfields of a given algebraic extension.
## It returns a list of pairs <M>[g,h]</M> (and an empty list if no such
## decomposition exists). If the option <A>onlyone</A> is given it returns at
## most one such decomposition (and performs faster).
## <Example><![CDATA[
## gap> x:=X(Rationals,"x");;pol:=x^8-24*x^6+144*x^4-288*x^2+144;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offtopic: the reference manual says this on X:

X is simply a synonym for Indeterminate. However, we do not recommend to use this synonym which is supported only for the backwards compatibility.

Now, don't get me wrong, I am not suggesting you should change the examples; rather, I always use X myself, so I am wondering if this last sentence in the manual should just be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. (At the time when this was written there was a push to make X obsolete as operation.)

## gap> l:=IdealDecompositionsOfPolynomial(pol);
## [ [ x^2+72*x+144, x^6-20*x^4+60*x^2-36 ],
## [ x^2-48*x+144, x^6-21*x^4+84*x^2-48 ],
## [ x^2+288*x+17280, x^6-24*x^4+132*x^2-288 ],
## [ x^4-24*x^3+144*x^2-288*x+144, x^2 ] ]
## gap> List(l,x->Value(x[1],x[2])/pol);
## [ x^4-16*x^2-8, x^4-18*x^2+33, x^4-24*x^2+120, 1 ]
## gap> IdealDecompositionsOfPolynomial(pol:onlyone);
## [ [ x^2+72*x+144, x^6-20*x^4+60*x^2-36 ] ]
## ]]></Example>
## In this example the given polynomial is regular with Galois group
## <M>Q_8</M>, as expected we get four proper subfields.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareGlobalFunction("IdealDecompositionsOfPolynomial");
DeclareSynonym("DecomPoly",IdealDecompositionsOfPolynomial);
29 changes: 13 additions & 16 deletions lib/algfld.gi
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ if Length(extra)>0 and IsString(extra[1]) then
SetCharacteristic(fam,Characteristic(f));
fam!.indeterminateName:=nam;
colf:=CollectionsFamily(fam);
e:=Objectify(NewType(colf,IsAlgebraicExtensionDefaultRep),
e:=Objectify(NewType(colf,
IsAlgebraicExtensionDefaultRep and IsAlgebraicExtension),
rec());

fam!.wholeField:=e;
Expand Down Expand Up @@ -2193,13 +2194,14 @@ end);

#############################################################################
##
#F DecomPoly( <f> [,"all"] ) finds (all) ideal decompositions of rational f
#F IdealDecompositionsOfPolynomial( <f> [,"onlyone"] ) finds ideal decompositions of rational f
## This is equivalent to finding subfields of K(alpha).
##
DecomPoly := function(arg)
local f,n,e,ff,p,ffp,ffd,roots,allroots,nowroots,fm,fft,comb,combi,k,h,i,j,
gut,avoid,blocks,g,m,decom,z,R,scale,allowed,hp,hpc,a,kfam;
f:=arg[1];
InstallGlobalFunction(IdealDecompositionsOfPolynomial,function(f)
local n,e,ff,p,ffp,ffd,roots,allroots,nowroots,fm,fft,comb,combi,k,h,i,j,
gut,avoid,blocks,g,m,decom,z,R,scale,allowed,hp,hpc,a,kfam,only;

only:=ValueOption("onlyone")=true;
n:=DegreeOfUnivariateLaurentPolynomial(f);
if IsPrime(n) then
return [];
Expand Down Expand Up @@ -2255,9 +2257,9 @@ local f,n,e,ff,p,ffp,ffd,roots,allroots,nowroots,fm,fft,comb,combi,k,h,i,j,
fft:=ff{combi};
ffp:=List(fft,i->AlgebraicPolynomialModP(kfam,i,fm[1],p));
roots:=Filtered(fm,i->ForAny(ffp,j->Value(j,i)=Zero(k)));
if Length(roots)<>Sum(ffd{combi}) then
Error("serious error");
fi;
if Length(roots)<>Sum(ffd{combi}) then
Error("serious error");
fi;
allroots:=Union(roots,[fm[1]]);
gut:=true;
j:=1;
Expand All @@ -2270,9 +2272,7 @@ local f,n,e,ff,p,ffp,ffd,roots,allroots,nowroots,fm,fft,comb,combi,k,h,i,j,
if gut then
Info(InfoPoly,2,"block found");
Add(blocks,combi);
if Length(arg)>1 then
gut:=false;
fi;
if only<>true then gut:=false; fi;
fi;
h:=h+1;
od;
Expand Down Expand Up @@ -2328,15 +2328,12 @@ local f,n,e,ff,p,ffp,ffd,roots,allroots,nowroots,fm,fft,comb,combi,k,h,i,j,
#h:=Value(h,X(Rationals)*z);
Add(decom,[g,h]);
od;
if Length(arg)=1 then
decom:=decom[1];
fi;
return decom;
else
Info(InfoPoly,2,"primitive");
return [];
fi;
end;
end);

#############################################################################
##
Expand Down
32 changes: 32 additions & 0 deletions lib/grp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4528,6 +4528,38 @@ DeclareGlobalFunction("GroupEnumeratorByClosure");
DeclareOperation( "LowIndexSubgroups",
[ IsGroup, IsPosInt ] );

#############################################################################
##
#F NormalizerViaRadical(<G>,<S>)
##
## <#GAPDoc Label="NormalizerViaRadical">
## <ManSection>
## <Func Name="NormalizerViaRadical" Arg='G,S'/>
##
## <Description>
## This function implements a particular approach, following the
## SolvableRadical paradigm, for calculating the
## normalizer of a subgroup <A>S</A> in <A>G</A>. It is at the moment
## provided only as a separate function, and not as method for the operation
## <C>Normalizer</C>, as it can often be slower than other built-in routines.
## In certain hard cases (non-solvable groups with nontrivial radical), however
## its performance is substantially superior.
## The function thus is provided as a
## non-automated tool for advanced users.
## <Example><![CDATA[
## gap> g:=TransitiveGroup(30,2030);;
## gap> s:=SylowSubgroup(g,5);;
## gap> Size(NormalizerViaRadical(g,s));
## 28800
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example of course is slower than the backtrack Normalizer. I have yet to find an example that is while being short enough for the manual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's OK, I think (though we might want to mention that the given example is not actually one where NormalizerViaRadical is faster?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function thus provided as a
there is an is missing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a line about example and inserted is.

## ]]></Example>
## Note that this example only demonstrates usage, but that in this case
## in fact the ordinary <C>Normalizer</C> routine performs faster.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareGlobalFunction("NormalizerViaRadical");

#############################################################################
##
#E
Expand Down
2 changes: 1 addition & 1 deletion lib/norad.gi
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ local expandvec,bassrc,basimg,transl,getbasimg,gettransl,myact2;
end);

# main normalizer routine
BindGlobal("NormalizerViaRadical",function(G,U)
InstallGlobalFunction(NormalizerViaRadical,function(G,U)
local sus,ser,len,factorhom,uf,n,d,up,mran,nran,mpcgs,pcgs,pcisom,nf,ng,np,sub,
central,f,ngm,npm,no2pcgs,part,stb,mods,famo,part0,nopcgs,uff,ufg,prev,
famo2,ufr,dims,vecs,ovecs,vecsz,l,prop,properties,clusters,clusterspaces,
Expand Down