I have the code TensorDimensions[TensorContract[c, {{1, 2}}]]
. It is in normal form. But if I add the rules:
Unprotect[TensorDimensions]
TensorDimensions[c] = {4, 4, 5}
then the code evaluates to {5}
.
I was wondering, is there some specific language construct that would give me the result of the evaluation TensorDimensions[TensorContract[c, {{1, 2}}]]
if I were to add those rules, without actually adding those rules in the global context?
I would like to see what would happen to the expression evaluation if the rules were added, but not add the rules. Is this possible? Like a "stronger" version of what ReplaceAll
does.