How to compute CG coefficient and Wigner 3nj Symbols

Introduction

This blog is the theory for https://github.com/0382/CGcoefficient.jl.

It is mainly inspired by Ref[1]. See Jensen’s code for details.

The idea is to simplify 3nj Symbols to sum combinations of binominal coefficients. We can calculate binominal coefficients by Pascal’s Triangle, and store them first. Then we calculate 3nj Symbols using the stored binominal coefficients.

My code is just a toy model, using Julia’s own binominal function, and use BigInt to get absolute results. If you want to get the exact result, and you don’t use it for numeric computing, it is really a good package.

CG coefficient

Ref[2], P240, Section 8.2.4, Formula (20).

Cj1m1j2m2j3m3=δm3,m1+m2[(2j1J2j3)(2j2J2j3)(J+1J2j3)(2j1j1m1)(2j2j2m2)(2j3j3m3)]1/2z(1)z(J2j3z)(J2j2j1m1z)(J2j1j2+m2z)C_{j_1m_1j_2m_2}^{j_3m_3} = \delta_{m_3, m_1+m_2}\left[\dfrac{\begin{pmatrix}2j_1 \\ J-2j_3\end{pmatrix}\begin{pmatrix}2j_2\\J-2j_3\end{pmatrix}}{\begin{pmatrix}J+1\\J-2j_3\end{pmatrix}\begin{pmatrix}2j_1\\j_1-m_1\end{pmatrix}\begin{pmatrix}2j_2 \\ j_2 - m_2\end{pmatrix}\begin{pmatrix}2j_3 \\ j_3-m_3\end{pmatrix}}\right]^{1/2} \sum_{z} (-1)^{z}\begin{pmatrix}J-2j_3 \\ z\end{pmatrix}\begin{pmatrix}J-2j_2 \\ j_1-m_1-z\end{pmatrix}\begin{pmatrix}J-2j_1 \\ j_2 + m_2 - z\end{pmatrix}

where, J=j1+j2+j3J = j_1+j_2+j_3. It is already combination of binominals.

3j symbol

Ref[2], P236, Section 8.1.2, Formula (11).

(j1j2j3m1m2m3)=(1)j3+m3+2j112j3+1Cj1m1j2m2j3m3\begin{pmatrix}j_1 & j_2 & j_3 \\ m_1 & m_2 & m_3\end{pmatrix} = (-1)^{j_3+m_3+2j_1}\dfrac{1}{\sqrt{2j_3+1}}C_{j_1-m_1j_2-m_2}^{j_3m_3}

In my code, I use CG coefficient to calculate 3j symbol.

6j symbol

Ref [2], P293, Section 9.2.1, Formula (1).

{j1j2j3j4j5j6}=Δ(j1j2j3)Δ(j4j5j3)Δ(j1j5j6)Δ(j4j2j6)×n(1)n(n+1)!(nj1j2j3)!(nj4j5j3)!(nj1j5j6)!(nj4j2j6)!(j1j2j4j5n)!(j1j3j4j6n)!(j2j3j5j6n)!\begin{Bmatrix}j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6\end{Bmatrix} = \Delta(j_1j_2j_3)\Delta(j_4j_5j_3)\Delta(j_1j_5j_6)\Delta(j_4j_2j_6) \\ \times \sum\limits_n\dfrac{(-1)^n(n+1)!}{(n-j_1j_2j_3)!(n-j_4j_5j_3)!(n-j_1j_5j_6)!(n-j_4j_2j_6)!(j_1j_2j_4j_5-n)!(j_1j_3j_4j_6-n)!(j_2j_3j_5j_6-n)!}

Here, I use j1j2j3j_1j_2j_3 to represent j1+j2+j2j_1+j_2+j_2. The symbol Δ(abc)\Delta(abc) is defined as

Δ(abc)=[(a+bc)!(ab+c)!(a+b+c)!(a+b+c+1)!]12.\Delta(abc) = \left[\dfrac{(a+b-c)!(a-b+c)!(-a+b+c)!}{(a+b+c+1)!}\right]^{\frac{1}{2}}.

We can find that

