Parameter
Parameter
class ParameterA numerical or symbolic parameter in a particle-physics model.
External parameters carry parameter-card coordinates and values; internal parameters carry expressions derived from the external inputs.
Examples
from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.standard_model()
mass = model.parameter("MM")
assert mass.nature == hep.ParameterNature.EXTERNALAttributes
| Name | Description |
|---|---|
expression |
Return the defining expression for an internal parameter. |
lhablock |
Return the Les Houches block name, when defined. |
lhacode |
Return the Les Houches entry indices, when defined. |
name |
Return the parameter name. |
nature |
Return whether the parameter is external or internal. |
parameter_type |
Return whether the parameter is real or complex. |
symbol |
Return the symbolic reference used by this model’s expressions |
texname |
The model’s LaTeX display label, or None when no label was supplied. |
typstname |
Native Typst math label, without dollar delimiters. |
value |
Return the evaluated value as a native Python complex number |
expression
Parameter.expression: typing.Optional[Expression]Return the defining expression for an internal parameter.
Examples
Using the setup in the Parameter class example:
internal = next(p for p in model.parameters if p.expression is not None)
formula = internal.expressionlhablock
Parameter.lhablock: typing.Optional[builtins.str]Return the Les Houches block name, when defined.
Examples
Using the setup in the Parameter class example:
mass = model.parameter(model.particle_by_pdg(13).mass_parameter)
mass.lhablock
'MASS'lhacode
Parameter.lhacode: typing.Optional[builtins.list[builtins.int]]Return the Les Houches entry indices, when defined.
Examples
Using the setup in the Parameter class example:
mass = model.parameter(model.particle_by_pdg(13).mass_parameter)
mass.lhacode
[13]name
Parameter.name: builtins.strReturn the parameter name.
Examples
Using the setup in the Parameter class example:
assert mass.name == "MM"nature
Parameter.nature: ParameterNatureReturn whether the parameter is external or internal.
Examples
Using the setup in the Parameter class example:
mass = model.parameter(model.particle_by_pdg(13).mass_parameter)
mass.nature == hep.ParameterNature.EXTERNAL
Trueparameter_type
Parameter.parameter_type: ParameterTypeReturn whether the parameter is real or complex.
Examples
Using the setup in the Parameter class example:
mass = model.parameter(model.particle_by_pdg(13).mass_parameter)
mass.parameter_type == hep.ParameterType.REAL
Truesymbol
Parameter.symbol: ExpressionReturn the symbolic reference used by this model’s expressions. TeX and Typst output use texname and typstname, respectively. Plain output keeps its symbolic name; no defining expression or numerical value is substituted.
Examples
from symbolica.community import hepkit as hep
model = hep.Model.standard_model()
reference = model.parameter("ee").symbol
mass = model.parameter("Me").symbol
assert "m_e" in (mass**2).to_latex()texname
Parameter.texname: typing.Optional[builtins.str]The model’s LaTeX display label, or None when no label was supplied. Native Typst output uses typstname independently.
hep.Model.standard_model().parameter(“ee”).texname ‘e’
Examples
Using the setup in the Parameter class example:
label = model.parameter("ee").texname
assert label == "e"typstname
Parameter.typstname: typing.Optional[builtins.str]Native Typst math label, without dollar delimiters.
Examples
from symbolica.community import hepkit as hep
hep.Model.standard_model().parameter("aS").typstname
'alpha_s'value
Parameter.value: complexReturn the evaluated value as a native Python complex number.
Raises :class:ModelError when this parameter has not been evaluated.
Examples
Using the setup in the Parameter class example:
mass_value = model.parameter("MM").value
print("mass:", mass_value.real, "width component:", mass_value.imag)Methods
| Name | Description |
|---|---|
__repr__ |
Summarize the defining data as well as the parameter name. |
_repr_html_ |
Display the model member’s physical data and defining expressions. |
_repr_pretty_ |
Write the complete text summary to an IPython pretty printer. |
__repr__
Parameter.__repr__() -> builtins.strSummarize the defining data as well as the parameter name.
Examples
Using the setup in the Parameter class example:
print(model.parameter(model.particle_by_pdg(13).mass_parameter))_repr_html_
Parameter._repr_html_() -> builtins.strDisplay the model member’s physical data and defining expressions.
Examples
Using the setup in the Parameter class example:
from IPython.display import display
display(mass)_repr_pretty_
Parameter._repr_pretty_(pretty: typing.Any, cycle: builtins.bool) -> NoneWrite the complete text summary to an IPython pretty printer.
Examples
Using the setup in the Parameter class example:
from IPython.lib.pretty import pretty
text = pretty(mass)Parameters
pretty(object) IPython pretty printer receiving the text.cycle(bool) Whether the object occurs recursively in the current display.