SDPB Manual
SDPB Manual
SDPB 1.0
Contents
1 Introduction 1
1.1 Installation and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 Input to SDPB 2
3.1 Input Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Mathematica Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Internal SDP 7
5 Output of SDPB 9
5.1 Terminal Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.3 Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.4 Checkpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Attribution 13
7 Acknowledgements 13
1 Introduction
SDPB is an arbitrary-precision semidefinite program solver, specialized for polynomial ma-
trix programs (defined below). This document describes SDPBs usage and input/output.
Much more detail about its design is given in [1]. The reader is encouraged to look there
for a better understanding of SDPBs parameters and internal operation.
1
1.1 Installation and Requirements
SDPB requires
To install, you must first edit the Makefile to define the variables GMPINCLUDEDIR,
BOOSTINCLUDEDIR, and LIBDIR. Then type make to build the sdpb executable.
maximize b0 + b y over y RN ,
(2.2)
such that Mj0 (x) + N n
P
n=1 yn Mj (x) 0 for all x 0 and 1 j J.
3 Input to SDPB
SDPB takes the following input:
for each j = 1, . . . , J:
2
(j) (j)
A bilinear basis is a collection of polynomials qm (x) such that deg qm = m, for example
(j)
monomials qm (x) = xm . (A better choice for numerical stability is usually orthogonal
polynomials on the positive real line.) The sample points and sample scalings determine
how the PMP is represented internally as an SDP. In principle, they do not affect the
solution of the PMP, but in practice they can affect numerical stability. The constant b0 is
completely irrelevant to the solution algorithm, but is included for convenience. See [1] for
details.
3
<samplePoints>
(j)
<elt>x0 </elt>
...
(j)
<elt>xdj </elt>
</samplePoints>
<sampleScalings>
(j)
<elt>s0 </elt>
...
(j)
<elt>sdj </elt>
</sampleScalings>
<bilinearBasis>
(j)
hxml for polynomial q0 (x)i
...
(j)
hxml for polynomial qbdj /2c (x)i
</bilinearBasis>
</polynomialVectorMatrix>
n (x)
xml for polynomial vector Pj,rs
<polynomialVector>
0 (x)i
hxml for polynomial Pj,rs
...
N (x)i
hxml for polynomial Pj,rs
</polynomialVector>
Several aspects of this format are inefficient. Because the matrices are symmetric, rows
and cols are redundant, and most elements are listed twice. Also, XML is extremely
verbose. The current choices are in the interest of simplicity and could obviously be changed
in a future version.
The options to SDPB are described in detail in the help text, obtained by running sdpb
--help.
A Mathematica notebook SDPB.m, included in the source distribution, generates files of the
form in listing 1 starting from Mathematica data. It automatically makes sensible choices
(j) (j) (j)
for the bilinear bases qm (x), the sample points xk and the sample scalings sk .
4
The Mathematica definition of a PMP is slightly different but trivially equivalent to
(2.2). It is:
maximize a z over z RN +1 ,
PN n
such that n=0 zn Wj (x) 0 for all x 0 and 1 j J, (3.1)
n z = 1.
where Wjn (x) are matrix polynomials. The normalization condition n z = 1 can be used
to solve for one of the components of z in terms of the others. Calling the remaining
components y RN , we arrive at (2.2), where Mjn (x) are linear combinations of Wjn (x) and
b0 , bn are linear combinations of the an . This difference in convention is for convenient use
in the conformal bootstrap.
SDPB.m defines a function WriteBootstrapSDP[file, sdp], where file is the XML file
to be written to, and sdp has the following form, where the polynomials Qnj,rs (x) are the
elements of Wjn (x).
Listing 2: Usage of WriteBootstrapSDP in SDPB.m
function call WriteBootstrapSDP[file, hsdpi]
prefactor
DampedRational[c, {p1 , . . . , pk }, b, x]
or
5
const
3.3 An Example
Lets look at an example. Consider the following problem: maximize y such that
4
4 x 2
1+x +y +x 0 for all x 0 (3.3)
12
This is an PMP with 1 1 positive-semidefiniteness constraints. We will arbitrarily choose
a prefactor of ex = DampedRational[1,{}, 1/E,x], so that the bilinear basis consists of
Laguerre polynomials. The Mathematica code for this example is
Listing 3: Mathematica input for the example (3.3)
Module[
{
pols = {
PositiveMatrixWithPrefactor[
DampedRational[1,{}, 1/E,x],
{{{1 + x^4, x^4/12 + x^2}}}
]
},
norm = {1, 0},
obj = {0, -1}
},
WriteBootstrapSDP["test.xml", SDP[obj, norm, pols]];
];
6
Listing 4: XML file test.xml produced by listing 3. Decimals are truncated at 12 digits.
<sdp>
<objective><elt>0</elt><elt>-1</elt></objective>
<polynomialVectorMatrices>
<polynomialVectorMatrix>
<rows>1</rows>
<cols>1</cols>
<elements>
<polynomialVector>
<polynomial>
<coeff>1</coeff><coeff>0</coeff><coeff>0</coeff>
<coeff>0</coeff><coeff>1</coeff>
</polynomial>
<polynomial>
<coeff>0</coeff><coeff>0</coeff><coeff>1</coeff>
<coeff>0</coeff><coeff>0.0833333333333</coeff>
</polynomial>
</polynomialVector>
</elements>
<samplePoints>
<elt>0.017496844815</elt><elt>0.157471603340</elt><elt>0.857345395967</elt>
<elt>2.117118222694</elt><elt>3.936790083523</elt>
</samplePoints>
<sampleScalings>
<elt>0.982655336118</elt><elt>0.854301072560</elt><elt>0.424286902403</elt>
<elt>0.120378031823</elt><elt>0.019510742190</elt>
</sampleScalings>
<bilinearBasis>
<polynomial><coeff>1</coeff></polynomial>
<polynomial><coeff>-1</coeff><coeff>1</coeff></polynomial>
<polynomial><coeff>1</coeff><coeff>-2</coeff><coeff>0.5</coeff></polynomial>
</bilinearBasis>
</polynomialVectorMatrix>
</polynomialVectorMatrices>
</sdp>
4 Internal SDP
To understand the output of SDPB, we need a rough understanding of its internal represen-
tation of the above PMP as a semidefinite program (SDP). Much more detail is given in [1].
The PMP (2.2) is translated into a dual pair of SDPs of the following form:
7
P : minimize b0 + c x over x RP , X S K ,
such that X = Pp=1 Ap xp C,
P
(4.2)
B T x = b,
X 0,
c RP ,
B RP N ,
A1 , . . . , AP , C S K . (4.3)
Here, S K is the space of K K symmetric real matrices, and Tr(A Y ) denotes the vector
(Tr(A1 Y ), . . . , Tr(AP Y )) RP . An optimal solution to (4.1) and (4.2) is characterized by
XY = 0 and also equality of the primal and dual objective functions Tr(CY ) + b0 + b y =
b0 + c x.
The residues
X
P Ai xi X C,
i
p b B T x,
d c Tr(A Y ) By, (4.4)
|primalObjective dualObjective|
dualityGap ,
max{1, |primalObjective + dualObjective|}
primalObjective b0 + c x,
dualObjective Tr(CY ) + b0 + b y. (4.5)
8
5 Output of SDPB
Parameters:
maxIterations = 500
maxRuntime = 86400
checkpointInterval = 3600
noFinalCheckpoint = true
findPrimalFeasible = false
findDualFeasible = false
detectPrimalFeasibleJump = false
detectDualFeasibleJump = false
precision(actual) = 400(448)
maxThreads(using) = 4(4)
dualityGapThreshold = 1e-10
primalErrorThreshold = 1e-30
dualErrorThreshold = 1e-30
initialMatrixScalePrimal = 100000000000000000000
initialMatrixScaleDual = 100000000000000000000
feasibleCenteringParameter = 0.1
infeasibleCenteringParameter = 0.3
stepLengthReduction = 0.9
choleskyStabilizeThreshold = 1e-40
maxComplementarity = 1e+100
time mu P-obj D-obj gap P-err D-err P-step D-step beta dim/stabilized
--------------------------------------------------------------------------------------------------------
1 00:00:00 1.0e+40 +0.00e+00 +0.00e+00 0.00e+00 +1.00e+20 +2.88e+20 0.811 0.832 0.3 1/1
2 00:00:00 2.7e+39 +1.22e+20 -2.11e+20 1.00e+00 +1.89e+19 +4.84e+19 0.786 0.807 0.3 1/1
3 00:00:00 8.4e+38 +1.27e+20 -3.52e+20 1.00e+00 +4.03e+18 +9.36e+18 0.777 0.794 0.3 1/1
...
82 00:00:00 2.4e-08 +1.84e+00 +1.84e+00 3.22e-08 +5.40e-136 +1.70e-134 1 1 0.1 1/1
83 00:00:00 2.4e-09 +1.84e+00 +1.84e+00 3.22e-09 +7.90e-136 +1.83e-134 1 1 0.1 1/1
84 00:00:00 2.4e-10 +1.84e+00 +1.84e+00 3.22e-10 +2.57e-136 +1.01e-133 1 1 0.1 1/1
-----found primal-dual optimal solution-----------------------------------------------------------------
primalObjective = 1.84026576320318090039117617247
dualObjective = 1.84026576308462848033006313255
dualityGap = 3.22106791408699658310926876654e-11
primalError = 4.26325166997944952057867662787e-136
dualError = 1.42154001133123757956323785185e-133
Last checkpoint : 0.161299s wall, 0.630000s user + 0.010000s system = 0.640000s CPU (396.8%)
Solver runtime : 0.161224s wall, 0.630000s user + 0.010000s system = 0.640000s CPU (397.0%)
The output from running SDPB on the example problem in section 3.3 is in listing 5. The
input, output, and checkpoint files are listed first, followed by various parameters. After
each iteration, SDPB prints the following:
9
mu: The value of the complementarity Tr(XY )/K.
If an optimal solution exists, the primal and dual error will decrease until the problem
becomes primal and dual feasible. Then the primal and dual objective functions start to
converge, and the complementarity decreases until the duality gap becomes smaller than
dualityGapThreshold.
The terminal output ends with the final values of the primal/dual objectives, primal/dual
errors and duality gap, together with the time since the last saved checkpoint and the total
solver runtime.
5.2 Termination
10
primal feasible jump detected
A Newton step with primal step length P just occurred, without resulting in a primal
feasible solution. (Usually this means one should increase precision and resume from
the latest checkpoint.)
dual feasible jump detected
A Newton step with dual step length D just occurred, without resulting in a dual
feasible solution. (Usually this means one should increase precision and resume from
the latest checkpoint.)
maxIterations exceeded
SDPB has run for more iterations than specified by the option --maxIterations.
maxRuntime exceeded
SDPB has run for longer than specified by the option --maxRuntime.
maxComplementarity exceeded
= Tr(XY )/ dim(X) exceeded the value specified by --maxComplementarity. This
might indicate that the problem is unbounded and no optimal solution will be found.
When using SDPB to determine primal or dual feasibility, one can specify the options
--findPrimalFeasible or --findDualFeasible. This will cause the solver to terminate
immediately once the primal or dual errors are sufficiently small. This often occurs immedi-
ately after the primal or dual step lengths become equal to 1. A step length of 1 means that
the solver has found a Newton step that exactly solves the primal or dual constraints, while
preserving positive-semidefiniteness of X, Y . Sometimes a step length of 1 does not result
in sufficiently small primal/dual errors. This is indicative of numerical instabilities and
usually means precision should be increased. The options --detectPrimalFeasibleJump
and --detectPrimalFeasibleJump cause SDPB to terminate if a step length of 1 occurs
without resulting in primal/dual feasibility. If desired, one can then restart the solver from
the most recent checkpoint, with a higher value of precision.
11
1.0
0.8
0.6
0.4
0.2
4
Figure 1: A plot of 1 + x4 + y x12 + x2 with y = 1.840265763084 equal to its optimal
value. The zero near x = 1 shows that y cannot be further increased without violating the
positivity constraint.
5.4 Checkpoints
Every checkpointInterval, SDPB saves a new checkpoint file with a .ck extension and
backs up the old checkpoint file to a .ck.bk extension. SDPB also saves a checkpoint after
termination, provided the option --noFinalCheckpoint is not specified.
A checkpoint file encodes the values of x, X, y, Y . If SDPB detects an existing checkpoint
file on startup, it will use those values of x, X, y, Y as initial conditions in the solver. Thus,
SDPB can be stopped and started at will without losing progress.
A typical workflow for long-running computations on shared machines is to specify a
moderate checkpointInterval (e.g. one hour) and a somewhat larger maxRuntime (e.g.
12 hours). SDPB will terminate after 12 hours and can then be restarted without losing
1
To include the matrices X, Y as well, uncomment the lines // ofs << "Y = " << Y << ";\n"; and
// ofs << "X = " << X << ";\n"; in the source file SDPSolverIO.cpp, and recompile SDPB.
12
progress. If SDPB is killed prematurely, then at most 1 hour of progress will be lost. This
pattern of restarting gives other users chances to run their processes. It can be sustained
indefinitely, allowing extremely long computations.
6 Attribution
If you use SDPB in work that results in publication, please cite [1]. Depending on how SDPB
is used, the following sources might also be relevant:
7 Acknowledgements
SDPB Makes extensive use of MPACK [9], the multiple precision linear algebra library written
by Maho Nakata. Several source files from MPACK are included in the SDPB source tree
(see the license at the top of those files). SDPB uses the Boost C++ libraries [10] and Lee
Thomasons tinyxml2 library [11] for parsing. SDPB was partially based on the solvers SDPA
and SDPA-GMP [68], which were essential sources of inspiration and examples.
Thanks to Filip Kos, David Poland, and Alessandro Vichi for collaboration in developing
semidefinite programming methods for the conformal bootstrap and assistance testing SDPB.
Thanks to Amir Ali Ahmadi, Hande Benson, Pablo Parrilo, and Robert Vanderbei for advice
and discussions about semidefinite programming.
I am supported by DOE grant number DE-SC0009988 and a William D. Loughlin
Membership at the Institute for Advanced Study.
References
[1] David Simmons-Duffin, A Semidefinite Program Solver for the Conformal Bootstrap,
arXiv:1502.02033 [hep-th].
[3] D. Poland, D. Simmons-Duffin and A. Vichi, Carving Out the Space of 4D CFTs,
JHEP 1205, 110 (2012) arXiv:1109.5176 [hep-th].
13
[4] F. Kos, D. Poland and D. Simmons-Duffin, Bootstrapping the O(N ) vector models,
JHEP 1406, 091 (2014) arXiv:1307.6856 [hep-th].
[10] C++ Standards Committee Library Working Group and other contributors, BOOST
C++ Libraries, http://www.boost.org.
14