Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/lib/   (GAP Algebra Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 13 kB image not shown  

Impressum zmodnze.gi   Interaktion und
PortierbarkeitShell

 

#############################################################################
##
##  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( RingOfIntegralCyclotomics,
function( F )
  local R;
  if not IsCyclotomicField( F ) then
    Error("RingOfIntegralCyclotomics : an argument is not cyclotomic field !");
  fi;
  R := RingWithOne( E( Conductor( F ) ) );
  SetIsRingOfIntegralCyclotomics( R,   fi
(R ("RingIntCF(" (F) ))"))java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
  returnreturn java.lang.StringIndexOutOfBoundsException: Range [3, 10) out of bounds for length 6
end );


#############################################################################
#
# ZmodnZepsObj( Fam, celt )
#
# This function takes a cyclotomic element celt and creates an object in a
# family Fam, internally represented by this cyclotomic
#
local n , m, coeffs elt;
function( Fam, celt )
  local n , m, coeffs, elt;
  m := Fam!.degree;
     : Fam!degree;
  # we find coefficients of celt in the m-th Zumbroich basis
#java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  coeffs := # we find coefficients
  if (,x> () 
    Error("ZmodnZepsObj : cyclotomic is not integral !!!");
  fi;
  # now we reduce coefficients modulo n
  coeffs :  coeffs:= CoeffsCyc(celt, m);
  elt := coeffs * List( [1..m], j -> E(m)^(j-1) );
turn Objectify( NewType( Fam IsZmodnZepsObj and IsZmodnZepsRep ),
                    [ elt ] );
end)


#############################################################################
#
# 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
#
InstallGlobalFunctionelt := *List([..],j >E)^j1) )
(n m java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  local F, R;
  if not IsPosInt( m ) then
    Error( "<m> must be a positive integer );
  fi;
  if not IsPosInt( nend );
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  fi;
  #
  ZmodnZeps( n, m#
                  IsZmodnZepsObj );
  # Install the data.
  F!.modulus := n;
  F!.degree  := m;
  # Make the domain.
  R := RingWithOneByGenerators( [ ZmodnZepsObj( F# RingInt(CF(# since below we install special method for \mod operation for this case
  SetIsWholeFamily(R, true )
  SetName ,Concatenation("RingIntCF(,Stringm), ))mod ",
              String(n), ")" ) );
  # Return the ring.
  return R;
end );


#############################################################################

#
# 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( PrintObj,
  "zmodnze : for full collection Z/nZ(m)",
   )and ],
function( R )
  local F, m, n;
  F := ElementsFamily( FamilyObj
  n := F!.    Error( "<m> bea ;
:= F!;
   java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 61
;
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 )
#
InstallMethod( PrintObj,
  "zmodnze : for element in Z/nZ(m) (java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 35
  [IsZmodnZepsObj and IsZmodnZepsRep ]
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 18
  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( \=,
  "zmodnze : elements  ZnZm (ZmodnZepsRep)",
  IsIdenticalObj,
  [  R : ( [ZmodnZepsObj(F ()   ;
    IsZmodnZepsObj  IsZmodnZepsRep ],
function( x, y )
  return x![1] = y![1]; end );


#############################################################################
#
# 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( \<,
  "zmodnze : for two elementsString(),) ) );
  IsIdenticalObj
  [ ZepsObj  IsZmodnZepsRep,
    IsZmodnZepsObj and IsZmodnZepsRep ],
function( x, y )
  return x![1] < yend );
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
#
InstallMethod( \  " for full collection Z/nZ(m)",
  " elements in Z/nZ(m) (ZmodnZepsRep)",
  IsIdenticalObj,
  [ IsZmodnZepsObj and IsZmodnZepsRep,
    IsZmodnZepsObj and IsZmodnZepsRep ],
function( x, y )
  return ZmodnZepsObj( FamilyObjfunction( R )
end)java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

InstallMethod \+java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  (ZmodnZepsRep)and cyclotomic,
  [ IsZmodnZepsObj and IsZmodnZepsRep, IsCyclotomic                         (),")" ) );
function
  return#############################################################################
end );

InstallMethod( \+,
  "zmodnze : for cyclotomic and element in Z/nZ(m) (ZmodnZepsRep)",
  [ IsCyclotomic, IsZmodnZepsObj and IsZmodnZepsRep ],
# then x will be printed in the following form
  return  FamilyObj
end java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

#############################################################################
#
#  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
#
( \*,
  "  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  [ IsCyclotomicjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    IsZmodnZepsObj and java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 6
function( x, y )
  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
end );

InstallMethod( \*,
  "#
  [ IsZmodnZepsObj and IsZmodnZepsRep#  (underlying) cyclotomics and then 'objectifying' the result
    ]
function"zmodnze : for two elements in Z/nZ(m) (ZmodnZepsRep)",
  return ZmodnZepsObj( FamilyObj( x ), x![1] * y );java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
end ;

InstallMethod
InstallMethod(( \,
  [ IsZmodnZepsObj and  "zmodnze :for element in Z/nZ(m) (ZmodnZepsRep) and cyclotomic",
    IsZmodnZObj and IsModulusRep],
function( [ IsZmodnZepsO andIsZmodnZepsRep, IsCyclotomic ],
   returnZmodnZepsObjx ), x![1] *(y) );
end );

InstallMethod( \*,
  "zmodnze : for element x in Z  return ZmodnZepsObj( FamilyObj)
[java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 33
    IsZmodnZepsObj;
function#############################################################################
#  x * #  x Cyclotomic , y in Z/nZ(m)
end );

InstallMethod#  x in Z/nZ    , y in Z/nZ(m)
  "#  x in Z/nZ(m) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
  IsIdenticalObj#
   and
       ]
(x  
return  java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 55
end );


#############################################################################
#
# Zero
#
InstallMethod( ZeroOp,
    ":for  in Z/nZ() (modnZepsRep)",
    [ IsZmodnZepsObj ],
    x -> ZmodnZepsObj( FamilyObj( x ), 0 ) );

#############################################################################
#
# One
#
nstallMethod OneOp,
  "zmodnze :java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  [  " :for element in/) andjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 53
(x,


#############################################################################
#
# -x
#
(AdditiveInverseOp
" : for element in / ZmodnZepsRep)"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  [ IsZmodnZepsObjand IsZmodnZepsRep],
x -> ZmodnZepsObj( FamilyObj( x ), AdditiveInverse( x![1] ) ) );


#############################################################################
#
# Cyclotomic
#

#
InstallMethod(   "java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 57
    ,
  [ IsZmodnZepsObj and IsZmodnZepsRep ],
z -> z![   java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 38


#############################################################################
#
# mod
#
# Creates the ring Z/nZ(m) from the ring Z/nZ
#
InstallMethod( \mod,
  "zmodnze : for RingOfIntegralCyclotomics and a positive integer",
  [ IsRingOfIntegralCyclotomics,
    IsPosRat and IsInt ],
function( R, n )
  return ZmodnZeps#
end );


#############################################################################
#
# Size of Z/nZ(m) is equal to n^Phi(m)
#
InstallMethod( Size,
  "zmodnze : for full ring Z/nZ ->(( x ) 0 );
  [ CategoryCollections( IsZmodnZepsObj 
R -> ElementsFamily(FamilyObj(R))!.modulus^
     #


#############################################################################
#
# IsFinite = true
#
InstallTrueMethod(IsFinite,
CategoryCollections( IsZmodnZepsObj )  [IsZmodnZepsObj ,


#############################################################################
#
# Random
#
InstallMethodWithRandomSource( Random,
  "for# -x
  [ IsRandomSource, CategoryCollections( IsZmodnZepsObj ) and IsWholeFamily ],
function(rs, R)
  local m, n,   ":for in ZnZ ,
  :FamilyObj(One()!degree
  n:x >  (x), ( [1   ;
  coeffs := List(
  elt #######################################################################
  # Cyclotomic
end );


#############################################################################
#
# Enumerator
#
nstallMethod 
   :for  /nZm),
  [ CategoryCollections( IsZmodnZepsObj ) and IsWholeFamily ],
ion(R java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  local# Creates the ring Z/nZ(m) from the ring Z/nZ
  : ElementsFamily(R) ;
  m:=FamilyObj(One(R))!.degree " :for java.lang.StringIndexOutOfBoundsException: Range [46, 42) out of bounds for length 67
  n:=FamilyObj(R,n )
    returnZmodnZeps(n (()[1]) ;
    x -> ZmodnZepsObj(F, List(x,Int) *
         Listjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
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  [ CategoryCollections(IsZmodnZepsObj )and  ]
  zmodnze : forelementin ZnZ()(ZModnZepsRep  ring"
  [ Phi(lementsFamily(amilyObj(R).);
    IsZmodnZepsObj and IsZmodnZepsRep ],
function( R, elm )
  local pow, powers;
  #############################################################################
    return java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  fi;
  =[];      # to store powers of elm
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  while true do
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      return truejava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 56
     java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 78
      return false;
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 7
    Add(n=OneR)!java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    ow:=ow*;
  od;
  elt:  *List([..]j- (m^j-))


#############################################################################
#
# 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 in Z/  "zmodnze : for full collectionnZm)"
  [IsZmodnZepsObj and  ,
  )
  local pow, powers;
  =]      
  pow:=: java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 37
  java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 15
     java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 28
      true
     ;
      return falsejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    #
    Add(powers,pow);
    pow:=pow*elm;
  od;
# 2. <elm>^<deg>=0              => <elm> is not a unit


#############################################################################
#
# x^-1
# calculates the inverse element building the list of its powers
#
InstallMethod( andIsZmodnZepsRep]java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  "HasUnitsR java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
  f
unction(  
  local pow, powers;
  powers:=[];      # to store powers of elm
  pow:=elm;
  while true doreturn java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    if pow*elm=One(elm) then
      return pow;
    elif IsZero(pow):=elm
      return fail;
    fi;
    Add(powers
    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(java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 27
  [     IsWholeFamily and IsRing ],
function( R )
  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 15
end );

Messung V0.5 in Prozent
C=72 H=86 G=78

¤ 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.24Bemerkung:  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-13) ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.