Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
QCDProvider.py
Go to the documentation of this file.
1"""High-level Python access to QCD running quantities from the C++ core.
2
3The :class:`QCDProvider` wrapper delegates to the C++ ``QCDProvider`` and
4exposes the few operations needed by Python workflows: running coupling,
5running quark masses, and backend QCD constants.
6"""
7
8from pyhyperiso.phyperiso.pyhyperiso.core import QCDProvider as _CppQCDProvider
9from pyhyperiso.core.Common.Configs import AlphasConfig, MassConfig
10from pyhyperiso.core.Core.QCDConstants import QCDConstants
11
12
14 """Compute QCD quantities through the bound C++ provider.
15
16 The provider expects the global Hyperiso state to have been initialized
17 before use, typically through ``HyperisoMaster.init(...)``. The exact
18 numerical scheme and thresholds are managed by the C++ backend.
19
20 Example:
21 >>> qcd = QCDProvider()
22 >>> alpha_s = qcd.get_alphas(AlphasConfig(42.0))
23 >>> mt_run = qcd.get_qcd_masses(MassConfig(5.0, pdg_id=6))
24 >>> constants = qcd.get_qcd_constants()
25 """
26
27 def __init__(self):
28 """Create a Python wrapper around the C++ ``QCDProvider``."""
29 self._cpp_obj = _CppQCDProvider()
30
31 def get_alphas(self, alpha_config: AlphasConfig):
32 """Compute the strong coupling for the requested configuration.
33
34 Args:
35 alpha_config: Python configuration object describing the scale and
36 any backend-specific options required by the C++ provider.
37
38 Returns:
39 float: The value returned by ``QCDProvider::compute_alphas``.
40 """
41 return self._cpp_obj.compute_alphas(alpha_config.to_cpp())
42
43 def get_qcd_masses(self, mass_config: MassConfig):
44 """Compute a running QCD mass for the requested configuration.
45
46 Args:
47 mass_config: Python configuration object containing the scale, PDG
48 identifier, and mass convention expected by the C++ backend.
49
50 Returns:
51 float: The value returned by ``QCDProvider::compute_mass``.
52 """
53 return self._cpp_obj.compute_mass(mass_config.to_cpp())
54
55 def get_qcd_constants(self) -> QCDConstants:
56 """Return QCD constants used internally by the backend.
57
58 Returns:
59 QCDConstants: Read-only Python wrapper around the C++ constants
60 object.
61 """
62 cpp_constants = self._cpp_obj.get_constants()
63 return QCDConstants(cpp_constants)
64
65
66__all__ = ["QCDProvider"]
get_qcd_masses(self, MassConfig mass_config)
get_alphas(self, AlphasConfig alpha_config)