Ticket #2412 (closed defect: invalid)
basis_matrix returns matrix over wrong ring
| Reported by: | ncalexan | Owned by: | was |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | linear algebra | Keywords: | basis matrix basis_matrix ZZ |
| Cc: | ncalexan, jason | Work issues: | |
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
sage: (ZZ**3).basis_matrix() [1 0 0] [0 1 0] [0 0 1] sage: (ZZ**3).basis_matrix().parent() Full MatrixSpace of 3 by 3 dense matrices over Rational Field
That should be over the integer ring; you can't do (ZZ**3).basis_matrix().smith_form() otherwise.
Change History
Note: See
TracTickets for help on using
tickets.

This is not a bug, it is a design decision. ZZ modules in Sage in general need *not* be embedded in ZZn -- they can be in QQn. For consistency the basis matrix is thus always over QQ. Here's an example of a module over ZZ but for which the basis matrix is over QQ.
I'm willing to consider changing the design to *try* to make the basis matrix over ZZ if posible, otherwise make it over QQ. Thoughts? I doubt this will break anything.... (famous last words).