2

How would I go about calculating the derivative with respect to $x$ of $$Q(x) = x^H A x $$ with $A$ a real matrix (not necessarily symmetric) and $x$ a complex valued vector? Here $(\cdot)^H$ denotes the conjugate transpose.



EDIT: This question came up in the context of the maximization problem:

$$ \text{arg}\max_x \, x^H A x \qquad \text{s.t.} \quad x^Hx = 1$$

I think for solving this I need to solve $ \nabla_x \, Q (x) \stackrel{!}{=} 0$, so what I am looking for is the complex gradient vector.

Am I correct in assuming (following the Matrix Cookbook and using that $A$ is real) that:

$$ \nabla_x \, Q(x) = \frac{\partial Q}{\partial Re(x)} + i \frac{\partial Q}{\partial Im(x)} = \, \dots \, = 2 A x$$

where I used that $Q(x) = (Re(x) - i\, Im(x))^T A \,(Re(x) + i\,Im(x)) $?



EDIT2: The above seems to only hold if $x^H A \, x$ is real (additional question: for which matrices $A$ would that be the case? Maybe when I can decompose $A$ into $A = B^TB$ or respectively $B^HB$ for complex A?).

mnl
  • 21
  • That depends on what you mean by "derivative with respect to $x$". There are several flavors of multivariable derivatives. Which one are you looking for? – Paul Sinclair Mar 15 '21 at 19:09
  • Thank you for your response. I think I'm looking for the complex gradient vector and updated my question accordingly. – mnl Mar 16 '21 at 10:59
  • 2
    Alas, there is still more to my question in this particular instance. If you treat $\Bbb C^n \equiv \Bbb R^{2n}$ then Rodrigo de Azevedo's link will work. But if you intend complex derivatives, then $x^H$ is not differentiable (because $\bar z$ is not differentiable). – Paul Sinclair Mar 16 '21 at 12:08
  • 1
    Actually, looking at the additional context you added, go ahead and treat it as a $\Bbb R^{2n}$ problem and use real derivatives. That is what you need for maximization. The answer to your other question is: $x^HAx$ is always real if and only if $A$ is Hermitian: $A^H = A$. – Paul Sinclair Mar 16 '21 at 12:23
  • Thanks for all your answers. Rodrigo's answer did not completely solve my problem but it was useful for checking the derivatives I had calculated. Yes I can definitely treat the problem as $\mathbb{R}^{2n}$ (the problem is related to shape analysis of planar curves, which I parametrize as $z(t) \in \mathbb{C}$ instead of $(x(t), y(t))$, which greatly simplifies derivations). – mnl Mar 16 '21 at 12:45
  • The problem I still have is that I am a bit confused about the actual derivative to use. I tried both: $$ \nabla_x , Q(x) = \frac{\partial Q}{\partial Re(x)} + i \frac{\partial Q}{\partial Im(x)} = , \dots , = 2 A x$$ and $$ \nabla_x , Q(x) \stackrel{?}{=} \frac{\partial Q}{\partial Re(x)} - i \frac{\partial Q}{\partial Im(x)} = , \dots , = 2 A^T x^*$$ where the first one seems more intuitive if I treat $\mathbb{C}^n$ as $\mathbb{R}^{2n}$, but after visualizing my results only the later seems to provide the expected result. – mnl Mar 16 '21 at 12:56
  • Ahh, yes. Ok I tried it out, but It does not seem to be as straight forward as the real case: $$ \lim_{h \rightarrow \infty} \frac{Q(x +hv) - Q(x)}{h} = x^H A , v + v^H A , x = \langle A^Tx, v \rangle + \langle v, Ax \rangle = \dots $$ Don't I have the problem here, that I am working with complex scalar products and therefore $\langle a, b \rangle = \langle b, a \rangle^*$, so this does not simplify as nicely as in the real case? – mnl Mar 16 '21 at 13:17
  • Well, I tried writing $x = Re(x) + i , Im(x)$ and $v = Re(v) + i , Im(v)$ and by using real scalar products (after pulling out the $i$'s) I end up with something like: $$ \langle Re(v), (A^T + A) Re(x) + i (A - A^T) Im(x) \rangle - i \langle Im(v), (A - A^T) Re(x) + i (A + A^T) Im(x) \rangle$$ at which point I am stuck. ^^ – mnl Mar 16 '21 at 14:04
  • Are you thinking about $Re(x) = \frac{x + x^*}{2}$? I tried applying this to the above expression (also rewriting $Im(x)$, $Re(v)$ snf $Im(v)$) and was able to simplify it further... will have to see how it goes. – mnl Mar 16 '21 at 15:28
  • You did not answer my question. Which exact problem do you want to solve? – Rodrigo de Azevedo Mar 16 '21 at 23:47
  • Related: https://math.stackexchange.com/q/1075887/339790 and https://math.stackexchange.com/q/2635763/339790 – Rodrigo de Azevedo Mar 17 '21 at 00:40
  • @mnl Could you post the answer? – paperskilltrees May 17 '22 at 00:28

0 Answers0