Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding the super delta continued fractions, after G.-N. Han #39417

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,9 @@ REFERENCES:
.. [Haj2000] \M. Hajiaghayi, *Consecutive Ones Property*, 2000.
http://www-math.mit.edu/~hajiagha/pp11.ps

.. [Han2016] \G.-N. Han, *Hankel continued fraction and its applications*,
Adv. in Math., 303, 2016, pp. 295-321.

.. [Han1960] Haim Hanani,
*On quadruple systems*,
pages 145--157, vol. 12,
Expand Down
80 changes: 80 additions & 0 deletions src/sage/rings/power_series_ring_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,86 @@ cdef class PowerSeries(AlgebraElement):
serie = (u - 1 - A * t) / (B * t ** 2)
return tuple(resu)

def super_delta_fraction(self, delta):
r"""
Return the super delta continued fraction of ``self``.

This is a continued fraction of the following shape:

.. MATH::

\cfrac{v_0 x^{k_0}} {U_1(x) -
\cfrac{v_1 x^{k_0 + k_1 + \delta}} {U_2(x) -
\cfrac{v_2 x^{k_0 + k_1 + k_2 + \delta}} {U_3(x) - \cdots} } }

where each `U_j(x) = 1 + u_j(x) x`.

INPUT:

- ``delta`` -- positive integer, usually 2

OUTPUT: list of `(v_j, k_j, U_{j+1}(x))_{j \geq 0}`

REFERENCES:

- [Han2016]_

EXAMPLES::

sage: deg = 30
sage: PS = PowerSeriesRing(QQ, 'q', default_prec=deg+1)
sage: q = PS.gen()
sage: F = prod([(1+q**k).add_bigoh(deg+1) for k in range(1,deg)])
sage: F.super_delta_fraction(2)
[(1, 0, -q + 1),
(1, 1, q + 1),
(-1, 2, -q^3 + q^2 - q + 1),
(1, 1, q^2 + q + 1),
(-1, 0, -q + 1),
(-1, 1, q^2 + q + 1),
(-1, 0, -q + 1),
(1, 1, 3*q^2 + 2*q + 1),
(-4, 0, -q + 1)]

A Jacobi continued fraction::

sage: t = PowerSeriesRing(QQ, 't').gen()
sage: s = sum(factorial(k) * t**k for k in range(12)).O(12)
sage: s.super_delta_fraction(2)
[(1, 0, -t + 1),
(1, 0, -3*t + 1),
(4, 0, -5*t + 1),
(9, 0, -7*t + 1),
(16, 0, -9*t + 1),
(25, 0, -11*t + 1)]
"""
q = self.parent().gen()
Gi, Gj = self.parent().one(), self
deg = self.prec()

list_vkU = []
di = Gi.valuation()
ci = Gi[di]

while deg >= 0:
dj = Gj.valuation()
cj = Gj[dj]
k, v = dj - di, cj / ci
c = v * q**k
gi = Gi.add_bigoh(dj + delta)
gj = Gj.add_bigoh(k + dj + delta)
U = (c * gi / gj).truncate()
Gk = (U * Gj - Gi * c) >> (k + delta)
deg -= 2 * k + delta
if deg < 0:
break
list_vkU.append((v, k, U))
if deg == 0 or Gk.degree() == -1:
break
di, ci, Gi, Gj = dj, cj, Gj, Gk

return list_vkU

def stieltjes_continued_fraction(self):
r"""
Return the Stieltjes continued fraction of ``self``.
Expand Down
Loading