Wigner, Clebsch-Gordan, Racah, and Gaunt coefficients¶
Collection of functions for calculating Wigner 3-\(j\), 6-\(j\), 9-\(j\), Clebsch-Gordan, Racah as well as Gaunt coefficients exactly, all evaluating to a rational number times the square root of a rational number [RH2003].
Please see the description of the individual functions for further details and examples.
AUTHORS:
Jens Rasch (2009-03-24): initial version for Sage
Jens Rasch (2009-05-31): updated to sage-4.0
- sage.functions.wigner.clebsch_gordan(j_1, j_2, j_3, m_1, m_2, m_3, prec=None)[source]¶
Return the Clebsch-Gordan coefficient \(\langle j_1 m_1 \; j_2 m_2 | j_3 m_3 \rangle\).
The reference for this function is [Ed1974].
INPUT:
j_1
,j_2
,j_3
,m_1
,m_2
,m_3
– integer or half integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
sage: simplify(clebsch_gordan(3/2,1/2,2, 3/2,1/2,2)) # needs sage.symbolic 1 sage: clebsch_gordan(1.5,0.5,1, 1.5,-0.5,1) # needs sage.symbolic 1/2*sqrt(3) sage: clebsch_gordan(3/2,1/2,1, -1/2,1/2,0) # needs sage.symbolic -sqrt(3)*sqrt(1/6)
>>> from sage.all import * >>> simplify(clebsch_gordan(Integer(3)/Integer(2),Integer(1)/Integer(2),Integer(2), Integer(3)/Integer(2),Integer(1)/Integer(2),Integer(2))) # needs sage.symbolic 1 >>> clebsch_gordan(RealNumber('1.5'),RealNumber('0.5'),Integer(1), RealNumber('1.5'),-RealNumber('0.5'),Integer(1)) # needs sage.symbolic 1/2*sqrt(3) >>> clebsch_gordan(Integer(3)/Integer(2),Integer(1)/Integer(2),Integer(1), -Integer(1)/Integer(2),Integer(1)/Integer(2),Integer(0)) # needs sage.symbolic -sqrt(3)*sqrt(1/6)
Note
The Clebsch-Gordan coefficient will be evaluated via its relation to Wigner 3-\(j\) symbols:
\[\begin{split}\langle j_1 m_1 \; j_2 m_2 | j_3 m_3 \rangle =(-1)^{j_1-j_2+m_3} \sqrt{2j_3+1} \begin{pmatrix} j_1 & j_2 & j_3 \\ m_1 & m_2 & -m_3 \end{pmatrix}\end{split}\]See also the documentation on Wigner 3-\(j\) symbols which exhibit much higher symmetry relations than the Clebsch-Gordan coefficient.
AUTHORS:
Jens Rasch (2009-03-24): initial version
- sage.functions.wigner.gaunt(l_1, l_2, l_3, m_1, m_2, m_3, prec=None)[source]¶
Return the Gaunt coefficient.
The Gaunt coefficient is defined as the integral over three spherical harmonics:
\[\begin{split}Y(l_1,l_2,l_3,m_1,m_2,m_3) \hspace{12em} \\ =\int Y_{l_1,m_1}(\Omega) \ Y_{l_2,m_2}(\Omega) \ Y_{l_3,m_3}(\Omega) \ d\Omega \hspace{5em} \\ =\sqrt{\frac{(2l_1+1)(2l_2+1)(2l_3+1)}{4\pi}} \hspace{6.5em} \\ \times \begin{pmatrix} l_1 & l_2 & l_3 \\ 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} l_1 & l_2 & l_3 \\ m_1 & m_2 & m_3 \end{pmatrix}\end{split}\]INPUT:
l_1
,l_2
,l_3
,m_1
,m_2
,m_3
– integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
sage: # needs sage.symbolic sage: gaunt(1,0,1,1,0,-1) -1/2/sqrt(pi) sage: gaunt(1,0,1,1,0,0) 0 sage: gaunt(29,29,34,10,-5,-5) 1821867940156/215552371055153321*sqrt(22134)/sqrt(pi) sage: gaunt(20,20,40,1,-1,0) 28384503878959800/74029560764440771/sqrt(pi) sage: gaunt(12,15,5,2,3,-5) 91/124062*sqrt(36890)/sqrt(pi) sage: gaunt(10,10,12,9,3,-12) -98/62031*sqrt(6279)/sqrt(pi) sage: gaunt(1000,1000,1200,9,3,-12).n(64) 0.00689500421922113448
>>> from sage.all import * >>> # needs sage.symbolic >>> gaunt(Integer(1),Integer(0),Integer(1),Integer(1),Integer(0),-Integer(1)) -1/2/sqrt(pi) >>> gaunt(Integer(1),Integer(0),Integer(1),Integer(1),Integer(0),Integer(0)) 0 >>> gaunt(Integer(29),Integer(29),Integer(34),Integer(10),-Integer(5),-Integer(5)) 1821867940156/215552371055153321*sqrt(22134)/sqrt(pi) >>> gaunt(Integer(20),Integer(20),Integer(40),Integer(1),-Integer(1),Integer(0)) 28384503878959800/74029560764440771/sqrt(pi) >>> gaunt(Integer(12),Integer(15),Integer(5),Integer(2),Integer(3),-Integer(5)) 91/124062*sqrt(36890)/sqrt(pi) >>> gaunt(Integer(10),Integer(10),Integer(12),Integer(9),Integer(3),-Integer(12)) -98/62031*sqrt(6279)/sqrt(pi) >>> gaunt(Integer(1000),Integer(1000),Integer(1200),Integer(9),Integer(3),-Integer(12)).n(Integer(64)) 0.00689500421922113448
If the sum of the \(l_i\) is odd, the answer is zero, even for Python ints (see Issue #14766):
sage: gaunt(1,2,2,1,0,-1) 0 sage: gaunt(int(1),int(2),int(2),1,0,-1) 0
>>> from sage.all import * >>> gaunt(Integer(1),Integer(2),Integer(2),Integer(1),Integer(0),-Integer(1)) 0 >>> gaunt(int(Integer(1)),int(Integer(2)),int(Integer(2)),Integer(1),Integer(0),-Integer(1)) 0
It is an error to use non-integer values for \(l\) or \(m\):
sage: gaunt(1.2,0,1.2,0,0,0) # needs sage.rings.real_mpfr Traceback (most recent call last): ... TypeError: Attempt to coerce non-integral RealNumber to Integer sage: gaunt(1,0,1,1.1,0,-1.1) # needs sage.rings.real_mpfr Traceback (most recent call last): ... TypeError: Attempt to coerce non-integral RealNumber to Integer
>>> from sage.all import * >>> gaunt(RealNumber('1.2'),Integer(0),RealNumber('1.2'),Integer(0),Integer(0),Integer(0)) # needs sage.rings.real_mpfr Traceback (most recent call last): ... TypeError: Attempt to coerce non-integral RealNumber to Integer >>> gaunt(Integer(1),Integer(0),Integer(1),RealNumber('1.1'),Integer(0),-RealNumber('1.1')) # needs sage.rings.real_mpfr Traceback (most recent call last): ... TypeError: Attempt to coerce non-integral RealNumber to Integer
ALGORITHM:
This function uses the algorithm of [LdB1982] to calculate the value of the Gaunt coefficient exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [RH2003].
AUTHORS:
Jens Rasch (2009-03-24): initial version for Sage
- sage.functions.wigner.racah(aa, bb, cc, dd, ee, ff, prec=None)[source]¶
Return the Racah symbol \(W(aa,bb,cc,dd;ee,ff)\).
INPUT:
aa
, …,ff
– integer or half integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
sage: racah(3,3,3,3,3,3) # needs sage.symbolic -1/14
>>> from sage.all import * >>> racah(Integer(3),Integer(3),Integer(3),Integer(3),Integer(3),Integer(3)) # needs sage.symbolic -1/14
Note
The Racah symbol is related to the Wigner 6-\(j\) symbol:
\[\begin{split}\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \end{Bmatrix} =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4;j_3,j_6)\end{split}\]Please see the 6-\(j\) symbol for its much richer symmetries and for additional properties.
ALGORITHM:
This function uses the algorithm of [Ed1974] to calculate the value of the 6-\(j\) symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [RH2003].
AUTHORS:
Jens Rasch (2009-03-24): initial version
- sage.functions.wigner.wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None)[source]¶
Return the Wigner 3-\(j\) symbol \(\begin{pmatrix} j_1 & j_2 & j_3 \\ m_1 & m_2 & m_3 \end{pmatrix}\).
INPUT:
j_1
,j_2
,j_3
,m_1
,m_2
,m_3
– integer or half integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
sage: wigner_3j(2, 6, 4, 0, 0, 0) # needs sage.symbolic sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) # needs sage.symbolic sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) # needs sage.symbolic 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) # needs sage.rings.real_mpfr 7.60424456883448589e-12
>>> from sage.all import * >>> wigner_3j(Integer(2), Integer(6), Integer(4), Integer(0), Integer(0), Integer(0)) # needs sage.symbolic sqrt(5/143) >>> wigner_3j(Integer(2), Integer(6), Integer(4), Integer(0), Integer(0), Integer(1)) 0 >>> wigner_3j(RealNumber('0.5'), RealNumber('0.5'), Integer(1), RealNumber('0.5'), -RealNumber('0.5'), Integer(0)) # needs sage.symbolic sqrt(1/6) >>> wigner_3j(Integer(40), Integer(100), Integer(60), -Integer(10), Integer(60), -Integer(50)) # needs sage.symbolic 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) >>> wigner_3j(Integer(2500), Integer(2500), Integer(5000), Integer(2488), Integer(2400), -Integer(4888), prec=Integer(64)) # needs sage.rings.real_mpfr 7.60424456883448589e-12
It is an error to have arguments that are not integer or half integer values:
sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer
>>> from sage.all import * >>> wigner_3j(RealNumber('2.1'), Integer(6), Integer(4), Integer(0), Integer(0), Integer(0)) Traceback (most recent call last): ... ValueError: j values must be integer or half integer >>> wigner_3j(Integer(2), Integer(6), Integer(4), Integer(1), Integer(0), -RealNumber('1.1')) Traceback (most recent call last): ... ValueError: m values must be integer or half integer
The Wigner 3-\(j\) symbol obeys the following symmetry rules:
invariant under any permutation of the columns (with the exception of a sign change where \(J=j_1+j_2+j_3\)):
\[\begin{split}\begin{pmatrix} j_1 & j_2 & j_3 \\ m_1 & m_2 & m_3 \end{pmatrix} =\begin{pmatrix} j_3 & j_1 & j_2 \\ m_3 & m_1 & m_2 \end{pmatrix} =\begin{pmatrix} j_2 & j_3 & j_1 \\ m_2 & m_3 & m_1 \end{pmatrix} \hspace{10em} \\ =(-1)^J \begin{pmatrix} j_3 & j_2 & j_1 \\ m_3 & m_2 & m_1 \end{pmatrix} =(-1)^J \begin{pmatrix} j_1 & j_3 & j_2 \\ m_1 & m_3 & m_2 \end{pmatrix} =(-1)^J \begin{pmatrix} j_2 & j_1 & j_3 \\ m_2 & m_1 & m_3 \end{pmatrix}\end{split}\]invariant under space inflection, i.e.
\[\begin{split}\begin{pmatrix} j_1 & j_2 & j_3 \\ m_1 & m_2 & m_3 \end{pmatrix} =(-1)^J \begin{pmatrix} j_1 & j_2 & j_3 \\ -m_1 & -m_2 & -m_3 \end{pmatrix}\end{split}\]symmetric with respect to the 72 additional symmetries based on the work by [Reg1958]
zero for \(j_1\), \(j_2\), \(j_3\) not fulfilling triangle relation
zero for \(m_1 + m_2 + m_3 \neq 0\)
zero for violating any one of the conditions \(j_1 \ge |m_1|\), \(j_2 \ge |m_2|\), \(j_3 \ge |m_3|\)
ALGORITHM:
This function uses the algorithm of [Ed1974] to calculate the value of the 3-\(j\) symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [RH2003].
AUTHORS:
Jens Rasch (2009-03-24): initial version
- sage.functions.wigner.wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None)[source]¶
Return the Wigner 6-\(j\) symbol \(\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \end{Bmatrix}\).
INPUT:
j_1
, …,j_6
– integer or half integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
sage: # needs sage.symbolic sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242
>>> from sage.all import * >>> # needs sage.symbolic >>> wigner_6j(Integer(3),Integer(3),Integer(3),Integer(3),Integer(3),Integer(3)) -1/14 >>> wigner_6j(Integer(5),Integer(5),Integer(5),Integer(5),Integer(5),Integer(5)) 1/52 >>> wigner_6j(Integer(6),Integer(6),Integer(6),Integer(6),Integer(6),Integer(6)) 309/10868 >>> wigner_6j(Integer(8),Integer(8),Integer(8),Integer(8),Integer(8),Integer(8)) -12219/965770 >>> wigner_6j(Integer(30),Integer(30),Integer(30),Integer(30),Integer(30),Integer(30)) 36082186869033479581/87954851694828981714124 >>> wigner_6j(RealNumber('0.5'),RealNumber('0.5'),Integer(1),RealNumber('0.5'),RealNumber('0.5'),Integer(1)) 1/6 >>> wigner_6j(Integer(200),Integer(200),Integer(200),Integer(200),Integer(200),Integer(200), prec=Integer(1000))*RealNumber('1.0') 0.000155903212413242
It is an error to have arguments that are not integer or half integer values or do not fulfill the triangle relation:
sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation
>>> from sage.all import * >>> wigner_6j(RealNumber('2.5'),RealNumber('2.5'),RealNumber('2.5'),RealNumber('2.5'),RealNumber('2.5'),RealNumber('2.5')) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation >>> wigner_6j(RealNumber('0.5'),RealNumber('0.5'),RealNumber('1.1'),RealNumber('0.5'),RealNumber('0.5'),RealNumber('1.1')) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation
The Wigner 6-\(j\) symbol is related to the Racah symbol but exhibits more symmetries as detailed below.
\[\begin{split}\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \end{Bmatrix} =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4;j_3,j_6)\end{split}\]The Wigner 6-\(j\) symbol obeys the following symmetry rules:
Wigner 6-\(j\) symbols are left invariant under any permutation of the columns:
\[\begin{split}\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \end{Bmatrix} =\begin{Bmatrix} j_3 & j_1 & j_2 \\ j_6 & j_4 & j_5 \end{Bmatrix} =\begin{Bmatrix} j_2 & j_3 & j_1 \\ j_5 & j_6 & j_4 \end{Bmatrix} \hspace{7em} \\ =\begin{Bmatrix} j_3 & j_2 & j_1 \\ j_6 & j_5 & j_4 \end{Bmatrix} =\begin{Bmatrix} j_1 & j_3 & j_2 \\ j_4 & j_6 & j_5 \end{Bmatrix} =\begin{Bmatrix} j_2 & j_1 & j_3 \\ j_5 & j_4 & j_6 \end{Bmatrix} \hspace{3em}\end{split}\]They are invariant under the exchange of the upper and lower arguments in each of any two columns, i.e.
\[\begin{split}\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \end{Bmatrix} =\begin{Bmatrix} j_1 & j_5 & j_6 \\ j_4 & j_2 & j_3 \end{Bmatrix} =\begin{Bmatrix} j_4 & j_2 & j_6 \\ j_1 & j_5 & j_3 \end{Bmatrix} =\begin{Bmatrix} j_4 & j_5 & j_3 \\ j_1 & j_2 & j_6 \end{Bmatrix}\end{split}\]additional 6 symmetries [Reg1959] giving rise to 144 symmetries in total
only nonzero if any triple of \(j\)’s fulfill a triangle relation
ALGORITHM:
This function uses the algorithm of [Ed1974] to calculate the value of the 6-\(j\) symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [RH2003].
- sage.functions.wigner.wigner_9j(j_1, j_2, j_3, j_4, j_5, j_6, j_7, j_8, j_9, prec=None)[source]¶
Return the Wigner 9-\(j\) symbol \(\begin{Bmatrix} j_1 & j_2 & j_3 \\ j_4 & j_5 & j_6 \\ j_7 & j_8 & j_9 \end{Bmatrix}\).
INPUT:
j_1
, …,j_9
– integer or half integerprec
– precision (default:None
); providing a precision can drastically speed up the calculation
OUTPUT:
Rational number times the square root of a rational number (if
prec=None
), or real number if a precision is given.EXAMPLES:
A couple of examples and test cases, note that for speed reasons a precision is given:
sage: # needs sage.symbolic sage: wigner_9j(1,1,1, 1,1,1, 1,1,0, prec=64) # ==1/18 0.0555555555555555555 sage: wigner_9j(1,1,1, 1,1,1, 1,1,1) 0 sage: wigner_9j(1,1,1, 1,1,1, 1,1,2, prec=64) # ==1/18 0.0555555555555555556 sage: wigner_9j(1,2,1, 2,2,2, 1,2,1, prec=64) # ==-1/150 -0.00666666666666666667 sage: wigner_9j(3,3,2, 2,2,2, 3,3,2, prec=64) # ==157/14700 0.0106802721088435374 sage: wigner_9j(3,3,2, 3,3,2, 3,3,2, prec=64) # ==3221*sqrt(70)/(246960*sqrt(105)) - 365/(3528*sqrt(70)*sqrt(105)) 0.00944247746651111739 sage: wigner_9j(3,3,1, 3.5,3.5,2, 3.5,3.5,1, prec=64) # ==3221*sqrt(70)/(246960*sqrt(105)) - 365/(3528*sqrt(70)*sqrt(105)) 0.0110216678544351364 sage: wigner_9j(100,80,50, 50,100,70, 60,50,100, prec=1000)*1.0 1.05597798065761e-7 sage: wigner_9j(30,30,10, 30.5,30.5,20, 30.5,30.5,10, prec=1000)*1.0 # ==(80944680186359968990/95103769817469)*sqrt(1/682288158959699477295) 0.0000325841699408828 sage: wigner_9j(64,62.5,114.5, 61.5,61,112.5, 113.5,110.5,60, prec=1000)*1.0 -3.41407910055520e-39 sage: wigner_9j(15,15,15, 15,3,15, 15,18,10, prec=1000)*1.0 -0.0000778324615309539 sage: wigner_9j(1.5,1,1.5, 1,1,1, 1.5,1,1.5) 0
>>> from sage.all import * >>> # needs sage.symbolic >>> wigner_9j(Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(0), prec=Integer(64)) # ==1/18 0.0555555555555555555 >>> wigner_9j(Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(1)) 0 >>> wigner_9j(Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(1), Integer(1),Integer(1),Integer(2), prec=Integer(64)) # ==1/18 0.0555555555555555556 >>> wigner_9j(Integer(1),Integer(2),Integer(1), Integer(2),Integer(2),Integer(2), Integer(1),Integer(2),Integer(1), prec=Integer(64)) # ==-1/150 -0.00666666666666666667 >>> wigner_9j(Integer(3),Integer(3),Integer(2), Integer(2),Integer(2),Integer(2), Integer(3),Integer(3),Integer(2), prec=Integer(64)) # ==157/14700 0.0106802721088435374 >>> wigner_9j(Integer(3),Integer(3),Integer(2), Integer(3),Integer(3),Integer(2), Integer(3),Integer(3),Integer(2), prec=Integer(64)) # ==3221*sqrt(70)/(246960*sqrt(105)) - 365/(3528*sqrt(70)*sqrt(105)) 0.00944247746651111739 >>> wigner_9j(Integer(3),Integer(3),Integer(1), RealNumber('3.5'),RealNumber('3.5'),Integer(2), RealNumber('3.5'),RealNumber('3.5'),Integer(1), prec=Integer(64)) # ==3221*sqrt(70)/(246960*sqrt(105)) - 365/(3528*sqrt(70)*sqrt(105)) 0.0110216678544351364 >>> wigner_9j(Integer(100),Integer(80),Integer(50), Integer(50),Integer(100),Integer(70), Integer(60),Integer(50),Integer(100), prec=Integer(1000))*RealNumber('1.0') 1.05597798065761e-7 >>> wigner_9j(Integer(30),Integer(30),Integer(10), RealNumber('30.5'),RealNumber('30.5'),Integer(20), RealNumber('30.5'),RealNumber('30.5'),Integer(10), prec=Integer(1000))*RealNumber('1.0') # ==(80944680186359968990/95103769817469)*sqrt(1/682288158959699477295) 0.0000325841699408828 >>> wigner_9j(Integer(64),RealNumber('62.5'),RealNumber('114.5'), RealNumber('61.5'),Integer(61),RealNumber('112.5'), RealNumber('113.5'),RealNumber('110.5'),Integer(60), prec=Integer(1000))*RealNumber('1.0') -3.41407910055520e-39 >>> wigner_9j(Integer(15),Integer(15),Integer(15), Integer(15),Integer(3),Integer(15), Integer(15),Integer(18),Integer(10), prec=Integer(1000))*RealNumber('1.0') -0.0000778324615309539 >>> wigner_9j(RealNumber('1.5'),Integer(1),RealNumber('1.5'), Integer(1),Integer(1),Integer(1), RealNumber('1.5'),Integer(1),RealNumber('1.5')) 0
It is an error to have arguments that are not integer or half integer values or do not fulfill the triangle relation:
sage: wigner_9j(0.5,0.5,0.5, 0.5,0.5,0.5, 0.5,0.5,0.5,prec=64) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation sage: wigner_9j(1,1,1, 0.5,1,1.5, 0.5,1,2.5,prec=64) # needs sage.rings.real_mpfr Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation
>>> from sage.all import * >>> wigner_9j(RealNumber('0.5'),RealNumber('0.5'),RealNumber('0.5'), RealNumber('0.5'),RealNumber('0.5'),RealNumber('0.5'), RealNumber('0.5'),RealNumber('0.5'),RealNumber('0.5'),prec=Integer(64)) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation >>> wigner_9j(Integer(1),Integer(1),Integer(1), RealNumber('0.5'),Integer(1),RealNumber('1.5'), RealNumber('0.5'),Integer(1),RealNumber('2.5'),prec=Integer(64)) # needs sage.rings.real_mpfr Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfill the triangle relation
ALGORITHM:
This function uses the algorithm of [Ed1974] to calculate the value of the 3-\(j\) symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [RH2003].