API reference

Everything below is importable from sdpb_python.

Problems

class sdpb_python.PMP(objective, normalization=None, matrices=<factory>)[source]

Bases: object

A polynomial matrix program (SDPB manual eq. 3.1):

maximize a . z over z in R^{N+1} such that n . z = 1 and, for every matrix j, sum_i z_i M^j_i(x) is positive semidefinite for all x >= 0.

objective is a_0..a_N; normalization is n_0..n_N (None means (1, 0, ..., 0), i.e. z_0 = 1 and y = z_1..z_N); each matrix holds N+1 polynomials per entry.

Parameters:
objective: Sequence[Any]
normalization: Sequence[Any] | None = None
matrices: Sequence[PolynomialMatrix]
property num_variables: int

number of dual variables y.

Type:

N

to_sdp(precision=None, max_num_poles=None)[source]

Convert to SDP data, as pmp2sdp --precision would.

Parameters:
  • precision (int | None)

  • max_num_poles (int | None)

Return type:

SDPData

solver(options=None, *, max_num_poles=None, **overrides)[source]

A Solver holding this problem’s state.

Parameters:
solve(options=None, *, max_num_poles=None, **overrides)[source]

Solve with SDPB. Keyword arguments override SolverOptions fields.

Parameters:
Return type:

Solution

class sdpb_python.PolynomialMatrix(polynomials, prefactor=None, reduced_prefactor=None, max_num_poles=None, sample_points=None, sample_scalings=None, reduced_sample_scalings=None, bilinear_basis=None, label='')[source]

Bases: object

One positivity constraint: sum_n z_n P^{rs}_n(x) is PSD for x >= 0.

polynomials[r][s] is the list of N+1 polynomials P^{rs}_0..P^{rs}_N (each a Polynomial or a coefficient list); the matrix must be symmetric. The optional fields mirror the keys of pmp.json; anything omitted is computed by SDPB (see sampled()).

Variables:
  • polynomials (Sequence[Sequence[Sequence[Any]]]) – dim x dim nested lists of N+1 polynomials each.

  • prefactor (sdpb_python.problem.DampedRational | None) – DampedRational; default exp(-x).

  • reduced_prefactor (sdpb_python.problem.DampedRational | None) – Prefactor with fewer poles used for sampling; default derived from prefactor and max_num_poles.

  • max_num_poles (int | None) – Keep at most this many poles of the prefactor when sampling (negative: no limit).

  • sample_points (Sequence[Any] | None) – Explicit sample points x_k >= 0.

  • sample_scalings (Sequence[Any] | None) – Explicit prefactor(x_k).

  • reduced_sample_scalings (Sequence[Any] | None) – Explicit reduced_prefactor(x_k).

  • bilinear_basis (tuple[Sequence[Any], Sequence[Any]] | None) – Explicit (even, odd) lists of basis polynomials.

  • label (str) – Free text, e.g. the source file; not used by the solver.

Parameters:
polynomials: Sequence[Sequence[Sequence[Any]]]
prefactor: DampedRational | None = None
reduced_prefactor: DampedRational | None = None
max_num_poles: int | None = None
sample_points: Sequence[Any] | None = None
sample_scalings: Sequence[Any] | None = None
reduced_sample_scalings: Sequence[Any] | None = None
bilinear_basis: tuple[Sequence[Any], Sequence[Any]] | None = None
label: str = ''
property dim: int
property num_vectors: int

number of polynomials per entry.

Type:

N + 1

property max_degree: int
sampled(precision=None, max_num_poles=None)[source]

The sampling data SDPB derives for this block (points, scalings, bases).

Parameters:
  • precision (int | None)

  • max_num_poles (int | None)

Return type:

SampledMatrix

class sdpb_python.Polynomial(coeffs=(0,))[source]

Bases: object

a_0 + a_1 x + ... + a_n x^n given by coeffs = [a_0, ..., a_n].

Parameters:

coeffs (Sequence[Any])

coeffs: Sequence[Any] = (0,)
classmethod from_sympy(expr, x=None, digits=300)[source]

From a sympy expression polynomial in x (the only symbol if omitted).

Exact rationals stay exact (as Fraction); other numbers are evaluated to digits significant digits.

Parameters:
Return type:

Polynomial

property degree: int
class sdpb_python.DampedRational(constant=1, base=1, poles=())[source]

Bases: object

