Create a polynomial ring using reasonably standard notation.
i1 : A = QQ[x,y,z];
|
i2 : f = x^3+y^2+z^2
3 2 2
o2 = x + y + z
o2 : A
|
i3 : f^2-f
6 3 2 3 2 4 2 2 4 3 2 2
o3 = x + 2x y + 2x z + y + 2y z + z - x - y - z
o3 : A
|
Here are several more examples.
i4 : B = ZZ/32003[x,y,z];
|
i5 : C = GF(8)[x,y,z];
|
i6 : D = ZZ[x,y,z];
|
i7 : E = (frac(ZZ[a,b,c]))[x,y,z];
|
In Macaulay2, there is no concept of current ring. When you assign a ring to a variable, the variables in the ring are made global variables. To get the variables in a previous ring to be available, use
use(Ring).
i8 : x
o8 = x
o8 : E
|
i9 : use D
o9 = D
o9 : PolynomialRing
|
i10 : x
o10 = x
o10 : D
|
Now x is an element of the ring D.
i11 : describe D
o11 = ZZ[x..z, Degrees => {3:1}, Heft => {1}]
|