PICOS for Quantum Information Science

PICOS was among the first convex optimization interfaces to natively support Hermitian semidefinite programming and subsystem manipulation operations such as the partial trace and partial transpose, which were implemented with feedback from the QIS community. This note outlines the features most relevant for the field and links to examples.

QIS Cheat Sheet

Complex expression manipulation

on paper

in picos

A \in \mathbb{C}^{m \times n}

A = pc.ComplexVariable("A", (m, n))

A = B + iC

A = B + 1j*C









\frac{1}{2} \left( A^\dagger + A \right)


\langle \psi \vert \psi \rangle

psi.H * psi

\rvert \psi \rangle \langle \psi \lvert

psi * psi.H

Hermitian semidefinite programming

on paper

in picos

\rho \in \mathbb{S}^n

rho = pc.HermitianVariable("ρ", n)

\rho \succeq 0

rho >> 0

\rho \succeq I

rho >> 1 / rho >> pc.I(n)

\operatorname{Tr}(\rho) = 1

rho.tr == 1

\begin{bmatrix}A & B \\ C & D\end{bmatrix} \succeq 0

pc.block([[A, B], [C, D]]) >> 0

Schatten norms

on paper

in picos

note / aka

{\lVert A \rVert}_1 = \operatorname{Tr}\left( \sqrt{A^\dagger A} \right)


trace norm

{\lVert A \rVert}_\infty = \sqrt{\lambda_{\max}(A^\dagger A)}


\lambda_{\max}(A) for A \in \mathbb{H}^n

Subsystem manipulation (partial trace, partial transpose, realignment)

on paper

in picos

note / docs

A = B \otimes C

A = B @ C

A_1 \otimes \cdots \otimes \operatorname{Tr}(A_i) \otimes \cdots \otimes A_n

A.partial_trace([i-1], shapes)


A_1 \otimes \cdots \otimes A_i^T \otimes \cdots \otimes A_n

A.partial_tranpose([i-1], shapes)


A_{ij\;\mapsto\;ji} = A^T



A_{ijkl\;\mapsto\;kjil} = \operatorname{T}_1(A)




A.tr0, …, A.tr3, A.trl

A \in \mathbb{H}^2 \otimes \cdots \otimes \mathbb{H}^2


A.T0, …, A.T3, A.Tl

A \in \mathbb{H}^2 \otimes \cdots \otimes \mathbb{H}^2

(\operatorname{Tr}_i and \operatorname{T}_i denote the partial trace and transpose of the i-th 2 \times 2 subsystem, counted from zero)

Hermitian semidefinite programming

PICOS makes use of the following identity to allow standard solvers to deal with hermitian LMIs:

A \succeq 0
  \Re(A) & \Im(A) \\
  -\Im(A) & \Re(A)
\end{bmatrix} \succeq 0

Hermitian variables are vectorized such that \rho \in \mathbb{S}^n is passed to solvers via n^2 real scalar variables.

Examples and exercises

Recent research using PICOS


  • Felix Huber and Nikolai Wyderka. Refuting spectral compatibility of quantum marginals. arXiv preprint, v2, 2023. arXiv: 2211.06349.

  • Aby Philip, Soorya Rethinasamy, Vincent Russo, and Mark M. Wilde. Quantum Steering Algorithm for Estimating Fidelity of Separability. arXiv preprint, 2023. arXiv: 2303.07911. code: on arxiv.org.


  • Armin Tavakoli, Alejandro Pozas-Kerstjens, Ming-Xing Luo, and Marc-Olivier Renou. Bell nonlocality in networks. Reports on Progress in Physics, 85, 2022. arXiv: 2104.10700. DOI: 10.1088/1361-6633/ac41bb.

  • Feng-Jui Chan et al. Maxwell’s two-demon engine under pure dephasing noise. Physical Review A, 106, 2022. arXiv: 2206.05921. DOI: 10.1103/PhysRevA.106.052201.

  • Viktor Nordgren et al. Certifying emergent genuine multipartite entanglement with a partially blind witness. Physical Review A, 106, 2022. preprint: on st-andrews.ac.uk. DOI: 10.1103/PhysRevA.106.062410

  • Matthew DeCross, Eli Chertkov, Megan Kohagen, and Michael Foss-Feig. Qubit-reuse compilation with mid-circuit measurement and reset. arXiv preprint, 2022. arXiv: 2210.08039.

  • Vincent Russo and Jamie Sikora. A note on the inner products of pure states and their antidistinguishability. arXiv preprint, 2022. arXiv: 2206.08313. code: on github.com.

  • Sarnava Datta, Hermann Kampermann, and Dagmar Bruß. Upper bound on the Guessing probability using Machine Learning. arXiv preprint, 2022. arXiv: 2212.08500.


(list updated 2023-03)

Connection with Ncpol2sdpa

Ncpol2sdpa [1] exposes SDP relaxations of (non-commutative) polynomial optimization problems as PICOS problem instances, see here.

Course material

Jupyter notebooks for a hands-on workshop on practical semidefinite programming aimed at quantum information students are available on GitLab. The fourth notebook is based on [2], which also comes with Python/PICOS notebooks.


  1. Peter Wittek. Algorithm 950: Ncpol2sdpa—sparse semidefinite programming relaxations for polynomial optimization problems of noncommuting Variables. ACM Transactions on Mathematical Software, 41(3), 21, 2015. DOI: 10.1145/2699464. arXiv: 1308.6029.

  2. Vikesh Siddhu and Sridhar Tayur. Five starter pieces: quantum information science via semi-definite programs. INFORMS TutORials in Operations Research, 2022. DOI: 10.1287/educ.2022.0243. arXiv: 2112.08276.