toqito.states.max_mixed

toqito.states.max_mixed(dim, is_sparse=False)[source]

Produce the maximally mixed state [AAR6].

Produces the maximally mixed state on of dim dimensions. The maximally mixed state is defined as

\[\begin{split}\omega = \frac{1}{d} \begin{pmatrix} 1 & 0 & \ldots & 0 \\ 0 & 1 & \ldots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \ldots & 1 \end{pmatrix},\end{split}\]

or equivalently, it is defined as

\[\omega = \frac{\mathbb{I}}{\text{dim}(\mathcal{X})}\]

for some complex Euclidean space \(\mathcal{X}\). The maximally mixed state is sometimes also referred to as the tracial state.

The maximally mixed state is returned as a sparse matrix if is_sparse = True and is full if is_sparse = False.

Examples

Using toqito, we can generate the \(2\)-dimensional maximally mixed state

\[\begin{split}\omega_2 = \frac{1}{2} \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\end{split}\]

as follows.

>>> from toqito.states import max_mixed
>>> max_mixed(2, is_sparse=False)
[[0.5, 0. ],
 [0. , 0.5]]

One may also generate a maximally mixed state returned as a sparse matrix

>>> from toqito.states import max_mixed
>>> max_mixed(2, is_sparse=True)
    <2x2 sparse matrix of type '<class 'numpy.float64'>'
    with 2 stored elements (1 diagonals) in DIAgonal format>

References

[AAR6]

Scott Aaronson: Lecture 6, Thurs Feb 2: Mixed States https://www.scottaaronson.com/qclec/6.pdf

Parameters:
  • dim – Dimension of the entangled state.

  • is_sparseTrue if vector is spare and False otherwise.

Returns:

The maximally mixed state of dimension dim.