Given a (dense) matrix A, what would be a fast, idiomatic way of calculating \text{tr}(A'A)? I can solve it as

```
A = Float64.(reshape(1:20, :, 2))
trace(A*A') # = 2870, but obviously wasteful
sum(i -> (a = @view A[i, :]; dot(a, a)), 1:size(A, 1)) # works, convoluted
```

I imagine there must be a simple solution that is compiled to some neat BLAS function, but I can’t come up with anything.