Open mantepse opened 8 months ago
Thinking a bit about this, I think we should set _arity
to None
, which should then disallow it for use in any method.
It does not make sense to tie the input homogeneity to the number of tensor product factors. The tensor product algebra could have a grading not connected to the gradings of the individual factors. It works as a default, but that should belong to the category of tensor product of graded algebras. I think we need a better _element_constructor_
for this too.
For __call__
, should we implement it, we would just pass it to the corresponding elements. The only place arity is used in the __call__
of the multivariate lazy series is to just have an earlier error with a (marginally IMO) better error message.
I don't think we should special case the free algebra as much as possible. In particular, a free algebra on 1 generator is the same as the univariate polynomial ring (if we allow noncommutative base rings), and I doubt anyone is asking for shifts in that case. I'm not sure if we want lazy Laurent series to support noncommutative base rings, but that would be better waiting until someone asks for it.
Steps To Reproduce
Currently, we have
which is nonsense. The same is true for
LazySymmetricFunctions(SymmetricFunctions(QQ).s())
.Expected Behavior
The
shift
method should raise an error or should not be available at all.Actual Behavior
See above.
Additional Information
I think we are using
_arity
for two things which are only superficially related, and I guess we should simply unentangle that, perhaps as follows:_arity
, for any code related to composition of series. In particular, we could very likely reusePowerSeries.__call__
for the completion of theFreeAlgebra
._shiftable
(or something better), a boolean that tells us whether a coefficient in the stream knows its degree or doesn't.Perhaps this also has something to do with
_internal_poly_ring
and_laurent_poly_ring
, but I haven't thought about it.At the same time, we might want to add special classes similar to
LazySymmetricFunction
for the completion of the free algebra.Environment
Checklist