Nowadays, I am trying to realize interaction between Matlab and Python. And I will use rel_entr function of CVX-QUAD in Matlab to slove the convex problem. The trouble is that when I start matlab engine in Python, it will report an error about rel_entr function. How can I solve this problem?
CVXQUAD is different than CVX and is an add-on collection of functions for it…
CVX and CVXPY both have
rel_entr. CVXQUAD has
quantum_rel_entr, which can be used in CVX. But
quantum_rel_entr and CVXQUAD are not available under CVXPY. or under Python at all.
I don’t know anything about being able to use CVX within MATLAB, when called from Python. If that can be done, it is not an advertised capability. if you can figure out how to do it, please post how on this forum.
There should be no issues if you only want to apply
rel_entr to double precision arguments, as opposed to being used on optimization variables expressions involving optimization variables.
Thanks for your reply!
I have tried putting the CVXQUAD package in Python’s working directory, but the depressing thing is that it didn’t work. By the way, does the rel_entr function have higher stability than the original log function?
I don’t know what exactly is meant by “does the rel_entr function have higher stability than the original log function”, but I’d guess no.
-rel_entr(1,x) is a convoluted way of writing
log(x), which is needed only if you want to use CVXQUAD’s Padé approximation, but is otherwise non-meritorious.
As for making CVXQUAD work in MATLAB when called by Python, I will say again that is all unadvertised and unsupported. CVX and its interactions with CVXQUAD do all sorts of things under the hood, so are more taxing on compatibility than “regular” MATLAB programs which are not doing tricky (object oriented) things under the hood.
Okay! Thank you very much for your detailed explanation!