Hello,
m.comp(0) gives you the x component of m for each cell. So if m is a LxMxN array of 3-component vectors, m.comp(0) is an LxMxN array of 1 component vectors/scalars (just the x component).
If you want just the average, you want something like "m.comp(0).average()" instead. This should allow you to square it.
It's a bit confusing, if you try "print(m.comp(0))", it does the averaging implicitly for you, so really it's doing "print(m.comp(0).average())" to the command line instead. But you can see the full details if you "save(m.comp(0))".
Best,
Josh L.