@@ -128,19 +128,16 @@ SemiclassicalJacobi{T}(t, a, b, c) where T = SemiclassicalJacobi(convert(T,t), c
128
128
129
129
WeightedSemiclassicalJacobi {T} (t, a, b, c, P... ) where T = SemiclassicalJacobiWeight {T} (convert (T,t), convert (T,a), convert (T,b), convert (T,c)) .* SemiclassicalJacobi {T} (convert (T,t), convert (T,a), convert (T,b), convert (T,c), P... )
130
130
131
-
132
-
133
131
function semiclassical_jacobimatrix (t, a, b, c)
134
132
T = float (promote_type (typeof (t), typeof (a), typeof (b), typeof (c)))
135
133
if iszero (a) && iszero (b) && c == - one (T)
136
134
# for this special case we can generate the Jacobi operator explicitly
137
135
N = (1 : ∞)
138
- α = neg1c_αcfs (one (T)* t) # cached coefficients
136
+ α = neg1c_αcfs (one (T)* t)
139
137
A = Vcat ((α[1 ]+ 1 )/ 2 , - N./ (N.* 4 .- 2 ). * α .+ (N.+ 1 ). / (N.* 4 .+ 2 ). * α[2 : end ]. + 1 / 2 )
140
138
C = - (N). / (N.* 4 .- 2 )
141
139
B = Vcat ((α[1 ]^ 2 * 3 - α[1 ]* α[2 ]* 2 - 1 )/ 6 , - (N). / (N.* 4 .+ 2 ). * α[2 : end ]. / α)
142
- # if J is Tridiagonal(c,a,b) then for norm. OPs it becomes SymTridiagonal(a, sqrt.( b.* c))
143
- return SymTridiagonal (A, sqrt .(B.* C))
140
+ return SymTridiagonal (A, sqrt .(B.* C)) # if J is Tridiagonal(c,a,b) then for norm. OPs it becomes SymTridiagonal(a, sqrt.( b.* c))
144
141
end
145
142
P = Normalized (jacobi (b, a, UnitInterval {T} ()))
146
143
iszero (c) && return jacobimatrix (P)
@@ -150,7 +147,7 @@ function semiclassical_jacobimatrix(t, a, b, c)
150
147
return qr_jacobimatrix (x-> (t- x),P)
151
148
elseif isinteger (c) && c ≥ 0 # reduce other integer c cases to hierarchy
152
149
return SemiclassicalJacobi .(t, a, b, 0 : Int (c))[end ]. X
153
- else # if c is not an integer, use Lanczos for now
150
+ else # if c is not an integer, use Lanczos
154
151
x = axes (P,1 )
155
152
return jacobimatrix (LanczosPolynomial (@. (x^ a * (1 - x)^ b * (t- x)^ c), jacobi (b, a, UnitInterval {T} ())))
156
153
end
@@ -188,7 +185,7 @@ function semiclassical_jacobimatrix(Q::SemiclassicalJacobi, a, b, c)
188
185
semiclassical_jacobimatrix (SemiclassicalJacobi (Q. t, Q. a, Q. b+ 1 , Q. c, Q), a, b, c)
189
186
elseif c > Q. c
190
187
semiclassical_jacobimatrix (SemiclassicalJacobi (Q. t, Q. a, Q. b, Q. c+ 1 , Q), a, b, c)
191
- # TODO : Implement lowering via QL/reverse Cholesky or via inverting R
188
+ # TODO : Implement lowering via QL/reverse Cholesky or via inverting R?
192
189
# elseif b < Q.b # iterative lowering by 1
193
190
# semiclassical_jacobimatrix(SemiclassicalJacobi(Q.t, Q.a, Q.b-1, Q.c, Q), a, b, c)
194
191
# elseif c < Q.c
@@ -233,8 +230,7 @@ Gives the Lowering operator from OPs w.r.t. (x-y)*w(x) to Q
233
230
as constructed from Chistoffel–Darboux
234
231
"""
235
232
function op_lowering (Q, y)
236
- # we first use Christoff-Darboux with d = 1
237
- # But we want the first OP to be 1 so we rescale
233
+ # we first use Christoff-Darboux with d = 1 but the first OP should be 1 so we rescale
238
234
P = RaisedOP (Q, y)
239
235
A,_,_ = recurrencecoefficients (Q)
240
236
d = - inv (A[1 ]* _p0 (Q)* P. ℓ[1 ])
@@ -268,16 +264,16 @@ function semijacobi_ldiv_direct(Q::SemiclassicalJacobi, P::SemiclassicalJacobi)
268
264
M = Diagonal (Ones (∞))
269
265
if iseven (Δa) && iseven (Δb) && iseven (Δc)
270
266
M = qr (P. X^ (Δa÷ 2 )* (I- P. X)^ (Δb÷ 2 )* (Q. t* I- P. X)^ (Δc÷ 2 )). R
271
- return ApplyArray (* , Diagonal (sign .(view (M,band (0 ))).* Fill (abs .(1 / M[1 ]),∞)), M) # match normalization choice P_0(x) = 1
267
+ return ApplyArray (* , Diagonal (sign .(view (M,band (0 ))).* Fill (abs .(1 / M[1 ]),∞)), M)
272
268
elseif isone (Δa) && iszero (Δb) && iszero (Δc) # special case (Δa,Δb,Δc) = (1,0,0)
273
269
M = cholesky (P. X). U
274
- return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M) # match normalization choice P_0(x) = 1
270
+ return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M)
275
271
elseif iszero (Δa) && isone (Δb) && iszero (Δc) # special case (Δa,Δb,Δc) = (0,1,0)
276
272
M = cholesky (I- P. X). U
277
- return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M) # match normalization choice P_0(x) = 1
273
+ return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M)
278
274
elseif iszero (Δa) && iszero (Δb) && isone (Δc) # special case (Δa,Δb,Δc) = (0,0,1)
279
275
M = cholesky (Q. t* I- P. X). U
280
- return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M) # match normalization choice P_0(x) = 1
276
+ return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M)
281
277
elseif isinteger (Δa) && isinteger (Δb) && isinteger (Δc)
282
278
M = cholesky (Symmetric (P. X^ (Δa)* (I- P. X)^ (Δb)* (Q. t* I- P. X)^ (Δc))). U
283
279
return ApplyArray (* , Diagonal (Fill (1 / M[1 ],∞)), M) # match normalization choice P_0(x) = 1
0 commit comments