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

Constructing from b=-1 #115

Closed
DanielVandH opened this issue Jul 30, 2024 · 0 comments · Fixed by #117
Closed

Constructing from b=-1 #115

DanielVandH opened this issue Jul 30, 2024 · 0 comments · Fixed by #117

Comments

@DanielVandH
Copy link
Member

It's currently not possible to construct a SemiclassicalJacobi from b=-1 except to b=1,

julia> P = SemiclassicalJacobi(2.0, -1/2, -1.0, -1/2);

julia> Q = SemiclassicalJacobi(2.0, -1/2, 0.0, -1/2, P);
ERROR: Polynomials must be orthonormal
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] cholesky_jacobimatrix(W::LazyBandedMatrices.Tridiagonal{…}, Q::SemiclassicalJacobi{…})
   @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\choleskyQR.jl:53
 [3] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
   @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:194
 [4] SemiclassicalJacobi(t::Float64, a::Float64, b::Float64, c::Float64, P::SemiclassicalJacobi{Float64})
   @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:127
 [5] top-level scope
   @ REPL[30]:1
Some type information was truncated. Use `show(err)` to see complete types.

The call for Q should probably do something like

julia> Q = SemiclassicalJacobi(2.0, -1/2, 0.0, -1/2, SemiclassicalJacobi(P.t, P.a, one(P.b), P.c, P))
SemiclassicalJacobi with weight x^-0.5 * (1-x)^0.0 * (2.0-x)^-0.5 on 0..1

The SemiclassicalJacobi(P.t, P.a, one(P.b), P.c, P) call is efficient

elseif iszero(Δa) && iszero(Δc) && Δb == 2 && b == 1
# When going from P[t, a, -1, c] to P[t, a, 1, c], you can just take
return SymTridiagonal(Q.X.d[2:end], Q.X.du[2:end])

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 a pull request may close this issue.

1 participant