#!/usr/bin/env cadabra2 ex := A_{m n} B_{m n}; type(ex); A_{m n}::Symmetric; B_{m n}::AntiSymmetric. canonicalise(ex); ex := A_{m n} B_{m n}; rule:= A_{m n} -> A_{m n} + C_{m n}; for i in range(3): substitute(ex, rule);