Macaulay2 » Documentation
Packages » Macaulay2Doc :: setupPromote
next | previous | forward | backward | up | index | toc

setupPromote -- set up promote from one ring to another

Synopsis

Description

This defines promotion from one ring to another as the application of a ring map. After calling setupPromote, any operation that is given an element of the source of f but expects an element of the target of f will automatically promote it by applying f.

i1 : R=QQ[x_1,x_2]

o1 = R

o1 : PolynomialRing
i2 : R'=QQ[e_1,e_2,Degrees=>{1,2}]

o2 = R'

o2 : PolynomialRing
i3 : setupPromote map(R,R',{x_1+x_2,x_1*x_2})
i4 : promote(e_1^2,R)

      2            2
o4 = x  + 2x x  + x
      1     1 2    2

o4 : R
i5 : e_1*x_1

      2
o5 = x  + x x
      1    1 2

o5 : R
i6 : e_2==x_1*x_2

o6 = true

See also

Ways to use setupPromote:

For the programmer

The object setupPromote is a method function.