(git:9ccafda)
Loading...
Searching...
No Matches
wignernj_interface Module Reference

Interface to libwignernj for the angular momentum algebra. More...

Functions/Subroutines

real(kind=dp) function, public real_gaunt (l1, m1, l2, m2, l3, m3)
 Gaunt coefficient of three real spherical harmonics, int S(l1,m1) S(l2,m2) S(l3,m3) dOmega.
real(kind=dp) function, public complex_gaunt (l1, m1, l2, m2, l3, m3)
 Gaunt coefficient of three complex spherical harmonics, int Y(l1,m1) Y(l2,m2) Y(l3,m3) dOmega.

Detailed Description

Interface to libwignernj for the angular momentum algebra.

Note
libwignernj carries out all intermediate arithmetic exactly, in a prime factorization representation, and rounds only once at the end. The returned coefficients are therefore correct to the last bit, whereas the factorial-ratio expressions that CP2K used before lost roughly one digit per two units of l.

The library takes all angular momenta as twice their value so that half-integers stay exact; the wrappers here take the plain integer l and m of a spherical harmonic and do the doubling.

The real spherical harmonics S(l,m) follow the Condon-Shortley convention S(l, 0) = Y(l,0) S(l, m>0) = ( Y(l,-m) + (-1)^m Y(l,m) )/sqrt(2) S(l, m<0) = ( Y(l,m) - (-1)^|m| Y(l,-m) )*i/sqrt(2) which is the same convention as spherical_harmonics::y_lm, so no additional phase is needed on either side.

The interfaces below bind directly to the C API, so no compiler-specific Fortran module from libwignernj is required.

History
09.2026 created [Susi Lehtola]
Author
Susi Lehtola

Function/Subroutine Documentation

◆ real_gaunt()

real(kind=dp) function, public wignernj_interface::real_gaunt ( integer, intent(in) l1,
integer, intent(in) m1,
integer, intent(in) l2,
integer, intent(in) m2,
integer, intent(in) l3,
integer, intent(in) m3 )

Gaunt coefficient of three real spherical harmonics, int S(l1,m1) S(l2,m2) S(l3,m3) dOmega.

Parameters
l1angular momentum of the first harmonic
m1magnetic quantum number of the first harmonic
l2angular momentum of the second harmonic
m2magnetic quantum number of the second harmonic
l3angular momentum of the third harmonic
m3magnetic quantum number of the third harmonic
Returns
the Gaunt coefficient, zero if the selection rules are violated

Definition at line 97 of file wignernj_interface.F.

Here is the caller graph for this function:

◆ complex_gaunt()

real(kind=dp) function, public wignernj_interface::complex_gaunt ( integer, intent(in) l1,
integer, intent(in) m1,
integer, intent(in) l2,
integer, intent(in) m2,
integer, intent(in) l3,
integer, intent(in) m3 )

Gaunt coefficient of three complex spherical harmonics, int Y(l1,m1) Y(l2,m2) Y(l3,m3) dOmega.

Parameters
l1angular momentum of the first harmonic
m1magnetic quantum number of the first harmonic
l2angular momentum of the second harmonic
m2magnetic quantum number of the second harmonic
l3angular momentum of the third harmonic
m3magnetic quantum number of the third harmonic
Returns
the Gaunt coefficient, zero if the selection rules are violated

Definition at line 116 of file wignernj_interface.F.

Here is the caller graph for this function: