sum() and prod() use special promotion rules (see #202 and https://data-apis.org/array-api/latest/API_specification/generated/signatures.statistical_functions.sum.html#signatures.statistical_functions.sum). trace() is effectively a sum over the diagonal, so it should use the same rules. np.trace() currently already acts the same as np.sum() in this regard.
Presumably this also means we should add a dtype argument to trace()