Am Samstag, 20. Juni 2015 18:44:30 UTC+2 schrieb Nils Bruin: > > On Saturday, June 20, 2015 at 9:15:06 AM UTC-7, Martin R wrote: >> >> I don't understand this. I just traced matrix(2,2,x) and this is handled >> by _matrix_constructor. I don't see why matrix(2,2,x) needs to return a >> diagonal matrix. Could you please explain what you mean with >> "matrix(n,n,c) is coming from matrix rings"? >> >> See the error that arises if you do matrix(2,3,1). It stumbles because > it discovers that the number of rows doesn't equal the number of columns > in constructing an identity matrix (i.e., the matrix space in question > isn't a ring). > > Yes, that's quite clear. _matrix_constructor determines nrows (2) and ncols (3) and the ring (Symbolic Ring) and calls matrix_space.MatrixSpace(ring, nrows, ncols)(entries). This fails, since entries is a single element. But the bug is, I'd say, that _matrix_constructor calls MatrixSpace with a single element.
On the other hand, I don't think that there is any doubt that MatrixSpace(...)(x) should "work", i.e., interpret a single coefficient ring element as a scalar matrix. Martin -- 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. For more options, visit https://groups.google.com/d/optout.