modp2 - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


modp2

bivariate polynomial arithmetic modulo n

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

modp2(e, p)

Parameters

e

-

algebraic expression

p

-

prime integer

Description

• 

The modp2 function offers fast arithmetic for bivariate polynomials over the integers modulo p, written Zp[x,y].

• 

To achieve its efficiency, modp2 uses a special representation. Explicit conversions are provided for converting the Maple ``sum of products'' representation to and from this representation. Knowledge of this representation is not required by the user in order to use modp2. Also, some of the Maple mod functions already take advantage of the modp2 routines.

• 

The actual representation consists of a list of modp1 polynomials representing the coefficients of the main variable.

• 

A typical use of modp2 would be modp2(Add(a, b), p), meaning add the modp2 polynomial a and the modp2 polynomial b together modulo p and return the result in the form of another modp2 polynomial.  The modp2 function accepts the following functions, whose names are also protected global names.

Add

Coeff

Content

Constant

ConvertIn

ConvertOut

Degree

Diff

Divide

Eval

Factors

RingMultiply

Gcd

Lcm

Multiply

One

Prem

Pquo

Power

Primpart

Randpoly

Sqrfree

TotalDegree

Unit

VarSwap

Zero

 

 

 

 

• 

The Add function is n-ary. The Zero and One nullary functions create the 0 and 1 modp2 polynomials.  The Constant function creates a modp2 polynomial for the given integer constant. The Multiply function is n-ary.  Scalar multiplication can be done using RingMultiply(n, a).

• 

The Degree function computes the degree.  The TotalDegree function computes the total degree in both variables.  The Coeff function computes any coefficient.  The Diff function computes the derivative.  The Randpoly function takes two degrees as  arguments and generates a polynomial of the given degrees with random coefficients modulo p.

• 

The Eval function evaluates one indeterminate of the polynomial for a specific value. The indeterminate to evaluate can be specified as the second argument (followed by the evaluation constant). If the indeterminate is left out, the main variable is evaluated

• 

The ConvertIn and ConvertOut functions are used to convert to and from the modp2 representation. The modp2(ConvertIn(b, x, y), p) command converts from a bivariate polynomial b in x and y over the integers to a modp2 polynomial modulo p. The ConvertOut function does the reverse of ConvertIn.

• 

Note that unlike the mod function, modp2 arithmetic operations do not take the variable as a name. Instead, 1 means take the main variable, x and 2 means use the second variable, y. If the variable argument is left out, the main variable is assumed. For example, the calling sequences of the Diff operation are Diff(a, 1), Diff(a, 2), and Diff(a). Calling sequences are similar for Coeff, Degree, Prem, and Pquo.

Examples

p11

p11

(1)

ax4y21

ax4y21

(2)

amodp2ConvertIna,x,y,p

ax4y2+10mod11

(3)

modp2ConvertOuta,x,y,p

x4y2+10

(4)

bmodp2Randpoly3,4,x,y,p

bx3y4+3x3y3+7x2y4+7x3y2+4x2y3+3xy4+10x3y+9x2y2+5xy3+6y4+2x3+10x2y+4xy2+9y3+x2+10xy+5y2+y+10mod11

(5)

modp2Prema,b,p

2x2y10+9x2y9+4xy10+3x2y8+9xy9+9y10+4x2y7+xy8+10y9+6x2y6+3y8+2x2y5+xy6+8y7+10x2y4+8xy5+5y6+3xy4+2y5+x2y2+7xy3+3y4+2xy2+4y3+3y2+4y+7mod11

(6)

cmodp2Diffa,p

c4x3y2mod11

(7)

modp2ConvertOutc,x,y,p

4x3y2

(8)

dmodp2Diffa,2,p

d2x4ymod11

(9)

modp2ConvertOutd,x,y,p

2x4y

(10)

modp2Gcda,d,p

1mod11

(11)

See Also

mod

modp1

type,zppoly