A damped rational prefactor constant * base**x / prod_i (x - poles[i]).

Multiplying a polynomial matrix by a positive prefactor does not change the positivity constraint, but it tells SDPB where to place the sample points and how to scale them. SDPB’s default is exp(-x); exp_minus_x() builds it (with optional poles) at full precision.

Parameters:
constant: Any = 1
base: Any = 1
poles: Sequence[Any] = ()
classmethod exp_minus_x(poles=())[source]
Parameters:

poles (Sequence[Any])

Return type:

DampedRational

class sdpb_python.LMI(b, blocks, f=0)[source]

Bases: object

Block-diagonal linear matrix inequality:

maximize f + b . y over y in R^N such that M_0 + sum_n y_n M_n is positive semidefinite, block by block.

blocks[j] is the sequence (M_0, M_1, ..., M_N) of symmetric matrices for block j (nested lists, numpy arrays or mpmath.matrix). To minimise, negate b and f. Internally this is a PMP whose polynomials are constants, so every block has a single sample point.

Parameters:
b: Sequence[Any]
blocks: Sequence[Sequence[Any]]
f: Any = 0
solver(options=None, **overrides)[source]

A Solver holding this problem’s state.

Parameters:
solve(options=None, **overrides)[source]
Parameters:
Return type:

Solution

class sdpb_python.SampledMatrix(prefactor, reduced_prefactor, sample_points, sample_scalings, reduced_sample_scalings, bilinear_basis, bilinear_bases)[source]

Bases: object

Sampling data SDPB derived for one PolynomialMatrix.

Variables:
Parameters:
prefactor: DampedRational
reduced_prefactor: DampedRational
sample_points: list[mpf]
sample_scalings: list[mpf]
reduced_sample_scalings: list[mpf]
bilinear_basis: tuple[list[Polynomial], list[Polynomial]]
bilinear_bases: tuple[matrix, matrix]
property num_points: int
class sdpb_python.SDPData(objective_const, b, normalization, blocks, precision)[source]

Bases: object

What pmp2sdp writes to an sdp/ directory (Manual eq. 2.2).

The normalization of the PMP has been eliminated: objective_const is b_0 and b is b_1..b_N.

Variables:
  • objective_const (mpmath.ctx_mp_python.mpf) – The constant term b_0.

  • b (list[mpmath.ctx_mp_python.mpf]) – The dual objective vector.

  • normalization (list[mpmath.ctx_mp_python.mpf] | None) – The PMP’s normalization, kept for recovering z.

  • blocks (list[sdpb_python.problem.SDPBlock]) – One SDPBlock per constraint.

  • precision (int) – Bits used for the conversion.

Parameters:
objective_const: mpf
b: list[mpf]
normalization: list[mpf] | None
blocks: list[SDPBlock]
precision: int
class sdpb_python.problem.SDPBlock(block_index, dim, num_points, bilinear_bases, c, B)[source]

Bases: object

One block of an SDPData (the content of block_data_<j>).

Variables:
  • block_index (int) – Global block index j.

  • dim (int) – Matrix dimension.

  • num_points (int) – Number of sample points.

  • bilinear_bases (tuple[mpmath.matrices.matrices.matrix, mpmath.matrices.matrices.matrix]) – Even and odd sampled bases.

  • c (list[mpmath.ctx_mp_python.mpf]) – Constraint constants, length num_points * dim * (dim+1) / 2.

  • B (mpmath.matrices.matrices.matrix) – Constraint matrix, len(c) by N.

Parameters:
  • block_index (int)

  • dim (int)

  • num_points (int)

  • bilinear_bases (tuple[matrix, matrix])

  • c (list[mpf])

  • B (matrix)

block_index: int
dim: int
num_points: int
bilinear_bases: tuple[matrix, matrix]
c: list[mpf]
B: matrix

Solving

class sdpb_python.SolverOptions(precision=None, max_iterations=500, max_runtime=9223372036854775807, duality_gap_threshold='1e-30', primal_error_threshold='1e-30', dual_error_threshold='1e-30', initial_matrix_scale_primal='1e20', initial_matrix_scale_dual='1e20', feasible_centering_parameter='0.1', infeasible_centering_parameter='0.3', step_length_reduction='0.7', max_complementarity='1e100', min_primal_step='0', min_dual_step='0', find_primal_feasible=False, find_dual_feasible=False, detect_primal_feasible_jump=False, detect_dual_feasible_jump=False, fast_step_length=False, max_shared_memory_bytes=0, checkpoint_dir=None, checkpoint_interval=3600, output_dir=None, verbosity='none', want=('y', 'z'))[source]

