> We could add infinite product similar to addiag, see
> attached diff.

Thanks. I only missed some documentation to make clear where
prodiag1 actually comes from.

In fact, I also defined prodiag to return the infinite product
rather than the g that you were defining.

In addition, I also changed a parenthesis in

  concat(rpSt(n, 0), f1*p1)

I somehow have the suspicion that doing the concat as an outermost
operation delays the computation of the product f1*p1 and wouldn't
include multiplying the initial n zeroes as you had it in your patch.

Both, your patch 0001 and my amendment 0002 are attached. Would be nice
to see that stuff in FriCAS. Of course you can squash those patches
together if you like.

>> I'd like to use/implement qPochhammer
>> http://en.wikipedia.org/wiki/Q-Pochhammer_symbol
>> as UnivariateLaurentSeries(K, q, 0).
> 
> That is finite product...

There is also an infinite version.

So qPochhammer(q, q) = prodiag(s) (with my new specification)
where e: Stream Integer := [-1]::Stream(Integer)
      s: Stream Stream Integer := repeating [e]
      c:=prodiag(s)$StreamTaylorSeriesOperations(Integer)

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" 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/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
From 2fd7294a3a6d5657e5af0806de1cadaf67a492f9 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Wed, 17 Dec 2014 17:17:29 +0100
Subject: prodiag

---
 src/algebra/sttaylor.spad | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/algebra/sttaylor.spad b/src/algebra/sttaylor.spad
index 9f8660c..61b7aad 100644
--- a/src/algebra/sttaylor.spad
+++ b/src/algebra/sttaylor.spad
@@ -95,6 +95,12 @@ StreamTaylorSeriesOperations(A) : Exports == Implementation where
       ++ addiag(x) performs diagonal addition of a stream of streams. if x =
       ++ \spad{[[a<0, 0>, a<0, 1>, ..], [a<1, 0>, a<1, 1>, ..], [a<2, 0>, a<2, 1>, ..], ..]}
       ++ and \spad{addiag(x) = [b<0, b<1>, ...], then b<k> = sum(i+j=k, a<i, j>)}.
+    prodiag : ST ST A -> ST A
+      ++ prodiag(x) performs "diagonal" infinite product of a stream
+      ++ of streams.  When \spad{x(i)} is interpreted as stream of
+      ++ coefficients of series \spad{f_i(z), i=1,...}, then
+      ++ \spad{prodiag(x) = (g(z) - 1)/z} where
+      ++ \spad{g(z) = (1 + z*f_1(z))*(1 + z^2*f_2(x))*...}
     lambert      : ST A -> ST A
       ++ lambert(st) computes \spad{f(x) + f(x^2) + f(x^3) + ...}
       ++ if st is a stream representing \spad{f(x)}.
@@ -336,6 +342,16 @@ StreamTaylorSeriesOperations(A) : Exports == Implementation where
         error "revert: should start 0, x, ... with invertible x"
       error "revert: should start 0, x, ..."
 
+    prodiag1(ststa : ST ST A, n : Integer) : ST(A) == delay
+        empty? ststa => zro()
+        f1 := frst ststa
+        r1 := rst ststa
+        p1 := prodiag1(r1, n + 1)
+        empty? f1 => concat(0, p1)
+        concat(frst(f1), rst(f1) + p1 + concat(rpSt(n, 0), f1)*p1)
+
+    prodiag(ststa : ST ST A) == prodiag1(ststa, 1)
+
 --% lambert functions
 
     addiag(ststa : ST ST A) == delay
-- 
2.1.0

From 750a0df366bf30dcc7c75f96bdbc1976267b3225 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Wed, 17 Dec 2014 22:35:21 +0100
Subject: prodiag with docs

---
 src/algebra/sttaylor.spad | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/algebra/sttaylor.spad b/src/algebra/sttaylor.spad
index 61b7aad..66751ee 100644
--- a/src/algebra/sttaylor.spad
+++ b/src/algebra/sttaylor.spad
@@ -99,8 +99,7 @@ StreamTaylorSeriesOperations(A) : Exports == Implementation where
       ++ prodiag(x) performs "diagonal" infinite product of a stream
       ++ of streams.  When \spad{x(i)} is interpreted as stream of
       ++ coefficients of series \spad{f_i(z), i=1,...}, then
-      ++ \spad{prodiag(x) = (g(z) - 1)/z} where
-      ++ \spad{g(z) = (1 + z*f_1(z))*(1 + z^2*f_2(x))*...}
+      ++ \spad{prodiag(x) = (1 + z*f_1(z))*(1 + z^2*f_2(x))*...}.
     lambert      : ST A -> ST A
       ++ lambert(st) computes \spad{f(x) + f(x^2) + f(x^3) + ...}
       ++ if st is a stream representing \spad{f(x)}.
@@ -342,15 +341,30 @@ StreamTaylorSeriesOperations(A) : Exports == Implementation where
         error "revert: should start 0, x, ... with invertible x"
       error "revert: should start 0, x, ..."
 
+    -- Let f = [f_1, f_2, f_3, ...] be a stream of streams of coefficients
+    -- of Taylor series. We tacitly identify a stream of coefficients with
+    -- a Taylor series in the variable z.
+    -- Let h(s), t(s) be the head and tail of a stream s, respectively.
+    -- Let p(s, n) be recursively defined by:
+    -- p(s, n) = (1+z^n*h(s)*p(t(s), n+1).
+    -- Then p(f, 1) gives the infinite product
+    -- p(f, 1) = (1+z*f_1)*(1+z^2*f_2)*(1+z^3*f_3)*...
+    -- Let q(s, n) be defined by: p(s, n) = 1 + z^n*q(s, n).
+    -- Then we get the following recursion formula for q.
+    -- q(s, n) = h(f1) + z*(r1 + q1 + z^n*f1*q1)
+    --           where
+    --              f1 = h(s)
+    --              r1 = t(s)
+    --              q1 = q(r1, n+1)
     prodiag1(ststa : ST ST A, n : Integer) : ST(A) == delay
         empty? ststa => zro()
-        f1 := frst ststa
-        r1 := rst ststa
+        f1 := frst ststa  -- head
+        r1 := rst ststa   -- tail
         p1 := prodiag1(r1, n + 1)
         empty? f1 => concat(0, p1)
-        concat(frst(f1), rst(f1) + p1 + concat(rpSt(n, 0), f1)*p1)
+        concat(frst(f1), rst(f1) + p1 + concat(rpSt(n, 0), f1*p1))
 
-    prodiag(ststa : ST ST A) == prodiag1(ststa, 1)
+    prodiag(ststa : ST ST A): ST A == concat(1, prodiag1(ststa, 1))
 
 --% lambert functions
 
-- 
2.1.0

Reply via email to