This question has already been asked here. I am not sure, whether I should have asked this question as a comment of an old question or in the general programming forum of stackexchange. Moderators please read and take appropriate decisions.

My machine is of 32 bit with Ubuntu 14.04. I have managed to install cvxopt, and necessary libraries for 64 bit (as much possible with Ubuntu). While installing pythonika, I am having trouble with the library, even after installing Python 2.6 and necessary interface (which, as a matter of fact loaded a lot of garbage programs - as it seems). (If someone interested, here is the error message given below). As a result, I can not install further programs. I use Mathematica 9.0, though I have backup of 7.0 and 8.0 as well.

The problem I am working is optimizing product of a Hermitian matrix (given) and a positive semi-definite operator with unit trace. I am not particularly interested in graph-theoretic or other aspects of SDP. Is there any ready-made package available which can be implemented directly. Or in worst case, is there any other programme interface which can be used in Mathematica 9 along with my system configuration).

I know that there are packages in Matlab for solving SDP. However, so far all of my programmes are written in Mathematica. I do not have time to learn Matlab and migrate all those programmes in it.

/usr/bin/ld: /usr/local/Wolfram/Mathematica/9.0/SystemFiles/Links/MathLink/DeveloperKit/Linux/CompilerAdditions/libML32i3.a(mlnumenv.c.o): undefined reference to symbol 'fmod@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
  • 2
    $\begingroup$ Take a look here and here (search for "cvx"). $\endgroup$ – Szabolcs Feb 4 '15 at 15:02
  • 2
    $\begingroup$ DO you have maybe a very small example you could post? Mathematica input and some indication of the desired output would be helpful. $\endgroup$ – Daniel Lichtblau Feb 4 '15 at 16:44

This add-on is the best I've found: https://github.com/NCAlgebra/NC

The documentation that is more specific to SDPs is here: http://www.math.ucsd.edu/~ncalg/DOCUMENTATION/index.html#SemidefiniteProgramming


Semidefinite programming (see here) has been added to Mathematica 12. Example

(*Dimension of matrices*)
d = 5;
(*Create matrices a0,a1,a2*)
a0 = RandomReal[{-1, 1}, {d, d}];
a0 = a0.Transpose@a0;
a1 = IdentityMatrix@d;
v = RandomReal[{-1, 1}, d];
a2 = TensorProduct[v, v];
a = {a0, a1, a2};
(*Vector c on objective function f = c.x*)
c = {3, 1};
(*Compute solution*)
sol = SemidefiniteOptimization[c, a];
(*Check solution*)
A = a0 + sol.{a1, a2};
ev = Sort@Eigenvalues@A;
q = PositiveSemidefiniteMatrixQ@A;
Print["Minimizer {x1,x2} of c.x such that A = a0+x1*a1+x2*a2 is \
positive semidefinite: \n\t", sol, "\nEigenvalues of A: \n\t", ev, "\n\
Is A positive semidefinite?\n\t", q]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.