Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# Dom::IntegerMod

Residue class rings modulo integers

## Syntax

### Domain Creation

`Dom::IntegerMod(n)`

### Element Creation

`Dom::IntegerMod(n)(a)`

## Description

### Domain Creation

Dom::IntegerMod(n) creates the residue class ring of integers modulo n.

Dom::IntegerMod(n) creates the integer residue class rings .

### Element Creation

Dom::IntegerMod(n)(a) creates the residue class of a modulo n.

Dom::BaseDomain

## Categories

If n is prime, then Cat::Field, else Cat::CommutativeRing.

## Examples

### Example 1

We define the residue class ring of the integers mod 7:

`Z7:= Dom::IntegerMod(7)`

Next, we create some elements:

`a:= Z7(1); b:= Z7(2); c:= Z7(3)`

We may use infix notation for arithmetical operations since the operators have been overloaded:

`a + b, a*b*c, 1/c, b/c/a/c`

a and b are squares while c is not:

`Z7::isSquare(a), Z7::isSquare(b), Z7::isSquare(c)`

Indeed, c is a generator of the group of units:

`Z7::order(a), Z7::order(b), Z7::order(c)`

## Parameters

 n Positive integer greater than 1 a Any integer or a rational number whose denominator is coprime to n

## Entries

 "characteristic" the characteristic of the residue class ring, n "one" the unit element, 1 mod n "zero" the zero element, 0 mod n

expand all

## Mathematical Methods

### _divide — Division of two elements

_divide(element1, element2)

_invert(element)

### _mult — Multiply elements

_mult(element, …)

_negate(element)

### _plus — Add elements

_plus(element, …)

### _power — Power of elements

_power(element, power)

### _subtract — Subtraction of two elements

_subtract(element1, element2)

### D — Return derivative

Inherited from Cat::CommutativeRing.

### associates — Test for associate elements

Inherited from Cat::Field.

### coerce — Coerce into this domain

Inherited from Cat::BaseCategory.

### diff — Differentiate element

Inherited from Cat::CommutativeRing.

### divide — Division with remainder

Inherited from Cat::Field.

### divides — Test if division is exact

Inherited from Cat::Field.

### equal — Test for mathematical equality

Inherited from Dom::BaseDomain.

### equiv — Test for equivalence

Inherited from Cat::BaseCategory.

### euclideanDegree — Return Euclidean degree

Inherited from Cat::Field.

### factor — Unique factorization

Inherited from Cat::Field.

### gcd — Greatest common divisor

Inherited from Cat::Field.

### gcdex — Extended greatest common divisor

Inherited from Cat::EuclideanDomain.

### idealGenerator — Generator of finitely generated ideal

Inherited from Cat::EuclideanDomain.

### irreducible — Test if element is irreducible

Inherited from Cat::Field.

### isUnit — Test if element is an unit

Inherited from Cat::Field.

### isone — Test if element is one

Inherited from Cat::Monoid.

### lcm — Least common multiple

Inherited from Cat::GcdDomain.

### quo — Return Euclidean quotient

Inherited from Cat::Field.

### rem — Return Euclidean remainder

Inherited from Cat::Field.

### sqrfree — Square-free factorization

Inherited from Cat::Field.

### testtype — Test type of object

Inherited from Cat::BaseCategory.

### isSquare — Test for being a square

isSquare(element)

iszero(element)

### ln — Discrete logarithm

ln(element, base)

The result is infinity if element is not in the subgroup generated by base.

The result is FAIL if base is not a unit.

### order — Order

order(element)

The result is FAIL if element is not a unit.

## Access Methods

### subs — Avoid substitution

Inherited from Dom::BaseDomain.

### subsex — Avoid extended substitution

Inherited from Dom::BaseDomain.

## Conversion Methods

TeX(element)

### convert — Conversion

convert(number)

The conversion fails if the denominator of number and the modulus n are not relatively prime.

### convert_to — Conversion

convert_to(element, d)

expr(element)

## Technical Methods

### allAxioms — Return all axioms

Inherited from Dom::BaseDomain.

### allCategories — Return all categories

Inherited from Dom::BaseDomain.

### allEntries — Return the names of all entries

Inherited from Dom::BaseDomain.

### allSuperDomains — Return all super-domains

Inherited from Dom::BaseDomain.

### getAxioms — Return axioms stated in the constructor

Inherited from Dom::BaseDomain.

### getCategories — Return categories stated in the constructor

Inherited from Dom::BaseDomain.

### getSuperDomain — Return super-domain stated in the constructor

Inherited from Dom::BaseDomain.

### hasProp — Test for a certain property

Inherited from Dom::BaseDomain.

Inherited from Dom::BaseDomain.

### new — Create element of this domain

Inherited from Cat::BaseCategory.

print(element)

### printMethods — Print out methods

Inherited from Dom::BaseDomain.

random()

### undefinedEntries — Return missing entries

Inherited from Dom::BaseDomain.

### unitNormal — Unit normal form

Inherited from Cat::Field.

### unitNormalRep — Unit normal representation

Inherited from Cat::Field.

### whichEntry — Return the domain or category implementing an entry

Inherited from Dom::BaseDomain.