Skip to content

Support stieltjes/cauchy of ChebyshevT via Legendre - #68

Open
dlfivefifty wants to merge 1 commit into
mainfrom
chebyshevt-stieltjes
Open

dlfivefifty wants to merge 1 commit into
mainfrom
chebyshevt-stieltjes

Conversation

@dlfivefifty

@dlfivefifty dlfivefifty commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

This drops the explicit-formula approach. stieltjes(J::AbstractJacobi, z) = stieltjes(Legendre(), z) * (Legendre() \ J) already covers ChebyshevT, and cauchy divides that lazy product by -2πi. The problem was that indexing rows of the product, e.g. stieltjes(ChebyshevT(), 2+im)[1,1:10] or anything from cauchy(ChebyshevT(), z), stalled inside LazyArrays. The fixes are upstream:

With those in place, cauchy(ChebyshevT(), 2+im)[1,1:1000] takes about 0.05s.

Changes in this PR:

  • Tests for stieltjes/cauchy of ChebyshevT: against quadrature, against the inhomogeneous three-term recurrence, on the interval with ±0im, for expansions, for vectors of points, and for mapped chebyshevt(0..2).
  • The StieltjesPoints * Legendre simplify rule becomes StieltjesPoints * AbstractJacobi, so inv.(zs .- x') * ChebyshevT() works too.
  • LazyArrays = "2.14.3", and the version is bumped to 0.4.2.

CI will fail until LazyArrays 2.14.3 is released with both fixes. The full test suite passes locally with those fixes applied to LazyArrays v2.14.1.

Still not working through this route: ChebyshevU/Ultraspherical, because ClassicalOrthogonalPolynomials has no Legendre \ ChebyshevU conversion, and general Jacobi, because Legendre \ Jacobi(a,b) is the inverse of a banded product and its triangular structure isn't recognised.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.32%. Comparing base (c0c2796) to head (69c7331).

Files with missing lines Patch % Lines
src/stieltjes.jl 95.83% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
+ Coverage   91.79%   92.32%   +0.53%     
==========================================
  Files           4        4              
  Lines         317      365      +48     
==========================================
+ Hits          291      337      +46     
- Misses         26       28       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

stieltjes(J::AbstractJacobi, z) = stieltjes(Legendre(), z) * (Legendre() \ J)
already covers ChebyshevT; the LazyArrays fixes for triangular inverses make
indexing rows of this lazy product (and of cauchy) finite. Add tests, generalise
the StieltjesPoints simplify rule from Legendre to AbstractJacobi and require
LazyArrays 2.14.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dlfivefifty dlfivefifty changed the title Explicit formula for stieltjes(ChebyshevT(), z) Support stieltjes/cauchy of ChebyshevT via Legendre Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant