Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);R

why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);R

why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);Rdef vbl(l,ex): ....: #li=liste de variables ....: #ex=liste d'entiers naturels de même longueur que li ....: n=len(l) ....: V=1 ....: for i in range(n): ....: V=V[l[i]*ex[i]] ....: return V

why sage does find problems when calculating with objects put in a list ?

def vbl(l,ex): ....: vbl(c,ex): #li=liste de variables ....: l=len(c) #ex=liste d'entiers naturels de même longueur que li ....: n=len(l) ....: V=1 ....: V=1 for i in range(n): ....: V=V[l[i][c[i]*ex[i]] ....: return V

why sage does find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

why sage does find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

why sage does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

why does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

why does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

why does Sage find problems when calculating with objects put in a list ?

Consider:

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

.

why does Sage find problems when calculating with objects put in a list ?

Consider:.

def vbl(c,ex):
                l=len(c)
               V=1 
               for i in range(n):
                    V=V[c[i]*ex[i]]
V=V*[c[i]**ex[i]]
                return V

V

.

why does Sage find problems when calculating with objects put in a list ?

.I define the following function:

def vbl(c,ex):
vbl(c, ex):
 l = len(c)
         l=len(c)
               V=1 V = 1       for i in range(n):
                    V=V*[c[i]**ex[i]]
            V = V * [c[i]**ex[i]]
    return V

.I then compute

 sage: vbl(['x, y, z'], [2, 3, 4])

expecting to get

x^2**y^3**z^4

Instead, I get an error:

TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'

Yet I can compute x^2, y^3 and z^4 after declaring x, y and z as variables:

sage: var('x, y, z')

What happens?