Diagonal tensor (source code)

= Diagonal tensor

A three-variable tensor is diagonal when it vanishes unless its three arguments are equal.