sq(x) returns x^2 if x is a real number, a complex number, a real square matrix, or a complex square matrix.