/
index.html
62 lines (53 loc) · 12.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html><HTML lang="en"><head><meta charset="UTF-8"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><title>Complex-domain Optimization · Convex.jl</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script data-main="../assets/documenter.js" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/documenter.css" rel="stylesheet" type="text/css"/><script data-outdated-warner="">function maybeAddWarning () {
const head = document.getElementsByTagName('head')[0];
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
const meta = document.createElement('meta');
meta.name = 'robots';
meta.content = 'noindex';
head.appendChild(meta);
};
// Add a stylesheet to avoid inline styling
const style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode('.outdated-warning-overlay { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 999; background-color: #ffaba7; color: rgba(0, 0, 0, 0.7); border-bottom: 3px solid #da0b00; padding: 10px 35px; text-align: center; font-size: 15px; } .outdated-warning-overlay .outdated-warning-closer { position: absolute; top: calc(50% - 10px); right: 18px; cursor: pointer; width: 12px; } .outdated-warning-overlay a { color: #2e63b8; } .outdated-warning-overlay a:hover { color: #363636; }'));
head.appendChild(style);
const div = document.createElement('div');
div.classList.add('outdated-warning-overlay');
const closer = document.createElement('div');
closer.classList.add('outdated-warning-closer');
// Icon by font-awesome (license: https://fontawesome.com/license, link: https://fontawesome.com/icons/times?style=solid)
closer.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>';
closer.addEventListener('click', function () {
document.body.removeChild(div);
});
let href = '/stable';
if (window.documenterBaseURL) {
href = window.documenterBaseURL + '/../stable';
}
div.innerHTML = 'This documentation is not for the latest version. <br> <a href="' + href + '">Go to the latest documentation</a>.';
div.appendChild(closer);
document.body.appendChild(div);
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', maybeAddWarning);
} else {
maybeAddWarning();
};
</script></head><body><nav class="toc"><h1>Convex.jl</h1><select id="version-selector" onchange="window.location.href=this.value" style="visibility: hidden"></select><form action="../search/" class="search" id="search-form"><input id="search-query" name="q" placeholder="Search docs" type="text"/></form><ul><li><a class="toctext" href="../">Home</a></li><li><a class="toctext" href="../installation/">Installation</a></li><li><a class="toctext" href="../quick_tutorial/">Quick Tutorial</a></li><li><a class="toctext" href="../types/">Basic Types</a></li><li><a class="toctext" href="../operations/">Supported Operations</a></li><li><a class="toctext" href="../examples/">Examples</a></li><li class="current"><a class="toctext" href="">Complex-domain Optimization</a><ul class="internal"><li><a class="toctext" href="#Complex-Variables-1">Complex Variables</a></li><li><a class="toctext" href="#Linear-Program-Representable-Functions-(complex-variables)-1">Linear Program Representable Functions (complex variables)</a></li><li><a class="toctext" href="#Second-Order-Cone-Representable-Functions-(complex-variables)-1">Second-Order Cone Representable Functions (complex variables)</a></li><li><a class="toctext" href="#Semidefinite-Program-Representable-Functions-(complex-variables)-1">Semidefinite Program Representable Functions (complex variables)</a></li><li><a class="toctext" href="#Exponential-SDP-representable-Functions-(complex-variables)-1">Exponential + SDP representable Functions (complex variables)</a></li><li><a class="toctext" href="#Optimizing-over-quantum-states-1">Optimizing over quantum states</a></li></ul></li><li><a class="toctext" href="../solvers/">Solvers</a></li><li><a class="toctext" href="../faq/">FAQ</a></li><li><a class="toctext" href="../loop/">Optimizing in a Loop</a></li><li><a class="toctext" href="../advanced/">Advanced</a></li><li><a class="toctext" href="../contributing/">Contributing</a></li><li><a class="toctext" href="../credits/">Credits</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="">Complex-domain Optimization</a></li></ul><a class="edit-page" href="https://github.com/JuliaOpt/Convex.jl/blob/master/docs/src/complex-domain_optimization.md#L"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Complex-domain Optimization</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" href="#Optimization-with-Complex-Variables-1" id="Optimization-with-Complex-Variables-1">Optimization with Complex Variables</a></h1><p>Convex.jl also supports optimization with complex variables. Below, we present a quick start guide on how to use Convex.jl for optimization with complex variables, and then list the operations supported on complex variables in Convex.jl. In general, any operation available in Convex.jl that is well defined and DCP compliant on complex variables should be available. We list these functions below. organized by the type of cone (linear, second-order, or semidefinite) used to represent that operation.</p><p>Internally, Convex.jl transforms the complex-domain problem to a larger real-domain problem using a bijective mapping. It then solves the real-domain problem and transforms the solution back to the complex domain.</p><h2><a class="nav-anchor" href="#Complex-Variables-1" id="Complex-Variables-1">Complex Variables</a></h2><p>Complex Variables in Convex.jl are declared in the same way as the variables are declared but using the different keyword <code>ComplexVariable</code>.</p><pre><code class="language-julia"> # Scalar complex variable
z = ComplexVariable()
# Column vector variable
z = ComplexVariable(5)
# Matrix variable
z = ComplexVariable(4, 6)
# Complex Positive Semidefinite variable
z = HermitianSemidefinite(4)</code></pre><h2><a class="nav-anchor" href="#Linear-Program-Representable-Functions-(complex-variables)-1" id="Linear-Program-Representable-Functions-(complex-variables)-1">Linear Program Representable Functions (complex variables)</a></h2><p>All of the linear functions that are listed under <a href="../operations/#Linear-Program-Representable-Functions-1">Linear Program Representable Functions</a> operate on complex variables as well. In addition, several specialized functions for complex variables are available:</p><table><tbody><tr><th style="text-align: right">operation</th><th style="text-align: right">description</th><th style="text-align: right">vexity</th><th style="text-align: right">slope</th><th style="text-align: right">notes</th></tr><tr><td style="text-align: right"><code>real(z)</code></td><td style="text-align: right">real part of complex of variable</td><td style="text-align: right">affine</td><td style="text-align: right">increasing</td><td style="text-align: right">none</td></tr><tr><td style="text-align: right"><code>imag(z)</code></td><td style="text-align: right">imaginary part of complex variable</td><td style="text-align: right">affine</td><td style="text-align: right">increasing</td><td style="text-align: right">none</td></tr><tr><td style="text-align: right"><code>conj(x)</code></td><td style="text-align: right">element-wise complex conjugate</td><td style="text-align: right">affine</td><td style="text-align: right">increasing</td><td style="text-align: right">none</td></tr><tr><td style="text-align: right"><code>innerproduct(x,y)</code></td><td style="text-align: right"><code>real(trace(x'*y))</code></td><td style="text-align: right">affine</td><td style="text-align: right">increasing</td><td style="text-align: right">PR: one argument is constant</td></tr></tbody></table><h2><a class="nav-anchor" href="#Second-Order-Cone-Representable-Functions-(complex-variables)-1" id="Second-Order-Cone-Representable-Functions-(complex-variables)-1">Second-Order Cone Representable Functions (complex variables)</a></h2><p>Most of the second order cone function listed under <a href="../operations/#Second-Order-Cone-Representable-Functions-1">Second-Order Cone Representable Functions</a> operate on complex variables as well. Notable exceptions include:</p><blockquote><ul><li>inverse</li><li>square</li><li>quadoverlin</li><li>sqrt</li><li>geomean</li><li>huber</li></ul></blockquote><p>One new function is available:</p><table><tbody><tr><th style="text-align: right">operation</th><th style="text-align: right">description</th><th style="text-align: right">vexity</th><th style="text-align: right">slope</th><th style="text-align: right">notes</th></tr><tr><td style="text-align: right"><code>abs2(z)</code></td><td style="text-align: right"><code>square(abs(z))</code></td><td style="text-align: right">convex</td><td style="text-align: right">increasing</td><td style="text-align: right">none</td></tr></tbody></table><h2><a class="nav-anchor" href="#Semidefinite-Program-Representable-Functions-(complex-variables)-1" id="Semidefinite-Program-Representable-Functions-(complex-variables)-1">Semidefinite Program Representable Functions (complex variables)</a></h2><p>All SDP-representable functions listed under <a href="../operations/#Semidefinite-Program-Representable-Functions-1">Semidefinite Program Representable Functions</a> work for complex variables.</p><h2><a class="nav-anchor" href="#Exponential-SDP-representable-Functions-(complex-variables)-1" id="Exponential-SDP-representable-Functions-(complex-variables)-1">Exponential + SDP representable Functions (complex variables)</a></h2><p>Complex variables also support logdet function.</p><h2><a class="nav-anchor" href="#Optimizing-over-quantum-states-1" id="Optimizing-over-quantum-states-1">Optimizing over quantum states</a></h2><p>The complex and Hermitian matrix variables, along with the <code>kron</code> and <code>partialtrace</code> operations, enable the definition of a wide range of problems in quantum information theory. As a simple example, let us consider a state <span>$\rho$</span> over a composite Hilbert space <span>$\mathcal{H}_A\otimes\mathcal{H}_B$</span>, where both component spaces are isomorphic to <span>$\mathbb{C}^2$</span>. Assume that <span>$\rho$</span> is a product state, with its component in <span>$\mathcal{H}_A$</span> given as <span>$A$</span>, a complex-valued matrix. We can optimize over the second component <span>$B$</span> to meet some requirement. Here we simply fix the second component too, but via the <code>partialtrace</code> operator:</p><pre><code class="language-julia">using Convex, SCS
A = [ 0.47213595 0.11469794+0.48586827im; 0.11469794-0.48586827im 0.52786405]
B = ComplexVariable(2, 2)
ρ = kron(A, B)
constraints = [partialtrace(ρ, 1, [2; 2]) == [1 0; 0 0]
tr(ρ) == 1
ρ in :SDP]
p = satisfy(constraints)
solve!(p, SCSSolver())
p.status</code></pre><pre><code class="language-none">:Optimal</code></pre><p>Since we fix both components as trace-1 positive semidefinite matrices, the last two constraints are actually redundant in this case.</p><footer><hr/><a class="previous" href="../examples/"><span class="direction">Previous</span><span class="title">Examples</span></a><a class="next" href="../solvers/"><span class="direction">Next</span><span class="title">Solvers</span></a></footer></article></body></HTML>