On Mon, Feb 26, 2018 at 8:52 PM, Juan Luis Varona <juanluis.var...@gmail.com> wrote: > In sagemath 7.5, we can use this code: > > t=var('t'); > M=matrix(4,[[0,0,5/4,2],[t,0,0,0],[0,1,0,0],[0,0,1,0]]); > P=charpoly(M); > P.substitute(x=1) > > Then, we get the correct answer > -13/4*t + 1 > > However, the same code gives an error with sagemath 8.2. > > A workaround that again gives the correct answer with sagemath 8.2 is the > following: > > t=var('t'); > M=matrix(4,[[0,0,5/4,2],[t,0,0,0],[0,1,0,0],[0,0,1,0]]); > P=charpoly(M); > y=var('y') > P.substitute(x=y).substitute(y=1) > > What is happening? > > Is this a bug or a strange feature of the "x" obtained from charpoly? >
This works in 7.6 and on cocalc.com: sage: PR.<x,t> = PolynomialRing(QQ, 2, "x,t") sage: M=matrix(PR,[[0,0,5/4,2],[t,0,0,0],[0,1,0,0],[0,0,1,0]]) sage: P = M.charpoly() sage: P(1) -13/4*t + 1 > Thanks in advance! > > Juan Luis Varona > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.