Euclidean - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


OreTools

  

Euclidean

  

perform right or left Euclidean algorithm

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Euclidean['right'](Poly1, Poly2, A, 'c1', 'c2')

Euclidean(Poly1, Poly2, A, 'c1', 'c2')

Euclidean['left'](Poly1, Poly2, A, 'c1', 'c2')

Parameters

Poly1, Poly2

-

nonzero Ore polynomials; to define an Ore polynomial, use the OrePoly structure.

A

-

Ore algebra; to define an Ore algebra, use the SetOreRing function.

'c1', 'c2'

-

(optional) unevaluated names

Description

• 

The Euclidean['right'](Poly1, Poly2, A) or Euclidean(Poly1, Poly2, A) calling sequence returns a list [m, S] where m is a positive integer and S is an array with m nonzero Ore polynomials such that:

S1=Poly1,S2=Poly2,Si=Remainder'right'Si−2,Si−1,A⁢i=3,4,...,m.

  

In addition, Remainder['right'](S[m-1], S[m], A) = 0. S is called the right Euclidean polynomial remainder sequence of Poly1 and Poly2.

• 

If the fourth argument c1 of Euclidean['right'] or Euclidean is specified, it is assigned the first co-sequence of Poly1 and Poly2 so that:

c1i⁢Poly1=Si⁢⁢is⁢right divisible⁢by⁢⁢Poly2,i=1,2,...,m

  

and c1[m+1] Poly1 is a least common left multiple (LCLM) of Poly1 and Poly2.

• 

If the fifth argument c2 of Euclidean['right'] or Euclidean is specified, it is assigned the second co-sequence of Poly1 and Poly2 so that:

c1i⁢Poly1+c2i⁢Poly2=Si⁢⁢⁢i=1,2,...,m

  

and c1m+1⁢Poly1=−c2m+1⁢Poly2 is an LCLM of Poly1 and Poly2.

• 

The Euclidean['left'](Poly1, Poly2, A) calling sequence returns a list [m, S] where m is a positive integer and S is an array with m nonzero Ore polynomials such that:

S1=Poly1,S2=Poly2,Si=Remainder'left'Si−2,Si−1,A⁢i=3,4,...,m.

  

In addition, Remainderleft⁡Sm−1,Sm,A=0. S is called the left Euclidean polynomial remainder sequence of Poly1 and Poly2.

• 

If the fourth argument c1 of Euclidean['left'] is specified, it is assigned the first co-sequence of Poly1 and Poly2 so that:

Poly1⁢c1i−Si⁢⁢⁢is⁢left divisible⁢by⁢Poly2,i=1,2,...,m

  

and Poly1 c1[m+1] is a least common right multiple (LCRM) of Poly1 and Poly2.

• 

If the fifth argument c2 of Euclidean['left'] is is specified, it is assigned the second co-sequence of Poly1 and Poly2 so that:

Poly1⁢c1i+Poly2⁢c2i=Si⁢⁢⁢i=1,2,...,m

  

and Poly1 c1[m+1]= - Poly2 c2[m+1] is an LCRM of Poly1 and Poly2.

Examples

Perform the right Euclidean algorithm.

> 

with⁡OreTools:

> 

A≔SetOreRing⁡x,differential

A≔UnivariateOreRing⁡x,differential

(1)
> 

Ore1≔OrePoly⁡1,3⁢x,x2−1+x,23⁢x+1

Ore1≔OrePoly⁡1,3⁢x,x2−x−1,23⁢x+1

(2)
> 

Ore2≔OrePoly⁡x,x,x2+x+1

Ore2≔OrePoly⁡x,x,x2+x+1

(3)
> 

U≔Euclideanright⁡Ore1,Ore2,A,c1,c2

U≔4,S

(4)
> 

m≔U1;S≔U2

m≔4

S≔S

(5)
> 

print⁡S

OrePoly⁡1,3⁢x,x2−x−1,23⁢x+1OrePoly⁡x,x,x2+x+1OrePoly⁡−x⁢x4−x3−49⁢x2−7⁢x+20x2+x+12,2⁢x5−17⁢x4+32⁢x3−14⁢x2−20⁢x−1x2+x+12OrePoly⁡x12+5⁢x11−200⁢x10+598⁢x9+1451⁢x8+2135⁢x7+1781⁢x6+1343⁢x5+1850⁢x4+1420⁢x3+981⁢x2−5⁢x−202⁢x5−17⁢x4+32⁢x3−14⁢x2−20⁢x−12

(6)

Check the co-sequences.

> 

foritomdoW1≔Multiply⁡c1i,Ore1,A;W2≔Multiply⁡c2i,Ore2,A;W≔Add⁡W1,W2;C≔Minus⁡W,Si;print⁡Cenddo:

OrePoly⁡0

OrePoly⁡0

OrePoly⁡0

OrePoly⁡0

(7)

Check the LCLM.

> 

W3≔Multiply⁡c15,Ore1,A:

> 

W4≔Multiply⁡c25,Ore2,A:

> 

Add⁡W3,W4

OrePoly⁡0

(8)

Perform the left Euclidean algorithm.

> 

U≔Euclideanleft⁡Ore1,Ore2,A,c1,c2

U≔4,S

(9)
> 

m≔U1;S≔U2

m≔4

S≔S

(10)
> 

print⁡S

OrePoly⁡1,3⁢x,x2−x−1,23⁢x+1OrePoly⁡x,x,x2+x+1OrePoly⁡−x7+18⁢x5+99⁢x4−12⁢x3−1059⁢x2−955⁢x−51x2+x+13,2⁢x5−21⁢x4+20⁢x3−17⁢x2−289⁢x−136x2+x+12OrePoly⁡x12+x11+44⁢x10+556⁢x9+1037⁢x8+1941⁢x7+11909⁢x6+36562⁢x5+72548⁢x4+88995⁢x3+76169⁢x2+39236⁢x+123082⁢x5−21⁢x4+20⁢x3−17⁢x2−289⁢x−1362

(11)

Check the co-sequences.

> 

foritomdoW1≔Multiply⁡Ore1,c1i,A;W2≔Multiply⁡Ore2,c2i,A;W≔Add⁡W1,W2;C≔Minus⁡W,Si;print⁡Cenddo:

OrePoly⁡0

OrePoly⁡0

OrePoly⁡0

OrePoly⁡0

(12)

Check the LCRM.

> 

W3≔Multiply⁡Ore1,c1m+1,A:

> 

W4≔Multiply⁡Ore2,c2m+1,A:

> 

Add⁡W3,W4

OrePoly⁡0

(13)

See Also

OreTools

OreTools/Add

OreTools/Minus

OreTools/Multiply

OreTools/OreAlgebra

OreTools/OrePoly

OreTools/Quotient

OreTools/Remainder

OreTools[SetOreRing]