EvaluationRequest

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

EvaluationRequest

class EvaluationRequest

The complete input supplied to a custom model evaluator.

An evaluation request contains already-known numerical parameters and the internal parameters, couplings, functions, and form factors still needed.

Examples

This evaluator implements the built-in scalar model at its default lam=1. A callback must return every requested internal parameter and coupling.

from symbolica import S, E
from symbolica.community import hepkit as hep
model = hep.Model.phi4()
process = model.process(["phi", "phi"], ["phi", "phi"])
requests = []
def evaluate(request):
    requests.append(request)
    return hep.EvaluatedValues(
        couplings={"SCALAR_COUPLING": (0.0, -1.0)},
    )
updated_model = model.recompute_with(evaluate)
request = requests[0]
formulas = {item.name: item.expression for item in request.couplings}

Attributes

Name Description
couplings Return the coupling expressions that must be evaluated.
form_factors Return the form-factor definitions available during evaluation.
functions Return the function definitions available during evaluation.
internal_parameters Return the derived parameter expressions that must be evaluated.
known_parameters Return the known parameter values keyed by name.

couplings

EvaluationRequest.couplings: builtins.list[ModelExpression]

Return the coupling expressions that must be evaluated.

Examples

Using the setup in the EvaluationRequest class example:

coupling_formulas = {item.name: item.expression for item in request.couplings}

form_factors

EvaluationRequest.form_factors: builtins.list[FormFactor]

Return the form-factor definitions available during evaluation.

Examples

Using the setup in the EvaluationRequest class example:

form_factors = {factor.name: factor for factor in request.form_factors}

functions

EvaluationRequest.functions: builtins.list[ModelFunction]

Return the function definitions available during evaluation.

Examples

Using the setup in the EvaluationRequest class example:

helper_functions = {function.name: function for function in request.functions}

internal_parameters

EvaluationRequest.internal_parameters: builtins.list[ModelExpression]

Return the derived parameter expressions that must be evaluated.

Examples

Using the setup in the EvaluationRequest class example:

formulas = {item.name: item.expression for item in request.internal_parameters}

known_parameters

EvaluationRequest.known_parameters: builtins.dict[builtins.str, tuple[builtins.float, builtins.float]]

Return the known parameter values keyed by name.

Examples

Using the setup in the EvaluationRequest class example:

def evaluate(request):
    alpha_s = request.known_parameters["aS"]
    return hep.EvaluatedValues()