#15635: free Pre-Lie algebras
-------------------------------------+-------------------------------------
Reporter: chapoton | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: combinatorics | Resolution:
Keywords: trees, prelie | Merged in:
algebra | Reviewers:
Authors: Frédéric Chapoton | Work issues: coercion
Report Upstream: N/A | Commit:
Branch: u/chapoton/15635 | 4b5a64600121409ab1cb711bd11b57cfc2b992bb
Dependencies: #11529 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by tscrim):
Here's some comments after taking a look:
- I'm not sure about using `<` to denote the pre-Lie product in Sage, as
python does something subtle, but very natural, with triple comparisons:
{{{
sage: A = FreePreLieAlgebra(QQ,'x,y')
sage: A.gens()
Family (B[x[]], B[,[]], B[y[]])
sage: x,a,y = A.gens()
sage: x < x < x
B[x[x[]]]
sage: (x < x) < x
B[x[x[], x[]]] + B[x[x[x[]]]]
sage: x < (x < x)
B[x[x[x[]]]]
sage: x < x and x < x # This is equivalent to x < x < x
B[x[x[]]]
}}}
Instead I think you should let `*` denote the pre-Lie product and have the
free pre-Lie algebra be in `MagmaticAlgebras` (perhaps `.Unital()`?). Thus
rename `pre_Lie_product_on_basis` to `product_on_basis`.
- You shouldn't need `_coerce_impl` since the default when
`_coerce_map_from_` returns `True` is to go through
`_element_constructor_`.
- I think you should not use the `__ngens` idiom, but instead use the more
explicit `len(self.algebra_generators())` or
`self.algebra_generators().cardinality()`.
- For the `return Family(self._alphabet, lambda a:
self.term(self.basis().keys()(a)))` should be consistently ordered...
--
Ticket URL: <http://trac.sagemath.org/ticket/15635#comment:25>
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.