Skip to content

Commit 311cb2e

Browse files
add bespoke angularmomentum
1 parent a677010 commit 311cb2e

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/rectdisk.jl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,38 @@ function jacobimatrix(::Val{2}, P::DunklXuDisk)
153153
), (blockedrange(Fill(3, 3)), axes(n,1)))
154154
_BandedBlockBandedMatrix(dat, axes(k,1), (1,1), (1,1))
155155
end
156+
157+
158+
159+
#########
160+
# AngularMomentum
161+
# Applies the partial derivative with respect to the last angular variable in the coordinate system.
162+
# For example, in polar coordinates (r, θ) in ℝ² or cylindrical coordinates (r, θ, z) in ℝ³, we apply ∂ / ∂θ = (x ∂ / ∂y - y ∂ / ∂x).
163+
# In spherical coordinates (ρ, θ, φ) in ℝ³, we apply ∂ / ∂φ = (x ∂ / ∂y - y ∂ / ∂x).
164+
#########
165+
166+
struct AngularMomentum{T,Ax<:Inclusion} <: LazyQuasiMatrix{T}
167+
axis::Ax
168+
end
169+
170+
AngularMomentum{T}(axis::Inclusion) where T = AngularMomentum{T,typeof(axis)}(axis)
171+
AngularMomentum{T}(domain) where T = AngularMomentum{T}(Inclusion(domain))
172+
AngularMomentum(axis) = AngularMomentum{eltype(eltype(axis))}(axis)
173+
174+
axes(A::AngularMomentum) = (A.axis, A.axis)
175+
==(a::AngularMomentum, b::AngularMomentum) = a.axis == b.axis
176+
copy(A::AngularMomentum) = AngularMomentum(copy(A.axis))
177+
178+
^(A::AngularMomentum, k::Integer) = ApplyQuasiArray(^, A, k)
179+
180+
@simplify function *(A::AngularMomentum, P::DunklXuDisk)
181+
β = P.β
182+
n = mortar(Fill.(oneto(∞),oneto(∞)))
183+
k = mortar(Base.OneTo.(oneto(∞)))
184+
dat = PseudoBlockArray(Vcat(
185+
(2 .* (k .+- 1)) .* (n .- k .+ 1) ./ (2k .+ (2β - 1)))', # n, k-1
186+
(0 .* n)', # n, k
187+
(-k .* (k .+ 2β) .* (n .+ k .+ 2β) ./ ((2k .+ (2β - 1)) .* (2k .+ 2β)))', # n, k+1
188+
), (blockedrange(Fill(3, 1)), axes(n,1)))
189+
DunklXuDisk(β) * _BandedBlockBandedMatrix(dat, axes(k,1), (0,0), (1,1))
190+
end

test/test_rectdisk.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ import MultivariateOrthogonalPolynomials: dunklxu_raising, dunklxu_lowering
5555

5656
@test λ im*imag(λ)
5757

58+
∂θ = AngularMomentum(P)
59+
60+
A = P \ (∂θ * P)
61+
62+
@test A[Block.(1:N), Block.(1:N)] C
63+
5864
@testset "truncations" begin
5965
KR,JR = Block.(1:N),Block.(1:N)
6066

0 commit comments

Comments
 (0)