JuliaApproximation / JuliaApproximation/ApproxFun.jl

Anomalous behavior of transform with Fourier()^2 space

Open
#712 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
559
Forks
71
PR merge metrics
No merged PRs in 30d

Description

transform and itransform behave strangely when used on a TensorSpace made of two Fourier spaces:

using ApproxFun
S = Fourier()^2
itransform(S, transform(S, [1.,2.,3.,4.]))
# gives [2.5, 3.0, 2.5, 2.0, 3.5, 4.0, 3.5, 3.0, 2.5, 3.0, 2.5, 2.0, 1.5, 2.0, 1.5, 1.0]
transform(S, itransform(S, [1.,2.,3.,4.]))
# gives [1.0, 2.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

I'm expecting both lines to return [1.,2.,3.,4.], but this is not the case (this would work with S=Fourier()).
At first sight, the issue is that transform adds a bunch of zeros at the end of the output.

I don't know if the truncated output is actually correct. With truncation transform followed by itransform indeed returns the original input (and conversely) .

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

Start by running the Julia reproduction in the issue with S = Fourier()^2 and compare both transform/itransform round trips with the single Fourier() case. Trace the transform and itransform behavior for the tensor-product space and determine whether the added zeros are expected; done means the two round trips produce the expected values or their truncation behavior is clearly corrected and tested.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.