Ask Your Question

po's profile - activity

2022-11-03 10:18:53 +0200 commented question conda-forge install SageMath 9.7 fails

Thanks. I opened an issue

2022-10-25 17:01:40 +0200 asked a question conda-forge install SageMath 9.7 fails

conda-forge install SageMath 9.7 fails I tried to install SageMath 9.7 from conda-forge (my OS is Ubuntu 18.04) followin

2022-10-23 22:17:46 +0200 marked best answer `repr` applied on a matrix

Typically, the repr function returns a string that can be executed and yield the same value as the object. In sageMath, this is not the case for a matrix : repr has the same behaviour as the str function has and str applied to a matrix returns a "nice" representation of it:

M=matrix([[1, 1],[1, 1]])

print(repr(M)==str(M)) 
print(M)

printing

True
[1 1]
[1 1]

This is not the behaviour I was expecting. To compare with Numpy:

from numpy import array

M = array([[1, 1], [1, 1]])

print(repr(M))
print()
print(M)

outpouting

array([[1, 1],
       [1, 1]])

[[1 1]
 [1 1]]

Do I need to write my own repr function when applied to a matrix?

2022-10-23 22:17:46 +0200 received badge  Scholar (source)
2022-10-22 12:05:00 +0200 asked a question `repr` applied on a matrix

`repr` applied on a matrix Typically, the repr function returns a string that can be executed and yield the same value a

2021-06-16 16:26:24 +0200 received badge  Supporter (source)
2021-06-16 11:05:27 +0200 commented question assume causes a solving failure

Emmanuel, thanks for your detailed examination.

2021-06-11 13:30:39 +0200 received badge  Nice Question (source)
2021-06-10 21:29:21 +0200 received badge  Student (source)
2021-06-10 12:56:13 +0200 asked a question assume causes a solving failure

assume causes a solving failure This code var("a b") assume(a, "real") equation=[a+b==0] s=solve(equation, a, b) print(