On Mar 8, 7:59 am, lesshaste <[email protected]> wrote:
> I am having problems simply defining a multivariate polynomial. I have
> a slightly modified excerpt from a very helpful python script I was
> given that looks like
>
> #!/opt/sage-4.3.3-linux-32bit-ubuntu_9.10-i686-Linux/sage -python
>
> import sys
> from sage.all import *
>
> from polybori.blocks import declare_ring
> from polybori.blocks import HigherOrderBlock
>
> index1_range=range(2)
> index2_range=range(2)
> index3_range=range(3)
> size=(len(index1_range),len(index2_range),len(index3_range))
> declare_ring([HigherOrderBlock("alpha",size),HigherOrderBlock("beta",size), 
> HigherOrderBlock("gamma",size)],
> globals())

You could do something like this:

sage: R = PolynomialRing(ZZ, names=['a' + str(i) for i in range(5)] +
['b' + str(i) for i in range(10)])
sage: R
Multivariate Polynomial Ring in a0, a1, a2, a3, a4, b0, b1, b2, b3,
b4, b5, b6, b7, b8, b9 over Integer Ring

Then to define the ideal, note that you can get elements like this:

sage: R('a0')
a0
sage: R('b' + str(2))
b2

So it should be easy to define a function which computes the ideal you
want.

--
John

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to