qics.quantum.random.pure_density_matrix

qics.quantum.random.pure_density_matrix(n, iscomplex=False)[source]

Generate a random pure density matrix i.e., rank 1 positive semidefinite matrix \(X\in\mathbb{H}^n\) satisfying \(\text{tr}[X] = 1\).

Parameters:
nint

Dimension of random pure density matrix \(X\).

iscomplexbool, optional

Whether the matrix is real (False) or complex (True). The default is False.

Returns:
ndarray

Random pure density matrix of dimension (n, n).

Notes

See [1] for additional details.