The t2s invariants don't fold a negated tensor argument or a rank-1 outer product. On main (dim 2 and 3):
| Expression |
Today |
Expected |
trace(-A) |
tr(-A) |
-tr(A) |
norm(-A) |
norm(-A) |
norm(A) |
det(-A) |
det(-A) |
det(A) for even dim, -det(A) for odd dim |
dot(-A) |
dot(-A) |
dot(A) |
trace(otimes(u, v)), u,v rank-1 |
tr(outer(u, {1}, v, {2})) |
dot_product(u, {1}, v, {1}) |
Scaled arguments already fold (trace((-2)*A) → -2*tr(A)); only the bare tensor_negative node is missed. The trace(-A) and trace(u⊗v) rules existed on the old 72-trace-simplifier branch but were not part of the #70–#72 rescue (5252027).
Plan: add them as t2s_rules (try_trace_negative, try_trace_outer_product, try_norm_negative, try_det_negative, try_dot_negative) driven by the factories, with rule unit tests and end-to-end checks.
Signed-off-by: petlenz peterlenz89.pl@gmail.com
The t2s invariants don't fold a negated tensor argument or a rank-1 outer product. On
main(dim 2 and 3):trace(-A)tr(-A)-tr(A)norm(-A)norm(-A)norm(A)det(-A)det(-A)det(A)for even dim,-det(A)for odd dimdot(-A)dot(-A)dot(A)trace(otimes(u, v)),u,vrank-1tr(outer(u, {1}, v, {2}))dot_product(u, {1}, v, {1})Scaled arguments already fold (
trace((-2)*A)→-2*tr(A)); only the baretensor_negativenode is missed. Thetrace(-A)andtrace(u⊗v)rules existed on the old72-trace-simplifierbranch but were not part of the #70–#72 rescue (5252027).Plan: add them as
t2s_rules(try_trace_negative,try_trace_outer_product,try_norm_negative,try_det_negative,try_dot_negative) driven by the factories, with rule unit tests and end-to-end checks.Signed-off-by: petlenz peterlenz89.pl@gmail.com