(j1+j2j3nj4j5j3)=(j1+j2j3)!(nj4j5j3)!(j1j2j4j5n)!(j1j2+j3nj4j2j6)=(j1j2+j3)!(nj4j2j6)!(j1j3j4j6n)!(j2+j3j1nj1j5j6)=(j2+j3j1)!(nj1j5j6)!(j2j3j5j6n)!(n+1j1j2j3+1)=(n+1)!(nj1j2j3)(j1j2j3+1)!.\begin{pmatrix}j_1+j_2-j_3 \\ n - j_4j_5j_3\end{pmatrix} = \dfrac{(j_1+j_2-j_3)!}{(n-j_4j_5j_3)!(j_1j_2j_4j_5-n)!} \\ \begin{pmatrix}j_1-j_2+j_3 \\ n - j_4j_2j_6\end{pmatrix} = \dfrac{(j_1-j_2+j_3)!}{(n-j_4j_2j_6)!(j_1j_3j_4j_6-n)!} \\ \begin{pmatrix}j_2+j_3-j_1 \\ n - j_1j_5j_6\end{pmatrix} = \dfrac{(j_2+j_3-j_1)!}{(n-j_1j_5j_6)!(j_2j_3j_5j_6-n)!} \\ \begin{pmatrix}n+1 \\ j_1j_2j_3+1\end{pmatrix} = \dfrac{(n+1)!}{(n-j_1j_2j_3)(j_1j_2j_3+1)!}.

So, we have

{j1j2j3j4j5j6}=Δ(j4j5j3)Δ(j1j5j6)Δ(j4j2j6)Δ(j1j2j3)×n(1)n(n+1j1j2j3+1)(j1+j2j3nj4j5j3)(j1j2+j3nj4j2j6)(j2+j3j1nj1j5j6).\begin{Bmatrix}j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6\end{Bmatrix} = \dfrac{\Delta(j_4j_5j_3)\Delta(j_1j_5j_6)\Delta(j_4j_2j_6)}{\Delta(j_1j_2j_3)} \\ \times \sum\limits_n (-1)^n \begin{pmatrix}n+1 \\ j_1j_2j_3+1\end{pmatrix} \begin{pmatrix}j_1+j_2-j_3 \\ n - j_4j_5j_3\end{pmatrix} \begin{pmatrix}j_1-j_2+j_3 \\ n - j_4j_2j_6\end{pmatrix} \begin{pmatrix}j_2+j_3-j_1 \\ n - j_1j_5j_6\end{pmatrix}.

Rewrite Δ(abc)\Delta(abc) with binominals,

Δ(abc)=[1(a+b+c+12a+1)(2aa+bc)(2a+1)]12.\Delta(abc) = \left[\dfrac{1}{\begin{pmatrix}a+b+c+1 \\ 2a + 1\end{pmatrix} \begin{pmatrix}2a \\ a + b - c\end{pmatrix}(2a+1)}\right]^{\frac{1}{2}}.

So

Δ(j4j5j3)Δ(j1j5j6)Δ(j4j2j6)Δ(j1j2j3)=12j4+1[(j1j2j3+12j1+1)(2j1j1+j2j3)(j1j5j6+12j1+1)(2j1j1+j5j6)(j4j5j3+12j4+1)(2j4j4+j5j3)(j4j2j6+12j4+1)(2j4j4+j2j6)]12\dfrac{\Delta(j_4j_5j_3)\Delta(j_1j_5j_6)\Delta(j_4j_2j_6)}{\Delta(j_1j_2j_3)} \\ = \dfrac{1}{2j_4+1} \left[\dfrac{\begin{pmatrix}j_1j_2j_3+1 \\ 2j_1+1\end{pmatrix}\begin{pmatrix}2j_1 \\ j_1 + j_2 - j_3\end{pmatrix}}{\begin{pmatrix}j_1j_5j_6+1 \\ 2j_1+1\end{pmatrix}\begin{pmatrix}2j_1 \\ j_1+j_5-j_6\end{pmatrix}\begin{pmatrix}j_4j_5j_3+1\\2j_4+1\end{pmatrix}\begin{pmatrix}2j_4\\j_4+j_5-j_3\end{pmatrix}\begin{pmatrix}j_4j_2j_6+1 \\ 2j_4+1\end{pmatrix}\begin{pmatrix}2j_4 \\ j_4+j_2-j_6\end{pmatrix}}\right]^{\frac{1}{2}}

