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

Operators for higher dimensional Tensorspaces #390

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

benjione
Copy link
Contributor

@benjione benjione commented Mar 7, 2023

See #389

I modified the KroneckerOperator temporarily to allow for tuples with more than 2 entries:

struct KroneckerOperator{S, V, DS,RS,DI,RI,T} <: Operator{T}
    ops::Tuple  # used to be Tuple{S, V}
    domainspace::DS
    rangespace::RS
    domaintensorizer::DI
    rangetensorizer::RI
end

I am not sure how to change this, maybe by changing the signature to

struct KroneckerOperator{TT, DS,RS,DI,RI,T} <: Operator{T}

where TT is than the tuple type T{S,V,D,...}.

What now works is the following:

f3 = Fun(Chebyshev()^3, rand(100))
Dx = Derivative(Chebyshev()^3, [1,0,0])  # this works now
Dy = Derivative(Chebyshev()^3, [0,1,0])
Dz = Derivative(Chebyshev()^3, [0,0,1])
DD = Dx + Dy + Dz   # this works

f3dd = DD * f3
f3dd(0.0, 0.2, 0.3) # this works, since it is a polynomial of same kinds and TrivialTensorizer can be used

f3dx = Dx * f3
f3dx(0.0, 0.2, 0.3) # this does not work, since only higher dim functions of same kind are currently supported

@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Attention: Patch coverage is 23.88060% with 102 lines in your changes missing coverage. Please review.

Project coverage is 60.89%. Comparing base (f1b1402) to head (40fbf7a).
Report is 203 commits behind head on master.

Files Patch % Lines
src/Multivariate/TensorSpace.jl 14.10% 67 Missing ⚠️
src/PDE/KroneckerOperator.jl 36.00% 32 Missing ⚠️
src/Multivariate/TrivialTensorFun.jl 0.00% 2 Missing ⚠️
src/Caching/blockbanded.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #390      +/-   ##
==========================================
- Coverage   65.66%   60.89%   -4.77%     
==========================================
  Files          79       80       +1     
  Lines        8323     8547     +224     
==========================================
- Hits         5465     5205     -260     
- Misses       2858     3342     +484     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jishnub
Copy link
Member

jishnub commented Mar 7, 2023

I am not sure how to change this, maybe by changing the signature to

struct KroneckerOperator{TT, DS,RS,DI,RI,T} <: Operator{T}

where TT is than the tuple type T{S,V,D,...}.

I think this is the right approach.

Also, the CI is probably broken right now because of FFTW v1.6, but hopefully that should be fixed soon

@benjione
Copy link
Contributor Author

benjione commented Mar 8, 2023

The following works now:

f3 = Fun(Chebyshev()^3, rand(100))
Dx = Derivative(Chebyshev()^3, [1,0,0])
f3dx = Dx * f3
f3dx(0.0, 0.2, 0.3)

What is missing is

DefiniteIntegral(Chebyshev()^3, [0,1,0])

which is because there is no Iterator for the Tensorizer of the space ConstantSpace() ⊗ Chebyshev() ⊗ Chebyshev().
For more than 2D cases, only spaces with blocklenghts 1:infty are currently supported. I wonder if in the case of ConstantSpace one can just reduce the constant dimension and work with Chebyshev() ⊗ Chebyshev()

@benjione
Copy link
Contributor Author

benjione commented Mar 9, 2023

The implementation is finished, but tests are missing. I feel like most of the test are necessary in ApproxFunOrthogonalPolynomials.jl and here maybe some for the KroneckerOperator.

@benjione benjione changed the title Work in progress: Operators for higher dimensional Tensorspaces Operators for higher dimensional Tensorspaces Mar 9, 2023
@jishnub
Copy link
Member

jishnub commented Mar 10, 2023

Could you look into the test failures? The CI issue should be resolved now

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 this pull request may close these issues.

2 participants