Differentiation with respect to complex matrix I want to differentiate $f(X,Y) = \Vert XYA-b \Vert^2_2 $ with respect to $X$ and $Y$, $X$ and $Y$ are matrices with complex variable elements. In real cases, I know how to differentiate there is online tools such as http://www.matrixcalculus.org/#example-collapse7 ,But, I do not know how much differences exist between complex and real cases?
 A: $\def\bb{\mathbb} \def\p#1#2{\frac{\partial #1}{\partial #2}}$
Denote the transpose, complex, and hermitian conjugates of $X$ as $(X^T,X^*,X^H)$ respectively. And denote the trace/Frobenius product using a colon
$$A:B = \sum_{i=1}^m\sum_{j=1}^nA_{ij}B_{ij} \;\doteq\; {\rm Tr}(A^TB)$$
This product is also defined for vectors by considering them as rectangular matrices. The cyclic property of the trace permits terms in such a product to be rearranged in many equivalent ways. For example
$$\eqalign{
A:BC &= B^TA:C &= AC^T:B = I:A^TBC = I:BCA^T \\
B:C &= B^T:C^T &= C:B = C^T:B^T \\
}$$
A useful guide is that the quantity on either side of the colon must have exactly the same dimensions.
The Frobenius norm of $X$ can be written using the Frobenius product as
$$\big\|X\big\|^2_F = X^*:X$$
The last tool is the $\bb{CR}$-calculus
(aka Wirtinger derivatives), wherein the real and imaginary components of a variable are treated independently under differentiation.
Write the function using the above ideas, and calculate its real Wirtinger derivative.
$$\eqalign{
 f &= (XYA-B)^*:(XYA-B) \\
df &= (XYA-B)^*:dX\,YA \\
   &= A^TY^T(XYA-B)^*:dX \\
\p{f}{X}   &= A^TY^T(XYA-B)^* \\
}$$
Analogous calculations yield the gradient wrt the complex component of $X$
$$\eqalign{
\p{f}{X^*}   &= A^HY^H(XYA-B) \\
}$$
or wrt the components of $Y$
$$\eqalign{
\p{f}{Y}   &= X^T(XYA-B)^*A^T \\
\p{f}{Y^*} &= X^H(XYA-B)A^H \\
}$$
