Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » polynomial rings » get a ring variable by index
next | previous | forward | backward | up | index | toc

# get a ring variable by index -- get a ring variable by index

- Usage:
    `R_i`
- Inputs:
  - R
  - i
- Outputs:
  - a ring element, the i-th generator of the ring R

The indexing of generators is based on 0, so R_0 would be the first one, and so on.

    i1 : R = ZZ[a..d]

    o1 = R

    o1 : PolynomialRing

    i2 : R_2

    o2 = c

    o2 : R

If the coefficient ring is a polynomial ring, then the numbering matches that in the list returned by generators.

    i3 : S = R[x,y,z]

    o3 = S

    o3 : PolynomialRing

    i4 : generators(S,CoefficientRing=>ZZ)

    o4 = {x, y, z, a, b, c, d}

    o4 : List

    i5 : S_2

    o5 = z

    o5 : S

    i6 : S_6

    o6 = d

    o6 : S

## See also

- generators -- provide matrix or list of generators
- String _ Ring -- get a ring variable by name

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/operators/underscore.m2:156:0.