1#ifndef WILSON_COEFFICIENT_REGISTRY_H
2#define WILSON_COEFFICIENT_REGISTRY_H
6#include <unordered_map>
61using CoefPtr = std::shared_ptr<WilsonCoefficient>;
91 table_[key(c,m,b)] = std::move(mk);
120 bool operator==(
const Key& o)
const noexcept {
121 return c==o.c && m==o.m && b==o.b;
132 std::size_t operator()(
const Key& k)
const noexcept {
134 std::size_t
h = std::hash<int>{}(k.c);
135 h ^= std::hash<int>{}(k.m) + 0x9e3779b97f4a7c15ULL + (h<<6) + (
h>>2);
136 h ^= std::hash<int>{}(k.b) + 0x9e3779b97f4a7c15ULL + (h<<6) + (
h>>2);
143 return Key{(int)c, (
int)m, (int)b};
147 std::unordered_map<Key, CoefMaker, KeyHash> table_;
bool operator==(const std::string &lhs, const BlockName &rhs)
Symmetric comparison between std::string and BlockName.
Declarative registry describing Wilson coefficient groups, their sources, and setup hooks.
void register_CC_bu(CoefficientRegistry &)
Registers coefficient factories for charged-current b->u (C_V1_bu, ...).
void register_BPrime(CoefficientRegistry &)
Registers coefficient factories for the B' group (CP1..CP10, CPQ1, CPQ2).
void register_CC_su(CoefficientRegistry &)
Registers coefficient factories for charged-current s->u (C_V1_su, ...).
void register_B(CoefficientRegistry &)
Registers coefficient factories for the B group (C1..C10).
std::shared_ptr< WilsonCoefficient > CoefPtr
Shared pointer type used to store coefficients in groups.
void register_BScalar(CoefficientRegistry &)
Registers coefficient factories for the scalar B group (CQ1, CQ2).
void register_K(CoefficientRegistry ®)
Registers coefficient factories for the K group (CK9, CK10, ...).
std::function< CoefPtr(const BuildContext &, WCoef)> CoefMaker
Factory signature for constructing a coefficient instance given a build context and enum id.
void register_CC_cs(CoefficientRegistry &)
Registers coefficient factories for charged-current c->s (C_V1_cs, ...).
void register_CC_du(CoefficientRegistry &)
Registers coefficient factories for charged-current d->u (C_V1_du, ...).
void register_CC_bc(CoefficientRegistry &)
Registers coefficient factories for charged-current b->c (C_V1_bc, ...).
void register_CC_cd(CoefficientRegistry &)
Registers coefficient factories for charged-current c->d (C_V1_cd, ...).
void register_MesonMixing(CoefficientRegistry &)
Registers coefficient factories for meson mixing coefficients.
Domain objects representing Wilson coefficients and their matching metadata.
Registry mapping (WCoef, Model, Backend) -> coefficient factory function.
void register_creator(WCoef c, Model m, Backend b, CoefMaker mk)
Registers a creator function for a given (coefficient, model, backend).
CoefPtr create(const BuildContext &ctx, WCoef c) const
Creates a coefficient instance according to the provided build context.
complex_t h(double s, double m_q, double mu_b)
Build-time context passed to group setup hooks.