Bases: object

Solver options. Defaults are SDPB’s own.

Names follow sdpb’s command line options in snake_case, e.g. duality_gap_threshold for --dualityGapThreshold. Numeric thresholds accept anything sdpb_python.numbers converts (int, float, str, Fraction, mpf); strings such as "1e-30" are the safest way to write tiny numbers.

Variables:
  • precision (int | None) – Working precision in bits (--precision). None means the precision already fixed for this process, or SDPB’s default 400 if none is fixed yet. See Precision.

  • max_iterations (int) – Stop after this many iterations (--maxIterations, 500).

  • max_runtime (int) – Stop after this many seconds (--maxRuntime, unlimited).

  • duality_gap_threshold (Any) – Optimality test on the normalised duality gap |primal - dual| / max(|primal| + |dual|, 1) (1e-30).

  • primal_error_threshold (Any) – Optimality test on the primal residues (1e-30).

  • dual_error_threshold (Any) – Optimality test on the dual residues (1e-30).

  • initial_matrix_scale_primal (Any) – X starts as this multiple of the identity (--initialMatrixScalePrimal, 1e20).

  • initial_matrix_scale_dual (Any) – Same for Y (1e20).

  • feasible_centering_parameter (Any) – Centering parameter beta used once primal and dual are feasible (0.1).

  • infeasible_centering_parameter (Any) – Centering parameter while infeasible (0.3).

  • step_length_reduction (Any) – Fraction of the maximal step taken (0.7).

  • max_complementarity (Any) – Abort when Tr(XY)/dim exceeds this (1e100).

  • min_primal_step (Any) – Stop when the primal step length falls below this (0).

  • min_dual_step (Any) – Stop when the dual step length falls below this (0).

  • find_primal_feasible (bool) – Stop as soon as a primal feasible point is found.

  • find_dual_feasible (bool) – Stop as soon as a dual feasible point is found.

  • detect_primal_feasible_jump (bool) – Stop when the primal step length reaches 1.

  • detect_dual_feasible_jump (bool) – Stop when the dual step length reaches 1.

  • fast_step_length (bool) – Compute the step lengths from a double-precision smallest eigenvalue, verified by an arbitrary-precision Cholesky (SDPB’s --fastStepLength); the exact eigensolver is used for blocks that fail the check. Default False.

  • max_shared_memory_bytes (int) – Memory budget for the exact Q computation (--maxSharedMemory); 0 lets SDPB choose about half of the free RAM. Accepts ints or strings such as "100K" / "64G".

  • checkpoint_dir (str | os.PathLike | None) – Directory for SDPB’s binary checkpoints. When set, a checkpoint found there is loaded before solving and one is written at the end and every checkpoint_interval seconds. None disables checkpointing.

  • checkpoint_interval (int) – Seconds between checkpoints (3600).

  • output_dir (str | os.PathLike | None) – If set, SDPB writes iterations.json (one record per iteration) and c_minus_By/c_minus_By.json there, as the sdpb executable does in its --outDir.

  • verbosity (str | int) – "none" (default), "regular", "debug" or "trace" (or 0-3). Anything above "none" prints SDPB’s iteration table to the C++ standard output.

  • want (Iterable[str]) – Which parts of the solution to return besides the objectives and errors: any of "x", "y", "z", "X", "Y", "c_minus_By". Default ("y", "z"). Large problems have large X/Y; ask only for what you need.

Parameters:
  • precision (int | None)

  • max_iterations (int)

  • max_runtime (int)

  • duality_gap_threshold (Any)

  • primal_error_threshold (Any)

  • dual_error_threshold (Any)

  • initial_matrix_scale_primal (Any)

  • initial_matrix_scale_dual (Any)

  • feasible_centering_parameter (Any)

  • infeasible_centering_parameter (Any)

  • step_length_reduction (Any)

  • max_complementarity (Any)

  • min_primal_step (Any)

  • min_dual_step (Any)

  • find_primal_feasible (bool)

  • find_dual_feasible (bool)

  • detect_primal_feasible_jump (bool)

  • detect_dual_feasible_jump (bool)

  • fast_step_length (bool)

  • max_shared_memory_bytes (int)

  • checkpoint_dir (str | PathLike | None)

  • checkpoint_interval (int)

  • output_dir (str | PathLike | None)

  • verbosity (str | int)

  • want (Iterable[str])

