up previous next

create a new PolyRing

NewPolyRing(CoeffRing: RING, IndetNames: STRING/LIST): RING
NewPolyRing(CoeffRing: RING, IndetNames: STRING/LIST, OrdMat: MAT, GradingDim: INT): RING

This function returns a polynomial ring which can be used as any programming variable (assigned with := ).

The ::= syntax starts the input method for a new polynomial ring, with the special interpretation of brackets and symbols (i.e. R ::= QQ[x] is not read as X := LL[i]). The pre-defined orderings for the ::= syntax are Lex (no grading), DegLex , DegRevLex (standard grading). For more orderings use the NewPolyRing function call (see also ElimMat ).

NOTE: calling NewPolyRing twice with the same arguments gives two different rings, therefore incompatible. See RingID .

NOTE: the syntax with all indet names in one string is new in CoCoA-5.1.2.

/**/  R ::= QQ[x,y,alpha]; -- is equivalent to
/**/  R := NewPolyRing(QQ, "x,y,alpha"); -- in "define/enddefine" use "RingQQ()"

/**/  R ::= QQ[x,y], DegRevLex; -- is equivalent to
/**/  R := NewPolyRing(QQ, "x,y", StdDegRevLexMat(2), 1);

/**/  OrdM := matrix([[2,3,1],[0,0,-1],[0,-1,0]]);
/**/  P := NewPolyRing(QQ, "x[1],x[2],x[9]", OrdM, 1); -- 3 indeterminates
/**/  [wdeg(X) | X in indets(P)];
[[2], [3], [1]]

/**/  P2 := NewPolyRing(RingZZ(), IndetSymbols(P)); -- same indet names as P
/**/  Indets(P2);
[x[1], x[2], x[9]]

/**/  P3 := NewPolyRing(P2, SymbolRange("alpha", -2,2));
/**/  indets(P3);
[alpha[-2], alpha[-1], alpha[0], alpha[1], alpha[2]]

See Also