# GCMMA using NLopt

Hi All. I have a question can i use NLopt for GCMMA algorithm?
also one other question can zygote has errors in calculating gradients?
thank you

Yes, the `NLopt.LD_MMA` algorithm in NLopt is the “globally convergent” variant of MMA by Svanberg (2002). (These days, I would tend to use the `NLopt.LD_CCSAQ` algorithm instead, which is another variant of the Svanberg algorithm.)

Nonconvex.jl also implements this method.

however, It is mentioned in NLopt documents that it is not using ptof. Svanberg algorithm. aslo as it is LD i though that it is local not global. right?

I don’t know what you are referring to. The NLopt manual specifically says it is using the Svanberg (2002) algorithm.

It is “LD” because the Svanberg algorithm is a local-optimization algorithm. I think you’re misunderstanding the meaning of the term “globally convergent”. “Globally convergent” does not mean that the algorithm necessarily converges to a global optimum. What it means is that the algorithm is guaranteed to converges to a local optimum from any feasible starting point (i.e. from any starting point satisfying the constraints).

(If you’re doing high-dimensional optimization of arbitrary non-convex functions, as is usually the case in PDE-constrained topology optimization, there is no practical optimization algorithm with any useful guarantees of attaining a global optimum. There are algorithms that converge to a global optimum eventually, of course — even random search does that — but they may take an arbitrarily long time and give no useful indication of when the global optimum is found.)

1 Like

ok thank you! i think i just get misunderstood from this sentence "The MMA implementation in NLopt, however, is completely independent of Svanberg’s, whose code we have not examined; any bugs are my own, of course.)"

NLopt uses Svanberg’s published mathematical algorithm, it just doesn’t use his code (for copyright reasons).

1 Like