wrap_indices
symbolica.community.idenso Function
wrap_indices(expression: Expression, header: Expression) -> ExpressionWrap all abstract indices with a header symbol
Arguments
expression: input expression containing tensor indicesheader: symbol to use as the wrapper function for all indices
Returns
Expression with all indices wrapped by the header symbol.
Examples
from symbolica.community.spenso import TensorName, Slot, Representation
import symbolica as sp
from symbolica.community.idenso import wrap_indices
T = TensorName("T")
rep = Representation.euc(3)
# With slots (creates TensorExpression)
mu = rep("mu")
nu = rep("nu")
x = sp.S("x")
tensor_with_args = T(x, mu, nu) # T(x; mu, nu)
print(tensor_with_args)
print(wrap_indices(tensor_with_args.to_expression(), sp.S("wrap")))
View generated signature source: docs/api/python/idenso-community.pyi:1134