toqito.state_props.abs_ppt_constraints ====================================== .. py:module:: toqito.state_props.abs_ppt_constraints .. autoapi-nested-parse:: Compute the constraints on a spectrum for it to be absolutely PPT. Module Contents --------------- .. py:function:: abs_ppt_constraints(eigs, p, max_constraints = 33592, use_check = False) Return the constraint matrices for the spectrum to be absolutely PPT [@Hildebrand_2007_AbsPPT]. The returned matrices are constructed from the provided eigenvalues `eigs`, and they must all be positive semidefinite for the spectrum to be absolutely PPT. !!! Note The function does not always return the optimal number of constraint matrices. There are some redundant constraint matrices [@Johnston_2014_Orderings]. * With `use_checks=False`, the number of matrices returned starting from \(p=1\) is \([0, 1, 2, 12, 286, 33592, 23178480, \ldots]\). * With `use_checks=True`, the number of matrices returned starting from \(p=1\) is \([0, 1, 2, 10, 114, 2612, 108664, \ldots]\). However, the optimal number of matrices starting from \(p=1\) is given by \([0, 1, 2, 10, 114, 2608, 107498]\). !!! Note This function accepts a `cvxpy` Variable as input for `eigs`. The function will return the assembled constraint matrices as a list of `cvxpy` Expressions. These can be used with `cvxpy` to optimize over the space of absolutely PPT matrices. The user must impose the condition `eigs[0] ≥ eigs[1] ≥ ... ≥ eigs[-1] ≥ 0` and the positive semidefinite constraint on each returned matrix separately. It is recommended to set `use_check=True` for this use case to minimize the number of constraint equations in the problem. This function is adapted from QETLAB [@QETLAB_link]. .. rubric:: Examples We can compute the constraint matrices for a random density matrix: ```python exec="1" source="above" import numpy as np from toqito.rand import random_density_matrix from toqito.state_props import abs_ppt_constraints rho = random_density_matrix(9) # assumed to act on a 3 x 3 bipartite system eigs = np.linalg.eigvalsh(rho) constraints = abs_ppt_constraints(eigs, 3) for i, cons in enumerate(constraints, 1): print(f"Constraint {i}:") print(cons) ``` :raises TypeError: If `eigs` is not a `numpy` ndarray or a `cvxpy` Variable. :param eigs: A list of eigenvalues. :param p: The dimension of the smaller subsystem in the bipartite system. :param max_constraints: The maximum number of constraint matrices to compute. (default: 33,592) :param use_check: Use the "criss-cross" ordering check described in [@Johnston_2014_Orderings] to reduce the number of :param constraint matrices. (default: `False`) :returns: A list of `max_constraints` constraint matrices which must be positive semidefinite for an absolutely PPT spectrum.