On Friday, June 4, 2021 at 10:03:47 PM UTC+8 Emmanuel Charpentier wrote:

> Le samedi 29 mai 2021 à 01:16:21 UTC+2, [email protected] a écrit :
>
>> On Saturday, May 29, 2021 at 1:01:38 AM UTC+8 [email protected] wrote:
>>
>>> On Fri, May 28, 2021 at 5:38 PM Hongyi Zhao <[email protected]> wrote: 
>>> > 
>>> > 
>>> > 
>>> > On Friday, May 28, 2021 at 8:19:07 PM UTC+8 Emmanuel Charpentier 
>>> wrote: 
>>> >> 
>>> >> This can be computed “by hand” using (one of) the textbook 
>>> definition(s) : 
>>> >> 
>>> >> sage: var("omega, s") 
>>> >> (omega, s) 
>>> >> sage: integrate(sin(x^2)*e^(-I*s*x), x, -oo, oo) 
>>> >> 1/2*sqrt(2)*sqrt(pi)*cos(1/4*s^2) - 1/2*sqrt(2)*sqrt(pi)*sin(1/4*s^2) 
>>> >> 
>>> >> Both sympy and giac have implementations of this transform : 
>>> >> 
>>> >> sage: from sympy import fourier_transform, sympify 
>>> >> sage: fourier_transform(*map(sympify, (sin(x^2),x, s)))._sage_() 
>>> >> 1/2*sqrt(2)*sqrt(pi)*(cos(pi^2*s^2) - sin(pi^2*s^2)) 
>>> >> sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x^2), x, 
>>> s))).sage() 
>>> >> 1/2*sqrt(2)*sqrt(pi)*(cos(1/4*s^2) - sin(1/4*s^2)) 
>>> >> 
>>> >> which do not follow the same definitions… But beware : they may be 
>>> more or less wrong : 
>>> >> 
>>> >> sage: integrate(sin(x)*e^(-I*s*x), x, -oo, oo).factor() 
>>> >> undef # Wrong 
>>> >> sage: fourier_transform(*map(sympify, (sin(x),x, s)))._sage_() 
>>> >> 0 # Wrong AND misleading 
>>> >> sage: libgiac.fourier(*map(lambda u:u._giac_(), (sin(x), x, 
>>> s))).sage() 
>>> >> I*pi*dirac_delta(s + 1) - I*pi*dirac_delta(s - 1) # Better... 
>>> >> 
>>> >> BTW: 
>>> >> 
>>> >> sage: mathematica.FourierTransform(sin(x^2), x, s).sage().factor() 
>>> >> 1/2*cos(1/4*s^2) - 1/2*sin(1/4*s^2) 
>>> >> sage: mathematica.FourierTransform(sin(x), x, s).sage().factor() 
>>> >> -1/2*I*sqrt(2)*sqrt(pi)*(dirac_delta(s + 1) - dirac_delta(s - 1)) 
>>> > 
>>> > But what I got is different from yours: 
>>> > 
>>> > sage: var("omega, s") 
>>> > (omega, s) 
>>> > sage: mathematica.FourierTransform(sin(x), x, s).sage().factor() 
>>> > -I*(dirac_delta(s + 1) - dirac_delta(s - 1))*Sqrt(1/2*pi) 
>>>
>>> this depends of a version of Mathematica 
>>>
>>
>> Is there a convenient way to prove they are the equivalent forms in sage?
>>
>
> Yep, with a bit of cut’n paste (since both foms can’t be obtained from the 
> same Mathematica installation) :
>
> sage: var("x, s")
> (x, s)
> sage: a="-I*(dirac_delta(s + 1) - dirac_delta(s - 1))*sqrt(1/2*pi)"         # 
> text representatin of yours.
> sage: b="-1/2*I*sqrt(2)*sqrt(pi)*(dirac_delta(s + 1) - dirac_delta(s - 1))" # 
> text representation of mine.
> sage: bool(eval(a)==eval(b))
> True
>
> ​
>
> This should do it...
>
>
Thanks a lot. It does the trick.

HY

 

> HY
>>
>>>
>>> > 
>>> > BTW: 
>>> > 
>>> > How to input the sage computation representation as the code style 
>>> just like what you've posted? 
>>> > 
>>> > HY 
>>> > 
>>> >> 
>>> >> HTH, 
>>> >> 
>>> >> Le dimanche 23 mai 2021 à 03:22:06 UTC+2, [email protected] a écrit 
>>> : 
>>> >>> 
>>> >>> It seems that all the Fourier transform methods implemented in 
>>> sagemath is numeric, instead of symbolic/analytic. 
>>> >>> 
>>> >>> I want to know whether there are some symbolic/analytic Fourier 
>>> transform functions, just as we can do in mathematica, in sagemath? 
>>> >>> 
>>> >>> I want to know if there are some symbolic/analytical Fourier 
>>> transform functions available in sagemath, just as the ones in mathematica? 
>>> >>> 
>>> >>> Regards, 
>>> >>> HY 
>>> >>> 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups "sage-support" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected]. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sage-support/84095de0-8726-4194-a84f-f2f0c5c876c3n%40googlegroups.com.
>>>  
>>>
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/d2402996-81a1-406e-8b0e-21f7eeb0ab5bn%40googlegroups.com.

Reply via email to