Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

create polynomial ring from a list

11 views
Skip to first unread message

Juan Diego Rojas

unread,
Sep 18, 2024, 1:54:56 PM9/18/24
to Macaulay2
Given a List of String, how can I create the polynomial ring whose variables are those in the List?

Mike Cummings

unread,
Sep 18, 2024, 1:59:32 PM9/18/24
to Macaulay2
If your list is called L, try:

R = QQ[apply(L, getSymbol)]


Here's an example:

i1 : L = {"a", "hello"}

o1 = {a, hello}

o1 : List

i2 : R = QQ[apply(L, getSymbol)]

o2 = R

o2 : PolynomialRing

i3 : gens R

o3 = {a, hello}

o3 : List

i4 : ideal(a^2 + hello^3)

                3    2
o4 = ideal(hello  + a )

o4 : Ideal of R



-Mike
Reply all
Reply to author
Forward
0 new messages