#18264: make map_coefficients in modules_with_basis safer or more general
-------------------------------------+-------------------------------------
Reporter: mantepse | Owner:
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-6.7
Component: algebra | Resolution:
Keywords: map_coefficients, | Merged in:
modules_with_basis, base_ring, | Reviewers:
check arguments | Work issues:
Authors: Martin Rubey | Commit:
Report Upstream: N/A | 3a7761e95b8ca8b83e08635828a3754d751fe918
Branch: | Stopgaps:
u/mantepse/make_map_coefficients_in_modules_with_basis_safer_or_more_general|
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by nthiery):
* cc: darij, sage-combinat, hivert (added)
Comment:
Replying to [comment:13 mantepse]:
> As it turns out, I get several failures when I insist on trying to
coerce to the base ring! (I pushed the nonworking branch, to get
feedback.) For example:
Ok. Can you post here the test summary with the list of failing files,
just to get an idea of how bad this is?
> {{{
> File "src/sage/combinat/ncsf_qsym/ncsf.py", line 3405, in
sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Psi
> Failed example:
> test_psi(2)
> ...
> TypeError: no conversion of this rational to integer
> }}}
>
> The test which fails looks as follows:
>
> {{{
> sage: NCSF = NonCommutativeSymmetricFunctions(ZZ)
> sage: R = NCSF.R()
> sage: Psi = NCSF.Psi()
> sage: n = 2; a = R.sum([(-1) ** i * R[[1]*i + [n-i]] for i in range(n)])
> sage: Psi(a)
> }}}
>
> The expected output is `Psi[2]` (literally). The easy fix would be to
add the optional argument `coerce=False` to the calls of `sum_of_terms` in
`ncsf.py` everywhere, but I'm not sure whether this is what I should do -
because that would mean that the answer to the question in my previous
comment is "3".
If some intermediate calculations involve rational coefficients, then
we definitely want a failure here. Maybe there is a way to improve the
ncsf code to better support NCSF over integers by sticking to integral
computations.
Darij, Mike, ..., what do you think? Do you have a quick way to improve
NCSF's
handling of integral coefficients? Or is it ok to switch this test to
`QQ` or mark it as "not implemented" for now?
--
Ticket URL: <http://trac.sagemath.org/ticket/18264#comment:14>
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.