On Jan 18, 2008 7:58 AM, David R. Kohel <[EMAIL PROTECTED]> wrote:
> Hi William,
>
> Some features/bugs to be traqued:

This sort of discussion should be archived on sage-devel, so
I've cc'd this email there.  Also, I don't really agree with  your suggestions
below, so I want to see what other people think.

> Let A be a matrix not over ZZ or QQ:
>
>   A.adjoint()
>   A.inverse()
>
> are not implemented.

I don't think they should be.   There are already (at least) 3 ways to do this:

sage: A = random_matrix(ZZ,2)
sage: ~A

[ 1/34  1/17]
[-6/17  5/17]
sage: A.__invert__()

[ 1/34  1/17]
[-6/17  5/17]
sage: A^(-1)

[ 1/34  1/17]
[-6/17  5/17]

>  For x a commutative ring element:
>
>   x.inverse()
>
> is not implemented even if x^-1 exists.

Same remark as above.

> sage: x = 7
> sage: type(x)
> <type 'sage.rings.integer.Integer'>
> sage: x^-1
> 1/7
> sage: type(x^-1)
> <type 'sage.rings.rational.Rational'>
> sage: x = -1
> sage: type(x^-1)
>
> Should the field of fractions be created?

Hmm, I don't think so, since x has an inverse in ZZ already.  Yes, I realize
that in Magma the field of fractions is created:

sage: magma.eval('Parent((-1)^(-1))')
'Rational Field'

And I realize that this is inconsistent with:

sage: parent(1/1)
Rational Field

So I'm a little torn here.

> Certaily x.inverse() should return an error for non-units.

No it shouldn't.  It should compute the inverse as an element of a natural
larger structure.

 -- William

--~--~---------~--~----~------------~-------~--~----~
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