Skip to content

Commit

Permalink
Merge pull request #611 from mohamed-barakat/PrimitiveElement
Browse files Browse the repository at this point in the history
d&i PrimitiveElement for homalg fields
  • Loading branch information
mohamed-barakat authored Aug 22, 2024
2 parents 3b863b0 + 4202f07 commit 5d2e553
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GaussForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "GaussForHomalg",
Subtitle := "Gauss functionality for the homalg project",
Version := "2024.07-01",
Version := "2024.08-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
6 changes: 4 additions & 2 deletions GaussForHomalg/gap/GaussTools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -397,20 +397,22 @@ InstallValue( CommonHomalgTableForGaussTools,

InstallGlobalFunction( HOMALG_RING_OF_INTEGERS_PRIME_POWER_HELPER,
function( argument_list, c )
local nargs, d, R;
local nargs, d, F, R;
nargs := Length( argument_list );
if IsPrime( c ) then
if nargs > 1 and IsPosInt( argument_list[2] ) then
d := argument_list[2];
else
d := 1;
fi;
R := CreateHomalgRing( GF( c, d ) );
F := GF( c, d );
R := CreateHomalgRing( F );

SetRingFilter( R, IsHomalgRing );
SetRingElementFilter( R, IsFFE );

R!.NameOfPrimitiveElement := Concatenation( "Z", String( c ), "_", String( d ) );
SetPrimitiveElement( R, PrimitiveElement( F ) / R );
SetIsFieldForHomalg( R, true );
SetRingProperties( R, c, d );
else
Expand Down
2 changes: 1 addition & 1 deletion MatricesForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "MatricesForHomalg",
Subtitle := "Matrices for the homalg project",
Version := "2024.07-01",
Version := "2024.08-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
13 changes: 13 additions & 0 deletions MatricesForHomalg/gap/HomalgRing.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,19 @@ DeclareAttribute( "AssociatedGradedRing",
DeclareAttribute( "AssociatedPolynomialRing",
IsHomalgRing );

## <#GAPDoc Label="PrimitiveElement">
## <ManSection>
## <Attr Arg="R" Name="PrimitiveElement"/>
## <Returns>a homalg ring element</Returns>
## <Description>
## The primitive element of the &homalg; field <A>R</A>.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareAttribute( "PrimitiveElement",
IsHomalgRing );

####################################
#
# global functions and operations:
Expand Down
15 changes: 15 additions & 0 deletions MatricesForHomalg/gap/HomalgRing.gi
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,21 @@ InstallMethod( BaseRing,

CoefficientsRing );

##
InstallMethod( PrimitiveElement,
"for homalg fields",
[ IsFieldForHomalg ],

function( R )

if not IsBound( R!.NameOfPrimitiveElement ) then
TryNextMethod( );
fi;

return R!.NameOfPrimitiveElement / R;

end );

####################################
#
# methods for operations:
Expand Down

0 comments on commit 5d2e553

Please sign in to comment.