How to make the $\ell_2$ norm of all columns and rows of an $n \times n$ matrix equal to $\sqrt{n}$?

I have an $n \times n$ matrix and I would like its columns and rows to have $\ell_2$ norm equal to $\sqrt{n}$. Is this possible?

• As long as you have one row or col of zeros this would be difficult. – Laurent Duval Dec 19 '15 at 22:57
• I dont have any row or columns of zeros ... – Abhishek Sadasivan Dec 20 '15 at 5:50
• Do you want to have "all your rows or colums", or "all your rows AND columns"? – Laurent Duval Dec 21 '15 at 17:17
• Ideally rows and columns ..but if rows or columns will serve the purpose – Abhishek Sadasivan Dec 23 '15 at 0:46
• And what features of the matrix would you like to preserve? Or alternatively, what operations are allowed to achieve your goal? Can you provide more context, maybe explain the application you have in mind or the problem you want to solve? – Jazzmaniac Oct 14 '17 at 19:37

HINT If we have the diagonal matrix: $$D = \left[\begin{array}{cccc} d_1&0&0&0\\ 0&d_2&0&0\\ 0&0&\ddots&0\\ 0&0&0&d_n \end{array}\right]$$

Multiplying another matrix $$M_r = \left[\begin{array}{c} r_1\\ r_2\\ \vdots\\ r_n \end{array}\right]$$to the left with it multiplies each row like this:

$$DM_r = \left[\begin{array}{c} d_1r_1\\ d_2r_2\\ \vdots\\ d_nr_n \end{array}\right]$$

If the matrix has the columns $$M_c = \left[\begin{array}{cccc} c_1& c_2& \dots& c_n \end{array}\right]$$

Then multiplying from the right with D will give:

$$M_cD = \left[\begin{array}{cccc}d_1c_1&d_2c_2&\dots&d_nc_n \end{array}\right]$$

Suppose we have a matrix $\mathrm A \in \mathbb R^{2 \times 2}$ that has neither zero columns nor zero rows. Left- and right-multiplying matrix $\rm A$ by positive diagonal matrices, we obtain

$$\begin{bmatrix} \sqrt{x_1} & 0\\ 0 & \sqrt{x_2}\end{bmatrix} \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\end{bmatrix} \begin{bmatrix} \sqrt{y_1} & 0\\ 0 & \sqrt{y_2}\end{bmatrix} = \begin{bmatrix} a_{11} \sqrt{x_1 y_1} & a_{12} \sqrt{x_1 y_2}\\ a_{21} \sqrt{x_2 y_1} & a_{22} \sqrt{x_2 y_2}\end{bmatrix}$$

If the squared $2$-norms of the rows and columns of this weighted matrix are equal to $2$, then we have $4$ bilinear equality constraints

$$\begin{array}{rl} a_{11}^2 x_1 y_1 + a_{12}^2 x_1 y_2 &= 2\\ a_{21}^2 x_2 y_1 + a_{22}^2 x_2 y_2 &= 2\\ a_{11}^2 x_1 y_1 + a_{21}^2 x_2 y_1 &= 2\\ a_{12}^2 x_1 y_2 + a_{22}^2 x_2 y_2 &= 2\end{array}$$

Let $\mathrm x := (x_1, x_2)$ and $\mathrm y := (y_1, y_2)$. Each of the bilinear equations above can be written in the form

$$\mathrm x^\top \mathrm Q \, \mathrm y = 2$$

or, alternatively, in the following form

$$\begin{bmatrix} \mathrm x\\ \mathrm y\end{bmatrix}^\top \begin{bmatrix} \mathrm O_2 & \mathrm Q\\ \mathrm Q^\top & \mathrm O_2\end{bmatrix} \begin{bmatrix} \mathrm x\\ \mathrm y\end{bmatrix} = 4$$

Hence, if $n=2$, we have the intersection of $2n=4$ quadratic hypersurfaces in $\mathbb R^4$. This does not appear to be easy. It should be harder for $n > 2$. However, if matrix $\rm A$ is symmetric, then we have only $2$ quadratic equations

$$\begin{array}{rl} a_{11}^2 x_1^2 + a_{12}^2 x_1 x_2 &= 2\\ a_{12}^2 x_1 x_2 + a_{22}^2 x_2^2 &= 2\end{array}$$

Hence, we now have the intersection of $2$ conic sections in $\mathbb R^2$.