# Wigner d-functions

**URL:** <https://root-forum.cern.ch/t/wigner-d-functions/9728>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [March 1, 2010, 3:25am UTC](https://root-forum.cern.ch/t/wigner-d-functions/9728 "2010-03-01T03:25:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzimbres](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mzimbres](https://root-forum.cern.ch/u/mzimbres)\
**Post date:** [March 1, 2010, 3:25am UTC](https://root-forum.cern.ch/t/wigner-d-functions/9728/1 "2010-03-01T03:25:16Z")

</div>

Hi,

I am using the code attached to calculate the Wigner d-functions. I think it may be useful for other Root users(I have seem one ask for them in roottalk). The macro wig\_graph.C can be used as an example on how to use the class.

Marcelo  
[wig\_graph.C](https://root-forum.cern.ch/uploads/default/original/2X/f/f001668cd2195c70feb4be3a1b59150726fe20f4.C) (1.67 KB)  
[TWignerd.cxx](https://root-forum.cern.ch/uploads/default/original/2X/7/7cdc02b927a7482d6c9877a4496e5a971db21741.cxx) (5.08 KB)  
[TWignerd.h](https://root-forum.cern.ch/uploads/default/original/2X/3/3be8170f5027abb41a411ba9d6b65270e93bc56d.h) (1.58 KB)

---

<div class="post-metadata">

**Author:** ![mzimbres](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mzimbres](https://root-forum.cern.ch/u/mzimbres)\
**Post date:** [December 21, 2010, 4:00pm UTC](https://root-forum.cern.ch/t/wigner-d-functions/9728/2 "2010-12-21T16:00:04Z")

</div>

Hi, I have made many improvements to the class TWignerd, some of them are:

- I have tested its precision in performing Spherical harmonic transforms and transforms on SO(3) functions(the spherical wavelet transform)

- Comparison with gsl associated legendre polinomials. I just checked if the are correct. But since the associated legendre polinomials are a subset of the wigner-d functions I could not test all, however the tests mentioned above are more strong.

- Only one eighth of the coefficients are being stored(the minimum) and the others are returned by simmetry relations, with significant improvement in efficiency and performance.

There is one last simmetry that can be explored (even/odd). I was not able to use root’s FFTW wrap TVirtualFFT::SineCosine() of sine and cosine transform. This would improve performance by at least a factor of two. If anyone is willing to help me with that I would be greatefull. That would mean change TVirtualFFT::FFT() in TSmallWignerd class, by TVirtualFFT::SineCosine()(I tried with types 2 and 6, for even and odd respectively).

I think this would be a very useful tutorial on FFT’s which lacks an example of sine and cosine transforms and also useful as an option to calculate associeted legendre polinomials by FFT(and does not rely on recursion.)

If I succeed I will post again here.  
The code is attached. To use it just run:

$ root load.C  
root[] wig\_graph(20,12,15) // for example.

Marcelo  
[wignerd.tar.gz](https://root-forum.cern.ch/uploads/default/original/2X/c/c2df82b5511fa362c20d2a80fc4625ff86f7bfba.gz) (2.94 KB)

---

<div class="post-metadata">

**Author:** ![mzimbres](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mzimbres](https://root-forum.cern.ch/u/mzimbres)\
**Post date:** [May 9, 2011, 10:17am UTC](https://root-forum.cern.ch/t/wigner-d-functions/9728/3 "2011-05-09T10:17:14Z")

</div>

Hi, I have succeed in using sine and cosine transforms to calculate the Wigner d functions. To benchmark the code, I compared the time to calculate all associated Legendre polynomials(all l an m) up to l = 149(after that the GSL crashs). I attached a graph of the time taken for both. The code is useful as a tutorial on how to use sine and cosine transforms in ROOT. I will upload it later.

Cheers  
Marcelo

 ![](https://root-forum.cern.ch/uploads/default/original/2X/1/102cb29fec8d59d17ece65ed23ad834313c449e5.jpg)

---

<div class="post-metadata">

**Author:** ![mzimbres](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mzimbres](https://root-forum.cern.ch/u/mzimbres)\
**Post date:** [April 30, 2012, 7:45pm UTC](https://root-forum.cern.ch/t/wigner-d-functions/9728/4 "2012-04-30T19:45:13Z")

</div>

Dear Root developers,

this is the last version of the code I am using to calculate the Wigner-d functions. I have seem some people interest on it, therefore I am thinking of turning it into a separate package, since at the moment it is part of my package for analysis of functions on the sphere. Is there any interest of doing it part of Root? I think this could be useful to many users including me, for example, the classes TWignerd and TSmallWignerd could be included and the macro wig\_graph.C could be used as a tutorial on TVirtualFFT::SineCosine() which is lacking at the moment.

Cheers, Marcelo  
[wignerd.tar.gz](https://root-forum.cern.ch/uploads/default/original/2X/6/68b11fbc83e9f2dcc783860d506e7f1ef53f7eb2.gz) (3.07 KB)
