#16836: __neg__ fails in CartesianProduct of CombinatorialFreeModule
-------------------------+-------------------------------------------------
Reporter: | Owner:
cnassau | Status: needs_work
Type: | Milestone: sage-6.4
defect | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
categories | Work issues:
Keywords: | Commit:
Authors: | 756c053d4779fa90485b528c930d7e4538456cc0
Christian Nassau | Stopgaps:
Report Upstream: N/A |
Branch: |
u/cnassau/16836 |
Dependencies: |
-------------------------+-------------------------------------------------
Changes (by vdelecroix):
* status: needs_review => needs_work
Comment:
Hello,
Could you change
{{{
sage: F = CombinatorialFreeModule(ZZ, ['a','b'])
sage: FF = cartesian_product((F,F))
sage: -FF.an_element() # random - only test that negative can be taken
}}}
to something explicit like
{{{
sage: F = CombinatorialFreeModule(ZZ, ['a','b'])
sage: a,b = F.gens()
sage: c = cartesian_product([a,b-2*a]) + cartesian_product([a,a])
sage: c
2*B[(0, 'a')] - B[(1, 'a')] + B[(1, 'b')]
sage: FF = cartesian_product((F,F))
sage: c.parent() == FF
True
sage: -c
-2*B[(0, 'a')] + B[(1, 'a')] - B[(1, 'b')]
}}}
IMHO, the following fails but should work
{{{
sage: FF([a,b])
Traceback (most recent call last)
...
TypeError: do not know how to make x (= [B['a'], B['b']])
an element of self (=Free module generated by {'a', 'b'} over Integer Ring
(+) Free module generated by {'a', 'b'} over Integer Ring)
}}}
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16836#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.