# Derivative of inner product via adjoint operator vs. complex derivatives

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.

Let us try to fix this. As @loup-blanc has already posted, there is no non-trivial $\mathbb C$-linear operator from $\mathbb C^n$ into $\mathcal S_n$. In fact, the set of hermitian matrices is a real inner product space, not a complex one. So let us push that into $\mathbb R^{2n}$ using the isometry $\mathbb C^n \ni (x+yi)\mapsto (x,y)$. Also notice, that $\mathbb C^n$ isn't a real inner product space, as for $w,z\in\mathbb C^n$, $\langle w,z \rangle$ isn't necessarily real.

For a real linear function $T:\mathbb C^n\to\mathcal S_n$ let $R:\mathbb R^{2n}\to \mathcal S_n$ be given by $R(x,y) = T(x+yi)$. For $A\in\mathcal S_n$ we have \begin{align*} f(x+yi) &= \langle A, T(x+yi) \rangle \\ &= \sum_{j=1}^n \langle A, T(e_j) \rangle x_j + \sum_{k=1}^n \langle A, T(e_ki) \rangle y_k \end{align*} On the other hand, we have \begin{align*} f(x+yi) &= \langle A, R(x, y) \rangle \\ &= \langle R^*(A), (x,y) \rangle \\ &= \langle R^*_x(A), x \rangle + \langle R^*_y(A), y \rangle, \end{align*} where $R^*_x$, $R^*_y$ denote the part of $R^*$ corresponding to $x$ and to $y$ respectively. In particular, we have $$R^*_{x_j}(A) = \langle A, T(e_j) \rangle$$ and $$R^*_{y_k}(A) = \langle A, T(e_ki) \rangle$$ Thus, the Wirtinger derivative is in both cases $$\partial_z f = \frac12\partial_x f - \frac12\partial_y f i = \frac{1}{2}R^*_x(A) - \frac{1}{2}R^*_y(A)i.$$

• For the OP : $T$ is a $\mathbb{R}$-linear operator between real inner product spaces and its adjoint exists but only in the real inner-product spaces, and it is only real differentiable. – reuns Jul 16 '17 at 23:24
• This is very useful, thank you! It looks like this derivative may be exactly what I need. I'll try things out and then report back here. – Florian Jul 17 '17 at 9:06
• So it seems things fit together nicely now. I can finally proceed with the derivation and it actually explains some of the factors that appeared there mysteriously. Thanks again for the great help! – Florian Jul 17 '17 at 16:46
• @Florian you’re welcome. Actually a good question :D – user251257 Jul 17 '17 at 17:32

Many mistakes...

First try: $T(x)=\begin{pmatrix}x_1&x_2\\\overline{x_2}&x_1\end{pmatrix}\notin S_2$.

Second try: $T(x)=\begin{pmatrix}Re(x_1)&x_2\\\overline{x_2}&Re(x_1)\end{pmatrix}$ is $\mathbb{R}$-linear and not $\mathbb{C}$-linear and, consequently, your adjoint operator $T^*$ does not exist.

EDIT. If $T$ is $\mathbb{C}$-linear, then $V:x\in\mathbb{C}^n \rightarrow T(x)_{j,j}$ also; that is impossible, because its image is real -except if $V=0$-. Then, in the general case, $T$ cannot be $\mathbb{C}$-linear but only $\mathbb{R}$-linear.

In this last case, you can differentiate with respect to the real and imaginary parts of the $(x_j)$; let $x_j=u_j+iv_j$ and let $(e_j)$ be the canonical basis of $\mathbb{C}^n$.

$\dfrac{\partial{<A,T(x)>}}{\partial{u_j}}=<A,T(\dfrac{\partial{x}}{\partial{u_j}})>=<A,T(e_j)>$.

$\dfrac{\partial{<A,T(x)>}}{\partial{v_j}}=<A,T(\dfrac{\partial{x}}{\partial{v_j}})>=<A,T(ie_j)>$.

• This is helpful, thanks! It's funny because I read a pretty popular paper where they are using these operators and derivatives without explaining any of the details. I'm slowly starting to understand now what's behind it, it is still incomprehensible to me why this discussion was not included in the paper. Thanks for pointing me to this! – Florian Jul 17 '17 at 9:03