#15215: Non-square matrices should inherit from ModuleElement, not RingElement
--------------------------+-------------------------------
Reporter: pbruin | Owner:
Type: task | Status: new
Priority: minor | Milestone: sage-5.12
Component: categories | Keywords: inheritance
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
--------------------------+-------------------------------
Matrices inherit from `RingElement` even if they are not square. Their
parents do behave correctly.
{{{
sage: A = Matrix([[1, 2], [3, 4]])
sage: A.parent() in Rings()
True
sage: A.parent() in Modules(ZZ)
True
sage: isinstance(A, RingElement)
True
sage: B = Matrix([[1, 2, 3], [4, 5, 6]])
sage: B.parent() in Rings()
False
sage: A.parent() in Modules(ZZ)
True
sage: isinstance(B, RingElement)
True
}}}
The same happens with `Algebras(ZZ)` and `AlgebraElement`.
Square matrices over a ring `R` should be made to inherit dynamically from
`AlgebraElement`; non-square matrices should only inherit from
`ModuleElement`.
''Motivation:'' Multiplication of matrices over a commutative ring ''R''
is in general only a bilinear map between ''R''-modules (in general three
different ones). Only if the matrices are square of the same size ''n''
can this be described as the multiplication map on an ''R''-algebra,
namely Mat,,''n'',,(''R'').
--
Ticket URL: <http://trac.sagemath.org/ticket/15215>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.