FWIW, “the competition” implements this :
Wolfram Language 14.0.0 Engine for Linux x86 (64-bit) Copyright 1988-2023 
Wolfram Research, Inc. In[1]:= A={{a0, a1}, {a2, a3}} Out[1]= {{a0, a1}, 
{a2, a3}} In[2]:= B={{b0, b1}, {b2, b3}} Out[2]= {{b0, b1}, {b2, b3}} 
In[3]:= A==B Out[3]= {{a0, a1}, {a2, a3}} == {{b0, b1}, {b2, b3}} In[4]:= 
Flatten[A] Out[4]= {a0, a1, a2, a3} In[5]:= Solve[A==B, Flatten[B]] Out[5]= 
{{b0 -> a0, b1 -> a1, b2 -> a2, b3 -> a3}} 
​
Le mardi 25 juin 2024 à 09:08:59 UTC+2, Emmanuel Charpentier a écrit :

> Inspired by this ask.sagemath question 
> <https://ask.sagemath.org/question/77986/with-symbolics-is-doing-unwanted-boolean-comparison/>
>  
> :
> sage: V=vector(var("v", n=2)) sage: W=vector(var("w", n=2)) sage: V==W 
> False 
>
> This is expected from a (Python) programmer’s point of view, but the 
> mathematician could expect something like :
> sage: from _operator import eq sage: vector(map(eq, V, W)) (v0 == w0, v1 
> == w1) 
>
> Similarly,
> sage: A=matrix(var("a", n=4), nrows=2) sage: B=matrix(var("b", n=4), 
> nrows=2) sage: A==B False 
>
> where
> sage: matrix(map(lambda u, v:map(eq, u, v), A, B)) [a0 == b0 a1 == b1] [a2 
> == b2 a3 == b3] 
>
> could be expected.
>
> Are there (good or bad) reasons not to implement such vector/matrix 
> equalities ?
> ​
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/a1a40ecf-70f6-4327-90e0-8c00db2e2bebn%40googlegroups.com.

Reply via email to