JuliaApproximation / JuliaApproximation/MultivariateOrthogonalPolynomials.jl

Either: PartialDerivative{k}(<:Basis) or Inclusion(::Basis) should err (or both)

Open
#88 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
20
Forks
6
Avg merge
2d 17h
Merged PRs (30d)
1

Description

julia> P = JacobiTriangle()
JacobiTriangle(0, 0, 0)

julia> Q = JacobiTriangle(2, 2, 2)
JacobiTriangle(2, 2, 2)

julia> ∂x = PartialDerivative{1}(P)
PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}

julia> Q \ (∂x^2 * P)
ERROR: DimensionMismatch("Second axis of A, Inclusion(JacobiTriangle(0, 0, 0)), and first axis of B, Inclusion(DomainSets.FixedUnitSimplex{SVector{2, Float64}, :closed}()) must match")
Stacktrace:
 [1] _check_mul_axes(A::PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, B::ApplyQuasiMatrix{Float64, typeof(*), Tuple{JacobiTriangle{Float64, Int64}, BandedBlockBandedMatrix{Float64, Adjoint{Float64, LazyBandedMatrices.BlockBroadcastArray{Float64, 2, typeof(hcat), Tuple{LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}}}}, BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:87
 [2] check_mul_axes(::PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, ::ApplyQuasiMatrix{Float64, typeof(*), Tuple{JacobiTriangle{Float64, Int64}, BandedBlockBandedMatrix{Float64, Adjoint{Float64, LazyBandedMatrices.BlockBroadcastArray{Float64, 2, typeof(hcat), Tuple{LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}}}}, BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:89
 [3] instantiate
   @ ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:101 [inlined]
 [4] materialize
   @ ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:105 [inlined]
 [5] mul
   @ ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:106 [inlined]
 [6] *(A::PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, B::ApplyQuasiMatrix{Float64, typeof(*), Tuple{JacobiTriangle{Float64, Int64}, BandedBlockBandedMatrix{Float64, Adjoint{Float64, LazyBandedMatrices.BlockBroadcastArray{Float64, 2, typeof(hcat), Tuple{LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Type{Fill}, Tuple{InfiniteArrays.OneToInf{Int64}, InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}}}, Int64}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}, LazyArrays.BroadcastVector{Int64, typeof(+), Tuple{BlockVector{Int64, LazyArrays.BroadcastVector{StepRange{Int64, Int64}, typeof(*), Tuple{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.OneToInf{Int64}}}}}, Tuple{BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}, Int64}}}}}}}, BlockedUnitRange{RangeCumsum{Int64, InfiniteArrays.OneToInf{Int64}}}}}})
   @ QuasiArrays ~/.julia/packages/QuasiArrays/bxqu9/src/matmul.jl:23
 [7] *(App::ApplyQuasiMatrix{Float64, typeof(^), Tuple{PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, Int64}}, b::JacobiTriangle{Float64, Int64})
   @ QuasiArrays ~/.julia/packages/QuasiArrays/bxqu9/src/lazyquasiarrays.jl:231
 [8] top-level scope
   @ REPL[72]:1

julia> Q \ (∂x.^2 * P)
ERROR: DimensionMismatch("Second axis of A, Inclusion(JacobiTriangle(0, 0, 0)), and first axis of B, Inclusion(DomainSets.FixedUnitSimplex{SVector{2, Float64}, :closed}()) must match")
Stacktrace:
 [1] _check_mul_axes(A::BroadcastQuasiMatrix{Float64, typeof(Base.literal_pow), Tuple{Base.RefValue{typeof(^)}, PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, Base.RefValue{Val{2}}}}, B::JacobiTriangle{Float64, Int64})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:87
 [2] check_mul_axes(::BroadcastQuasiMatrix{Float64, typeof(Base.literal_pow), Tuple{Base.RefValue{typeof(^)}, PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, Base.RefValue{Val{2}}}}, ::JacobiTriangle{Float64, Int64})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:89
 [3] instantiate
   @ ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:101 [inlined]
 [4] materialize(M::ArrayLayouts.Mul{LazyArrays.BroadcastLayout{typeof(Base.literal_pow)}, ContinuumArrays.BasisLayout, BroadcastQuasiMatrix{Float64, typeof(Base.literal_pow), Tuple{Base.RefValue{typeof(^)}, PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, Base.RefValue{Val{2}}}}, JacobiTriangle{Float64, Int64}})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:105
 [5] mul
   @ ~/.julia/packages/ArrayLayouts/mTQvg/src/mul.jl:106 [inlined]
 [6] *(A::BroadcastQuasiMatrix{Float64, typeof(Base.literal_pow), Tuple{Base.RefValue{typeof(^)}, PartialDerivative{1, Float64, Inclusion{Float64, JacobiTriangle{Float64, Int64}}}, Base.RefValue{Val{2}}}}, B::JacobiTriangle{Float64, Int64})
   @ QuasiArrays ~/.julia/packages/QuasiArrays/bxqu9/src/matmul.jl:23
 [7] top-level scope
   @ REPL[73]:1

julia> 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two REPL expressions using PartialDerivative, JacobiTriangle, and Inclusion, then inspect the reported axis checks in ArrayLayouts and the multiplication path in QuasiArrays. Determine whether PartialDerivative{k}(basis) or Inclusion(basis) should reject the incompatible composition; done means the invalid operation is rejected consistently at the appropriate entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.