#16399: Matrix stack doesn't coerce to a common parent
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: tscrim
Type: defect | Status: new
Priority: major | Milestone: sage-6.3
Component: coercion | Resolution:
Keywords: matrix stack | Merged in:
coercion | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: u/chapoton/16399 | 9986c476c78510e1b98d46890a5b9506f3b62613
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
Given the syntax, `m.stack(...)` it makes a lot of sense to try and let
the result depend as much as possible on m and not on "...". The error you
get now is quick and it is clear how to avoid it. With coercion, you could
get an unexpected base
ring change of the resulting matrix, which might give erroneous results
much later.
The example below gives questionable results, but the change you propose
here would break the behaviour we have already:
{{{
sage: M=matrix(ZZ,[1]).stack(matrix(GF(3),[1])).stack(matrix(GF(5),[1]))
sage: M.base_ring()
Integer Ring
}}}
Clearly, the current semantics are *conversion* into the base ring of the
first matrix. Changing that into *coercion* into a common parent would be
a real change, and it's not clear to me the resulting semantics are
entirely desirable.
I'm not particularly defending the current semantics either. I'm just
pointing out you're proposing an incompatible change and for that to be
justified we'd need fairly wide concensus that the change leads to
significantly more desirable behaviour.
--
Ticket URL: <http://trac.sagemath.org/ticket/16399#comment:5>
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/d/optout.