Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » substitution and maps between rings » working with multiple rings » promote
next | previous | forward | backward | up | index | toc

promote -- promote to another ring

Description

Promote the given ring element or matrix f to an element or matrix of R, via the natural map to R. This is semantically equivalent to creating the natural ring map from ring f --> R and mapping f via this map.

i1 : R = QQ[a..d]; f = a^2;
i3 : S = R/(a^2-b-1);
i4 : promote(2/3,S)

     2
o4 = -
     3

o4 : S
i5 : F = map(R,QQ);  F(2/3)

o5 : RingMap R <-- QQ

     2
o6 = -
     3

o6 : R
i7 : promote(f,S)

o7 = b + 1

o7 : S
i8 : G = map(S,R); G(f)

o8 : RingMap S <-- R

o9 = b + 1

o9 : S

For promotion of ring elements, there is the following shorter notation.

i10 : 13_R

o10 = 13

o10 : R

If you wish to promote a module to another ring, either promote the corresponding matrices, use the natural ring map, or use tensor product of matrices or modules.

i11 : use R;
i12 : I = ideal(a^2,a^3,a^4)

              2   3   4
o12 = ideal (a , a , a )

o12 : Ideal of R
i13 : promote(I,S)

                              2
o13 = ideal (b + 1, a*b + a, b  + 2b + 1)

o13 : Ideal of S
i14 : m = image matrix{{a^2,a^3,a^4}}

o14 = image | a2 a3 a4 |

                              1
o14 : R-module, submodule of R
i15 : promote(gens m,S)

o15 = | b+1 ab+a b2+2b+1 |

              1      3
o15 : Matrix S  <-- S
i16 : G m

o16 = image | b+1 ab+a b2+2b+1 |

                              1
o16 : S-module, submodule of S
i17 : m ** S

o17 = cokernel {2} | a  0  |
               {3} | -1 a  |
               {4} | 0  -1 |

                             3
o17 : S-module, quotient of S
A special feature is that if f is rational, and R is not an algebra over QQ, then an element of R is provided by attempting the evident division.

Prior to version 1.26.05, promotion of real numbers to rational numbers was accomplished by using all of the bits of the internal representation. This feature was removed since there is no natural map from $\RR\to\QQ$. However, this functionality is still available using the unexported function internalRepresentation.

i18 : debug Core
i19 : internalRepresentation 101.

o19 = 101

o19 : QQ
i20 : internalRepresentation .101

       3638908498915361
o20 = -----------------
      36028797018963968

o20 : QQ
i21 : factor denominator oo

       55
o21 = 2

o21 : Expression of class Product
i22 : ooo + 0.

o22 = .101

o22 : RR (of precision 53)
i23 : oo === .101

o23 = true

See also

Menu

Ways to use promote:

  • promote(Constant,type of InexactNumber') (missing documentation)
  • promote(Constant,type of RingElement) (missing documentation)
  • promote(IndexedVariable,type of RingElement) (missing documentation)
  • promote(List,type of CCi_*,type of CCi_*) (missing documentation)
  • promote(List,type of RRi_*,type of CCi_*) (missing documentation)
  • promote(List,type of RRi_*,type of RRi_*) (missing documentation)
  • promote(Matrix,type of CCi_*,type of CCi_*) (missing documentation)
  • promote(Matrix,type of RRi_*,type of CCi_*) (missing documentation)
  • promote(Matrix,type of RRi_*,type of RRi_*) (missing documentation)

For the programmer

The object promote is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2:173:0.