# How can I write a standard notation for matrix of ones in mathematics [Example]?

Let $|Q|$ be denote magnitude of $Q$. A function $g$ that inverts the magnitude so that the maximum magnitude close to zeros. Hence it can be written as $$g(|Q|)=\max(|Q|) 1_{Q}-|Q|$$ where $1_{Q}$ is unit matrix which consisting of all ones. It has same size with $Q$. The purpose for using it is to makes sense for the above subtraction ($\max(|Q|)$ returns a value, it cannot subtract to a matrix, then if I multiple it with matrix of one, it will be make sense)

For example, $$|Q|= \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ 10 & 11 & 12 \\ \end{bmatrix}$$ Then $\max (|Q|)=\max(1,2,..,12)=12$

The unit matrix is $$1_Q= \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}$$

Then the function $g$ has value $$g(|Q|)= 12\times \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{bmatrix}- \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ 10 & 11 & 12 \\ \end{bmatrix}= \begin{bmatrix} 11 & 10 & 9 \\ 8 & 7 & 6 \\ 5 & 4 & 3 \\ 2 & 1 & 0 \\ \end{bmatrix}$$

However, my found that unit matrix must be square. Thus my denotation about matrix of ones looks mistake. Based on my example, could you suggest to me a clear equation for $g$ function in mathematics? Thanks