Version: SMASH-3.1
smash::ClebschGordan Class Reference

#include <clebschgordan_lookup.h>

Class to store and retrieve/calculate Clebsch-Gordan coefficients.

Definition at line 22 of file clebschgordan_lookup.h.

Classes

struct  ThreeSpinHash
 This is one of the possible ways to prepare a hashing mechanism to use a custom object in a std::unordered_map container. More...
 
struct  ThreeSpins
 Auxiliary struct to be used as key in the look up table of Clebsch-Gordan coefficients. More...
 

Static Public Member Functions

static double coefficient (const int j_a, const int j_b, const int j_c, const int m_a, const int m_b, const int m_c)
 Check in the Clebsch-Gordan lookup table if the requested coefficient is available. More...
 

Static Private Member Functions

static double calculate_coefficient (const int j_a, const int j_b, const int j_c, const int m_a, const int m_b, const int m_c)
 Calculate Clebsch-Gordan coefficient \((-1)^{j_a - j_b + m_c} \sqrt{(2 j_c + 1)} \cdot [Wigner 3J symbol] \). More...
 

Static Private Attributes

static std::unordered_map< ThreeSpins, double, ThreeSpinHashlookup_table
 Tabulation of Clebsch-Gordan coefficients. More...
 

Member Function Documentation

◆ coefficient()

double smash::ClebschGordan::coefficient ( const int  j_a,
const int  j_b,
const int  j_c,
const int  m_a,
const int  m_b,
const int  m_c 
)
static

Check in the Clebsch-Gordan lookup table if the requested coefficient is available.

If so, return it, otherwise calculate the requested one, store it in the lookup table and return it.

See also
calculate_coefficient for a description of function arguments and return value.

Definition at line 41 of file clebschgordan_lookup.cc.

42  {
43  const ThreeSpins spin_information = {j_a, j_b, j_c, m_a, m_b, m_c};
44  if (auto search = lookup_table.find(spin_information);
45  search != lookup_table.end()) {
46  return search->second;
47  } else {
48  double result = calculate_coefficient(j_a, j_b, j_c, m_a, m_b, m_c);
49  lookup_table.insert({spin_information, result});
50  return result;
51  }
52 }
static std::unordered_map< ThreeSpins, double, ThreeSpinHash > lookup_table
Tabulation of Clebsch-Gordan coefficients.
static double calculate_coefficient(const int j_a, const int j_b, const int j_c, const int m_a, const int m_b, const int m_c)
Calculate Clebsch-Gordan coefficient .

◆ calculate_coefficient()

double smash::ClebschGordan::calculate_coefficient ( const int  j_a,
const int  j_b,
const int  j_c,
const int  m_a,
const int  m_b,
const int  m_c 
)
staticprivate

Calculate Clebsch-Gordan coefficient \((-1)^{j_a - j_b + m_c} \sqrt{(2 j_c + 1)} \cdot [Wigner 3J symbol] \).

Parameters
[in]j_aisospin of first particle
[in]j_bisospin of second particle
[in]j_cisospin of resonance
[in]m_az-component of isospin of first particle
[in]m_bz-component of isospin of second particle
[in]m_cz-component of isospin of resonance
Returns
Clebsch-Gordan coefficient for coupling of particles a, b and c

Note that the calculation assumes that the isospin values (j/m) have been multiplied by two (in order to be integer).

Definition at line 22 of file clebschgordan_lookup.cc.

24  {
25  const double wigner_3j = gsl_sf_coupling_3j(j_a, j_b, j_c, m_a, m_b, -m_c);
26  if (std::abs(wigner_3j) < really_small) {
27  return 0.;
28  }
29  assert((j_a - j_b + m_c) % 2 == 0);
30  const int j = (j_a - j_b + m_c) / 2;
31  double result = std::sqrt(j_c + 1) * wigner_3j;
32  result *= (j % 2 == 0) * 2 - 1; // == (-1)**j
33 
34  logg[LResonances].debug("CG: ", result, " I1: ", j_a, " I2: ", j_b,
35  " IR: ", j_c, " iz1: ", m_a, " iz2: ", m_b,
36  " izR: ", m_c);
37 
38  return result;
39 }
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
static constexpr int LResonances
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37

Member Data Documentation

◆ lookup_table

std::unordered_map<ThreeSpins, double, ThreeSpinHash> smash::ClebschGordan::lookup_table
inlinestaticprivate

Tabulation of Clebsch-Gordan coefficients.

The C++ code to produce this member declaration can be found in the "tabulate" unit test of this file.

Definition at line 193 of file clebschgordan_lookup.h.


The documentation for this class was generated from the following files: