<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>Singular Book 1.1.9 -- computation in polynomial rings</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Singular_sp__Book_sp1.1.10.html">next</a> | <a href="___Singular_sp__Book_sp1.1.8.html">previous</a> | <a href="___Singular_sp__Book_sp1.1.10.html">forward</a> | <a href="___Singular_sp__Book_sp1.1.8.html">backward</a> | <a href="___M2__Singular__Book.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_basic_spcommutative_spalgebra.html" title="">basic commutative algebra</a> > <a href="___M2__Singular__Book.html" title="Macaulay2 examples for the Singular book">M2SingularBook</a> > <a href="___Singular_sp__Book_sp1.1.9.html" title="computation in polynomial rings">Singular Book 1.1.9</a></div> <hr/> <div><h1>Singular Book 1.1.9 -- computation in polynomial rings</h1> <div>Create a polynomial ring using reasonably standard notation.<table class="examples"><tr><td><pre>i1 : A = QQ[x,y,z];</pre> </td></tr> <tr><td><pre>i2 : f = x^3+y^2+z^2 3 2 2 o2 = x + y + z o2 : A</pre> </td></tr> <tr><td><pre>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</pre> </td></tr> </table> Here are several more examples.<table class="examples"><tr><td><pre>i4 : B = ZZ/32003[x,y,z];</pre> </td></tr> <tr><td><pre>i5 : C = GF(8)[x,y,z];</pre> </td></tr> <tr><td><pre>i6 : D = ZZ[x,y,z];</pre> </td></tr> <tr><td><pre>i7 : E = (frac(ZZ[a,b,c]))[x,y,z];</pre> </td></tr> </table> 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 <a href="_use_lp__Ring_rp.html" title="install ring variables and ring operations">use(Ring)</a>.<table class="examples"><tr><td><pre>i8 : x o8 = x o8 : E</pre> </td></tr> <tr><td><pre>i9 : use D o9 = D o9 : PolynomialRing</pre> </td></tr> <tr><td><pre>i10 : x o10 = x o10 : D</pre> </td></tr> </table> Now x is an element of the ring D.<table class="examples"><tr><td><pre>i11 : describe D o11 = ZZ[x..z, Degrees => {3:1}, Heft => {1}, MonomialOrder => ----------------------------------------------------------------------- {MonomialSize => 32}, DegreeRank => 1] {GRevLex => {3:1} } {Position => Up }</pre> </td></tr> </table> </div> </div> </body> </html>