Implementing a convolution operator
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia studiando gli spazi Laurent() e Fourier() esistenti, le loro rappresentazioni tramite coefficienti e il modo in cui gli operatori di conversione collegano i domini periodici. Poi analizza come vengono definiti gli operatori personalizzati e come vengono composti con altri operatori. Il lavoro è completato quando è possibile costruire un operatore di convoluzione per funzioni periodiche e sommarlo o moltiplicarlo nelle equazioni lineari descritte, gestendo la conversione per i domini non canonici.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Given a (periodic) function $f$ I would like to implement its convolution operator $C_f$, i.e. an operator that I can later apply on a function to give $C_f g = \int dy f(x-y)g(y)$.
After doing some search through the code, I don't think a convolution operator has been implemented in ApproxFun, though as a complete newbie, tbh, I am quite lost in the code. I could imagine a convolution was implemented as least implicitly, because I guess it is used for multiplying two functions over any Fourier space.
I managed to implement and explicit convolution for two functions on a Laurent() space. This is convenient, as the convolution basically just amounts to multiplying the coefficients of both functions:
#assume that f and g are Laurent over the same domain
function convolution_approxfun(f,g)
x0=first(ApproxFunBase.domain(f))
x1=last(ApproxFunBase.domain(f))
L=x1-x0
#fourier index of the n'th coefficient
fourier_index = [if mod(a,2)==1 div(a-1,2) else -div(a,2) end for a=1:ncoefficients(f)]
return Fun(Laurent(ApproxFunBase.domain(f)),f.coefficients.*g.coefficients.*L.*exp.(-2*pi*1im/L.*fourier_index*x0))
end
It works, but it is of course not very flexible code (Note the extra phase has to be added in case the interval starts at $x_0 \neq 0$).
The reason I need to implement the convolution operator is that I would like to solve some linear equation that contains a convolution operator. So the above explicit implementation is not enough for me, I need to implement an operator that I can add and multiply to other operators.
From what I understand about the functionality of ApproxFun.jl I think a good implementation would look something like this:
- Using a conversion operator to convert a function on any periodic domain to the canonical domain with the canonical space (I think its Fourier()) on it.
- Implementing a convolution operator on this canonical space, which is just multiplying the coefficients
- Using a conversion operator to convert the function back to the original domain/space
I have the feeling all of these steps could be very easy to implement, but I am lacking the detailed understanding of how ApproxFun.jl works in the background. I would be great if someone could help me with that: How do I implement a custom operator in general? How do I take care of the conversion properly?
PS: In case others agree I would be great to add convolution operators to the general functionality of ApproxFun in the future. At least for me convolution operators appear frequently in scientific computing.
- Lingua principale
- Julia
- Stelle
- 559
- Fork
- 71
- Merge medio
- 23m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaApproximation/ApproxFun.jl
-
tagbot-manual
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
How to add Gauge/Tau MethodAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
JuliaApproximation/ApproxFun.jl#970 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Plotting with MakieAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Tutte le issue di JuliaApproximation/ApproxFun.jl
Issue simili
-
broken links in docsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
JuliaPhysics/BeamletOptics.jl#127 ·
I maintainer di solito rispondono entro 1 giorno
-
Chains resumed from `initial_state` take `num_warmup + 1` warm-up stepsForse già presa @thevolatilebit l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
TuringLang/AbstractMCMC.jl#220 ·
-
found-by-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
exanauts/SparseDirectSolver.jl#92 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno