#flipcode

#flipcode
Welcome to the chatterbox... 
#flipcode forumspace!

Browsing Technica, Graphica, Physica

Triple product of spherical harmonics


 




 
Tobold (219)Triple product of spherical harmonics - 2007-03-12 12:20:50
Registered: unknown
Posts: 3

Howdy ho, just rediscovered that flipcode (at least in another form) is alive!

I have the following problem at hand: The integral of three spherical harmonic functions is said to be related or described by the so called Clebsch-Gordan coefficients. I already have a working implementation to generate those coefficients . However, if I multiply three functions and do a monte-carlo integration, the values are different from the Clebsch-Gordan coefficients. Even with the formula on Mathworld I get different values.

Can somebody point me to a working piece of code, or does anyone have an idea what I might be doing wrong?

Dirtysouthafrican (2)Re: Triple product of spherical harmonics - 2007-03-13 14:25:08
Avatar of user Dirtysouthafrican
Registered: unknown
Posts: 312

I thought the integral of the product of three spherical harmonics is given by the Wigner 3-j symbols.

The Glebsch-Gordan coefficients relate the product of two spherical harmonics to another spherical harmonic. Since the aforementioned integral is basically the inner product between a spherical harmonic and the product of two spherical harmonics, there is a natural relationship between the CG and 3-j symbols.

What is it you're trying to do?

Dirtysouthafrican (2)Re: Triple product of spherical harmonics - 2007-03-13 14:27:28
Avatar of user Dirtysouthafrican
Registered: unknown
Posts: 312

Mmm, I just checked your link and that obviously uses the 3-j symbols. However, are you remembering that those formulas take the complex conjugate of Y? Usually, .

Also, spherical harmonics are normalized differently in different literature.

Finally, depending on how you're choosing your points on the sphere for the Monte Carlo, you could be biasing your integral towards certain angles, i.e., the integration measure assumes uniform intervals on and not necessarily on the sphere.

Tobold (219)Re: Triple product of spherical harmonics - 2007-03-13 15:20:10
Registered: unknown
Posts: 3

However, are you remembering that those formulas take the complex conjugate of Y?

Yes, I've noted that too. Basically what I'm trying to do is this: I'm working on a PRT renderer and my current problem is to get the transfer matrix right. In this paper I've found out that instead of numerically calculating the triple product, I could use Clebsch-Gordan or Wigner 3j symbols (which now also work). So right now I simply need to get the triple product of the real spherical harmonics right that I'm using.

The Mathworld article on spherical harmonics says this:

So, either there is a typo somewhere, or this is the triple product without a conjugate, which would be just the thing I need. My Wigner3j function is simply using the Clebsch Gordan coefficient and dividing it by the stuff in equation 18 on the Wigner3j article. The normalization I use is from the Green paper.

I did a test today: I have two spherical functions - the grace probe image and a diffuse transfer function with a normal pointing upwards. I transformed both into SH coefficients and created a transfer matrix from the transfer function coefficients. When I transform the grace probe coefficients with the matrix, the expected result would be a coefficient vector that represents the low-frequency part of the upper half of the grace cathedral probe. However, I get the left half, and much too bright... damn that stuff is tricky! =/

Well, thanks for clearing up what the symbols actually do, I didn't understand the connection between them and the spherical harmonic functions. All the important literature seems to be on quantum physics, and so far I didn't get my hands on any of the books usually referenced.

Dirtysouthafrican (2)Re: Triple product of spherical harmonics - 2007-03-13 15:45:54
Avatar of user Dirtysouthafrican
Registered: unknown
Posts: 312

Which spherical harmonics are you using? Because different representations may use different coefficients. If you are using real SHs, then likely you will need different coefficients than the ones given on mathworld.

The real SHs are simply related to the complex ones, so it should be easy to derive the appropriate coefficients.

Tobold (219)Re: Triple product of spherical harmonics - 2007-03-15 04:10:02
Registered: unknown
Posts: 3

I'm using real SHs with the formula given in the green paper (equation 6). I've seen the compact variant of that equation with a sum of two complex spherical harmonic functions somewhere else. But you're right, the error is probably that I didn't modify the coefficients for the real case.

m0rf (248)Re: Triple product of spherical harmonics - 2008-06-22 03:22:28
Registered: 2008-06-22
Posts: 4

Hi there - my turn to look at this! I'm using a real spherical harmonic formulation that's similar to Green's for some audio work.

Anyway, I'm also looking for an efficient triple product integral implementation. I follow the mathworld Wigner 3j-symbol definition, except where it says "the sum is over all integers t for which the factorials in f(t) all have nonnegative arguments". What is this mysterious f(t)?

I can track back to source and get hold of the Messiah text, but I was wondering if one of you good people might have wisdom to share from your previous work...

m0rf (248)Re: Triple product of spherical harmonics - 2008-06-22 06:27:21
Registered: 2008-06-22
Posts: 4

Okay, I have the Wigner 3j-symbol working now. But I'm guessing I am where Tobold was when this thread was last active - trying to work out how to relate the formulation in complex spherical harmonics to the one in real spherical harmonics...

Clues appreciated!

m0rf (248)Re: Triple product of spherical harmonics - 2008-06-22 08:00:03
Registered: 2008-06-22
Posts: 4

Sorted.

The f(t) was just the expression for "x" in the paragraph above.

The integral was straightforward in the end - just express the RSHs in terms of the SHs and follow the integral through...

Dirtysouthafrican (2)Re: Triple product of spherical harmonics - 2008-06-22 10:16:13
Avatar of user Dirtysouthafrican
Registered: unknown
Posts: 312

I take it all is well now?

m0rf (248)Re: Triple product of spherical harmonics - 2008-06-30 01:33:51
Registered: 2008-06-22
Posts: 4

Yes thanks :-)

Sorry about the on-line ramble. Thought I was going to need more help than I did...

Have fun


 
You need to log in in order to reply to this topic.
generated:August 28, 2008, 12:07 am
Generated on August 28, 2008, 12:07 am



© 2007 Lionel Brits

This page validates as XHTML 1.1 RSS 2.0 posts


Theme © 2006 Lionel Brits