9j symbol

Ref[2], P340, Section 10.2.4, Formula (20)

{j1j2j3j4j5j6j7j8j9}=t(1)2t(2t+1){j1j2j3j6j9t}{j4j5j6j2tj8}{j7j8j9tj1j4}\begin{Bmatrix}j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \\ j_7 & j_8 & j_9\end{Bmatrix} = \sum\limits_{t}(-1)^{2t}(2t+1)\begin{Bmatrix}j_1 & j_2 & j_3 \\ j_6 & j_9 & t\end{Bmatrix} \begin{Bmatrix}j_4 & j_5 & j_6 \\ j_2 & t & j_8\end{Bmatrix} \begin{Bmatrix}j_7 & j_8 & j_9 \\ t & j_1 & j_4\end{Bmatrix}

Use 6j symbol result above, we get

Δ(j1j9t)Δ(j6j9j3)Δ(j6j2t)Δ(j1j2j3)Δ(j4tj8)Δ(j2tj6)Δ(j2j5j8)Δ(j4j5j6)Δ(j7j1j4)Δ(tj1j9)Δ(tj8j4)Δ(j7j8j9)=Δ(j3j6j9)Δ(j2j5j8)Δ(j1j4j7)Δ(j1j2j3)Δ(j4j5j6)Δ(j7j8j9)Δ2(j1j9t)Δ2(j2j6t)Δ2(j4j8t).\dfrac{\Delta(j_1j_9t)\Delta(j_6j_9j_3)\Delta(j_6j_2t)}{\Delta(j_1j_2j_3)} \dfrac{\Delta(j_4tj_8)\Delta(j_2tj_6)\Delta(j_2j_5j_8)}{\Delta(j_4j_5j_6)} \dfrac{\Delta(j_7j_1j_4)\Delta(tj_1j_9)\Delta(tj_8j_4)}{\Delta(j_7j_8j_9)} \\ = \dfrac{\Delta(j_3j_6j_9)\Delta(j_2j_5j_8)\Delta(j_1j_4j_7)}{\Delta(j_1j_2j_3)\Delta(j_4j_5j_6)\Delta(j_7j_8j_9)} \Delta^2(j_1j_9t)\Delta^2(j_2j_6t)\Delta^2(j_4j_8t).

Define j123j1+j2+j3j_{123} \equiv j_1+j_2+j_3, and

P0Δ(j3j6j9)Δ(j2j5j8)Δ(j1j4j7)Δ(j1j2j3)Δ(j4j5j6)Δ(j7j8j9)=[(j123+12j1+1)(2j1j1+j2j3)(j456+12j5+1)(2j5j4+j5j6)(j789+12j9+1)(2j9j7+j9j8)(j147+12j1+1)(2j1j1+j4j7)(j258+12j5+1)(2j5j2+j5j8)(j369+12j9+1)(2j9j3+j9j6)]1/2.P_0 \equiv \dfrac{\Delta(j_3j_6j_9)\Delta(j_2j_5j_8)\Delta(j_1j_4j_7)}{\Delta(j_1j_2j_3)\Delta(j_4j_5j_6)\Delta(j_7j_8j_9)} \\ = \left[\dfrac{\begin{pmatrix}j_{123} + 1 \\ 2j_1+1\end{pmatrix}\begin{pmatrix}2j_1\\j_1+j_2-j_3\end{pmatrix}\begin{pmatrix}j_{456}+1\\2j_5+1\end{pmatrix}\begin{pmatrix}2j_5 \\ j_4+j_5-j_6\end{pmatrix}\begin{pmatrix}j_{789}+1 \\ 2j_9+1\end{pmatrix}\begin{pmatrix}2j_9 \\ j_7 + j_9 - j_8\end{pmatrix}}{\begin{pmatrix}j_{147} + 1\\ 2j_1 + 1\end{pmatrix}\begin{pmatrix}2j_1 \\ j_1+j_4-j_7\end{pmatrix}\begin{pmatrix}j_{258}+1 \\ 2j_5+1\end{pmatrix}\begin{pmatrix}2j_5 \\ j_2+j_5 - j_8\end{pmatrix}\begin{pmatrix}j_{369}+1 \\ 2j_9+1\end{pmatrix}\begin{pmatrix}2j_9 \\ j_3+j_9 - j_6\end{pmatrix}}\right]^{1/2}.

