Hello Xianghao,
There's a few things to distinguish in your question:
* Manopt has no problem working with complex numbers as a rule, just as it wouldn't have a problem working with quaternions, or cells, or whatever. The toolbox can work with any representation of a Riemannian manifold, as long as one can expose projections, retractions, inner products, etc. for it.
* This being said, most manifolds that come out of the box with Manopt, currently, are real manifolds. Those that work with complex numbers are explicitly tagged as such. The complex sphere you mention is one of them. We hope to see complex Stiefel and Grassmann at some point (people showed interest.)
* When considering complex functions, there are multiple notions of differentiability. You may want to look into the Cauchy-Riemann conditions and Wirtinger calculus:
* For Manopt (that is to say, for what optimization algorithms will expect to get as a gradient, and for what checkgradient etc. will check against), what counts is that the gradient should provide a first-order approximation of the cost function as explained here:
* For the complex sphere, the inner product can be read in M.inner, here:
It corresponds to seeing complex matrices of size mxn as elements of R^2mn, with the canonical metric.
* For the complex circle, the inner product corresponds to seeing the complex plane as R^2, really:
So yes, you can use checkgradient to check derivatives of real functions of complex variables on complex manifolds in Manopt; you just need to be sure what it is that you are checking, and trying to obtain. The notion implemented in Manopt is the one that was useful for all our test cases so far, but if you find that you need a different notion, that'd be interesting to know.
I hope this helps ; the different notions of derivatives on complex variables can sometimes be confusing (they shouldn't be though ; it'd be nice to give a clearer picture of this at some point.)
Cheers,
Nicolas