Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
QEDProvider.py
Go to the documentation of this file.
1"""High-level Python access to QED/electroweak coupling quantities from the C++ core.
2
3The :class:`QEDProvider` wrapper delegates to the C++ ``QEDProvider`` and
4exposes the electromagnetic coupling computation backed by ``EWHelper``.
5"""
6
7from pyhyperiso.phyperiso.pyhyperiso.core import QEDProvider as _CppQEDProvider
8from pyhyperiso.core.Common.Configs import AlphasConfig
9
10
12 r"""Compute QED/electroweak quantities through the bound C++ provider.
13
14 The provider expects the global Hyperiso state to have been initialized
15 before use, typically through ``HyperisoMaster.init(...)``. The numerical
16 implementation is delegated to the C++ ``EWHelper`` backend.
17
18 Note:
19 At the C++ level, generic running through ``EWHelper::alpha_em``
20 raises an explicit error because it is not implemented. The precomputed
21 values of :math:`\alpha_{\mathrm{em}}` are stored in the ``EW`` block
22 initialized by ``EWHelper::Init()``.
23
24 Example:
25 >>> qed = QEDProvider()
26 >>> alpha_em = qed.get_alphaem(AlphasConfig(91.1876))
27 """
28
29 def __init__(self):
30 """Create a Python wrapper around the C++ ``QEDProvider``."""
31 self._cpp_obj = _CppQEDProvider()
32
33 def get_alphaem(self, alpha_config: AlphasConfig):
34 """Compute the electromagnetic coupling for the requested configuration.
35
36 Args:
37 alpha_config: Python configuration object describing the target
38 scale and convertible to the C++ ``AlphasConfig``.
39
40 Returns:
41 float: The value returned by ``QEDProvider::compute_alphaem``.
42 """
43 return self._cpp_obj.compute_alphaem(alpha_config.to_cpp())
44
45 def get_alpha_em(self, alpha_config: AlphasConfig):
46 """Alias for :meth:`get_alphaem` using the conventional alpha_em spelling."""
47 return self.get_alphaem(alpha_config)
48
49
50__all__ = ["QEDProvider"]
get_alphaem(self, AlphasConfig alpha_config)
get_alpha_em(self, AlphasConfig alpha_config)