This is now https://trac.sagemath.org/ticket/24853

On Tuesday, February 27, 2018 at 9:47:55 AM UTC, Dima Pasechnik wrote:
>
>
>
> On Tuesday, February 27, 2018 at 1:52:20 AM UTC, Juan Luis Varona 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 appears to be a bug; indeed, in Sage 8.2.beta6 one sees
>
> sage: P.parent()
> Univariate Polynomial Ring in x over Symbolic Ring 
> (I think it was not the case in 7.5, please check)
>
> but
> sage: P.substitute(x=1)
> Exception RuntimeError: 'maximum recursion depth exceeded while calling a 
> Python object' in <type 'exceptions.RuntimeError'> ignored
>
> (same error with P(x=1) or with P(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.

Reply via email to