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 |
Promotion of real numbers to rational numbers is accomplished by using all of the bits of the internal representation.
i10 : promote(101.,QQ) o10 = 101 o10 : QQ |
i11 : promote(.101,QQ)
3638908498915361
o11 = -----------------
36028797018963968
o11 : QQ
|
i12 : factor denominator oo
55
o12 = 2
o12 : Expression of class Product
|
i13 : ooo + 0. o13 = .101 o13 : RR (of precision 53) |
i14 : oo === .101 o14 = true |
For promotion of ring elements, there is the following shorter notation.
i15 : 13_R o15 = 13 o15 : 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.
i16 : use R; |
i17 : I = ideal(a^2,a^3,a^4)
2 3 4
o17 = ideal (a , a , a )
o17 : Ideal of R
|
i18 : promote(I,S)
2
o18 = ideal (b + 1, a*b + a, b + 2b + 1)
o18 : Ideal of S
|
i19 : m = image matrix{{a^2,a^3,a^4}}
o19 = image | a2 a3 a4 |
1
o19 : R-module, submodule of R
|
i20 : promote(gens m,S)
o20 = | b+1 ab+a b2+2b+1 |
1 3
o20 : Matrix S <--- S
|
i21 : G m
o21 = image | b+1 ab+a b2+2b+1 |
1
o21 : S-module, submodule of S
|
i22 : m ** S
o22 = cokernel {2} | a 0 |
{3} | -1 a |
{4} | 0 -1 |
3
o22 : S-module, quotient of S
|
The object promote is a method function.