############################################################################# ## ## This file is part of GAP, a system for computational discrete algebra. ## This file's authors include Alexander Konovalov. ## ## Copyright of GAP belongs to its developers, whose names are too numerous ## to list here. Please refer to the COPYRIGHT file for details. ## ## SPDX-License-Identifier: GPL-2.0-or-later ## ## This file contains methods for the elements of the rings $Z/nZ(epsilon)$, ## where epsilon is the primitive root of unity of degree m (not depending ## on n). ## The following approach was used to construct such rings. First we create ## a ring of integral cyclotomics in the m-th cyclotomic field. Then we ## construct from its elements a new ring, defining operations modulo n. ## Thus, elements of the ring $Z/nz(epsilon)$ internally are represented ## as cyclotomic integers. ##
############################################################################# # # RingOfIntegralCyclotomics( F ) # # Let F be a cyclotomic field. This function returns the ring of integral # cyclotomics of the field F #
InstallGlobalFunction## to list here. Please refer to the COPYRIGHT file for details. function(## where epsilon is the primitive root of unity of degree m (not depending
local R; if## a ring of integral cyclotomics in the m-th cyclotomic field. Then we
Error("## Thus, elements of the ring $Z/nz(epsilon)$ java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 27
;
SetName(R,Concatenation ((("String(onductor(),") ;
SetIsRingOfIntegralCyclotomics( R, true );
SetName( R, Concatenation( "(RingInt(CF(", String(Conductor(F)), ")))" ) );
R; end );
############################################################################# # # ZmodnZepsObj( Fam, celt ) # # This function takes a cyclotomic element celt and creates an object in a # family Fam, internally represented by this cyclotomic #
InstallGlobalFunction( ZmodnZepsObj, function( Fam,# family Fam, internally represented by this cyclotomic
, eltjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
m=Fam.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
n this guarantee the canonical form of an element from Z_m(eps) of celt in the m-th Zumbroich basisifForAnycoeffs - notIsIntx)then # this guarantee the canonical form of an element from Z_m(eps)
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31 if ,java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 70
Error ; fi; # now we reduce coefficients modulo n
coeffs := List(coeffs, x -> x # integer and epsilon is a primitive root of # Alternatively, the same result may me obtained using the command
:=coeffs*List 1m - (m(-1 ; function ,m)
[ elt ] );must"
############################################################################# # # ZmodnZeps( n, m) # # This function returns the ring $Z/nZ(epsilon)$, where n is a positive # integer and epsilon is a primitive root of unity of degree m. # Alternatively, the same result may me obtained using the command # RingInt(CF(m)) mod n # since below we install special method for \mod operation for this case #
InstallGlobalFunction( ZmodnZeps ,true;
( R ( ((" (," java.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 66
local F [CategoryCollections(( IsZmodnZepsObj and IsWholeFamily java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 27
must a positive integer"); fi!degree if Print(Concatenation( "(RingInt(CF(", String(m), ")) mod ",
Error( "<n> must be a positive ")" ) ) fi; ## If x is an element of the ring $Z/nZ(epsilon)$, where epsilon^m=1, and celt
F := NewFamily( Concatenation( "Zmod", String(# is its underlying cyclotomic element (# then x will be printed in the following form:
IsZmodnZepsObj ); # Install the data.
F and IsZmodnZepsRep]
F!.degree# their canonical form is uniquely determined by ZmodnZepsObj # Make the domain." for two elements in Z/() ZmodnZepsRep)",
R=RingWithOneByGenerators ,Em) ] )
SetIsWholeFamily( RIsZmodnZepsObj andIsZmodnZepsRep ]java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 16
cyclotomics. Thus, x < y iff the same# cyclotomics, since their canonical form is # ZmodnZepsObj
(, "));
IsIdenticalObj,
IsZmodnandjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
;
# # PrintObj( R ) # # If R is the ring $Z/nZ(epsilon)$, where epsilon^m=1, then it will be # printed in the following form: # RingInt(CF(m)) mod n #
InstallMethod( # (underlying) cyclotomics and then 'objectifying' the result "zmodnze : collection ,
[ zmodnze : for twonZ)java.lang.StringIndexOutOfBoundsException: Range [57, 54) out of bounds for length 57 function )
local F, m, ne ;
F := ElementsFamily( FamilyObj(R) );
n
InstallMethod( +,
Print( Concatenation( "(RingInt( "zmodnze : for element in Z/nZ(m) )and ",
Stringn ") end );
############################################################################# # # PrintObj( x ) # # If x is an element of the ring $Z/nZ(epsilon)$, where epsilon^m=1, and celt # is its underlying cyclotomic element (thus, its internal representation), # then x will be printed in the following form: # ( celt mod n ) #
ZmodnZepsObj(FamilyObj( y ), x + y![1] ); "zmodnze : for element in Z/nZ(m) (ZmodnZepsRep)",
[ IsZmodnZepsObj and IsZmodnZepsRep ], function( x )
Print( "( ", x![1], " mod ", FamilyObj(x)!.modulus, " )" ); end );
############################################################################# # # x=y # # x equal y iff corresponding underlying cyclotomics are equal, since # their canonical form is uniquely determined by ZmodnZepsObj #
InstallMethod( \=# "# x * y
# x Cyclotomic , y in Z/nZ(m)
[ IsZmodnZepsObj and IsZmodnZepsRep,
IsZmodnZepsObj and IsZmodnZepsRep ], function( x, y )
return x![# x in Z/nZ(m) , y in Z#
############################################################################# # # x < y # # this is just extending of relation "<" implemented in GAP for # cyclotomics. Thus, x < y iff the same relation holds for underlying # cyclotomics, since their canonical form is uniquely determined by # ZmodnZepsObj #
InstallMethod( \<,
InstallMethod \*,
IsIdenticalObj,
[ IsZmodnZepsObj and IsZmodnZepsRep,
IsZmodnZepsObj and IsZmodnZepsRep ], function( x,,
return x![1] < y![1]; end );
############################################################################# # # x+y # # x and y in Z/nZ(m) # x in Z/nZ(m), y Cyclotomic # x Cyclotomic, y in Z/nZ(m) # # These operations are implemented via appropriate operations over # (underlying) cyclotomics and then 'objectifying' the result #
IsCyclotomic,
zmodnze java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 57
IsIdenticalObj,
[ IsZmodnZepsObj and IsZmodnZepsRep,
IsZmodnZepsObj and IsZmodnZepsRep ], function( x, y ) end); end );
\+
zmodnze elementjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 67
bjand , function( x return ( FamilyObj( Int(java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
return java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 51 end );
InstallMethod( \+, "zmodnze : for cyclotomic and element in Z/nZ(m) (ZmodnZepsRep)"
[ IsCyclotomic, IsZmodnZObj and IsModulusRep, function( x, y )
return ZmodnZepsObj( FamilyObj( y ), x + y![1] ); end );
############################################################################# # # x * y # x Cyclotomic , y in Z/nZ(m) # x in Z/nZ(m) , y Cyclotomic # x in Z/nZ(m) , y in Z/nZ # x in Z/nZ , y in Z/nZ(m) # x in Z/nZ(m) , y in Z/nZ(m) # # These operations are implemented via appropriate operations over # (underlying) cyclotomics and then 'objectifying' the result #
[ IsZmodnZepsObj IsZmodnZepsRep, "IsZmodnZepsObjandIsZmodnZepsRep,
[ function x,y )
IsZmodnZepsObj and return ZmodnZepsObj( FamilyObj( x ), x![1] * y![1] ); function( x, y )
return java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0 end );
InstallMethod( \*, "zmodnze : for element x in Z/nZ(m) (ZmodnZepsRep) and cyclotomic y",
[ IsZmodnZepsObj and IsZmodnZepsRep,
IsCyclotomic# functionzmodnze elementm(java.lang.StringIndexOutOfBoundsException: Range [54, 51) out of bounds for length 54
return ZmodnZepsObj############################################################################# end )(,
InstallMethod( \*,
zmodnze element x ZnZ(m) and y in Z/nZ",
[ IsZmodnZepsObj and IsZmodnZepsRep,
IsZmodnZObj and IsModulusRep], function x, )
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 end#
InstallMethod ,
zmodnze for ZnZ(m)(),
[ IsZmodnZObj and IsModulusRep,
java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 39 function
return ZmodnZepsObj# end#
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 "zmodnze : for two elements in Z/nZ(m) (ZmodnZepsRep)",
IsIdenticalObjjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
[IsZmodnZepsObj and IsZmodnZepsRep,
IsZmodnZepsObj and IsZmodnZepsRep ], function( x, y )
return ZmodnZepsObj(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 end );
############################################################################# # # Zero #
InstallMethod "#############################################################################
[ java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
x- ZmodnZepsObj( FamilyObj, 0))java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
############################################################################# # # One #
#############################################################################
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
[]java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
elm ->#
############################################################################# # # -x #
InstallMethod( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 15 "modnze for element in Z/nZ(m)(ZmodnZepsRep)"
[ IsZmodnZepsObjm=(OneR).;
x->ZmodnZepsObj(FamilyObj( ,AdditiveInverse x!1]) ))java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
############################################################################# # # Cyclotomic # # returns an underlying cyclotomic element #
# Enumerator
I(Enumerator,
[ "zmodnze: fullcollection Z/("java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
z -> ion( )
############################################################################# # # mod # # Creates the ring Z/nZ(m) from the ring Z/nZ #
InstallMethod( \F= FamilyObj(R) )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 "modnze for RingOfIntegralCyclotomics and a positive integer",
[ IsRingOfIntegralCyclotomics,
IsPosRat and IsInt ], function
,ConductorGeneratorsOfRingWithOneR)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 end );
############################################################################# # # Size of Z/nZ(m) is equal to n^Phi(m) #
InstallMethod( Size, "zmodnze : # 3. <elm>^<deg>=<elm>^<deg+C> => <elm> is not a unit
[(IsZmodnZepsObj IsWholeFamily ]
R ":for Z/m ZModnZepsRep)with given ,
(((R)!degree)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
############################################################################# # # IsFinite = true #
InstallTrueMethod( IsFinite,
powers:[]; # to store powers of elm
############################################################################# # # Random #
InstallMethodWithRandomSource( Random,
ource and the full collection Z/nZ(m)",
IsRandomSource,CategoryCollections( IsZmodnZepsObj ) and IsWholeFamily ], function(rs, R)
local m, n, coeffs
m:=FamilyObj(One(R))!.degree;
:FamilyObj((R).modulus;
coeffs := List([1..m], x - =*elm
:coeffs 1.m] -Em)^j- ;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 end );
############################################################################# # # Enumerator #
InstallMethod# 3. <elm>^<deg>=<elm>^<deg+C> => <elm> is not a java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 1
Z/(m,
[ CategoryCollections IsZmodnZepsRep] function(R java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
local F, m powers:[; # to store powers of elm
F=ElementsFamily( FamilyObj(R) );
m:=FamilyObj(One(R))!.degree;
n:=FamilyObj(One(R))!.modulus;
return List( Enumerator( (Integers mod n)^Phi(mwhile true do
x -> ZmodnZepsObj(F, ifpow*elm=One(elm) then
List( [1..Phi(m)], j - return true; end);
############################################################################# # # IsUnit( R, elm ) # # checks whether the element is a unit, building the list of its powers # 1. <elm>^<deg>=1 => <elm>^(-1)=<elm>^<deg-1> # 2. <elm>^<deg>=0 => <elm> is not a unit # 3. <elm>^<deg>=<elm>^<deg+C> => <elm> is not a unit #
InstallMethod( IsUnit,
x^-1
[ CategoryCollections( IsZmodnZepsObj ) and IsWholeFamily and IsRing,
IsZmodnZepsObj and IsZmodnZepsRep ], function( R, elm )
local pow, powers; if ()then
return elm in Units(R); fi;
powers(unction elm)
pow:=elm; while true do if pow*elm=One(elm) then
returntrue; elif IsZero(pow) or (pow in powers) then
return false; fi;
Add(powers,pow);
pow=ow*;
od; end );
############################################################################# # # IsUnit( elm ) # # checks whether the element is a unit, building the list of its powers # 1. <elm>^<deg>=1 => <elm>^(-1)=<elm>^<deg-1> # 2. <elm>^<deg>=0 => <elm> is not a unit # 3. <elm>^<deg>=<elm>^<deg+C> => <elm> is not a unit #
InstallOtherMethod( IsUnit, "zmodnze : for element [CategoryCollections(IsZmodnZepsObj ) and java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 73
[ IsZmodnZepsObj and IsZmodnZepsRep ], function( elm )
local pow, powers;
powers:=[]; # to store powers of elm
pow:=elm; while true do if pow*elm=One(elm) then
return true; elif IsZero(pow) or (pow in powers) then
return false; fi;
Add(powers,pow);
pow:=pow*elm;
od; end );
############################################################################# # # x^-1 # calculates the inverse element building the list of its powers #
InstallMethod( InverseOp, "zmodnze : for element in Z/nZ(m) (ZModnZepsRep)",
[ IsZmodnZepsObj and IsZmodnZepsRep ], function( elm )
local pow, powers;
powers:=[]; # to store powers of elm
pow:=elm; while true do if pow*elm=One(elm) then
return pow; elif IsZero(pow) or (pow in powers) then
return fail; fi;
Add(powers,pow);
pow:=pow*elm;
od; end );
############################################################################# # # Units # # now simply generates the group using all units. # TODO: Improve by minimizing the list of generators #
InstallMethod( Units, "zmodnze : for full ring Z/nZ(m)",
[ CategoryCollections( IsZmodnZepsObj ) and IsWholeFamily and IsRing ], function( R )
return Group( Filtered(AsList(R), IsUnit ) ); end );
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.