diff --git a/GaussForHomalg/PackageInfo.g b/GaussForHomalg/PackageInfo.g index e221143e1..8245935cc 100644 --- a/GaussForHomalg/PackageInfo.g +++ b/GaussForHomalg/PackageInfo.g @@ -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", diff --git a/GaussForHomalg/gap/GaussTools.gi b/GaussForHomalg/gap/GaussTools.gi index d30dd2374..57ee700e7 100644 --- a/GaussForHomalg/gap/GaussTools.gi +++ b/GaussForHomalg/gap/GaussTools.gi @@ -397,7 +397,7 @@ 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 @@ -405,12 +405,14 @@ InstallGlobalFunction( HOMALG_RING_OF_INTEGERS_PRIME_POWER_HELPER, 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 diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index cb8bd7bf8..dcd2fb69f 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -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", diff --git a/MatricesForHomalg/gap/HomalgRing.gd b/MatricesForHomalg/gap/HomalgRing.gd index 9eee023d2..6a5bdadad 100644 --- a/MatricesForHomalg/gap/HomalgRing.gd +++ b/MatricesForHomalg/gap/HomalgRing.gd @@ -1604,6 +1604,19 @@ DeclareAttribute( "AssociatedGradedRing", DeclareAttribute( "AssociatedPolynomialRing", IsHomalgRing ); +## <#GAPDoc Label="PrimitiveElement"> +## +## +## a homalg ring element +## +## The primitive element of the &homalg; field R. +## +## +## <#/GAPDoc> +## +DeclareAttribute( "PrimitiveElement", + IsHomalgRing ); + #################################### # # global functions and operations: diff --git a/MatricesForHomalg/gap/HomalgRing.gi b/MatricesForHomalg/gap/HomalgRing.gi index 3526f0eb3..362b7af2b 100644 --- a/MatricesForHomalg/gap/HomalgRing.gi +++ b/MatricesForHomalg/gap/HomalgRing.gi @@ -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: