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

Wrong tensor product between Fourier and Chebyshev #929

Closed
mzaffalon opened this issue Feb 9, 2024 · 1 comment · Fixed by JuliaApproximation/ApproxFunBase.jl#640 or JuliaApproximation/ApproxFunFourier.jl#117

Comments

@mzaffalon
Copy link
Contributor

mzaffalon commented Feb 9, 2024

using ApproxFun
f₁ = Fun(Fourier(), [zeros(2); 1]);
f₂ = Fun(Chebyshev(), [zeros(3); 1]);
f = f₁ ⊗ f₂;
coefficients(f) # all coefficients are zero

with ApproxFun v0.13.25 and Julia v1.10.0. The problem seems to be associated with Chebyshev: increasing its order past n=2 makes all coefficients zero.

The evaluation of the individual terms work:

ϕs = range(0, 2π, 51);
zs = range(-1, 1, 31);
[f₁(ϕ) * f₂(z) for ϕ in ϕs, z in zs]
@mzaffalon
Copy link
Contributor Author

mzaffalon commented Feb 19, 2024

The problem is with the tensor product with two Fourier spaces:

using ApproxFun
f = Fun(Fourier(), [0; 0; 1]);
kron(f,f).coefficients

This if-statement breaks too early. According to the documentation,, the ordering in the function is assumed to be (1,1), (1,2), (2,1), (1,3), (2,2)... but for Fourier spaces it appears that the ordering is instead (1,1), (1,2), (2,1), (2,2), (1,3).

What does TODO: generalize refer too?

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

Successfully merging a pull request may close this issue.

1 participant