I have these constraints on a cost function
$$ c = A+Bx=A+B\text{vec}\ (q^*q^\top), $$ where $(c,A)\in\mathbb{R}^{100}$, $B\in\mathbb{C}^{100\times 81}$, $x\in\mathbb{C}^{81}$ and $q\in\mathbb{C}^9$. So $x=\text{vec}\ (q^*q^\top)$, which is the vectorization operator. I want to speed up my optimizer and therefore i require the gradient of the constraints (with respect to $q$). This is how far i have come:
$$ \begin{aligned} dc = Bdx &= Bd\text{vec}\ (q^*q^\top)\\ &=B\text{vec}\ (q^*dq^\top+dq^*q^\top) \\ &=B\text{vec}\ (q^H:dq)+B\text{vec}\ (q^\top:dq^*) \end{aligned} $$
However, i cannot seem to get rid of the $\text{vec}$ operator. If i "matricize" the left side to remove the vectorization at the right side, i cannot get to $\frac{\partial c}{\partial q}$ anymore. Anyone got some brilliance for me?
Update: The last line of my derivation is incorrect i think. $q^H\in\mathbb{C}^{12}$ while $dq\in\mathbb{C}^{1\times 12}$, so you cannot use the Frobenius product here.
The outer product of two vectors can be vectorized in several equivalent ways $$\eqalign{ {\rm vec}(q^*q^T) &= {\rm vec}(q^*q^TI) = {\rm vec}(Iq^*q^T) \\ =q\otimes q^* &= (I\otimes q^*)\,q = (q\otimes I)\,q^* \\ }$$ Use this to rewrite the constraint vector and calculate its gradient(s). $$\eqalign{ (c-A) &= B(I\otimes q^*)\,q \;=\; B(q\otimes I)\,q^* \\ dc &= B(I\otimes q^*)\,dq + B(q\otimes I)\,dq^* \\ \frac{\partial c}{\partial q} &= B(I\otimes q^*), \quad \frac{\partial c}{\partial q^*} = B(q\otimes I) \\ }$$