next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: quotientRemainder

quotientRemainder -- matrix quotient and remainder

Synopsis

Description

The equation g*q+r == f will hold. The source of f should be a free module.
i1 : R = ZZ[x,y]

o1 = R

o1 : PolynomialRing
i2 : f = random(R^2,R^{2:-1})

o2 = | 4y    6x+2y |
     | 4x+8y 6x+8y |

             2       2
o2 : Matrix R  <--- R
i3 : g = vars R ++ vars R

o3 = | x y 0 0 |
     | 0 0 x y |

             2       4
o3 : Matrix R  <--- R
i4 : (q,r) = quotientRemainder(f,g)

o4 = ({1} | 0 6 |, 0)
      {1} | 4 2 |
      {1} | 4 6 |
      {1} | 8 8 |

o4 : Sequence
i5 : g*q+r == f

o5 = true
i6 : f = f + map(target f, source f, id_(R^2))

o6 = | 4y+1  6x+2y   |
     | 4x+8y 6x+8y+1 |

             2       2
o6 : Matrix R  <--- R
i7 : (q,r) = quotientRemainder(f,g)

o7 = ({1} | 0 6 |, | 1 0 |)
      {1} | 4 2 |  | 0 1 |
      {1} | 4 6 |
      {1} | 8 8 |

o7 : Sequence
i8 : g*q+r == f

o8 = true

See also

Ways to use quotientRemainder :