precision: int | None = None
max_iterations: int = 500
max_runtime: int = 9223372036854775807
duality_gap_threshold: Any = '1e-30'
primal_error_threshold: Any = '1e-30'
dual_error_threshold: Any = '1e-30'
initial_matrix_scale_primal: Any = '1e20'
initial_matrix_scale_dual: Any = '1e20'
feasible_centering_parameter: Any = '0.1'
infeasible_centering_parameter: Any = '0.3'
step_length_reduction: Any = '0.7'
max_complementarity: Any = '1e100'
min_primal_step: Any = '0'
min_dual_step: Any = '0'
find_primal_feasible: bool = False
find_dual_feasible: bool = False
detect_primal_feasible_jump: bool = False
detect_dual_feasible_jump: bool = False
fast_step_length: bool = False
max_shared_memory_bytes: int = 0
checkpoint_dir: str | PathLike | None = None
checkpoint_interval: int = 3600
output_dir: str | PathLike | None = None
verbosity: str | int = 'none'
want: Iterable[str] = ('y', 'z')
class sdpb_python.Solution(status, primal_objective, dual_objective, duality_gap, primal_error, dual_error, y, z, x, X, Y, c_minus_By, iterations, runtime_seconds, precision, blocks=<factory>)[source]

Bases: object

Solver output. Numbers are mpmath.mpf at precision bits.

See Background: what SDPB solves for the meaning of the variables.

Variables:
  • status (sdpb_python.solution.TerminateReason) – Why the solver stopped; optimal is the usual check.

  • primal_objective (mpmath.ctx_mp_python.mpf) – f + c . x.

  • dual_objective (mpmath.ctx_mp_python.mpf) – f + b . y; for a PMP this is the optimal value of the objective a . z.

  • duality_gap (mpmath.ctx_mp_python.mpf) – |primal - dual| / max(|primal| + |dual|, 1).

  • primal_error (mpmath.ctx_mp_python.mpf) – Largest primal residue.

  • dual_error (mpmath.ctx_mp_python.mpf) – Largest dual residue.

  • y (list[mpmath.ctx_mp_python.mpf]) – The dual variables, length N.

  • z (list[mpmath.ctx_mp_python.mpf] | None) – The PMP variables of Manual eq. (3.1), length N + 1, when the problem has a normalization and "z" was requested; else None.

  • x (list[list[mpmath.ctx_mp_python.mpf]] | None) – Per block, the primal variables (length num_points * dim * (dim+1) / 2); None unless "x" was requested.

  • X (list[tuple[mpmath.matrices.matrices.matrix, mpmath.matrices.matrices.matrix]] | None) – Per block, the pair (even, odd) of positive semidefinite primal matrices; None unless "X" was requested.

  • Y (list[tuple[mpmath.matrices.matrices.matrix, mpmath.matrices.matrices.matrix]] | None) – Per block, the pair (even, odd) of positive semidefinite dual matrices; for an LMI block Y[j][0] is M_0 + sum_n y_n M_n.

  • c_minus_By (list[list[mpmath.ctx_mp_python.mpf]] | None) – Per block, c - B y: the extremal functional evaluated on the sampled constraints (what spectrum consumes).

  • iterations (int) – Iterations completed by this run.

  • runtime_seconds (float) – Wall time of the run.

  • precision (int) – Bits of precision used.

  • blocks (list[sdpb_python.solution.BlockInfo]) – BlockInfo per block.

Parameters:
status: TerminateReason
primal_objective: mpf
dual_objective: mpf
duality_gap: mpf
primal_error: mpf
dual_error: mpf
y: list[mpf]
z: list[mpf] | None
x: list[list[mpf]] | None
X: list[tuple[matrix, matrix]] | None
Y: list[tuple[matrix, matrix]] | None
c_minus_By: list[list[mpf]] | None
iterations: int
runtime_seconds: float
precision: int
blocks: list[BlockInfo]
property optimal: bool
class sdpb_python.TerminateReason(*values)[source]

Bases: Enum

Why SDPB stopped (SDP_Solver_Terminate_Reason).

