{"id":20500569,"url":"https://github.com/juliaapproximation/classicalorthogonalpolynomials.jl","last_synced_at":"2026-01-26T20:12:32.391Z","repository":{"id":37022041,"uuid":"333057481","full_name":"JuliaApproximation/ClassicalOrthogonalPolynomials.jl","owner":"JuliaApproximation","description":"A Julia package for classical orthogonal polynomials and expansions","archived":false,"fork":false,"pushed_at":"2025-03-02T23:17:22.000Z","size":1393,"stargazers_count":40,"open_issues_count":28,"forks_count":7,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-03T00:49:36.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaApproximation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-26T11:03:51.000Z","updated_at":"2025-02-27T20:09:41.000Z","dependencies_parsed_at":"2023-12-15T12:28:55.885Z","dependency_job_id":"f9cf3d79-2478-44a0-bdd9-c81c59df5e38","html_url":"https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl","commit_stats":{"total_commits":102,"total_committers":7,"mean_commits":"14.571428571428571","dds":"0.27450980392156865","last_synced_commit":"87c636d7ad5c296fb25009f0abc9cabefc64194e"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaApproximation%2FClassicalOrthogonalPolynomials.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaApproximation%2FClassicalOrthogonalPolynomials.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaApproximation%2FClassicalOrthogonalPolynomials.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaApproximation%2FClassicalOrthogonalPolynomials.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaApproximation","download_url":"https://codeload.github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242092443,"owners_count":20070532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T18:21:36.250Z","updated_at":"2026-01-26T20:12:32.356Z","avatar_url":"https://github.com/JuliaApproximation.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ClassicalOrthogonalPolynomials.jl\nA Julia package for classical orthogonal polynomials and expansions\n\n[![Build Status](https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/workflows/CI/badge.svg)](https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/actions)\n[![codecov](https://codecov.io/gh/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaApproximation/ClassicalOrthogonalPolynomials.jl)\n[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaApproximation.github.io/ClassicalOrthogonalPolynomials.jl)\n\n\nThis package implements classical orthogonal polynomials.\n```julia\njulia\u003e using ClassicalOrthogonalPolynomials, ContinuumArrays\n\njulia\u003e chebyshevt.(0:5,0.1)\n6-element Array{Float64,1}:\n  1.0\n  0.1\n -0.98\n -0.296\n  0.9208\n  0.48016\n```\nOther examples include `chebyshevu`, `legendrep`, `jacobip`, `ultrasphericalc`, `hermiteh` and `laguerrel`.\n\nFor expansion, it supports usage as quasi-arrays where one axis is continuous and the other axis is discrete (countably infinite), as implemented in [QuasiArrays.jl](https://github.com/JuliaApproximation/QuasiArrays.jl) and [ContinuumArrays.jl](https://github.com/JuliaApproximation/ContinuumArrays.jl).  \n```julia\njulia\u003e P = Legendre(); # Legendre polynomials\n\njulia\u003e size(P) # uncountable ∞ x countable ∞\n(ℵ₁, ∞)\n\njulia\u003e axes(P) # essentially (-1..1, 1:∞), Inclusion plays the same role as Slice\n(Inclusion(-1.0..1.0 (Chebyshev)), OneToInf())\n\njulia\u003e P[0.1,1:10] # [P_0(0.1), …, P_9(0.1)]\n10-element Array{Float64,1}:\n  1.0                \n  0.1                \n -0.485              \n -0.14750000000000002\n  0.3379375          \n  0.17882875         \n -0.2488293125       \n -0.19949294375000004\n  0.180320721484375  \n  0.21138764183593753\n\njulia\u003e @time P[range(-1,1; length=10_000), 1:10_000]; # construct 10_000^2 Vandermonde matrix\n  1.624796 seconds (10.02 k allocations: 1.491 GiB, 6.81% gc time)\n```\nThis also works for associated Legendre polynomials as weighted Ultraspherical polynomials:\n```julia\njulia\u003e associatedlegendre(m) = ((-1)^m*prod(1:2:(2m-1)))*(UltrasphericalWeight((m+1)/2).*Ultraspherical(m+1/2))\nassociatedlegendre (generic function with 1 method)\n\njulia\u003e associatedlegendre(2)[0.1,1:10]\n10-element Array{Float64,1}:\n   2.9699999999999998\n   1.4849999999999999\n  -6.9052500000000006\n  -5.041575          \n  10.697754375       \n  10.8479361375      \n -13.334647528125    \n -18.735466024687497 \n  13.885467170308594 \n  28.220563705988674 \n```\n\n## p-Finite Element Method\n\nThe language of quasi-arrays gives a natural framework for constructing p-finite element methods. The convention\nis that adjoint-products are understood as inner products over the axes with uniform weight. To solve Poisson's equation\nusing its weak formulation with Dirichlet conditions we can thus expand in a weighted Jacobi basis:\n```julia\njulia\u003e P¹¹ = Jacobi(1.0,1.0); # Quasi-matrix of Jacobi polynomials\n\njulia\u003e w = JacobiWeight(1.0,1.0); # quasi-vector correspoinding to (1-x^2)\n\njulia\u003e w[0.1] ≈ (1-0.1^2)\ntrue\n\njulia\u003e S = w .* P¹¹; # Quasi-matrix of weighted Jacobi polynomials\n\njulia\u003e D = Derivative(axes(S,1)); # quasi-matrix corresponding to derivative\n\njulia\u003e Δ = (D*S)'*(D*S) # weak laplacian corresponding to inner products of weighted Jacobi polynomials\n∞×∞ LazyArrays.ApplyArray{Float64,2,typeof(*),Tuple{Adjoint{Int64,BandedMatrices.BandedMatrix{Int64,Adjoint{Int64,InfiniteArrays.InfStepRange{Int64,Int64}},InfiniteArrays.OneToInf{Int64}}},LazyArrays.BroadcastArray{Float64,2,typeof(*),Tuple{LazyArrays.BroadcastArray{Float64,1,typeof(/),Tuple{Int64,InfiniteArrays.InfStepRange{Int64,Int64}}},BandedMatrices.BandedMatrix{Int64,Adjoint{Int64,InfiniteArrays.InfStepRange{Int64,Int64}},InfiniteArrays.OneToInf{Int64}}}}}} with indices OneToInf()×OneToInf():\n 2.66667   ⋅     ⋅        ⋅        ⋅        ⋅        ⋅        ⋅      …  \n  ⋅       6.4    ⋅        ⋅        ⋅        ⋅        ⋅        ⋅         \n  ⋅        ⋅   10.2857    ⋅        ⋅        ⋅        ⋅        ⋅         \n  ⋅        ⋅     ⋅      14.2222    ⋅        ⋅        ⋅        ⋅         \n  ⋅        ⋅     ⋅        ⋅      18.1818    ⋅        ⋅        ⋅         \n  ⋅        ⋅     ⋅        ⋅        ⋅      22.1538    ⋅        ⋅      …  \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅      26.1333    ⋅         \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅        ⋅      30.1176     \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅        ⋅        ⋅         \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅        ⋅        ⋅         \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅        ⋅        ⋅      …  \n  ⋅        ⋅     ⋅        ⋅        ⋅        ⋅        ⋅        ⋅         \n ⋮                                         ⋮                         ⋱  \n```\n\n## Related Packages\n\n**[HarmonicOrthogonalPolynomials.jl](https://github.com/JuliaApproximation/HarmonicOrthogonalPolynomials.jl)**: adds support for spherical harmonic expansions and harmonic polynomials in balls.\n\n**[MultivariateOrthogonalPolynomials.jl](https://github.com/JuliaApproximation/MultivariateOrthogonalPolynomials.jl)**: adds support for multivariate orthogonal polynomials on disks, spheres, triangles, and other simple geometries\n\n**[SemiclassicalOrthogonalPolynomials.jl](https://github.com/JuliaApproximation/SemiclassicalOrthogonalPolynomials.jl)**: adds support for semiclassical orthogonal polynomials such as Semiclassical Jacobi polynomials with weights `x^a * (1-x)^b * (t-x)^c`.\n\n**[PiecewiseOrthogonalPolynomials.jl](https://github.com/JuliaApproximation/PiecewiseOrthogonalPolynomials.jl)**: adds support for piecewise orthogonal polynomials which can be used in p-FEM.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaapproximation%2Fclassicalorthogonalpolynomials.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliaapproximation%2Fclassicalorthogonalpolynomials.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaapproximation%2Fclassicalorthogonalpolynomials.jl/lists"}