toqito.state_props.learnability

Evaluate the quantum learnability semidefinite programs.

Module Contents

toqito.state_props.learnability.learnability(states, k, *, solver='SCS', solver_kwargs=None, verify_reduced=True, verify_tolerance=0.0001, tol=1e-08)[source]

Compute the average error value of the learnability semidefinite program.

This routine minimizes

[

frac{1}{n} sum_{i = 1}^n leftlangle rho_i, sum_{S: i notin S} M_S rightrangle.

]

over POVM elements ((M_S)) indexed by k-element subsets, subject to (sum_S M_S = mathbb{I}) and (M_S succeq 0). When all inputs are pure, the reduced Gram-matrix SDP

[

sum_{i = 1}^n bra{i} sum_{S: i notin S} W_S ket{i}.

]

with constraint (sum_S W_S = G) (Gram matrix) and (W_S succeq 0) is also solved as a consistency check.

Examples

```python exec=”1” source=”above” from toqito.state_props import learnability from toqito.states import basis

e0, e1 = basis(2, 0), basis(2, 1) print(learnability(

[e0, e1], k=1, solver=”SCS”, solver_kwargs={“eps”: 1e-6, “max_iters”: 5_000},

))

param states:

Sequence of state vectors or density matrices acting on the same space.

param k:

Subset size for the POVM outcomes; must satisfy 1 <= k <= len(states).

param solver:

Optional CVXPY solver name. Defaults to “SCS”.

param solver_kwargs:

Extra keyword arguments forwarded to cvxpy.Problem.solve().

param verify_reduced:

If True and the states are pure, also solve the reduced SDP.

param verify_tolerance:

Absolute tolerance used when comparing the two optimal values.

param tol:

Numerical tolerance used when validating positivity and rank-one states.

returns:

Dictionary with keys value, total_value, status, measurement_operators, and optionally reduced_value, reduced_total_value, reduced_status, reduced_operators.

raises ValueError:

If the data are inconsistent with valid quantum states or if k lies outside the permissible range.

raises cvxpy.error.SolverError:

If the selected solver reports a failure.

Parameters:
  • states (Sequence[numpy.ndarray])

  • k (int)

  • solver (str | None)

  • solver_kwargs (dict[str, Any] | None)

  • verify_reduced (bool)

  • verify_tolerance (float)

  • tol (float)

Return type:

dict[str, float | str | None | dict]