The value of each member is the exact text SDPB writes to out.txt. Only PRIMAL_DUAL_OPTIMAL means the problem was solved to the requested thresholds; the *_FEASIBLE and *_JUMP_DETECTED reasons are early stops requested through SolverOptions.

PRIMAL_DUAL_OPTIMAL = 'found primal-dual optimal solution'
PRIMAL_FEASIBLE = 'found primal feasible solution'
DUAL_FEASIBLE = 'found dual feasible solution'
PRIMAL_FEASIBLE_JUMP_DETECTED = 'primal feasible jump detected'
DUAL_FEASIBLE_JUMP_DETECTED = 'dual feasible jump detected'
MAX_COMPLEMENTARITY_EXCEEDED = 'maxComplementarity exceeded'
MAX_ITERATIONS_EXCEEDED = 'maxIterations exceeded'
MAX_RUNTIME_EXCEEDED = 'maxRuntime exceeded'
PRIMAL_STEP_TOO_SMALL = 'primal step too small'
DUAL_STEP_TOO_SMALL = 'dual step too small'
SIGTERM_RECEIVED = 'SIGTERM signal received'
classmethod from_sdpb(text)[source]
Parameters:

text (str)

Return type:

TerminateReason

class sdpb_python.BlockInfo(dim, num_points)[source]

Bases: object

Size of one SDP block.

Variables:
  • dim (int) – Matrix dimension of the constraint (m_j).

  • num_points (int) – Number of sample points (d_j + 1); 1 for an LMI block.

Parameters:
dim: int
num_points: int
property schur_size: int
class sdpb_python.Solver(kind, spec, options)[source]

Bases: object

Owns SDPB’s Block_Info, SDP and SDP_Solver for one problem.

Created by PMP.solver() or LMI.solver(). run() continues the interior-point iteration from the current x, X, y, Y and may be called repeatedly, e.g. with tighter thresholds. Use as a context manager or call close() to release the C++ objects.

Parameters:
close()[source]
Return type:

None

property closed: bool
property options: SolverOptions
property precision: int
property num_variables: int
property total_iterations: int

Iterations completed over all calls of run().

run(options=None, **overrides)[source]

Continue iterating. Raises SolverInterrupted on Ctrl-C.

Parameters:
Return type:

Solution

state(want=('y', 'z', 'x', 'X', 'Y'))[source]

The current iterate without running (objectives are those of the last run).

Parameters:

want (Sequence[str])

Return type:

Solution

warm_start(y=None, X=None, Y=None)[source]

Overwrite the iterate before run().

y has length N; X / Y are per-block pairs (even, odd) of matrices in the shapes SDPB uses (see Solution.X).

Parameters:
Return type:

Solver

save_checkpoint(directory)[source]

Write SDPB’s binary checkpoint (checkpoint_<g>_<rank>, checkpoint.json).

Parameters:

directory (str | PathLike)

Return type:

None

exception sdpb_python.SolverInterrupted(solution)[source]

Bases: KeyboardInterrupt

Ctrl-C during a run: SDPB stopped cleanly at the end of an iteration.

solution holds the state at that point; the Solver can be run again to continue.

Parameters:

solution (Solution)

exception sdpb_python.SDPBError(details)[source]

Bases: RuntimeError

An error raised inside SDPB’s C++ code.

str(error) is SDPB’s message, with the source location appended in brackets when SDPB reported one; details keeps the whole text as SDPB produced it, including its stack trace.

Parameters:

details (str)

property location: str | None

file:line (function) of the SDPB source that threw, if known.

Parallel solves

class sdpb_python.SolverPool(workers=None, *, precision=None, env=None)[source]

Bases: object

A pool of worker processes that solve PMP / LMI problems.

with SolverPool(workers=4, precision=768) as pool:
    futures = [pool.submit(pmp, fast_step_length=True) for pmp in problems]
    solutions = [f.result() for f in futures]
Parameters:
  • workers (int | None) – Number of processes; default default_workers() (physical cores, capped by available memory).

  • precision (int | None) – Working precision of every worker, in bits. None means the precision fixed in this process, or SDPB’s default 400.

  • env (Mapping[str, str] | None) – Extra environment variables for the workers (on top of DEFAULT_WORKER_ENV), e.g. {"LD_PRELOAD": ...}.

submit() returns a concurrent.futures.Future whose result is the Solution (or whose exception is the SDPBError the solve raised). Results do not depend on the number of workers or the order in which solves run.

