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

Infinite loop in SemiclassicalJacobi(t, a, b, c, P) constructor #116

Open
DanielVandH opened this issue Jul 30, 2024 · 2 comments
Open

Infinite loop in SemiclassicalJacobi(t, a, b, c, P) constructor #116

DanielVandH opened this issue Jul 30, 2024 · 2 comments

Comments

@DanielVandH
Copy link
Member

julia> SemiclassicalJacobi(2.0, 3/2, 2.0, 1.0, SemiclassicalJacobi(2.0, -1/2, 1.0, -1/2))
ERROR: InterruptException:
Stacktrace:
    [1] __broadcastarray2broadcasted(a::SubArray{…}, b::SubArray{…})
      @ LazyArrays C:\Users\danjv\.julia\packages\LazyArrays\jaUBE\src\lazybroadcasting.jl:72
    [2] _broadcastarray2broadcasted
      @ C:\Users\danjv\.julia\packages\LazyArrays\jaUBE\src\lazybroadcasting.jl:73 [inlined]
    [3] _broadcastarray2broadcasted
      @ C:\Users\danjv\.julia\packages\LazyArrays\jaUBE\src\lazybroadcasting.jl:79 [inlined]
--- the last 3 lines are repeated 1 more time ---
    [7] _broadcasted
      @ C:\Users\danjv\.julia\packages\LazyArrays\jaUBE\src\lazybroadcasting.jl:80 [inlined]
    [8] sub_materialize(::LazyArrays.BroadcastLayout{…}, A::SubArray{…})
      @ LazyArrays C:\Users\danjv\.julia\packages\LazyArrays\jaUBE\src\lazybroadcasting.jl:97
    [9] sub_materialize
      @ C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\ArrayLayouts.jl:132 [inlined]
   [10] layout_getindex
      @ C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\ArrayLayouts.jl:138 [inlined]
   [11] getindex
      @ C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\ArrayLayouts.jl:198 [inlined]
   [12] _tritrunc(::ArrayLayouts.SymTridiagonalLayout{…}, X::LazyBandedMatrices.SymTridiagonal{…}, n::Int64)
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\ClassicalOrthogonalPolynomials.jl:160
   [13] _tritrunc(X::LazyBandedMatrices.SymTridiagonal{…}, n::Int64)
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\ClassicalOrthogonalPolynomials.jl:163
   [14] jacobimatrix_layout(lay::ClassicalOrthogonalPolynomials.NormalizedOPLayout{…}, P::Normalized{…}, n::Int64)
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\ClassicalOrthogonalPolynomials.jl:165
   [15] jacobimatrix
      @ C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\ClassicalOrthogonalPolynomials.jl:143 [inlined]
   [16] grid_layout(::ClassicalOrthogonalPolynomials.NormalizedOPLayout{…}, P::Normalized{…}, n::Int64)
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\ClassicalOrthogonalPolynomials.jl:292
   [17] grid
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:178 [inlined]
   [18] plan_grid_transform
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:213 [inlined]
   [19] _sub_factorize(::Tuple{…}, ::Tuple{…}, ::QuasiArrays.SubQuasiArray{…}; kws::@Kwargs{})
      @ ContinuumArrays C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:241
   [20] _sub_factorize
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:241 [inlined]
   [21] _factorize
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:248 [inlined]
   [22] factorize
      @ C:\Users\danjv\.julia\packages\QuasiArrays\nTH6k\src\inv.jl:57 [inlined]
   [23] _factorize(::ContinuumArrays.WeightedBasisLayout{…}, ::QuasiArrays.SubQuasiArray{…}; kws::@Kwargs{})
      @ ContinuumArrays C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:350
   [24] _factorize
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:350 [inlined]
   [25] factorize
      @ C:\Users\danjv\.julia\packages\QuasiArrays\nTH6k\src\inv.jl:57 [inlined]
   [26] plan_ldiv
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:279 [inlined]
   [27] transform_ldiv_size(::Tuple{…}, A::QuasiArrays.SubQuasiArray{…}, B::QuasiArrays.BroadcastQuasiVector{…})
      @ ContinuumArrays C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:282
   [28] transform_ldiv
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:283 [inlined]
   [29] adaptivetransform_ldiv(A::ClassicalOrthogonalPolynomials.Weighted{…}, f::QuasiArrays.BroadcastQuasiVector{…})
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\adaptivetransform.jl:34
   [30] transform_ldiv_size
      @ C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\adaptivetransform.jl:2 [inlined]
   [31] transform_ldiv
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:283 [inlined]
   [32] basis_ldiv_size
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:332 [inlined]
   [33] copy
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:323 [inlined]
   [34] _broadcast_mul_ldiv
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:150 [inlined]
   [35] copy
      @ C:\Users\danjv\.julia\packages\ContinuumArrays\Py5Q6\src\bases\bases.jl:152 [inlined]
   [36] materialize
      @ C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\ldiv.jl:22 [inlined]
   [37] ldiv
      @ C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\ldiv.jl:98 [inlined]
   [38] \
      @ C:\Users\danjv\.julia\packages\QuasiArrays\nTH6k\src\matmul.jl:34 [inlined]
   [39] LanczosPolynomial(w_in::QuasiArrays.BroadcastQuasiVector{…}, P::QuasiArrays.SubQuasiArray{…})
      @ ClassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\ClassicalOrthogonalPolynomials\3YYrU\src\lanczos.jl:162
   [40] semiclassical_jacobimatrix(t::Float64, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:161
   [41] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:205
   [42] SemiclassicalJacobi(t::Float64, a::Float64, b::Float64, c::Float64, P::SemiclassicalJacobi{Float64})
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:127
   [43] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:217
   [44] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:211
--- the last 2 lines are repeated 1488 more times ---
 [3021] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:217
 [3022] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64) (repeats 2 times)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:211
 [3023] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:209
 [3024] semiclassical_jacobimatrix(Q::SemiclassicalJacobi{Float64}, a::Float64, b::Float64, c::Float64) (repeats 2 times)
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:207
 [3025] SemiclassicalJacobi(t::Float64, a::Float64, b::Float64, c::Float64, P::SemiclassicalJacobi{Float64})
      @ SemiclassicalOrthogonalPolynomials C:\Users\danjv\.julia\packages\SemiclassicalOrthogonalPolynomials\GAsGB\src\SemiclassicalOrthogonalPolynomials.jl:127
Some type information was truncated. Use `show(err)` to see complete types.

Is there something obviously wrong with SemiclassicalJacobi(2.0, 3/2, 2.0, 1.0, SemiclassicalJacobi(2.0, -1/2, 1.0, -1/2))? Print shows it's going back and forth between c values

Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^0.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^0.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^1.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^1.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^0.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^0.5 on 0..1
Q = SemiclassicalJacobi with weight x^1.5 * (1-x)^2.0 * (2.0-x)^1.5 on 0..1
@TSGut
Copy link
Member

TSGut commented Jul 30, 2024

Building from previous is currently only implemented for integer differences. Nothing fundamental, just needs an if statement added in the right places if you want general cases. In that case you want to go up by integers until the remaining difference is smaller 1, then modify the final bit.

@DanielVandH
Copy link
Member Author

Ah, thought it might be something like that. I don't need it currently, just noticed it while writing tests and couldn't tell if it should work or not. Thanks.

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

No branches or pull requests

2 participants