Its not linear algebra but comes from the symbolic ring stuff: sage: var('x,y') (x, y) sage: (y - sqrt(x)).polynomial(None, ring=SR[y]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-75-0227d66cfcfd> in <module>() ----> 1 (y - sqrt(x)).polynomial(None, ring=SR[y])
/home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.polynomial (sage/symbolic/expression.cpp:23610)() /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in polynomial(ex, base_ring, ring) 1054 """ 1055 converter = PolynomialConverter(ex, base_ring=base_ring, ring=ring) -> 1056 res = converter() 1057 return converter.ring(res) 1058 /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex) 212 div = self.get_fake_div(ex) 213 return self.arithmetic(div, div.operator()) --> 214 return self.arithmetic(ex, operator) 215 elif operator in relation_operators: 216 return self.relation(ex, operator) /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in arithmetic(self, ex, operator) 1008 return self(base)**Integer(exp) 1009 else: -> 1010 ops = [self(a) for a in ex.operands()] 1011 return reduce(operator, ops) 1012 /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex) 212 div = self.get_fake_div(ex) 213 return self.arithmetic(div, div.operator()) --> 214 return self.arithmetic(ex, operator) 215 elif operator in relation_operators: 216 return self.relation(ex, operator) /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in arithmetic(self, ex, operator) 1008 return self(base)**Integer(exp) 1009 else: -> 1010 ops = [self(a) for a in ex.operands()] 1011 return reduce(operator, ops) 1012 /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex) 212 div = self.get_fake_div(ex) 213 return self.arithmetic(div, div.operator()) --> 214 return self.arithmetic(ex, operator) 215 elif operator in relation_operators: 216 return self.relation(ex, operator) /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in arithmetic(self, ex, operator) 1006 from sage.rings.all import Integer 1007 base, exp = ex.operands() -> 1008 return self(base)**Integer(exp) 1009 else: 1010 ops = [self(a) for a in ex.operands()] /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__ (sage/rings/integer.c:7335)() /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression._integer_ (sage/symbolic/expression.cpp:5340)() /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__ (sage/rings/integer.c:7335)() /home/vbraun/opt/sage-5.9.beta2/local/lib/python2.7/site-packages/sage/rings/rational.so in sage.rings.rational.Rational._integer_ (sage/rings/rational.c:20598)() TypeError: no conversion of this rational to integer On Saturday, March 30, 2013 5:14:35 PM UTC, Eric Gourgoulhon wrote: > > Hello, > > I've noticed this strange behavior (bug ?) on the following elementary > computation: > > sage: a = matrix([[sqrt(x),0,0,0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, > 1]]) > sage: det(a) > ... > TypeError: no conversion of this rational to integer > > If the matrix is smaller, it is fine: > > sage: a = matrix([[sqrt(x),0,0], [0, 1, 0], [0, 0, 1]]) > sage: det(a) > sqrt(x) > > If sqrt(x) is replaced by another function, e.g. exp(x), it is fine as > well: > > sage: a = matrix([[exp(x),0,0,0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, > 1]]) > sage: det(a) > e^x > > The problem seems to be connected with the non-integer power of x: > > sage: a = matrix([[x^(1/2),0,0,0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, > 1]]) > sage: det(a) > ... > TypeError: no conversion of this rational to integer > > I've reproduced it in Sage 5.8, 5.7 and 5.4. > > Is this a known issue ? > > Eric. > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.