Optimization helpers
- inflation.optimization_utils.max_within_feasible(program: InflationLP | InflationSDP, symbolic_values: Dict[CompoundMomentSDP, Expr], method: str, return_last_certificate=False, **kwargs) float | Tuple[float, dict] [source]
Maximize a single real variable within the set of feasible moment matrices determined by an
InflationSDP
. The dependence of the moment matrices in the variable is specified by an assignment of monomials in the moment matrix to arbitrary expressions of the variable. This is useful for finding (bounds for) critical visibilities of distributions beyond which they are impossible to generate in a given quantum causal scenario.- Parameters:
program (Union[InflationLP, InflationSDP]) – The problem under which to carry the optimization.
symbolic_values (Dict[CompoundMomentSDP, Callable]) – The correspondence between monomials in the SDP problem and symbolic expressions depending on the variable to be optimized.
method (str) – Technique used for optimization. Currently supported:
"bisection"
for bisection algorithms, and"dual"
for exploitation of the certificates of infeasibility (typically much fewer iteration steps).return_last_certificate (bool, optional) – Whether to return, along with the maximum value of the parameter, a separating surface that leaves the set of positive-semidefinite moment matrices in its positive side and evaluates to 0 in the maximum value reported.
**kwargs – Instructions on which extra symbolic values to assign numbers and options to be passed to the optimization routines (bounds, precision, tolerance, …).
- Returns:
float – The maximum value that the parameter can take under the set of distributions compatible with an inflation (for LPs) or under the set of positive-semidefinite moment matrices (for SDPs). This is the output when
return_last_certificate=False
.Tuple[float, dict] – The maximum value that the parameter can take under the set of distributions compatible with an inflation (for LPs) or under the set of positive-semidefinite moment matrices (for SDPs), and a corresponding separating surface (a root of the function corresponds to the critical feasible value of the parameter reported). This is the output when
return_last_certificate=True
.