# notation appointment

Hello, I was reading about Basic Rings, and the notation ratpoly.<t> = PolynomialRing(QQ) popped up. What is the <> for? It's not a function call, although I can see what it does. And the ratpoly has no meaning. I substituted skunkpoly with the same result. I can't seem to find much about it.

edit retag close merge delete

ratpoly.<t> = PolynomialRing(QQ) defines the ring of polynomials in variable t over the ring QQ. The ratpoly becomes the name for this polynomial ring (like QQ for the rational numbers). Does that answer your question?

( 2023-08-11 16:37:04 +0100 )edit

I think the syntax is inspired by Magma.

( 2023-08-11 17:47:37 +0100 )edit

Sort by ยป oldest newest most voted

Sage syntax is based on Python syntax, but with a "preparser" added. One prominent example of this is that Sage uses ^ for exponentiation, so the preparser turns ^ into ** before passing it on to Python. The <> syntax is another example, and you can find out what it does by explicitly calling the preparser:

sage: preparse('ratpoly.<t> = PolynomialRing(QQ)')
"ratpoly = PolynomialRing(QQ, names=('t',)); (t,) = ratpoly._first_ngens(1)"


So first it does

"ratpoly = PolynomialRing(QQ, names=('t',))


which defines ratpoly to be a polynomial ring, coefficients in QQ, with a single generator named t. The second thing is

(t,) = ratpoly._first_ngens(1)


which defines t to be the generator. So it's shorthand that simultaneously defines both the name of the polynomial ring and its generator.

This is described in the Sage tutorial and has more thorough documentation in the reference manual.

more