Documentation Center

  • Trial Software
  • Product Updates

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.

Superdomain

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

Methods

expand all

Mathematical Methods

_divide — Division of two elements

_divide(element1, element2)

_invert — Invert elements

_invert(element)

_mult — Multiply elements

_mult(element, …)

_negate — Negate elements

_negate(element)

_plus — Add elements

_plus(element, …)

_power — Power of elements

_power(element, power)

_subtract — Subtraction of two elements

_subtract(element1, element2)

iszero — Zero test

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

Conversion Methods

TeX — TeX output

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)

Technical Methods

See Also

MuPAD Domains

Was this topic helpful?