davidsd / sdpb

A semidefinite program solver for the conformal bootstrap.
MIT License
56 stars 43 forks source link

Organize pvm2sdp, sdp2input & sdpb: IO format, naming etc. #96

Open vasdommes opened 1 year ago

vasdommes commented 1 year ago

This is an umbrella issue for pvm2sdp/sdp2input formats, naming and other things that could be improved.

TL;DR

More details

Input

We have two converters, pvm2sdp and sdp2input, both generating the same SDP format (zip with JSON files for each block), which serves as SDPB input. We can implement binary SDP instead of JSON to make it more compact and fast, see #79

These converters use different mathematical formulations (equation numbers taken from SDPB Manual):

One can easily translate from (2.2) to (3.1) and back using the normalization condition $n \cdot z = 1$.

Most of users are now using sdp2input. If no one needs pvm2sdp anymore (TODO check), we can remove it.

To get rid of unnecessary disk reads/writes, we can combine all into a single executable, see #78

SDPB

SDPB operates in terms of $y$ variable, i.e. formulation (2.2). It also writes $y$ to output y.txt

Meanwhile, $z$ makes more physical sense, so end users usually have to convert $y \to z$ after running SDPB.

SDPB can do it and write z.txt, if it has normalization vector $(n_0..n_N)$. Normalization vector is read from sdp2input input.

We can do as follows:

Naming

Current naming is terribly inconsistent. pvm2sdp: we convert PVM (Polynomial Vector Matrix) to SDP (sdpb input format). sdp2input: we convert sdp (which is not sdpb input format, but a bunch of positive matrices with prefactor!) to sdpb input.

By the way, in spectrum pvm2sdp input format is called PVM (Polynomial Vector Matrix), and sdp2input format is called PMP (Positive Matrix with Prefactor): https://github.com/davidsd/sdpb/blob/fbbefbf11f60b009fa0ed804a18785c2634983d1/src/spectrum/handle_arguments.cxx#L33-L34

In SDPB manual and paper, however, PMP stands for "Polynomial Matrix Program" (which describes both pvm2sdp and sdp2input).

I would say, as in paper and manual, that generally we are converting PMP to SDP. So probably we should have a (universal?) converter called pmp2sdp.

vasdommes commented 10 months ago

In order to avoid name collision between Polynomial Matrix Program and Positive Matrix with Prefactor, we can call them PMP and PMWP, respectively.