ApproxFun.jl icon indicating copy to clipboard operation
ApproxFun.jl copied to clipboard

What is the order of basis functions in 2D Laurent space?

Open atbug opened this issue 4 years ago • 1 comments

I read from the documentation that product of 1D space is interlaced with lexigraphical order. However, when I try to test this, I get the following order:

using ApproxFun

foo = [(i, j) for i in -5:5 for j in -5:5]
bar = [length(Fun((x, y)->exp(i*im*x)*exp(j*im*y), Laurent()^2).coefficients) for i in -5:5 for j in -5:5]

# output the ordering of basis functions
for item in foo[sortperm(bar)]
    println(item)
end

"""
output:
(0, 0) 
(-1, 0)
(0, -1)
(-1, -1)
(0, 1)
(-1, 1)
(0, -2)
(-1, -2)
(1, 0)
(-2, 0)
(1, -1)
(-2, -1)
(0, 2)
(-1, 2)
(0, -3)
(-1, -3)
(1, 1)
(-2, 1)
(1, -2)
(-2, -2)
(2, 0)
(-3, 0)
(2, -1)
(-3, -1)
(0, 3)
(-1, 3)
(0, -4)
(-1, -4)
(1, 2)
(-2, 2)
(1, -3)
(-2, -3)
(2, 1)
(-3, 1)
(2, -2)
(-3, -2)
(3, 0)
(-4, 0)
(3, -1)
(-4, -1)
(0, 4)
(-1, 4)
(0, -5)
(-1, -5)
(1, 3)
(-2, 3)
(1, -4)
(-2, -4)
(2, 2)
(-3, 2)
"""

I don't think this is lexigraphical order. In fact, I cannot find a rule for the ordering. What is the order of basis functions in 2D Laurent space?

atbug avatar May 30 '20 16:05 atbug

Laurent is a bit more involved since its grouped by blocks, and the coefficients are then also grouped by blocks. One way to think of this is it's grouped by polynomial degree, where we have polynomials in z = exp(im*θ) and conj(z).

I'm redesigning this at the moment so won't be updating the docs right now.

dlfivefifty avatar May 30 '20 19:05 dlfivefifty