Derivative of absolute value square $|X|^2$ For the function;
$$Q(X,\gamma)=- \sum_{i,j} \frac{1}{2\gamma}|x_{i,j}|^2+\frac{\gamma}{2}$$
How to calculate derivative $\frac{\delta Q(X,\gamma)}{\delta X} = 0$, as X is in $|x_{i,j}|^2$ form? The expected outcome seems to be $x_{i,j} = 2\gamma$.
 A: Are you familiar with how to take differentiate a scalar with respect to a matrix?
If not, see here. All you do is take the element by element derivative. So in this case:
\begin{align} \frac{\partial Q}{\partial x_{\ell k}} 
&= \frac{\partial}{\partial x_{\ell k}}\sum_{i,j} \frac{-1}{2\gamma}|x_{ij}|^2 + \frac{\gamma}{2}\\ 
&= \sum_{i,j}\frac{-1}{2\gamma}\frac{\partial}{\partial x_{\ell k}}|x_{ij}|^2 \\
&=\sum_{i,j}\frac{-1}{2\gamma}\delta_{i\ell}\delta_{jk}2|x_{ij}|\\
&= \frac{|x_{\ell k}|}{\gamma}\\
\therefore \frac{\partial Q}{\partial X} &= \frac{-1}{\gamma}|X| \end{align}
However, this means that $ {\partial Q}/{\partial X} = 0 $ only when $|X|=0$, i.e. $x_{ij}=0\;\forall\;i,j$. 
This is intuitively sensible, since clearly $Q$ is minimal when $X$ vanishes, and it is impossible to shrink it further.
Separately, note that if you solve $\partial Q/\partial \gamma=0$, you get: $$ \gamma=\sqrt{\sum_{i,j} |x_{ij}|^2} = || X||_F $$
So that, if plugged into $Q$, we get: $$ Q(X,||X||_F)=\sum_{i,j} \frac{-1}{2||X||_F}|x_{ij}|^2 + \frac{||X||_F}{2}=\frac{-1}{2||X||_F}||X||_F^2 + \frac{||X||_F}{2}=0 $$
