1. How can I compute the cokernel of a matrix? For example:

sage: mat = matrix(ZZ, 2, 2, [[1, 0], [0, 2]])
sage: M = FreeModule(ZZ, rank=2)

Then I would like to use M / mat.image() or M / mat.column_module(),
but those give errors. (It works if M and mat are defined over QQ, and
perhaps over any field?)

Is there an easy way to do this? If not, are quotients of free modules
(e.g., over PIDs) defined in Sage, and if so, how do I get at them?

2. Another question about free modules: what does == mean,
mathematically, for them? For example:

sage: id = matrix(ZZ, 2, 2, [[1, 0], [0, 1]])
sage: id.right_kernel() == FreeModule(ZZ, rank=0)
False

I guess if I want to test isomorphism, I should just check that the
ranks are equal?

Oh, wait, I just found the method nonembedded_free_module, which looks
like what I want:

sage: id.right_kernel().nonembedded_free_module() == FreeModule(ZZ, 0)
True

3. One more thing: is the following a bug?

sage: id = matrix(ZZ, 2, 2, [[1, 0], [0, 1]])

Then id.right_kernel() works, as does id.kernel() (which gives the
left kernel), but id.left_kernel() gives an error: "TypeError:
Argument K (= Integer Ring) must be a field."

  John


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