-
Notifications
You must be signed in to change notification settings - Fork 6
Support algebra operations on expansions #54
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
Conversation
I think it looks a lot like the ad hoc thing I have in Atoms.jl: https://github.com/JuliaAtoms/Atoms.jl/blob/compact-bases/src/radial_orbitals.jl#L2 (and also in CompactBases.jl: https://github.com/JuliaApproximation/CompactBases.jl/blob/master/src/types.jl), so I think it is a good idea to upstream the type definitions to ContinuumArrays.jl. Maybe also add the higher-order tensor case, i.e. The algebra is also very nice to have! Is Will the comparison of ContinuumArrays.jl/src/bases/bases.jl Lines 192 to 197 in 0c94353
I.e. what type should And what is the difference between ContinuumArrays.jl/src/bases/bases.jl Line 181 in 0c94353
|
Yes.
Yes: if
The idea was that one would only need to overload one of these. |
I don't follow: higher dimensions is a property of the axes. Unless you are proposing we support tensor algebra, that is, |
Yeah, I realized I was wrong; rather I meant supporting const Expansion{T,N,Space<:Basis,Coeffs<:AbstractVecOrMat{T}} =
ApplyQuasiVector{T,typeof(*),<:Tuple{Space,Coeffs}} Then, if I think for functions in higher dimensions (this is really #15), i.e. beyond curves, you need to increase the number of quasi-axes as you increase the number of discrete axes (if that makes sense). I.e. a function mapping from 2d -> 1d would have 2 quasi-axes and 2 "basis function" axes (which we could denote e.g. Also mentioned in #15 is the case |
If the coefficients are a matrix, then the basis needs to be a 3-tensor, with 3-tensor times matrix multiplication defined. otherwise |
Well, then I would simply have EDIT: The reason being if |
Algebra has to make sense: if Where things are more complicated were if you wanted spherical harmonics with the coefficients represented as a matrix. This would not makes sense as the basis is different for each column. So in that case it would be best to wrap the matrix as a block-vector and avoid the need to define tensors. |
Fair enough. For spherical harmonics, the number of coefficients would be different though, for each irreducible representation? I.e. for |
Just as a block-quasi-matrix, see https://github.com/JuliaApproximation/SphericalHarmonics.jl |
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
==========================================
+ Coverage 69.64% 79.43% +9.79%
==========================================
Files 4 4
Lines 336 355 +19
==========================================
+ Hits 234 282 +48
+ Misses 102 73 -29
Continue to review full report at Codecov.
|
@jagot FYI, this will be a big change so let me know your thoughts.
At the moment it's just a quick prototype: I want to make it trait based, so that, for example,
view(f, 0.5:0.5:1)
is also treated as an expansion. I think this is doable via aBroadcastStyle
, instead of overloadingbroadcasted
directly.