Skip to content

Commit 0710136

Browse files
committed
k-regular sequences: convolution/docs
1 parent bb3d701 commit 0710136

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/sage/combinat/k_regular_sequence.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ def forward_differences(self, **kwds):
677677
def _mul_(self, other):
678678
r"""
679679
Return the product of this `k`-regular sequence with ``other``,
680-
where the multiplication is convolution.
680+
where the multiplication is convolution of power series.
681+
682+
The operator `*` is mapped to :meth:`convolution`.
681683
682684
INPUT:
683685
@@ -699,14 +701,28 @@ def _mul_(self, other):
699701
....: vector([1, 0]), vector([1, 1]))
700702
sage: E
701703
2-regular sequence 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...
704+
705+
We can build the convolution (in the sense of power-series) of `E` by
706+
itself via::
707+
708+
sage: E.convolution(E)
709+
2-regular sequence 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, ...
710+
711+
This is the same as using multiplication operator::
712+
702713
sage: E * E
703714
2-regular sequence 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, ...
704715
716+
Building :meth:`partial_sums` can also be seen as a convolution::
717+
705718
sage: o = Seq2.one_hadamard()
706719
sage: E * o
707720
2-regular sequence 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ...
708721
sage: E * o == E.partial_sums(include_n=True)
709722
True
723+
724+
TESTS::
725+
710726
sage: E * o == o * E
711727
True
712728
"""
@@ -758,6 +774,8 @@ def blocks(r):
758774

759775
return result
760776

777+
convolution = _mul_
778+
761779
@minimize_result
762780
def partial_sums(self, include_n=False):
763781
r"""

0 commit comments

Comments
 (0)