Skip to content

Composition of LazyPowerSeries not working when valuation is not explicitly called beforehand. #40750

@LeonardTokic

Description

@LeonardTokic

Steps To Reproduce

With a fresh installation of 10.7, the following code

F2t.<t>=LazyPowerSeriesRing(GF(2));
D=F2t(lambda n: 1 if is_power_of_two(n) else 0);
w=D(t^3);
inv=w/(t^2);
inv(inv)

gives the output

<repr(<sage.rings.lazy_series_ring.LazyPowerSeriesRing_with_category.element_class at 0x12f278310>) failed: ValueError: can only compose with a series of positive valuation>

while executing

F2t.<t>=LazyPowerSeriesRing(GF(2));
D=F2t(lambda n: 1 if is_power_of_two(n) else 0);
w=D(t^3);
inv=w/(t^2);
inv.valuation();
inv(inv)

gives the expected output t + O(t^8)

Expected Behavior

I expected the composition of inv with itself to be well behaved, since it does have positive valuation.

Actual Behavior

Composing inv with itself only works if inv.valuation() is explicitly called beforehand.

Additional Information

From what I can tell, the issue is the step inv=w/(t^2);. Calling inv.parent() gives Lazy Taylor Series Ring in t over Finite Field of size 2, but maybe the division makes it such that the valuation is not 'remebered correctly'?

Environment

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions