TensorReductionError
Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.
TensorReductionError
class TensorReductionErrorFailure while parsing or reducing a Lorentz tensor.
Examples
from symbolica import S, E
from symbolica.community import hepkit as hep
from symbolica.community.tensor import Representation, TensorName
D, mu = S("D", "mu")
k = TensorName.vector("tensor_reduction_error_example::k")
reducer = hep.TensorReducer(D)
try:
reducer.reduce(k(Representation.mink(D)(mu)))
except hep.TensorReductionError as error:
assert "no integrated vectors selected" in str(error)
else:
raise AssertionError("expected a missing-selector error")