didier deshommes wrote:
> On Thu, May 15, 2008 at 10:48 AM, Jason Grout
> <[EMAIL PROTECTED]> wrote:
>>  More concisely, this proposal could be worded:
>>
>>  What do people think of making matrix() return a matrix over a field by
>>  default, unless a ring is explicitly specified.  The default field would
>>  either be the fraction field of the ring containing the specified
>>  elements, or would be QQ if no elements are specified.  This logic would
>>  *only* be applied if a ring is not specified.  The documentation of
>>  matrix() would also be changed accordingly.
> 
> Just to make sure I get it:
> matrix(1,1,[1]) and matrix(1,2,[Mod(23,4),23])  will be over QQ


Currently, your first example yields a matrix over ZZ and the second a 
matrix over Ring of integers mod 4.

After the change, your first example would yield a matrix over QQ.  The 
second would still yield a matrix over Ring of integers mod 4 because 
calling fraction_field throws an exception (the ring is not an integral 
domain).


> 
> To me it looks like the *only* change from the current beahavior will
> be that the matrices above  will be over QQ, instead of over ZZ or a
> generic ring. What other cases am I missing?

A matrix over a polynomial ring, for example.

sage: x=polygen(QQ)
sage: matrix([x]).base_ring()
Univariate Polynomial Ring in x over Rational Field

After the change it would be:

sage: x=polygen(QQ)
sage: matrix([x]).base_ring()
Fraction Field of Univariate Polynomial Ring in x over Rational Field


Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to