It's hard to tell where to start, so please ignore what is not necessary.
I took an optimization course a number of years ago that was in an EE department using
Luenberger, David G. Linear and nonlinear programming. Reading, MA:
Addison-wesley, 1984.
as one of the texts. I recall asking about Complex Variables and being told that you should just convert your problem to Real Variables. Given that Luenberger is a Engineer, one feels doubly disappointed.
When one does a least anything (squares included), you need a relationship $a \le b$ which is obvious for real variables but for Complex number $a < b $ is ambiguous.
In Matlab the test $a < b $ is converted to $|a| < |b| $. You can have $|a| = |b| $ but that does not mean that $a = b $. They can differ in phase.
In complex least squares, the objective function is a real function of a complex variable. In the case $ f(a)= |a| $ or $ g(a)= |a|^2 = a \;\text{conj}(a)$ we can have $g(a)=g(b)$ where $a \ne b$. In general the Cauchy Reimann condition for a real function of a complex variable is not analytic. $\frac{d}{dx} g(x)$ is flat with respect to phase,
The is fixed by having real function of the form $g( x , \text{conj(x)})$ where $x$ and $\text{conj}(x)$ are considered independent variables. This looks strange but one can transform $x$ and $\text{conj}(x)$ to $\text{real}(x)$ and $\text{imag}(x)$ and $h( \text{real}(x), \text{imag}(x))$ is perfectly reasonable.
This device is called a Brandwood Derivative.
Brandwood, D. H. "A complex gradient operator and its application in
adaptive array theory." IEE Proceedings H-Microwaves, Optics and
Antennas. Vol. 130. No. 1. IET, 1983.
As an example
$$
\frac{d}{dx^H} x^H R x = Rx $$
There are appendices in
Van Trees, Harry L. Optimum array processing: Part IV of detection,
estimation, and modulation theory. John Wiley & Sons, 2004.
and
Kailath T, Sayed AH, Hassibi B. Linear estimation. Prentice Hall;
2000.
that cover the topic. Kailath being particularly applicable to least squares.
For more complicated optimizations of real functions of complex variables,
Sorber, Laurent, Marc Van Barel, and Lieven De Lathauwer.
"Unconstrained optimization of real functions in complex variables."
SIAM Journal on Optimization 22.3 (2012): 879-898.
This paper is actually worth reading.