ApproxFun.jl icon indicating copy to clipboard operation
ApproxFun.jl copied to clipboard

Functions of Multiplication operators

Open marcusdavidwebb opened this issue 7 years ago • 6 comments

Should we implement something to the effect of F(Multiplication(f,space(f))) = Multiplication(F(f),space(f))? I'd like to have a discussion before proceeding. The end goal is for the functional calculus in SpectralMeasures.jl. At present,

f = Fun(x->cos(x))
M = Multiplication(f,space(f)) 
F = x-> x^2
F(M)

returns a TimesOperator, and

G = x->exp(x)
G(M)

returns an OperatorFunction that is devoid of usable content.

marcusdavidwebb avatar Mar 12 '18 17:03 marcusdavidwebb

I don’t think it’s possible to override for all functions.

You could loop over calculus functions to get those at least.

dlfivefifty avatar Mar 12 '18 17:03 dlfivefifty

OperatorFunction is useful for diagonal operators. @MikaelSlevinsky added it for exp integrators.

dlfivefifty avatar Mar 12 '18 17:03 dlfivefifty

I didn't mean OperatorFunction is not useful. I meant that the OperatorFunction that is returned from the code above is useless at present. As far as I can tell...

marcusdavidwebb avatar Mar 12 '18 17:03 marcusdavidwebb

Do you see any issues for the difference between F(M) returning a times operator and F(M) returning a new multiplication operator? As I see it, applying to a vector requires (slightly) fewer floating point multiplications with the latter implementation.

marcusdavidwebb avatar Mar 12 '18 17:03 marcusdavidwebb

I think it’s a good idea. But as I said it’s impossible to do for all F, so would be restricted to whatever you explicitly override.

dlfivefifty avatar Mar 12 '18 17:03 dlfivefifty

Sure 👍🏻

marcusdavidwebb avatar Mar 12 '18 17:03 marcusdavidwebb