Diagonal Laplacians not identified
The Fourier Laplacians could be simplified:
julia> L = Laplacian(SinSpace()^2)
LaplacianWrapper:SinSpace(【0.0,6.283185307179586❫)⊗SinSpace(【0.0,6.283185307179586❫)→SinSpace(【0.0,6.283185307179586❫)⊗SinSpace(【0.0,6.283185307179586❫)
-2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋯
0.0 -5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
0.0 0.0 -5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
0.0 0.0 0.0 -10.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
0.0 0.0 0.0 0.0 -8.0 0.0 0.0 0.0 0.0 0.0 ⋱
0.0 0.0 0.0 0.0 0.0 -10.0 0.0 0.0 0.0 0.0 ⋱
0.0 0.0 0.0 0.0 0.0 0.0 -17.0 0.0 0.0 0.0 ⋱
0.0 0.0 0.0 0.0 0.0 0.0 0.0 -13.0 0.0 0.0 ⋱
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -13.0 0.0 ⋱
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -17.0 ⋱
⋮ ⋱ ⋱ ⋱ ⋱ ⋱ ⋱ ⋱ ⋱ ⋱ ⋱
julia> isdiag(L)
false
julia> bandwidths(L)
(∞, ∞)
I think we need a notion of a diagonal operator. Then kronecker products of diagonal operators would be diagonal.
It also creates a RaggedMatrix instead of a Diagonal or BandedMatrix.
And some Fourier-based spaces (e.g. SinSpace()) don't need wrappers for Derivative, so the Laplacian shouldn't be a wrapper either.
If you do L[Block.(1:N), Block.(1:N)] it will create a BandedBlockBandedMatrix, with diagonal bandwidths.
Whether L[1:n, 1:n] should also return a BandedBlockBandedMatrix needs some thought, see https://github.com/JuliaArrays/BlockArrays.jl/issues/55
Yes, the notion of a diagonal operator would be good: some integral operators are diagonal but not a finite sum of Kronecker products.
Cheers,
Mikael
On Oct 16, 2018, at 11:28 AM, Sheehan Olver <[email protected]mailto:[email protected]> wrote:
Whether L[1:n, 1:n] should also return a BandedBlockBandedMatrix needs some thought, see JuliaArrays/BlockArrays.jl#55https://github.com/JuliaArrays/BlockArrays.jl/issues/55
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/JuliaApproximation/ApproxFun.jl/issues/625#issuecomment-430304865, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHzBpc9RlO80bMhGI_hpIHFRkvlhlkYbks5ulgkYgaJpZM4Xesbk.
I think it’ll have to wait until everything is moved to InfiniteArrays.jl, which already supports diagonal: Diagonal(1:∞).
This is fixed now
julia> L = Laplacian(SinSpace()^2)
LaplacianWrapper : SinSpace(【0.0,6.283185307179586❫) ⊗ SinSpace(【0.0,6.283185307179586❫) → SinSpace(【0.0,6.283185307179586❫) ⊗ SinSpace(【0.0,6.283185307179586❫)
-2.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ -5.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ -5.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ -10.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ -8.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ -10.0 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -17.0 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -13.0 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -13.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -17.0 ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋱
julia> isdiag(L)
true
julia> bandwidths(L)
(0, 0)