Dear math enthusiasts,
I need to take the derivative of an inner product involving an operator on one side and I'd like to do this via the adjoint operator. However, it seems I'm doing something wrong since things don't quite match for the complex-valued case (for real numbers it works). I'm assuming some mismatch between the (Wirtinger?) calculus I'm applying for the complex derivative and the inner products / operators but I'm not sure where exactly things go wrong.
Here is the setting: I have an operator $T: \mathbb{C}^n \mapsto {\mathcal S_n}$, where $\mathcal S_n$ denotes the set of Hermitian symmetric complex $n \times n$ matrices. I am looking at the inner product $\langle A, T(x) \rangle$ and I need its derivative with respect to $x$. The inner products I'm using are $\langle x,y\rangle = x^{\rm H} y$ on $\mathbb{C}^n$ and $\langle X,Y\rangle = {\rm Trace}(X^{\rm H} Y)$ on $\mathcal S_n$, where $(\cdot)^{\rm H}$ denotes conjugate transpose. I was thinking to use the adjoint operator $T^*: {\mathcal S_n} \mapsto \mathbb{C}^n$ defined via $\langle A, T(x) \rangle = \langle T^*(A), x \rangle$ for all $A \in \mathcal S_n$, $x \in \mathbb{C}^n$. Then I was hoping to use some magic like this:
$$\frac{{\rm d} \langle A, T(x) \rangle}{{\rm d} x} = \frac{{\rm d} \langle T^*(A), x \rangle}{{\rm d} x} = T^*(A). $$
Is this rule correct? Does it work in the complex domain? I was thinking it should work on any Hilbert space but I'm not sure.
Anyways, I'm having trouble applying this. Here is a concrete simple example. The most simple form of it is the operator $T(x) = \begin{bmatrix} x_1 & x_2 \\ \bar{x}_2 & x_1 \end{bmatrix}$ [*], where $\bar{x}$ denotes complex conjugation. Since $A \in \mathcal S_n$, let's say $A = \begin{bmatrix} a_1 & a_2 \\ \bar{a}_2 & a_1 \end{bmatrix}$, where $a_1$ is real. I'm computing the adjoint via
$$[T^*(A)]_i = \langle T^*(A),e_i\rangle = \langle A,T(e_i) \rangle = \begin{bmatrix} \langle A, \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \rangle \\ \langle A, \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \rangle \end{bmatrix} = \begin{bmatrix} 2 a_1 \\ a_2 + \bar{a}_2\end{bmatrix}.$$
So far so good. At the same time, my inner product gives me
$$ \langle A,T(x) \rangle = a_1 x_1 + \bar{a}_2 x_2 + a_2 \bar{x}_2 + a_1 x_1.$$
I would have said its derivative should be
$$\frac{{\rm d} \langle A, T(x) \rangle}{{\rm d} x} = \begin{bmatrix} 2a_1 \\ \bar{a}_2 \end{bmatrix},$$
using $\frac{\partial \bar{x}_2}{x_2} = 0$. I'm assuming this is where I'm wrong. On the other hand, I would only get a result agreeing with $T^*(A)$ if this derivative would be equal to one, which I find hard to believe (unless $x$ is real).
I'm not an expert in complex analysis but I was told that for functions $f: \mathbb{C}^n \mapsto \mathbb{R}$ we have $\frac{{\rm d}f}{{\rm d}x} = \overline{\frac{{\rm d}f}{{\rm d}\bar{x}}}$, since $f = \bar{f}$. This means that if we look for extrema it does not matter which of the derivatives we equate to zero. It works nicely in the above example if we treat $x_2$ and $\bar{x}_2$ independently (I belive this is called Wirtinger calculus or something?). At the same time this seems to break something with the inner products and/or adjoint operators.
Could someone help me shed light on where is the incompatibility and what is the best way of treating these types of problems? What is the correct answer to the derivative? What makes me really sceptical about using $T^*(A)$ is that it always returns something real-valued (for symmetric $A$ on which it is defined) though the derivatives should be complex-valued.
P.S.: [*] There is another minor issue here that I think has not directly to do with the problem but I welcome comments on: For this operator to map to $\mathcal S_n$ we actually need to make sure $x_1$ is real. So I have two options:
(a) define it as $T(x) = \begin{bmatrix} {\rm Real}(x_1) & x_2 \\ \bar{x}_2 & {\rm Real}(x_1) \end{bmatrix}$ where ${\rm Real}(x_1) = \frac 12(x_1 + \bar{x}_1)$. Interestingly, this does not seem to change the adjoint operator, since $T(e_i)$ is unchanged. However, my inner product becomes $\langle 2 a_1 \frac 12 (x_1+\bar{x}_1) + a_2x_2 + \bar{a}_2 \bar{x}_2 \rangle$, which does seem to change the derivative again to $\begin{bmatrix} a_1 \\ a_2 \end{bmatrix}$. So even with this correction, the result is incompatible to the one we get via $T^*(A)$.
(b) Alternatively, I could define the operator to map from $\mathbb{R} \times \mathbb{C}^{n-1}$ to $\mathcal S_n$. I'm not sure if this causes complications for the inner products though.