On Apr 4, 2009, at 12:55 PM, Kwankyu wrote:

> Hi,
>
> I get this:
>
> sage: R=IntegerModRing(8)
> sage: m=matrix(R,2,[2,1,3,3]);m.det()
> sage: m.inverse()
> Traceback (most recent call last):
> ...
> TypeError: self must be an integral domain.
> sage: m^-1
> Traceback (most recent call last):
> ...
> TypeError: self must be an integral domain.
>
> Actually, R(3)^-1 produces an error message. I use Sage 3.4. Is
> someone implementing the inverse operation in integer mod rings?

You could try lifting, computing the inverse there, then reducing.

sage: m.change_ring(ZZ).inverse().change_ring(R)
[1 5]
[7 6]
sage: m.change_ring(ZZ).inverse().change_ring(R) * m
[1 0]
[0 1]

The problem is that the inverse is typically defined over the  
fraction field, and so it must be an integral domain to have one.

- Robert


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

Reply via email to