Define

P(t)(1)2t(2t+1)Δ2(j1j9t)Δ2(j2j6t)Δ2(j4j8t)=(1)2t1(j1+j9+t+12t+1)(2tj1+tj9)(j2+j6+t+12t+1)(2tj2+tj6)(j4+j8+t2t+1)(2tj4+tj8)(2t+1)2.P(t) \equiv (-1)^{2t}(2t+1)\Delta^2(j_1j_9t)\Delta^2(j_2j_6t)\Delta^2(j_4j_8t) \\ = (-1)^{2t} \dfrac{1}{\begin{pmatrix}j_1+j_9+t+1 \\ 2t+1\end{pmatrix}\begin{pmatrix}2t \\ j_1+t-j_9\end{pmatrix}\begin{pmatrix}j_2+j_6+t+1 \\ 2t+1\end{pmatrix}\begin{pmatrix}2t \\ j_2+t-j_6\end{pmatrix}\begin{pmatrix}j_4+j_8+t \\ 2t+1\end{pmatrix}\begin{pmatrix}2t \\ j_4+t-j_8\end{pmatrix}(2t+1)^2}.

A(t,x)(1)x(x+1j123+1)(j1+j2j3x(j6+j9+j3))(j1+j3j2x(j6+j2+t))(j2+j3j1x(j1+j9+t)).A(t,x) \equiv (-1)^x\begin{pmatrix}x+1 \\ j_{123} + 1\end{pmatrix}\begin{pmatrix}j_1+j_2-j_3 \\ x - (j_6+j_9+j_3)\end{pmatrix} \begin{pmatrix}j_1+j_3-j_2 \\ x - (j_6+j_2+t)\end{pmatrix}\begin{pmatrix}j_2+j_3-j_1 \\ x - (j_1 + j_9 + t)\end{pmatrix}.

B(t,y)(1)y(y+1j456+1)(j4+j5j6y(j2+t+j6))(j4+j6j5y(j2+j5+j8))(j5+j6j4y(j4+t+j8)).B(t,y) \equiv (-1)^y\begin{pmatrix}y+1 \\ j_{456} + 1\end{pmatrix}\begin{pmatrix}j_4+j_5-j_6 \\ y - (j_2+t+j_6)\end{pmatrix}\begin{pmatrix}j_4+j_6-j_5 \\ y - (j_2+j_5+j_8)\end{pmatrix}\begin{pmatrix}j_5+j_6-j_4 \\ y - (j_4+t+j_8)\end{pmatrix}.

C(t,z)(1)z(z+1j789+1)(j7+j8j9z(t+j1+j9))(j7+j9j8z(t+j8+j4))(j8+j9j7z(j7+j1+j4)).C(t,z) \equiv (-1)^z \begin{pmatrix}z+1 \\ j_{789} + 1\end{pmatrix}\begin{pmatrix}j_7+j_8-j_9 \\ z - (t+j_1+j_9)\end{pmatrix}\begin{pmatrix}j_7+j_9-j_8 \\ z - (t+j_8+j_4)\end{pmatrix}\begin{pmatrix}j_8+j_9- j_7 \\ z - (j_7 + j_1 + j_4)\end{pmatrix}.

At last, we get

{j1j2j3j4j5j6j7j8j9}=P0tP(t)(xA(t,x))(yB(t,y))(zC(t,z))\begin{Bmatrix}j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \\ j_7 & j_8 & j_9\end{Bmatrix} = P_0\sum_t P(t) \left(\sum_x A(t,x)\right) \left(\sum_y B(t,y)\right) \left(\sum_z C(t,z)\right)

It deserves to be mentioned that, although the formula has 4 \sum, the \sum of x,y,zx,y,z are decoupled. So we can do the three for loops respectively, which means the depth of for loop is not 4 but 2.


Reference

  1. T. Engeland and M. Hjorth-Jensen, the Oslo-FCI code. https://github.com/ManyBodyPhysics/CENS.
  2. A. N. Moskalev D. A. Varshalovich and V. K. Khersonskii, Quantum theory of angular momentum.