submit(problem, options=None, *, max_num_poles=None, **overrides)[source]

Queue one solve; keyword arguments override SolverOptions fields.

Parameters:
Return type:

Future

map(problems, options=None, **overrides)[source]

Solve every problem; the solutions in input order (raises the first error).

Parameters:
Return type:

list

cancel(future)[source]

Cancel a solve: drop it if it is still queued, or stop it at the end of its current iteration if it runs (its future then raises SolveCancelled). Returns False when the solve already finished. A running solve that completes before the request arrives keeps its result.

Parameters:

future (Future)

Return type:

bool

cancel_all()[source]

Cancel every queued and running solve.

Return type:

None

close(*, cancel=False)[source]

Finish the queued solves (or cancel them), then stop the workers.

Parameters:

cancel (bool)

Return type:

None

terminate()[source]

Kill the workers now. Queued solves are cancelled; running ones raise SolveCancelled.

Return type:

None

property pids: list[int]

Process ids of the workers that have started.

sdpb_python.solve_many(problems, options=None, *, workers=None, precision=None, env=None, **overrides)[source]

Solve independent problems on a temporary SolverPool; the solutions in input order.

Parameters:
Return type:

list

exception sdpb_python.SolveCancelled(message, solution=None)[source]

Bases: CancelledError

The solve was cancelled with SolverPool.cancel() while it ran.

solution is the state at the end of the last iteration (status SIGTERM_RECEIVED, with its iterations and runtime_seconds), or None when the worker was stopped another way.

Parameters:
exception sdpb_python.SDPBWorkerError(details)[source]

Bases: SDPBError

A worker process died (crash, MPI_Abort, killed) during a solve.

Parameters:

details (str)

sdpb_python.pool.default_workers()[source]

min(physical cores, available memory / WORKER_MEMORY_BYTES), at least 1.

Return type:

int

Precision

sdpb_python.set_precision(bits)[source]

Fix the working precision (bits) for this process.

SDPB’s Elemental allows setting it once per process; calling again with a different value raises SDPBError. When not called, the first solve fixes it (to its precision option, default 400).

Parameters:

bits (int)

Return type:

None

sdpb_python.precision()[source]

Precision (bits) fixed for this process, or 0 if not fixed yet.

Return type:

int

Files

sdpb_python.read_pmp_json(*paths)[source]

Load one or more pmp.json files (or .nsv lists) into a PMP.

As in SDPB, every file may carry the objective and normalization; they must agree, and matrices are concatenated in file order.

Parameters:

paths (str | PathLike)

Return type:

PMP

sdpb_python.write_pmp_json(pmp, path, precision=768)[source]
Parameters:
Return type:

None

sdpb_python.io.read_nsv(path)[source]

Expand an .nsv file (NUL-separated list of paths, recursively).

Parameters:

path (str | PathLike)

Return type:

list[Path]

sdpb_python.io.pmp_to_json_dict(pmp, precision=768)[source]

The pmp.json representation (numbers as strings).

Parameters:
Return type:

dict

Numbers

Conversions between Python numbers and the decimal strings SDPB exchanges.

Strings are printed with max_digits10 digits for the working precision, so mpf -> str -> BigFloat -> str -> mpf is lossless.

sdpb_python.numbers.digits_for(bits)[source]

Decimal digits that uniquely identify a binary float of bits bits.

Parameters:

bits (int)

Return type:

int

sdpb_python.numbers.to_str(value, bits)[source]

Render value as a decimal string exact to bits of precision.

Parameters:
Return type:

str

sdpb_python.numbers.from_str(s, bits)[source]

Parse a decimal string without rounding below bits of precision.

Parameters:
Return type:

mpf

sdpb_python.numbers.strs(values, bits)[source]
Parameters:
Return type:

list[str]

sdpb_python.numbers.mpfs(values, bits)[source]
Parameters:
Return type:

list[mpf]

sdpb_python.numbers.matrix_strs(rows, bits)[source]

Convert a nested sequence / numpy array / mpmath.matrix to string rows.

Parameters:
Return type:

list[list[str]]

sdpb_python.numbers.matrix_mpfs(data, bits)[source]

From the Cython layer’s {“shape”: (h, w), “rows”: [[str]]}.

Parameters:
Return type:

matrix

Version

sdpb_python.sdpb_version()[source]

Git version of the SDPB sources compiled into the extension.

Return type:

str