Hello,
This is not a smooth manifold (it is a manifold with a boundary), hence it does not fit "as is" in Manopt, but you can still use Manopt to optimize over that set.
The idea is to parameterize the set in a smooth way (lots -- likely too much -- theory for that here:
https://arxiv.org/abs/2207.03512 ; Example 4.5 is specifically about how to parameterize an annulus by using a higher-dimensional torus, which is indeed a smooth manifold).
Concretely:
You could optimize over the set of 2n unit-modulus complex numbers. Say x in C^n and y in C^n, where |x_i| = 1 and |y_i| = 1 for all i.
Now, let z_i = ((a+b)/2) x_i + ((b-a)/2) y_i
Notice that z is a simple (linear) function of x and y.
Also, notice that the vectors z you can form in that way are exactly the vectors you want to consider. The parameterization is "complete" (surjective), though admittedly it is not 1-to-1 (it is redundant).
In Manopt, let:
problem.M = complexcirclefactory(n, 2);
Now, your cost function in problem.cost = @(X) ...; takes as input a matrix X of size n-by-2 whose first column you can think of as x, and whose second column you can think of as y. Form z = X*[(a+b)/2) ; (b-a)/2)]; Express your cost function in terms of z. And for the gradient, you'll have to take that into account as well (but it's just a linear effect).
I hope that makes sense.
Nicolas