Skip to content

Update for QuasiArrays.jl #13

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

Merged
merged 16 commits into from
Aug 22, 2019
Merged

Update for QuasiArrays.jl #13

merged 16 commits into from
Aug 22, 2019

Conversation

dlfivefifty
Copy link
Member

No description provided.

@dlfivefifty dlfivefifty changed the title add ultraspherical bases Update for QuasiArrays.jl Aug 20, 2019
@dlfivefifty
Copy link
Member Author

@jagot This is converging on a reasonable revised system, building on QuasiArrays.jl. I'll probably move out the ultraspherical code before merging to try to make this package "bare bones", but thought I'd warn you about what's going to happen.

Probably the nicest change is the addition of an @simplify macro to specify commuting relationships. Here are some examples:

# mass matrix for Legendre
@simplify *(A::QuasiAdjoint{<:Any,<:Legendre}, B::Legendre) = Diagonal(2 ./ (2(0:∞) .+ 1))		     
# Jacobi matrix for Legendre
@simplify \(A::Legendre, *(B::Identity, C::Legendre))  =		
     _BandedMatrix(Vcat(((0:∞)./(1:2:∞))', Zeros(1,∞), ((1:∞)./(1:2:∞))'), ∞, 1,1)		   

The @simplify code adds a bunch of extra functions, for example, if you have @simplify *(::Type1, ::Type2) it automatically also adds the adjoint code *(::QuasiAdjoint{<:Any,<:Type2}, ::QuasiAdjoint{<:Any,<:Type1}) (taking into account Type1/Type2 may also be adjoints).

Other than that its tried to make everything more systematic. One left over unsystematic routine is fullmaterialize, which I think can be redesigned in a more robust way by checking ApplyStyle(*, typeof.(A.args[subinds])...) == SimplifyStyle() to see if a simplifying relationship is known, and this could even happen at compile time now that ApplyStyle depends only on types. I'll probably just leave it for now though.

Another thing left to do is collapse Eye(...) * B to just B. This probably isn't too hard.

@jagot
Copy link
Member

jagot commented Aug 20, 2019

That's really cool! 👍

@dlfivefifty dlfivefifty merged commit cf4ee76 into master Aug 22, 2019
@dlfivefifty dlfivefifty deleted the ultraspherical branch August 22, 2019 12:29
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