# Derivative of a trace with diag() and Kronecker product

I have a function about the trace of a matrix

$$f(\mathbf{h})=\mathrm{tr}[\mathbf{F} (\mathbf{I}_N \otimes \mathrm{diag}(\mathbf{h})) \mathbf{A} (\mathbf{I}_N \otimes \mathrm{diag}(\mathbf{h})) \mathbf{F}^\mathrm{H}]$$

where $$\mathbf{I}_N$$ is the identity matrix.

What is $$\frac{\partial f}{\partial \mathbf{h}}$$?

The most related question is

Derivative of a trace with Kronecker product

and

Replace $X$ with $\mbox{diag}(x)$ in trace matrix derivative identity

Just a slight modification of the answer in Replace $X$ with $\mbox{diag}(x)$ in trace matrix derivative identity
$$\frac{\partial f}{\partial \mathbf{h}} = (\mathbf{1}_{1 \times N} \otimes \mathbf{I}_M) (\mathrm{diag}^{-1}(\mathbf{A}\mathrm{diag}(\mathbf{I}_N \otimes \mathrm{diag}(\mathbf{h}))\mathbf{F}^\mathrm{H}\mathbf{F}) + \mathrm{diag}^{-1}(\mathbf{F}^\mathrm{H}\mathbf{F}\mathrm{diag}(\mathbf{I}_N \otimes \mathrm{diag}(\mathbf{h}))\mathbf{A}))$$
where $$M$$ is the length of $$\mathbf{h}$$.