Test that Tensor::dimension() fails when the dimension index is wrong.
The test for trace() can only fail if we do not use NDEBUG